Documentation
¶
Overview ¶
Package features is the registry of OPTIONAL features: the parts of Seamless the owner can switch on and off from the console without losing any data.
It is the single source of truth every surface derives from -- the MCP tool filter, the console route gate and nav, the Settings cards, the docs, and the guard tests. Adding a future optional feature is one registry entry plus one config.Features field plus tagging its surfaces; nothing else hand-maintains a list of what a feature covers.
The package is a leaf: it imports config and nothing else, so mcp, console, store, skills, and cmd/ can all import it without a cycle. The cross-consistency tests (registry tools exist in the MCP catalog, route prefixes are registered routes, nav ids exist in the layout) therefore live in those packages, where the imports are legal.
Optional features default to OFF: a fresh installation exposes none of them until the owner enables it. Disabling never deletes anything -- it gates exposure only, and re-enabling restores every surface instantly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Defaults ¶
Defaults returns the features config with every feature at its registry default. It mirrors config.Defaults().Features; a test asserts they agree.
func Enabled ¶
Enabled reports whether the named feature is on. An unknown key is off: a caller asking about a feature that does not exist must not be told it is available.
func HiddenTools ¶
HiddenTools returns the set of MCP tool names hidden by the currently disabled features. An empty result means every registered tool is exposed.
func ToolOwners ¶
ToolOwners maps every registered optional tool name to the feature that owns it, regardless of whether that feature is on. Guard tests use it to assert no tool is claimed twice and that every name exists in the MCP catalog.
Types ¶
type Feature ¶
type Feature struct {
// Key is the stable identifier (also the settings anchor and form field).
Key Key
// Label is the owner-facing name, shown in Settings.
Label string
// Blurb is one sentence explaining what the feature is.
Blurb string
// Tools are the MCP tool names hidden from tools/list and rejected by
// tools/call while the feature is off. Every name must exist in
// mcp.Catalog() (asserted by a guard test in internal/mcp).
Tools []string
NavIDs []string
// RoutePrefixes are the console route prefixes to gate.
RoutePrefixes []string
// Surfaces are owner-facing phrases for the feature's IN-PAGE surfaces --
// elements woven into existing screens (an Overview card, a board glyph)
// rather than whole screens, gated where they render via the console's
// per-request features state rather than by a route prefix. Each phrase
// joins the Settings card's "what disappears" line verbatim, so register a
// surface's phrase in the same change that adds the surface.
Surfaces []string
// Skill is the client-side skill that documents the feature's tools, or ""
// when it has none. install-hooks skips installing it while the feature is
// off, so agents never read about tools they cannot call.
Skill string
// Default is the built-in value, mirroring config.Defaults(). Optional
// features ship off.
Default bool
// contains filtered or unexported fields
}
Feature describes one optional feature and every surface it owns.
func Registry ¶
func Registry() []Feature
Registry returns the ordered optional features. The slice is a copy, so a caller cannot mutate the registry.
type Key ¶
type Key string
Key identifies an optional feature. It is the stable identifier used by the config field, the settings form, and the URL fragment on the Settings page.
const Gamification Key = "gamification"
Gamification covers the arcade layer of the Now screen: the day tape, the personal-records rail, the hot-streak pulse, and the celebration moments. It is separate from Momentum because it answers a different question -- momentum asks "is this knowledge practice building on itself?", gamification plays back "how hard is the fleet running right now?" -- and an owner who enjoys one framing may find the other noisy. Like every surface here, its numbers are judged from real recorded activity, never invented, and there are no punishment mechanics.
const Momentum Key = "momentum"
Momentum covers the gentle motivation surfaces woven into EXISTING screens rather than screens of their own: the plan finish-line card (and its agent briefing emphasis), the activity calendar with capture streaks, knowledge payoff moments, and project maturity stages. They are one feature because they answer one question -- "is this knowledge practice building on itself?" -- and an owner who finds that framing noisy switches all of it off with one toggle.
const Research Key = "research"
Research covers the whole research-lab domain: both console screens (Labs, Trials) and all three MCP tools. Labs and trials are one feature because a lab has no independent existence -- there is no labs table and no Lab core type, a lab is only the label its trials carry -- so splitting them would leave either a fully usable feature or an empty screen.