Documentation
¶
Overview ¶
Package launch is what a task agent is prompted with and how the prompt reaches it: the skill line, the driven marker and the Enter retry.
Index ¶
- Constants
- Variables
- func DependencyClause(id string, dep *Dependency) string
- func DiscussionPrompt(d Discussion, note string) string
- func Driven(text string) string
- func HoldsPrompt(screen, text string) bool
- func InputReady(ctx context.Context, path, id, suffix string) (bool, error)
- func Prompt(mode, id string, dep *Dependency, plan string, pick *hostops.Pickup, ...) string
- func PromptAgentAs(ctx context.Context, path, id, suffix, text string) (string, error)
- func PromptChecked(ctx context.Context, path, id, suffix, text string) (string, error)
- func RetryEnter(ctx context.Context, b agentctl.Backend, name, text string) string
- func WatchEnter(ctx context.Context, b agentctl.Backend, root, name, text string, ...) string
- type Closed
- type Dependency
- type Discussion
Constants ¶
const DrivenMarker = "--driven"
DrivenMarker tells a skill the run is driven from another session: no interactive question, every ask through run state (modes/driven.md).
const ModeDiscuss = "discuss"
const ModePlan = "plan"
Variables ¶
var ( EnterRetry = 10 * time.Second EnterPoll = 500 * time.Millisecond )
A typed prompt's Enter can arrive while the input box is still busy with the text, and be lost; these bound how long a typed prompt is watched for that before Enter is pressed again, once.
Functions ¶
func DependencyClause ¶
func DependencyClause(id string, dep *Dependency) string
DependencyClause names the base task and where its plan is. What to do with that (design against the plan, not this checkout, with no fallback for its absence) is the plan step's rule, so the prompt does not repeat it.
func DiscussionPrompt ¶ added in v0.64.0
func DiscussionPrompt(d Discussion, note string) string
DiscussionPrompt reads every task, shows how they relate and what the drive would propose, then waits. Its outcome is a start command, whose first group continues in this worktree.
func Driven ¶
Driven marks an f10 command as sent from outside; plain text (an answer, a steering note) goes as it is, since the agent it reaches already knows.
func HoldsPrompt ¶
HoldsPrompt reports whether the input box on screen still holds text, unsubmitted. A screen with no box found holds nothing, so no Enter is pressed where f10 cannot see what it would submit.
func InputReady ¶ added in v0.62.0
InputReady reports whether the task's agent shows Claude's input box, which a permission dialog or a menu replaces while it is open.
func Prompt ¶
func Prompt( mode, id string, dep *Dependency, plan string, pick *hostops.Pickup, note string, closed ...Closed, ) string
Prompt is what an agent that waits for a person is told: a discussion, or a picked-up PR, which is never shipped unread. A task run through its flow is prompted by its drive, one skill at a time.
func PromptAgentAs ¶
PromptAgentAs prompts the task's agent in the worktree at path, falling back to the bare name an agent started before the path hash still answers to, and names the agent that took the text.
func PromptChecked ¶
PromptChecked types text into the task's agent, then waits up to EnterRetry for the agent's prompt mark and presses Enter once if the text is still in its input box. The note says what the check did; it is never an error, since the prompt itself went out.
func RetryEnter ¶
RetryEnter presses Enter once when the agent's input box still holds text. It says what it did, or why it could not look, "" when the prompt had gone through.
func WatchEnter ¶
func WatchEnter(ctx context.Context, b agentctl.Backend, root, name, text string, sent time.Time) string
WatchEnter is PromptChecked's wait, for a prompt typed at sent into the agent in the checkout at root. Only the prompt mark ends it early: an empty input box may be one that has not drawn the text yet.
Types ¶
type Closed ¶ added in v0.65.0
type Closed struct {
ID string // the task, as its label
Shipped []string // "<sha> <subject>", newest first
More int // shipping commits left out of Shipped
Release string // the oldest tag holding the newest of them, or ""
Typos []string // open tasks one digit off the id, as "<id> (<title>)"
}
Closed is what a discussion's agent is told about a task the tracker already closed. It holds the commits that shipped the task, and the open tasks a typo of its id would have meant.
type Dependency ¶
type Dependency struct {
Task string
Branch string
Plan string // the plan's path, or "" when no checkout can reach it
Planned bool // the plan exists at that path
}
A Dependency is what --after records on the new branch: the base task, its branch as a bare name (`origin/` stripped, since the pr step targets a branch and ship looks it up local-first), and where its plan is.
type Discussion ¶ added in v0.64.0
type Discussion struct {
Tasks []string // every id, the worktree's first
Parents []string // the ids among them with subtasks
Closed []Closed // the ids among them the tracker closed
}
A Discussion is what a discussion of a parent or of several tasks covers; a lone task with no subtasks has none.