pluginreload

package
v0.16.397 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 9 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 pluginreload carries a change of the person's Claude Code plugins and skills into the Claude tabs that run. The plugin reconciler leaves a mark file ({"plugins": <ms>, "skills": <ms>}) when it installed or updated some; a running Claude keeps what it loaded at start until /reload-plugins or /reload-skills, so each Claude tab gets the command typed once per change: only an agent that stopped, with an empty prompt box and no message of the person waiting. What each tab has applied is kept on disk, so a restart does not reload every tab again.

Index

Constants

This section is empty.

Variables

View Source
var Commands = map[string]string{"plugins": "/reload-plugins", "skills": "/reload-skills"}

Commands are what each kind's reload types.

View Source
var Kinds = []string{"plugins", "skills"}

Kinds, plugins first: their reload also brings the skills plugins carry.

Functions

func Outcome

func Outcome(status int, errorCode string) string

Outcome is what a typed reload came to: applied, settled (no Claude runs in the tab; the next one reads the plugins as they are), gone (the tab has no session) or wait.

func Pending

func Pending(mark, applied Mark) []string

Pending are the kinds changed since what a tab applied.

func ScreenDecision

func ScreenDecision(s *Screen) string

ScreenDecision is insert, wait, or probe (no prompt box on screen: whether a Claude runs in the pane decides).

Types

type Applied

type Applied struct {
	File string
	// contains filtered or unexported fields
}

Applied is what each tab's Claude has, kept in a file.

func (*Applied) Delete

func (a *Applied) Delete(tab string)

Delete forgets a tab.

func (*Applied) Get

func (a *Applied) Get(tab string) Mark

Get is a tab's applied mark (nil when none).

func (*Applied) Save

func (a *Applied) Save() error

Save writes the file whole, through a temporary one.

func (*Applied) Set

func (a *Applied) Set(tab string, m Mark)

Set records a tab's mark.

func (*Applied) Tabs

func (a *Applied) Tabs() []string

Tabs are the tabs with a mark.

type Decision

type Decision struct {
	Action, Kind string
}

Decision is insert (with the kind to reload), wait or skip.

func Decide

func Decide(t Tab, mark, applied Mark) Decision

Decide says whether to type a reload now. The screen is read once more right before typing, so an agent shown idle by a stale state is not interrupted.

type Mark

type Mark map[string]float64

Mark is the time of the last change of each kind (epoch ms); a kind that is not there never changed.

func Apply

func Apply(applied, mark Mark, kind, outcome string) Mark

Apply is what a tab has applied after an outcome; the same map when nothing changed.

func ParseMark

func ParseMark(raw []byte) (Mark, bool)

ParseMark reads a mark file; false when it is not a JSON object. Only positive finite numbers count.

func (Mark) MarshalJSON

func (m Mark) MarshalJSON() ([]byte, error)

MarshalJSON writes the kinds in their order.

type Screen

type Screen struct {
	Busy, Menu bool
	Input      *string
}

Screen is the screen's say: a working agent, an open menu, the text in Claude's prompt box (nil without one).

type Tab

type Tab struct {
	PanelType, Provider string // "" for none
	CliState            string
	// Queued: a message of the person waits in the platform's queue; it goes first.
	Queued bool
}

Tab is what the decision reads of a tab.

Jump to

Keyboard shortcuts

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