console

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Package console serves the Seamless observability UI: server-rendered html/template pages plus an SSE feed, with no node/npm/React or build step. It is read-mostly -- the writes are the owner's overrides and curation actions: archiving a memory, approving a plan, force-releasing a task's claim lock, asking the gardener for proposals (request/split) and resolving them (apply/dismiss/retarget), and saving or resetting the briefing settings. Access is guarded by the same static bearer key as the MCP surface: a browser trades the key for a cookie at /console/login, and the seam CLI presents the key as a bearer token.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DB       *sql.DB
	Files    *files.Manager
	Gardener *gardener.Service
	Events   *events.Recorder
	// Retrieve backs the search page and command palette: the same fused
	// FTS+semantic engine recall uses, through its human-facing Search entry
	// point. A nil Retrieve degrades search to the structured entities only.
	Retrieve    *retrieve.Service
	APIKey      string
	DataDir     string // for resolving memory/note file paths to absolute editor links
	Budgets     config.Budgets
	GardenerCfg config.Gardener // for the Settings page (read-only display)
	// BriefingCfg is the file/env briefing base the Settings page edits: the
	// form's effective values are this plus the store's override row, and a
	// save writes the override (never the file).
	BriefingCfg config.Briefing
	// SessionIdleTTL is the configured live/idle threshold for session displays
	// (gardener.session_idle_minutes); <= 0 falls back to core.SessionIdleTTL.
	SessionIdleTTL time.Duration
	Logger         *slog.Logger
}

Config wires the console's dependencies. Files/Gardener/Events are used by the write actions (archive, apply/dismiss) and the live feed; DB backs every read.

type Service

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

Service renders the console and serves its routes.

func New

func New(cfg Config) (*Service, error)

New builds a console Service, parsing its templates once.

func (*Service) Register

func (s *Service) Register(mux *http.ServeMux)

Register mounts the console routes on mux under /console. Public routes are the login page and the stylesheet; everything else requires the key.

Every route -- public included -- is registered through `secured`, which attaches the console's security response headers. Going through one helper rather than each handler setting its own is what makes that coverage structural: a route added later cannot forget.

Jump to

Keyboard shortcuts

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