Documentation
¶
Overview ¶
Package features is muster's feature registry: every optional (and core) feature, whether this server runs it, why not, and the exact .env line(s) that turn it on — written for the documented install, the Compose stack (docs/features.md).
🔴 THIS PACKAGE HOLDS THE SHAPE AND THE IDS, NOT THE PREDICATES. Whether a feature is on is decided by cmd/muster-server from the SAME wired extensions and the SAME parsed config the server itself runs on (its features.go), and handed to internal/api once, at boot, as a Set.
⚠ WHAT READS THE SET, EXACTLY (internal/api features.go has the list beside the code): the boot log's summary line, /api/doctor's `features` (and so `muster doctor`), the Features page, the Account page's suggested-replies note, the Credentials page's variable name, the MCP doors' "disabled" answers and muster_help's disabled_features, and the typed feature_disabled 404. The GATES — whether a microphone or paperclip is drawn, whether the Connectors tab, the push button and the dispatch "+" are drawn, and which MCP tools are listed — read their extension AND the Set (Server.featureOff): the Set can only take a feature away, so a feature the registry calls OFF is never offered. A MISCONFIGURED one keeps what is wired (its store and tools work as far as they go) and is reported where its gap is true: `muster doctor` FAILs on it, and the Features page and the banner say so. Route handlers still gate on their own extension (each answers its own unwired case); the ones the CLI and the composer reach answer the typed 404.
The variable names are spelled in cmd/muster-server's config.go and nowhere else; this package never names a variable.
Index ¶
Constants ¶
const ( Mirror = "mirror" PasswordSignIn = "password-sign-in" Push = "push" Dictation = "dictation" Attachments = "attachments" SuggestedReplies = "suggested-replies" Focus = "focus" Accounts = "accounts" Connectors = "connectors" GitHubApp = "github-app" Dispatch = "dispatch" AgentGateway = "agent-gateway" ClaudeCodeAgents = "claude-code-agents" Chief = "chief" ChiefSessionRuntimes = "chief-session-runtimes" ChiefNudges = "chief-nudges" SessionState = "session-state" Plugins = "plugins" PluginTasks = "plugin-tasks" SessionRouting = "session-routing" TaskRouting = "task-routing" PRMailRouting = "pr-mail-routing" FleetReports = "fleet-reports" MailResume = "mail-resume" MemoRelay = "memo-relay" ApprovalRouter = "approval-router" BrowserFlows = "browser-flows" AgentAskTool = "agent-ask-tool" ServiceToken = "service-token" Android = "android" Telemetry = "telemetry" Officers = "officers" )
The feature ids. They are also the anchors of docs/features.md (DocsRef), so renaming one breaks every link to it: don't.
const ComposeProfilesVar = "COMPOSE_PROFILES"
ComposeProfilesVar is the variable a profile line sets.
const DocsPage = "docs/features.md"
DocsPage is the document whose headings are the feature ids.
const DocsURL = "https://github.com/ZacxDev/muster/blob/main/" + DocsPage
DocsURL is DocsPage on GitHub, for a link a browser can follow.
const KubernetesHint = "needs Kubernetes (in-cluster dispatch)"
KubernetesHint is what a feature the Compose stack cannot run needs.
const NeedsChiefHint = "needs the chief, which " + KubernetesHint + " — see " + DocsPage + "#chief"
NeedsChiefHint leads the hint of a feature that acts through the chief.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Feature ¶
type Feature struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
// Core: part of the documented install (the Compose stack, its Postgres,
// muster-mirror and tmux). Everything else is optional.
Core bool `json:"core"`
// Enable is what turns the feature on, as .env lines.
Enable []Var `json:"enable"`
// Settings are the other variables that tune the feature (by name). They
// are not needed to turn it on.
Settings []string `json:"settings,omitempty"`
// Note is what turning it on takes beyond the variables (a runner to host,
// a host to configure). "" for none.
Note string `json:"note,omitempty"`
// HostSide: the feature is set up on each machine running muster-mirror,
// not in the hub's .env.
HostSide bool `json:"host_side,omitempty"`
// Kubernetes: the feature needs in-cluster dispatch, which the Compose
// stack cannot provide (it does not forward these variables). Its hint
// then says so instead of "set X in .env", which would not work there.
// Enable still lists the variables, for a Kubernetes deployment.
Kubernetes bool `json:"kubernetes,omitempty"`
// NeedsChief: the feature's variables are forwarded by the Compose stack,
// but what it does goes through the chief, which needs Kubernetes. Its
// hint says that FIRST, so following it on Compose is not a dead end
// (setting the variable alone leaves the feature misconfigured).
NeedsChief bool `json:"needs_chief,omitempty"`
State State `json:"state"`
// Reason is why the feature is off or misconfigured ("" when on), or, for
// a feature that is on, what it still depends on ("" when nothing).
Reason string `json:"reason,omitempty"`
}
Feature is one registry entry: what the catalog says about it (ID through HostSide) and, once evaluated, its State and Reason.
🔴 IT CARRIES VARIABLE NAMES, NEVER VALUES. Reason is written by the evaluator and must not quote a configured value either; the evaluator's test feeds every variable a distinctive value and fails if one comes out.
func (Feature) DisabledMessage ¶
DisabledMessage is what a surface answers when a caller reaches for this feature while it is not on:
disabled: dictation — set MUSTER_STT_URL and MUSTER_STT_TOKEN in .env and restart (docs/features.md#dictation)
A misconfigured feature's reason comes first, since it names what is actually missing.
func (Feature) EnableHint ¶
EnableHint is the one sentence that says how to turn the feature on:
set MUSTER_STT_URL and MUSTER_STT_TOKEN in .env and restart (docs/features.md#dictation)
A Kubernetes feature's hint never says "set X in .env":
needs Kubernetes (in-cluster dispatch) — see docs/features.md#chief
func (Feature) EnableLines ¶
EnableLines is Enable as .env lines.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is the evaluated registry, in catalog order.
The zero Set holds nothing: a server that was never handed one reports no feature (and its consumers fall back to what they did before the registry).
func Evaluate ¶
Evaluate joins a catalog with its statuses.
🔴 IT IS A TWO-WAY LEDGER, NOT A LOOKUP. An entry with no status, a status for no entry, a duplicate id, an unknown state, a feature with no way to turn it on, or an "on" feature with no state at all is an error — so adding a feature to the catalog without deciding its state (or the reverse) fails the boot of every test that builds the registry rather than quietly reading "off".
type State ¶
type State string
State is a feature's state on this server.
const ( // On: the feature runs. On State = "on" // Off: the feature is not configured. Nothing is wrong; it is optional. Off State = "off" // Misconfigured: the feature was asked for (or is on by default) but a // dependency it needs is missing, so it does not do what it says — e.g. // suggested replies with no OpenRouter key. Misconfigured State = "misconfigured" )
type Var ¶
type Var struct {
Name string `json:"name"`
Value string `json:"value,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
Profile string `json:"profile,omitempty"`
Compose bool `json:"compose,omitempty"`
}
Var is one .env line a feature needs. Value is a fixed value the variable must have ("1", "gotrue"); Placeholder describes a value the operator supplies ("a 32-byte base64 key"). At most one is set.
Profile names a Compose profile instead: the line is COMPOSE_PROFILES=<it> (Name is then "COMPOSE_PROFILES"). Compose marks a variable the Compose stack reads and muster-server does not (S3_STORE_SECRET_KEY): it is a real .env line, and the registry's ledger against docs/configuration.md skips it.
func ProfileVar ¶
ProfileVar is the .env line that turns a Compose profile on.