Documentation
¶
Overview ¶
Package features provides a feature flag system for gating experimental functionality, with priority resolution from CLI overrides, config file values, and compiled-in defaults.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // TmuxInteractiveInput enables write support for tmux panes. TmuxInteractiveInput = Feature{ Name: "tmux_interactive_input", Default: true, Description: "Enable write support for tmux panes", } // TmuxFullAttach suspends Sidecar and runs `tmux attach-session`. // Off by default so users stay in the embedded pane. TmuxFullAttach = Feature{ Name: "tmux_full_attach", Default: false, Description: "Suspend Sidecar and attach to the full tmux session", } // WorkspaceTerminalPanel enables the Ctrl+T / Alt+T split terminal panel. WorkspaceTerminalPanel = Feature{ Name: "workspace_terminal_panel", Default: false, Description: "Enable the workspace split terminal panel", } // TmuxInlineEdit enables inline file editing via tmux in the files plugin. TmuxInlineEdit = Feature{ Name: "tmux_inline_edit", Default: true, Description: "Enable inline file editing via tmux in the files plugin", } // FilesAutoRefresh enables watching expanded directories in the files // plugin and refreshing the tree when they change on disk. FilesAutoRefresh = Feature{ Name: "files_auto_refresh", Default: true, Description: "Auto-refresh the files tree when watched directories change on disk", } // NotesPlugin enables the notes plugin for capturing quick notes. NotesPlugin = Feature{ Name: "notes_plugin", Default: false, Description: "Enable the notes plugin for capturing quick notes", } // TasksPlugin enables the embedded Tasks plugin tab. TasksPlugin = Feature{ Name: "tasks_plugin", Default: false, Description: "Enable the embedded Tasks plugin tab", } // ConversationsPlugin enables the multi-agent session history tab. // Off by default: history lives in each harness; this is an opt-in viewer. // When disabled, Sidecar does not construct history adapters or read // agent session stores (see assembly.ConversationsWanted). ConversationsPlugin = Feature{ Name: "conversations_plugin", Default: false, Description: "Enable the Conversations plugin (multi-agent session history)", } // WorkspaceDocPanes enables document panes beside workspace terminals. // When off there is no pane tree, so Diff is also unavailable. WorkspaceDocPanes = Feature{ Name: "workspace_doc_panes", Default: true, Description: "Open documents in panes beside workspace terminals. When disabled, Diff is unavailable (no pane tree).", } // WorkspaceDocPanesDisabledDiff is the toast/no-op copy when Diff is // requested while the pane tree is off. WorkspaceDocPanesDisabledDiff = "Document panes are disabled; Diff needs the workspace pane tree" // CrossProjectOverview gates the cross-project agent overview. CrossProjectOverview = Feature{ Name: "cross_project_overview", Default: true, Description: "Enable the cross-project agent overview", } )
Known feature flags - add new features here.
var ErrNotInitialized = errors.New("feature manager not initialized")
ErrNotInitialized is returned when the feature manager is not initialized.
Functions ¶
func DefaultEnabled ¶ added in v1.0.0
DefaultEnabled reports a feature's built-in default, ignoring configuration and CLI overrides. It is what a surface editing the config file needs: a flag absent from features.flags is not "off", it is "whatever this build defaults to", and a settings page that showed OFF for a default-on flag would be lying.
func Init ¶
Init initializes the feature flag manager with the given config. Should be called once at startup after config is loaded.
func IsEnabled ¶
IsEnabled checks if a feature is enabled. Priority: CLI override > config > default.
func IsKnownFeature ¶
IsKnownFeature returns true if the feature name is registered.
func SetEnabled ¶
SetEnabled updates a feature flag in the config and saves it. Returns an error if the config cannot be saved or if the manager is not initialized.
func SetOverride ¶
SetOverride sets a CLI override for a feature flag. Overrides take precedence over config values.