console

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 34 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
	ConfigPath  string // absolute path of the config file this daemon loaded; empty when config is env-only
	DBPath      string // absolute path of the SQLite database, for the Settings storage panel
	Budgets     config.Budgets
	GardenerCfg config.Gardener // for the Settings page (read-only display)
	// Embedding describes the embedder this process resolved at serve start.
	// It is fixed for the daemon's life: the console's on/off override and any
	// config change apply from the next restart, and the Settings page uses the
	// gap between this and the stored override to say so.
	Embedding EmbeddingRuntime
	// 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 EmbeddingRuntime added in v0.4.1

type EmbeddingRuntime struct {
	Enabled bool `json:"enabled"`
	// Provider is the configured llm.provider, shown even when disabled.
	Provider string `json:"provider"`
	// Model is the active embedding model when enabled, else the configured one.
	Model string `json:"model"`
	// Reason is the human-readable cause when disabled; empty when enabled.
	Reason string `json:"reason,omitempty"`
	// Misconfigured marks Reason as a local config error (llm.ErrConfig class)
	// rather than a deliberate opt-out, so the panel can escalate its tone.
	Misconfigured bool `json:"misconfigured,omitempty"`
	// OverriddenOff means this process started with the console off switch set.
	OverriddenOff bool `json:"overriddenOff,omitempty"`
}

EmbeddingRuntime describes the embedder the daemon resolved at serve start. Enabled means vectors are being written and searched this process. When disabled, Reason says why in the owner's terms: their off switch, a missing credential, or a config mistake -- three states that call for three different next actions.

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