console

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 38 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.

The Now screen: the full exploded view of what every agent is doing right now, across every project and plan at once. It inverts the project workspace's task-centric lens -- here the AGENT is the unit: one card per live session carrying its claims, its lease countdowns, and its freshest output, with the loose ends (claims nobody live is holding), the plans in motion, the cross-project ready queue, and the live wire below.

The optional gamification feature layers the arcade on top: the day tape, the personal-records rail, the hot-streak pulse, and celebration moments. Off (the shipped default), none of it is computed and the page is byte-identical to the feature never existing -- in HTML and JSON alike.

Index

Constants

View Source
const (
	MatrixScreens  = "Screens"
	MatrixSections = "Settings sections"
	MatrixSurfaces = "Within screens"
)

Level matrix groups, in the order the docs render them.

View Source
const StreakEmberFloor = 7

StreakEmberFloor is the current-streak length, in covered days, at which the calendar header lights its ember. A stated judgment threshold like the targets in atoms.go -- which is why it is a named const, not config.

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
	// Features is the file/env optional-features base. The effective state is
	// this plus the store's override row, resolved live per request (see
	// effectiveFeatures) so a Settings save applies without a restart.
	Features config.Features
	// Version is the daemon's build version (seamlessd's buildVersion), shown
	// on the Home health strip and in Settings -> Your setup. Empty omits it.
	Version string
	// Level is the file/env console level base (config.Console.Level): how much
	// of the console the owner sees. The effective level is this plus the
	// store's level row, resolved live per request (see consoleLevel). Empty
	// means the config default; any other value must be one of
	// config.ConsoleLevels, or New refuses it.
	Level string
	// SessionIdleTTL is the configured live/idle threshold for session displays
	// (gardener.session_idle_minutes); <= 0 falls back to core.SessionIdleTTL.
	SessionIdleTTL time.Duration
	// SecureCookies marks the console session cookie Secure. It follows
	// config.TLSEnabled and nothing else: a browser silently DROPS a Secure
	// cookie that arrives over http, so setting it on a plaintext listener
	// would lock the owner out of their own console with no error anywhere.
	SecureCookies bool
	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 LevelMatrixRow added in v0.5.3

type LevelMatrixRow struct {
	// Group is "Screens", "Settings sections", or "Within screens".
	Group string
	// Name is what the owner sees it called.
	Name string
	// Note qualifies the row ("research feature", "no sidebar entry").
	Note string
	// Min is the first level (a config.ConsoleLevels value) that shows it.
	Min string
}

LevelMatrixRow is one line of the docs matrix: something the console shows, and the first level that shows it.

func LevelMatrix added in v0.5.3

func LevelMatrix() []LevelMatrixRow

LevelMatrix returns every row, grouped and in registry order.

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