Documentation
¶
Overview ¶
Package pi provides the Pi coding agent source for agentwatch.
Pi (github.com/earendil-works/pi) stores sessions as JSONL files at:
<sessions_dir>/--<path>--/<timestamp>_<uuid>.jsonl
where <path> is the working directory with "/" replaced by "-". The sessions directory defaults to ~/.pi/agent/sessions but can be overridden by passing it via WithRoot. Consumers that want environment fallback can implement it themselves:
sessDir := os.Getenv("PI_CODING_AGENT_SESSION_DIR")
if sessDir == "" {
base := os.Getenv("PI_CODING_AGENT_DIR")
if base == "" {
home, _ := os.UserHomeDir()
base = filepath.Join(home, ".pi", "agent")
}
sessDir = filepath.Join(base, "sessions")
}
src := pi.New(pi.WithRoot(sessDir))
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*Source)
Option configures a Source.
func WithDiscoverWindow ¶
WithDiscoverWindow limits discovery to session files whose modification time is within d of the current time. Zero disables age filtering.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source implements source.Source for Pi coding agent sessions.
Pi stores sessions under a root sessions directory in per-project subdirectories named --<encoded-path>--. Each session is a JSONL file named <timestamp>_<uuid>.jsonl.