echo

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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
}

func (*Agent) Binary

func (a *Agent) Binary() string

func (*Agent) Command

func (a *Agent) Command(turns.AgentSession) (string, error)

func (*Agent) Name

func (a *Agent) Name() string

func (*Agent) Preflight

func (a *Agent) Preflight(context.Context, turns.AgentSession) error

func (*Agent) Resume

func (a *Agent) Resume(string, string) string

func (*Agent) Type

func (a *Agent) Type(ctx context.Context, handle, line string) (bool, error)

Type plays a session receiving line: a line with --turn starts that turn on handle, any other line continues the handle's current one.

type Home

type Home struct {
	Command string
	Entries map[string]string
}

Home writes Entries into a home's registration file.

func (Home) Check

func (h Home) Check(_ context.Context, home string) ([]setup.Finding, error)

func (Home) Install

func (h Home) Install(_ context.Context, home string, dryRun bool) ([]string, error)

func (Home) Remove

func (h Home) Remove(_ context.Context, home string, dryRun bool) ([]string, error)

type HomeKind

type HomeKind struct{ Root string }

HomeKind keeps the echo agent's homes under Root/.echo.

func (HomeKind) Default

func (k HomeKind) Default(string) string

func (HomeKind) Find

func (k HomeKind) Find(s setup.HomeSpec) []string

func (HomeKind) New

func (HomeKind) Owns

func (HomeKind) Owns(dir string) bool

func (HomeKind) SkillsRoot

func (HomeKind) SkillsRoot(home string) string

type Protocol

type Protocol struct{}

Protocol is the echo agent's hook payloads and session environment.

func (Protocol) Block

func (Protocol) Block(reason string) []byte

func (Protocol) Home

func (Protocol) Home(getenv func(string) string) string

func (Protocol) SessionID

func (Protocol) SessionID(getenv func(string) string) string

func (Protocol) SessionStart

func (Protocol) SessionStart(raw []byte) (agentSession, source, cwd string, err error)

func (Protocol) Stop

func (Protocol) Stop(raw []byte) (agentSession, promptID, lastMessage string, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL