Documentation
¶
Overview ¶
Package echo is a test-only agent: its sessions answer typed prompts with scripted records, through the same calls a real session makes.
Index ¶
- Constants
- type Agent
- func (a *Agent) Binary() string
- func (a *Agent) Command(turns.AgentSession) (string, error)
- func (a *Agent) Name() string
- func (a *Agent) Preflight(context.Context, turns.AgentSession) error
- func (a *Agent) Resume(string, string) string
- func (a *Agent) Type(ctx context.Context, handle, line string) (bool, error)
- type Home
- type HomeKind
- type Protocol
- func (Protocol) Block(reason string) []byte
- func (Protocol) Home(getenv func(string) string) string
- func (Protocol) SessionID(getenv func(string) string) string
- func (Protocol) SessionStart(raw []byte) (agentSession, source, cwd string, err error)
- func (Protocol) Stop(raw []byte) (agentSession, promptID, lastMessage string, err error)
Constants ¶
const ( SessionVar = "ECHO_SESSION" HomeVar = "ECHO_HOME" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// Start is called when a typed line names a turn with --turn.
Start func(ctx context.Context, handle, id string) error
// Record stores the record Reply scripts for a line.
Record func(ctx context.Context, handle, id string, r record.Record) error
// Reply is the record the session ends with after line; false ends the
// line without one.
Reply func(id, line string) (record.Record, bool)
// contains filtered or unexported fields
}
type HomeKind ¶
type HomeKind struct{ Root string }
HomeKind keeps the echo agent's homes under Root/.echo.
func (HomeKind) SkillsRoot ¶
type Protocol ¶
type Protocol struct{}
Protocol is the echo agent's hook payloads and session environment.