Documentation
¶
Overview ¶
Package agent provides unified agent settings management.
Package agent provides shared types and utilities for Gas Town agents (witness, refinery, deacon, etc.).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureSettingsForAllAgents ¶
EnsureSettingsForAllAgents ensures settings exist for all supported agents. This is useful during installation to prepare the workspace for any agent.
func EnsureSettingsForRole ¶
EnsureSettingsForRole ensures agent settings exist for the given agent preset and role. This is a unified function that delegates to the appropriate agent-specific implementation.
For Cursor: Creates .cursor/rules/gastown.mdc with rules and .cursor/hooks.json For other agents: Currently no-op (may be extended in future)
Types ¶
type StateManager ¶
type StateManager[T any] struct { // contains filtered or unexported fields }
StateManager handles loading and saving agent state to disk. It uses generics to work with any state type.
func NewStateManager ¶
func NewStateManager[T any](rigPath, stateFileName string, defaultFactory func() *T) *StateManager[T]
NewStateManager creates a new StateManager for the given state file path. The defaultFactory function is called when the state file doesn't exist to create a new state with default values.
func (*StateManager[T]) Load ¶
func (m *StateManager[T]) Load() (*T, error)
Load loads agent state from disk. If the file doesn't exist, returns a new state created by the default factory.
func (*StateManager[T]) Save ¶
func (m *StateManager[T]) Save(state *T) error
Save persists agent state to disk using atomic write.
func (*StateManager[T]) StateFile ¶
func (m *StateManager[T]) StateFile() string
StateFile returns the path to the state file.