Documentation
¶
Overview ¶
Package herdr reports ask's agent state to herdr (https://herdr.dev), the agent-aware terminal multiplexer, when ask runs inside a herdr pane: whether ask is idle, working, or blocked on the user, the command that resumes its session after a herdr restart, and display metadata for the pane. Reports travel over herdr's socket API (newline-delimited JSON) from one background goroutine; they are best-effort and never block the caller.
Index ¶
Constants ¶
const ( // Source identifies ask's reports. herdr reserves the "herdr:" prefix // for its own integrations. Source = "ask" // Agent is the agent name herdr shows for the pane. Agent = "ask" )
const ( EnvMarker = "HERDR_ENV" EnvPaneID = "HERDR_PANE_ID" EnvSocket = "HERDR_SOCKET_PATH" )
The variables herdr sets for every process in a pane.
Variables ¶
var DebugLog = func(format string, args ...any) {}
DebugLog is the package's debug sink; the TUI points it at its ASK_DEBUG logger. A no-op by default.
Functions ¶
func WithoutPaneEnv ¶
WithoutPaneEnv returns env without herdr's pane variables. Processes ask starts on the agent's behalf get it, so a nested agent (an `ask`, a `claude` child with herdr's hooks installed, a test binary) can neither report over nor release ask's own status in the pane.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client reports one pane's status to herdr. A nil *Client is valid and does nothing, which is what FromEnv returns outside herdr.
func FromEnv ¶
FromEnv returns a client for the pane described by herdr's variables, or nil when the process is not running inside a herdr pane.
func (*Client) Reclaim ¶
func (c *Client) Reclaim()
Reclaim resends the whole status. herdr drops an agent once its pane is back at a shell prompt, as it is while ask is suspended, so ask reclaims the pane when it resumes.
type RejectedError ¶
RejectedError is herdr's answer to a request it refused.
func (*RejectedError) Error ¶
func (e *RejectedError) Error() string
type State ¶
type State string
State is herdr's semantic agent state. herdr derives "done" (finished and not yet looked at) on its own.
type Status ¶
type Status struct {
State State
// Message says what a blocked agent is waiting for.
Message string
// SessionID names the session Resume reopens. Resume is the argv herdr
// runs in the pane after a server restart; its first element is a
// plain command name.
SessionID string
Resume []string
// Title and Tokens are display-only: the pane title, and named values
// herdr's sidebar renders as $name.
Title string
Tokens map[string]string
}
Status is everything ask tells herdr about its pane. Every Report carries the whole status; the client sends only the parts herdr has not yet accepted.