skillstub

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 5 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 skillstub is the stub of Physa's skill that setup writes into an agent's skills directory: its text, and whether the stub at a path is current, stale, missing or not Physa's. It writes and removes only a stub Physa wrote, at the one path it is given, and never follows a symlink.

Index

Constants

View Source
const Version = "1"

Version is the stub's version. A stub written under another version reads as stale.

Variables

View Source
var ErrNotPhysas = errors.New("not a stub Physa wrote")

ErrNotPhysas is returned when the file at the path is not a stub Physa wrote, so it is left alone.

Functions

func Remove

func Remove(path string) error

Remove deletes the stub at path, then its directory if that is now empty. A file Physa did not write returns ErrNotPhysas. It never touches the skills directory above.

func Text

func Text() string

Text is the stub: the skill's name, a description that makes the agent load it in a repo with a .physa folder, the stub's version, and one instruction to run physa skill show and follow it.

func Write

func Write(path string) (err error)

Write puts the current stub at path, replacing a stale one. A current stub is left as it is; a file Physa did not write returns ErrNotPhysas.

Types

type State

type State int

State is what is at a stub's path.

const (
	// Missing means there is no file.
	Missing State = iota
	// Current means Physa's stub, exactly as this Physa writes it.
	Current
	// Stale means Physa's stub with other bytes: an older version, or edited.
	Stale
	// Other means something Physa did not write, or a symlink.
	Other
)

func Read

func Read(path string) (State, error)

Read says what is at path. It never follows a symlink, in the file or in its directory.

func (State) String

func (s State) String() string

String names the state as the commands print it.

Jump to

Keyboard shortcuts

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