skillsettings

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package skillsettings owns trusted project-local Skill enablement policy.

Index

Constants

View Source
const (
	// Schema is the strict project Skill settings schema.
	Schema = "pips.skills/v1alpha1"
)

Variables

View Source
var (
	// ErrInvalid reports malformed settings or identities.
	ErrInvalid = errors.New("coding skill settings: invalid")
	// ErrDuplicate reports a repeated disabled Skill identity.
	ErrDuplicate = errors.New("coding skill settings: duplicate")
	// ErrLimitExceeded reports a bounded file or record limit.
	ErrLimitExceeded = errors.New("coding skill settings: limit exceeded")
	// ErrUnsafeFile reports a tracked, linked, broad-mode, or special file.
	ErrUnsafeFile = errors.New("coding skill settings: unsafe file")
	// ErrUntrusted reports project policy access without Workspace trust.
	ErrUntrusted = errors.New("coding skill settings: untrusted project")
)

Functions

This section is empty.

Types

type Limits

type Limits struct {
	MaxFileBytes int64
	MaxDisabled  int
}

Limits bound project Skill settings reads and records.

func DefaultLimits

func DefaultLimits() Limits

DefaultLimits returns conservative project settings limits.

type Manager

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

Manager reads and atomically replaces one project Skill settings file.

func New

func New(options Options) (*Manager, error)

New constructs one project Skill settings manager.

func (*Manager) Load

func (m *Manager) Load(ctx context.Context) (Snapshot, error)

Load returns the current trusted project policy. Untrusted projects are not inspected and receive an empty effective policy.

func (*Manager) Save

func (m *Manager) Save(ctx context.Context, snapshot Snapshot) error

Save atomically persists one trusted project policy.

type Options

type Options struct {
	Tree    *workspace.Tree
	Git     ProjectGit
	Trusted bool
	Limits  Limits
}

Options bind a Manager to one Workspace and trust decision.

type ProjectGit

type ProjectGit interface {
	Tracked(context.Context, string) (bool, bool, error)
	ExcludeLocal(context.Context, string) error
}

ProjectGit supplies the narrow Git-local safety boundary for project state.

type Ref

type Ref struct {
	Source string `toml:"source"`
	Name   string `toml:"name"`
}

Ref is the content-free stable identity of one resolved Skill.

type Snapshot

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

Snapshot is one immutable set of disabled Skill identities.

func Empty

func Empty() Snapshot

Empty returns an initialized policy with no disabled Skills.

func (Snapshot) Clone

func (s Snapshot) Clone() Snapshot

Clone returns a defensive copy.

func (Snapshot) IsDisabled

func (s Snapshot) IsDisabled(ref Ref) bool

IsDisabled reports whether ref is disabled in this snapshot.

func (Snapshot) WithDisabled

func (s Snapshot) WithDisabled(ref Ref, disabled bool) Snapshot

WithDisabled returns a detached snapshot with ref added or removed.

Jump to

Keyboard shortcuts

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