Documentation
¶
Overview ¶
Package projstate manages a project's gitignored machine-local state file (.gskill/state.json): the stable project identifier, the global store object each skill activates, and the links gskill owns. The state exists for safe repair and removal only — a project is always restorable from its committed skills-lock.json alone, and deleting the state file simply regenerates it with a fresh project ID.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentState ¶
AgentState is one gskill-created agent target.
type SkillState ¶
type SkillState struct {
StoreHash string `json:"storeHash"`
StoreScope string `json:"storeScope,omitempty"`
ActiveTarget string `json:"activeTarget,omitempty"`
ActiveMode string `json:"activeMode,omitempty"`
Agents map[string]AgentState `json:"agents,omitempty"`
}
SkillState records which global object a skill activates and which links gskill owns for it — enough for safe repair and removal (FR-014).
type State ¶
type State struct {
SchemaVersion int `json:"schemaVersion"`
ProjectID string `json:"projectId"`
Skills map[string]SkillState `json:"skills"`
// contains filtered or unexported fields
}
State is a project's machine-local installation record. It is gitignored, never required to reproduce the project (the lockfile alone restores it, FR-015), and safe to delete: a fresh state with a new project ID is generated on the next gskill operation.
func LoadOrInit ¶
LoadOrInit loads the project state under root, or initializes a fresh one (with a newly generated stable project ID) when none exists. A fresh state is not persisted until Save is called.
func (*State) RemoveSkill ¶
RemoveSkill drops the record for name.
func (*State) Save ¶
Save writes the state atomically and deterministically (map keys are sorted by encoding/json).
func (*State) SetSkill ¶
func (s *State) SetSkill(name string, sk SkillState)
SetSkill records the state for name.