Documentation
¶
Overview ¶
Package handoff implements the opt-in session handoff file (issue #251): each run leaves a short Markdown note with what it was asked, how it ended and what comes next, and the next fresh run reads it as data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Preamble ¶
Preamble returns the text placed before the task in the run's first user message: the previous handoff and startup output wrapped as data, and a request to end the final answer with next steps. path is shown relative to the workspace.
Types ¶
type Loaded ¶
type Loaded struct {
// Path is the file that was read.
Path string
// Text is its content, cut to the byte limit.
Text string
// Bytes is the file's full size.
Bytes int
// Truncated reports that Text is shorter than the file.
Truncated bool
}
Loaded is a handoff file read at run start.
type Startup ¶
type Startup struct {
Command string
ExitCode int
Output string
// Truncated reports that Output keeps only the tail.
Truncated bool
TimedOut bool
Duration time.Duration
}
Startup is the result of the configured startup command.
func RunStartup ¶
func RunStartup(ctx context.Context, dir, command string, timeout time.Duration, maxOutput int) (Startup, error)
RunStartup runs command with the platform shell in dir, bounded by timeout, and returns its combined output (the last maxOutput bytes). A non-zero exit is reported in the result, not as an error; err is set only when the command couldn't be started.
type Summary ¶
type Summary struct {
Task string
Status string
Answer string
Model string
At time.Time
StartupCommand string
Trajectory string
// Untrusted reports that untrusted content (web_fetch, MCP results)
// entered the run's context, so the answer may be steered by it.
Untrusted bool
}
Summary is what a finished run records in the handoff file.