features

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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 workspace split terminal pane —
	// live terminals placed beside the session, which is also what
	// `sidecar create shell` defaults to from inside a shell (nt-7c82c9).
	WorkspaceTerminalPanel = Feature{
		Name:        "workspace_terminal_panel",
		Default:     true,
		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. Notes is
	// stable and defaults on; assembly additionally requires the existing td
	// panel preference because td owns its storage.
	NotesPlugin = Feature{
		Name:        "notes_plugin",
		Default:     true,
		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).",
	}

	// PluginContentPanes enables the app-owned passive content deck around
	// eligible capability-driven plugins. Files, Git, Notes, and the embedded
	// td/Tasks focus hosts have completed their parity journeys; td/Tasks still
	// expose no link surface until their owning packages publish safe passive
	// text rectangles.
	PluginContentPanes = Feature{
		Name:        "plugin_content_panes",
		Default:     true,
		Description: "Open passive content panes beside eligible project plugins",
	}

	// 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"

	// TerminalResourceProviders gates external terminal resource providers:
	// the matchers they declare, the panes they open, and the describe pass
	// that asks them what they are. Off by default until the whole journey is
	// proven, and deliberately a flag rather than "is anything configured":
	// a user should be able to write the configuration and turn it on
	// separately, and turning it off should stop every provider process.
	TerminalResourceProviders = Feature{
		Name:        "terminal_resource_providers",
		Default:     false,
		Description: "Recognize and open resources from configured external terminal resource providers",
	}

	// 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.

View Source
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

func DefaultEnabled(name string) bool

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

func Init(cfg *config.Config)

Init initializes the feature flag manager with the given config. Should be called once at startup after config is loaded.

func IsEnabled

func IsEnabled(name string) bool

IsEnabled checks if a feature is enabled. Priority: CLI override > config > default.

func IsKnownFeature

func IsKnownFeature(name string) bool

IsKnownFeature returns true if the feature name is registered.

func List

func List() map[string]bool

List returns all known features with their current enabled state.

func SetEnabled

func SetEnabled(name string, enabled bool) error

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

func SetOverride(name string, enabled bool)

SetOverride sets a CLI override for a feature flag. Overrides take precedence over config values.

Types

type Feature

type Feature struct {
	Name        string
	Default     bool
	Description string
}

Feature represents a known feature flag with its default value.

func ListAll

func ListAll() []Feature

ListAll returns all known features with metadata. Returns a copy to prevent mutation of internal state.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles feature flag state.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL