Documentation
¶
Overview ¶
Package execution provides execution mode state management.
Pair programming mode: collaborative AI-human coding with real-time feedback. All tools execute normally in this mode; the collaboration logic is handled at the prompt and suggestion level rather than through tool blocking.
Package execution provides execution mode state management.
Plan mode: the agent explores the codebase and writes a plan, which is then presented to the user for approval before any source files are modified.
Index ¶
- Constants
- Variables
- func ClearAllPairProgrammingStates()
- func ClearAllPlanSlugs()
- func ClearAllStates()
- func ClearAllSuggestionSlugs()
- func ClearPairProgrammingState(sessionID types.SessionID)
- func ClearPlanSlug(sessionID types.SessionID)
- func ClearState(sessionID types.SessionID)
- func ClearSuggestionSlug(sessionID types.SessionID)
- func DeletePlan(sessionID types.SessionID, agentID *types.AgentID) error
- func DeleteSuggestions(sessionID types.SessionID) error
- func EnterPairProgrammingMode(sessionID types.SessionID)
- func EnterPlanMode(sessionID types.SessionID, agentID *types.AgentID)
- func ExitPairProgrammingMode(sessionID types.SessionID)
- func ExitPlanMode(sessionID types.SessionID)
- func ExtractSlugFromFilePath(filePath string) string
- func GetAcceptedSuggestions(sessionID types.SessionID) int
- func GetCollaborationTurns(sessionID types.SessionID) int
- func GetDisplayPath(planFilePath string) string
- func GetHasPlanFile(sessionID types.SessionID) bool
- func GetHasSuggestionsFile(sessionID types.SessionID) bool
- func GetPlan(sessionID types.SessionID, agentID *types.AgentID) (string, error)
- func GetPlanFilePath(sessionID types.SessionID, agentID *types.AgentID) string
- func GetPlanSlug(sessionID types.SessionID) string
- func GetPlanWasEdited(sessionID types.SessionID) bool
- func GetPlansDirectory() string
- func GetSuggestionFilePath(sessionID types.SessionID) string
- func GetSuggestionSlug(sessionID types.SessionID) string
- func GetSuggestions(sessionID types.SessionID) (string, error)
- func GetSuggestionsCount(sessionID types.SessionID) int
- func GetSuggestionsDirectory() string
- func GetSuggestionsDisplayPath(suggestionFilePath string) string
- func GetSuggestionsWereReviewed(sessionID types.SessionID) bool
- func HasActiveCollaboration(sessionID types.SessionID) bool
- func HasExitedPlanMode(sessionID types.SessionID) bool
- func IncrementAcceptedSuggestions(sessionID types.SessionID)
- func IncrementCollaborationTurns(sessionID types.SessionID)
- func IncrementSuggestionsCount(sessionID types.SessionID)
- func NeedsPlanModeExitAttachment(sessionID types.SessionID) bool
- func NeedsUserConfirmation(sessionID types.SessionID) bool
- func PlanExists(sessionID types.SessionID, agentID *types.AgentID) bool
- func SetHasActiveCollaboration(sessionID types.SessionID, v bool)
- func SetHasExitedPlanMode(sessionID types.SessionID, v bool)
- func SetHasPlanFile(sessionID types.SessionID, v bool)
- func SetHasSuggestionsFile(sessionID types.SessionID, v bool)
- func SetNeedsPlanModeExitAttachment(sessionID types.SessionID, v bool)
- func SetNeedsUserConfirmation(sessionID types.SessionID, v bool)
- func SetPairProgrammingState(sessionID types.SessionID, state *PairProgrammingState)
- func SetPlan(sessionID types.SessionID, agentID *types.AgentID, content string) error
- func SetPlanSlug(sessionID types.SessionID, slug string)
- func SetPlanWasEdited(sessionID types.SessionID, v bool)
- func SetPlansDirectory(dir string) error
- func SetState(sessionID types.SessionID, state *State)
- func SetSuggestionSlug(sessionID types.SessionID, slug string)
- func SetSuggestions(sessionID types.SessionID, content string) error
- func SetSuggestionsDirectory(dir string) error
- func SetSuggestionsWereReviewed(sessionID types.SessionID, v bool)
- func SuggestionsExist(sessionID types.SessionID) bool
- type ModeCache
- func (c *ModeCache[S]) ClearAllSlugs()
- func (c *ModeCache[S]) ClearAllStates()
- func (c *ModeCache[S]) ClearSlug(sessionID types.SessionID)
- func (c *ModeCache[S]) ClearState(sessionID types.SessionID)
- func (c *ModeCache[S]) DeleteFile(sessionID types.SessionID) error
- func (c *ModeCache[S]) FileExists(sessionID types.SessionID) bool
- func (c *ModeCache[S]) GetDirectory() string
- func (c *ModeCache[S]) GetDisplayPath(filePath string) string
- func (c *ModeCache[S]) GetFilePath(sessionID types.SessionID) string
- func (c *ModeCache[S]) GetSlug(sessionID types.SessionID) string
- func (c *ModeCache[S]) GetState(sessionID types.SessionID) *S
- func (c *ModeCache[S]) ReadFile(sessionID types.SessionID) (string, error)
- func (c *ModeCache[S]) SetDirectory(dir string) error
- func (c *ModeCache[S]) SetSlug(sessionID types.SessionID, slug string)
- func (c *ModeCache[S]) SetState(sessionID types.SessionID, state *S)
- func (c *ModeCache[S]) WriteFile(sessionID types.SessionID, content string) error
- type PairProgrammingState
- type State
Constants ¶
const DefaultSuggestionsDirectory = ".seshat/suggestions"
Variables ¶
var DefaultPlansDirectory = runtimepath.PlansDir("")
DefaultPlansDirectory is the default location for plan files (~/.config/seshat/plans/).
var WordList = []string{
"algorithm", "cascade", "discovery", "element", "focus", "galaxy", "horizon", "insight",
"journey", "kernel", "launch", "momentum", "seshat", "orbit", "prism", "quest",
"resonance", "spectrum", "tempo", "unity", "vertex", "wavelength", "zenith", "apex",
"bridge", "chronicle", "dynamics", "eclipse", "fusion", "genesis", "harmonic", "infinity",
"junction", "kinesis", "lucid", "meridian", "novel", "origins", "paradigm", "quantum",
"radian", "symmetry", "threshold", "unity", "vortex", "wanderer", "xenon", "yearning",
}
WordList is used to generate human-readable mode file slugs.
Functions ¶
func ClearAllPairProgrammingStates ¶
func ClearAllPairProgrammingStates()
ClearAllPairProgrammingStates removes all session states (useful for testing).
func ClearAllPlanSlugs ¶
func ClearAllPlanSlugs()
ClearAllPlanSlugs removes all plan slugs (useful for testing).
func ClearAllStates ¶
func ClearAllStates()
ClearAllStates removes all session states (useful for testing).
func ClearAllSuggestionSlugs ¶
func ClearAllSuggestionSlugs()
ClearAllSuggestionSlugs removes all suggestion slugs (useful for testing).
func ClearPairProgrammingState ¶
ClearPairProgrammingState removes all state for a session.
func ClearPlanSlug ¶
ClearPlanSlug removes the plan slug for a session.
func ClearState ¶
ClearState removes the state for a session.
func ClearSuggestionSlug ¶
ClearSuggestionSlug removes the suggestion slug for a session.
func DeletePlan ¶
DeletePlan deletes the plan file for a session.
func DeleteSuggestions ¶
DeleteSuggestions deletes the suggestions file for a session.
func EnterPairProgrammingMode ¶
EnterPairProgrammingMode initializes pair programming mode state for a session.
func EnterPlanMode ¶
EnterPlanMode initializes plan mode state for a session.
func ExitPairProgrammingMode ¶
ExitPairProgrammingMode applies state changes when leaving pair programming mode.
func ExitPlanMode ¶
ExitPlanMode applies state changes when leaving plan mode.
func ExtractSlugFromFilePath ¶
ExtractSlugFromFilePath extracts the slug from a mode file path. E.g. "/path/to/quantum-bridge.md" → "quantum-bridge".
func GetAcceptedSuggestions ¶
func GetCollaborationTurns ¶
func GetDisplayPath ¶
GetDisplayPath returns a user-friendly tilde-prefixed path to the plan file.
func GetHasPlanFile ¶
func GetHasSuggestionsFile ¶
func GetPlanFilePath ¶
GetPlanFilePath returns the full path to the plan file for a session. Plans are stored under sessions/{sessionID}/plans/ so that deleting a session directory removes all its plans in one shot. When agentID is non-nil the filename includes the agent identifier, allowing separate plan files per sub-agent within the same session.
func GetPlanSlug ¶
GetPlanSlug returns the slug for a session's plan file.
func GetPlanWasEdited ¶
func GetPlansDirectory ¶
func GetPlansDirectory() string
GetPlansDirectory returns the directory where plan files are stored.
func GetSuggestionFilePath ¶
GetSuggestionFilePath returns the full path to the suggestions file for a session.
func GetSuggestionSlug ¶
GetSuggestionSlug returns the suggestion slug for a session.
func GetSuggestions ¶
GetSuggestions reads the suggestions content from disk.
func GetSuggestionsCount ¶
func GetSuggestionsDirectory ¶
func GetSuggestionsDirectory() string
GetSuggestionsDirectory returns the directory where suggestion files are stored.
func GetSuggestionsDisplayPath ¶
GetSuggestionsDisplayPath returns a user-friendly relative path to the suggestions file.
func HasActiveCollaboration ¶
func HasExitedPlanMode ¶
func NeedsUserConfirmation ¶
func PlanExists ¶
PlanExists checks if a plan file exists for the session.
func SetHasExitedPlanMode ¶
func SetHasPlanFile ¶
func SetHasSuggestionsFile ¶
func SetPairProgrammingState ¶
func SetPairProgrammingState(sessionID types.SessionID, state *PairProgrammingState)
SetPairProgrammingState explicitly sets the state for a session (useful for testing).
func SetPlanSlug ¶
SetPlanSlug sets the plan slug for a session (useful for testing).
func SetPlanWasEdited ¶
func SetPlansDirectory ¶
SetPlansDirectory sets a custom directory for plan files.
func SetSuggestionSlug ¶
SetSuggestionSlug sets the suggestion slug for a session (useful for testing).
func SetSuggestions ¶
SetSuggestions writes the suggestions content to disk.
func SetSuggestionsDirectory ¶
SetSuggestionsDirectory sets a custom directory for suggestion files.
func SuggestionsExist ¶
SuggestionsExist checks if a suggestions file exists for the session.
Types ¶
type ModeCache ¶
type ModeCache[S any] struct { // contains filtered or unexported fields }
ModeCache manages per-session state, slug, and file artifact for a single mode. S is the mode-specific state type.
func NewModeCache ¶
NewModeCache creates a new ModeCache. subDir is the path relative to cwd (e.g. ".seshat/plans"). newState returns a fresh zero state for new sessions.
func (*ModeCache[S]) ClearAllSlugs ¶
func (c *ModeCache[S]) ClearAllSlugs()
ClearAllSlugs removes all slugs.
func (*ModeCache[S]) ClearAllStates ¶
func (c *ModeCache[S]) ClearAllStates()
ClearAllStates removes all session states.
func (*ModeCache[S]) ClearState ¶
ClearState removes the state for a session.
func (*ModeCache[S]) DeleteFile ¶
DeleteFile deletes the mode file for a session.
func (*ModeCache[S]) FileExists ¶
FileExists checks if the mode file exists for a session.
func (*ModeCache[S]) GetDirectory ¶
GetDirectory returns the mode's file directory, creating it lazily on first call.
func (*ModeCache[S]) GetDisplayPath ¶
GetDisplayPath returns a user-friendly path relative to the current working directory.
func (*ModeCache[S]) GetFilePath ¶
GetFilePath returns the full path to the mode file for a session.
func (*ModeCache[S]) GetSlug ¶
GetSlug returns the slug for a session, generating one if it does not exist.
func (*ModeCache[S]) GetState ¶
GetState returns the state for a session, creating it if it does not exist.
func (*ModeCache[S]) SetDirectory ¶
SetDirectory sets a custom directory for mode files.
type PairProgrammingState ¶
type PairProgrammingState struct {
HasActiveCollaboration bool
NeedsUserConfirmation bool
HasSuggestionsFile bool
SuggestionsWereReviewed bool
CollaborationTurns int
SuggestionsCount int
AcceptedSuggestions int
}
PairProgrammingState represents the pair programming mode state for a session.
func ClonePairProgrammingState ¶
func ClonePairProgrammingState(sessionID types.SessionID) *PairProgrammingState
ClonePairProgrammingState returns a copy of the current state.
func GetPairProgrammingState ¶
func GetPairProgrammingState(sessionID types.SessionID) *PairProgrammingState
GetPairProgrammingState returns the pair programming state for a session.