Documentation
¶
Overview ¶
Package piagent implements an adapter for standalone Pi Agent sessions.
Pi Agent stores sessions in ~/.pi/agent/sessions/<encoded-path>/ where encoded-path is the project path with slashes replaced by dashes, wrapped in double dashes (e.g., /home/user/project → --home-user-project--).
This differs from the openclaw-embedded Pi which uses a flat global directory. The JSONL format is identical to the pi package.
Index ¶
- func NewWatcher(projectDir string) (<-chan adapter.Event, io.Closer, error)
- type Adapter
- func (a *Adapter) Capabilities() adapter.CapabilitySet
- func (a *Adapter) Detect(projectRoot string) (bool, error)
- func (a *Adapter) ID() string
- func (a *Adapter) Icon() string
- func (a *Adapter) Messages(sessionID string) ([]adapter.Message, error)
- func (a *Adapter) Name() string
- func (a *Adapter) SessionByID(sessionID string) (*adapter.Session, error)
- func (a *Adapter) Sessions(projectRoot string) ([]adapter.Session, error)
- func (a *Adapter) Usage(sessionID string) (*adapter.UsageStats, error)
- func (a *Adapter) Watch(projectRoot string) (<-chan adapter.Event, io.Closer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements the adapter.Adapter interface for standalone Pi Agent sessions.
func (*Adapter) Capabilities ¶
func (a *Adapter) Capabilities() adapter.CapabilitySet
Capabilities returns the supported features.
func (*Adapter) SessionByID ¶
SessionByID returns a single session by ID without scanning the directory. Implements adapter.TargetedRefresher for efficient targeted refresh.
func (*Adapter) Sessions ¶
Sessions returns all sessions for the given project, sorted by update time.