manifestplugins

package
v0.60.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LatestVersion added in v0.45.0

func LatestVersion(ctx context.Context, stellaHome, tool string) (string, error)

LatestVersion resolves the latest installable version for a mise tool key (short name like "fd" or backend-qualified like "github:cli/cli"). It may hit the network to query the backend's available versions.

func RuntimeMiseEnv added in v0.38.0

func RuntimeMiseEnv(stellaHome, userDataDir, workspaceDir string) map[string]string

RuntimeMiseEnv returns the mise environment for a sandbox session, layered like a real machine: the shared system installs supply the builtin tools and the _builtin config supplies their default versions, while the per-user writable tree (userDataDir) holds anything the agent installs itself. HOME/XDG are left untouched — the sandbox owns those.

When userDataDir is set the per-user tree is writable, so DATA/CACHE/STATE live there and auto-install is enabled; a user's own tool versions win because the per-user shims sort ahead on PATH. (Auto-install still only reaches the network when the session's NetworkPolicy permits egress — mise doesn't widen it.) workspaceDir (the host workspace root) is trusted alongside the bwrap "/workspace" mount so a project's mise.toml participates in resolution regardless of backend.

When userDataDir is empty (no user/group) it falls back to the read-only system tree with auto-install disabled and state redirected to a writable temp dir, matching the historical behavior.

MISE_DATA_DIR is load-bearing beyond mise itself: the sandbox host backends recover the per-user mise home from it via pkgsandbox.PerUserMiseDataDir to put the per-user shims on PATH, so the FilesystemPolicy carries no mise-specific field. Keep DATA_DIR pointing at userDataDir (or the system tree when empty).

func SaveState

func SaveState(path string, s *ManifestState) error

SaveState writes the manifest state to path atomically (write to .tmp then rename).

func ScopeConfigPath added in v0.38.0

func ScopeConfigPath(stellaHome, scope string) string

ScopeConfigPath returns the persisted mise config path for a scope.

func StatePath

func StatePath(stellaHome string) string

StatePath returns the path for the manifest state file.

func Validate

func Validate(m *Manifest) error

Types

type BinaryInstallState

type BinaryInstallState struct {
	Name string `json:"name"`
	Tool string `json:"tool"`
	// Spec is the version spec requested by the manifest (e.g. "2.40", "latest").
	// Cache hits key on it; an empty Spec (pre-Spec state files) always misses
	// and re-resolves, repopulating it.
	Spec string `json:"spec,omitempty"`
	// Version is the concrete version mise resolved for Spec at install time.
	Version     string    `json:"version"`
	InstalledAt time.Time `json:"installed_at"`
}

type BinaryReconcileResult

type BinaryReconcileResult struct {
	Name     string
	Version  string
	CacheHit bool
	Err      error
}

BinaryReconcileResult holds the result for a single binary within a plugin.

type Manifest

type Manifest struct {
	OAuthProviders []ManifestOAuthProvider `json:"oauth_providers,omitempty" yaml:"oauth_providers,omitempty"`
	Plugins        []ManifestPlugin        `json:"plugins" yaml:"plugins"`
}

func LoadBuiltin

func LoadBuiltin() (*Manifest, error)

LoadBuiltin returns the manifest baked into the binary at build time. This is the single source of truth for plugin defaults; overrides live in the plugin_override DB table.

type ManifestBinary

type ManifestBinary struct {
	// Name is the binary name written to $STELLA_HOME/bin/.
	Name string `json:"name" yaml:"name"`

	// Tool is the mise tool key, e.g.:
	//   uv   bun   github:cli/cli   pipx:mypy   npm:serve   http:sentinel
	Tool string `json:"tool" yaml:"tool"`

	// Version to install; defaults to "latest" when omitted.
	Version string `json:"version,omitempty" yaml:"version,omitempty"`

	// Options are mise tool options, using the same names as mise.toml.
	Options map[string]any `json:"options,omitempty" yaml:",inline"`
}

type ManifestOAuthFlow

type ManifestOAuthFlow struct {
	Type          string `json:"type" yaml:"type"`
	AuthURL       string `json:"auth_url,omitempty" yaml:"auth_url,omitempty"`
	DeviceAuthURL string `json:"device_auth_url,omitempty" yaml:"device_auth_url,omitempty"`
	TokenURL      string `json:"token_url" yaml:"token_url"`
	AuthStyle     string `json:"auth_style,omitempty" yaml:"auth_style,omitempty"`
	PKCE          bool   `json:"pkce,omitempty" yaml:"pkce,omitempty"`
}

type ManifestOAuthProvider

type ManifestOAuthProvider struct {
	ID           string              `json:"id" yaml:"id"`
	Icon         string              `json:"icon,omitempty" yaml:"icon,omitempty"`
	Scopes       []string            `json:"scopes" yaml:"scopes"`
	VaultKey     string              `json:"vault_key" yaml:"vault_key"`
	Flows        []ManifestOAuthFlow `json:"flows" yaml:"flows"`
	ClientID     string              `json:"client_id,omitempty" yaml:"client_id,omitempty"`
	ClientSecret string              `json:"client_secret,omitempty" yaml:"client_secret,omitempty"`
}

type ManifestPlugin

type ManifestPlugin struct {
	ID          string `json:"id" yaml:"id"`
	Kind        string `json:"kind" yaml:"kind"`
	Name        string `json:"name" yaml:"name"`
	DisplayName string `json:"display_name" yaml:"display_name"`
	Description string `json:"description" yaml:"description"`
	Enabled     bool   `json:"enabled" yaml:"enabled"`

	// Category is a display-only hint for grouping in the settings UI
	// ("system", "integration", "tool"). Empty means the UI derives a bucket
	// from the plugin's signals (oauth → integration, hook → system, else tool).
	Category string `json:"category,omitempty" yaml:"category,omitempty"`
	// Essential marks a plugin the runtime depends on (e.g. rg/fd back the
	// Grep/Glob tools); the UI guards against disabling it.
	Essential bool `json:"essential,omitempty" yaml:"essential,omitempty"`

	Prompt        string               `json:"prompt,omitempty" yaml:"prompt,omitempty"`
	Binaries      []ManifestBinary     `json:"binaries,omitempty" yaml:"binaries,omitempty"`
	Skills        []ManifestSkill      `json:"skills,omitempty" yaml:"skills,omitempty"`
	SessionEnvs   []ManifestSessionEnv `json:"session_env,omitempty" yaml:"session_env,omitempty"`
	OAuthProvider string               `json:"oauth_provider,omitempty" yaml:"oauth_provider,omitempty"`
}

type ManifestSessionEnv

type ManifestSessionEnv struct {
	EnvVar   string `json:"env_var" yaml:"env_var"`
	Source   string `json:"source" yaml:"source"`
	Value    string `json:"value,omitempty" yaml:"value,omitempty"`
	Required bool   `json:"required,omitempty" yaml:"required,omitempty"`
}

type ManifestSkill

type ManifestSkill struct {
	Repo string `json:"repo" yaml:"repo"`
	Name string `json:"name" yaml:"name"`
}

type ManifestState

type ManifestState struct {
	UpdatedAt time.Time                     `json:"updated_at"`
	Plugins   map[string]PluginInstallState `json:"plugins"`
}

func LoadState

func LoadState(path string) (*ManifestState, error)

LoadState reads the manifest state file at path. If the file does not exist, an empty state is returned.

type PluginInstallState

type PluginInstallState struct {
	Binaries []BinaryInstallState `json:"binaries,omitempty"`
	Skills   []SkillInstallState  `json:"skills,omitempty"`
}

type PluginReconcileResult

type PluginReconcileResult struct {
	PluginID string
	Binaries []BinaryReconcileResult
	// Skills not yet implemented (bundled-only in v1), but reserved for future use
	Err error
}

PluginReconcileResult holds the result for a single plugin.

type ReconcileResult

type ReconcileResult struct {
	EnabledCount int
	// Per-plugin results, keyed by plugin ID
	Plugins map[string]PluginReconcileResult
}

ReconcileResult summarizes one reconcile run.

func Reconcile

func Reconcile(ctx context.Context, m *Manifest, stellaHome string) ReconcileResult

Reconcile processes all enabled plugins in the manifest, downloading any binaries that are not already at the correct version according to the state file.

type RegistryTool added in v0.45.0

type RegistryTool struct {
	Name     string   `json:"name"`
	Backends []string `json:"backends"`
}

RegistryTool is one entry from `mise registry`: a short name and the backend keys that can provide it (e.g. "aqua:anthropics/claude-code", "npm:@anthropic-ai/claude-code"). Either the short name or a backend key is a valid mise tool spec for a manifest binary.

func SearchRegistry added in v0.45.0

func SearchRegistry(ctx context.Context, stellaHome, query string, limit int) ([]RegistryTool, error)

SearchRegistry returns registry tools whose name or backend keys contain query (case-insensitive), ranked by name relevance. An empty query returns nothing — the registry has thousands of entries and is meant to be filtered. Results are capped at limit (default 30).

type SkillInstallState

type SkillInstallState struct {
	Repo        string    `json:"repo"`
	Name        string    `json:"name"`
	InstalledAt time.Time `json:"installed_at"`
}

Jump to

Keyboard shortcuts

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