Documentation
¶
Overview ¶
Package harness is what a client reads from the coding agent and the workspace manager that run it: the agent's hook payloads and the session's identity in its environment.
Index ¶
- type Claimer
- type Prompts
- type Protocol
- type SessionEnv
- type Set
- func (s Set) Detect(getenv func(string) string) Protocol
- func (s Set) For(kind string) (Protocol, error)
- func (s Set) Handle(getenv func(string) string) string
- func (s Set) Kind(getenv func(string) string) string
- func (s Set) Manager(getenv func(string) string) (string, SessionEnv)
- func (s Set) Session(getenv func(string) string) SessionEnv
- type Transcripts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claimer ¶
Claimer is a SessionEnv whose manager also runs sessions the loop does not drive: it claims a session only in a working directory it hands the loop.
type Protocol ¶
type Protocol interface {
SessionID(getenv func(string) string) string
Home(getenv func(string) string) string
SessionStart(raw []byte) (agentSession, source, cwd string, err error)
Stop(raw []byte) (agentSession, promptID, lastMessage string, err error)
Block(reason string) []byte
}
Protocol is one coding agent's hook payloads and session environment.
type SessionEnv ¶
type SessionEnv interface {
Handle(getenv func(string) string) string
Pane(getenv func(string) string) string
WorktreeID(getenv func(string) string) string
}
SessionEnv reads, from a session's environment, the identity its workspace manager gives it.
type Set ¶
type Set struct {
SessionEnvs map[string]SessionEnv
Agents map[string]Protocol
// DefaultAgent is the agent used when the environment names none.
DefaultAgent string
// Cwd is the session's working directory; nil reads none, and a Claimer
// then claims nothing.
Cwd func() string
}
Set is the session environments and agent protocols a client can read, by name.
func (Set) Handle ¶
Handle is the handle the environment sets, the first by sorted manager name, claimed or not; "" when no manager sets one.
func (Set) Kind ¶
Kind is the agent whose SessionID the environment sets, the first by sorted name, else DefaultAgent.
type Transcripts ¶
Transcripts is a Protocol whose hook payloads name the session's transcript file.