toolsettings

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package toolsettings is a small local store of which tools and skills are disabled — the on/off switch behind the CLI's tools/skills screen. Same on-disk shape and guarantees as internal/credentials: plain JSON under kramhome, 0600, no separate save step.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is a set of disabled item names. Tools and skills share one namespace here — a tool name like "bash" and a skill name never legitimately collide since skills are user-authored and tool names are a fixed built-in set, so there's no need to prefix/separate them.

func Load

func Load() (*Store, error)

Load reads the settings file, or returns an empty (everything enabled) Store if it doesn't exist yet.

func (*Store) Disabled

func (s *Store) Disabled() map[string]bool

Disabled returns every disabled name.

func (*Store) IsDisabled

func (s *Store) IsDisabled(name string) bool

IsDisabled reports whether name is turned off.

func (*Store) ReplaceDisabled added in v0.2.5

func (s *Store) ReplaceDisabled(names []string) error

ReplaceDisabled atomically reconciles the store to exactly names. Presets use this instead of incremental toggles so applying Recommended or Minimal has the same result regardless of whatever a previous setup run disabled.

func (*Store) SetAllDisabled

func (s *Store) SetAllDisabled(names []string, disabled bool) error

SetAllDisabled turns every name in names on or off in one persisted write — the tools/skills screen's bulk "enable all"/"disable all" keys, so toggling a whole section doesn't fire a save per item.

func (*Store) SetDisabled

func (s *Store) SetDisabled(name string, disabled bool) error

SetDisabled turns name on or off and persists immediately.

Jump to

Keyboard shortcuts

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