start

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 30 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 start opens a task: its checkout, its workspace and its agent, prompted, or a PR picked up to continue.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterFromBody

func AfterFromBody(ctx context.Context, tr stack.Tracker, main string, task ref.Ref) (string, []string, error)

AfterFromBody reads the task's body for an After: line. A body that cannot be read is a note, never a refusal: --after stays the explicit way.

func AgentArgs

func AgentArgs(p agentctl.Profile, root storage.Root, worktree string) []string

AgentArgs is the agent's command line: the profile's flags through its kind, and each task-file dir of the storage root when that root sits outside the worktree, so writing plans and findings there asks no permission.

func ChecksParent

func ChecksParent(mode string, pick *hostops.Pickup) bool

ChecksParent reports whether start refuses a parent: a PR pickup is someone else's branch, and talking an umbrella task through before splitting it is what --discuss is for.

func FetchPickup

func FetchPickup(ctx context.Context, main string, pick *hostops.Pickup) error

FetchPickup: a handover has not fetched the request's branch yet. A landed request's commit must be here before its worktree is made, and a closed request's head comes only through the host's own ref for it.

func MarkStarted

func MarkStarted(ctx context.Context, started func(context.Context, ref.Ref) error, task ref.Ref) []string

MarkStarted moves every member to its started status. The worktree is the result, so a failure is a note, never a refusal.

func PickedTask

func PickedTask(prefix string, hostIssues bool, pick *hostops.Pickup, pr forge.PR, task string) (string, error)

PickedTask is the task id for a picked-up PR: --task, else the one the PR names. A PR naming none exits with ui.ExitDeclined, which the start skill turns into a question; --task with no PR is a refusal.

func PickupFor

func PickupFor(ctx context.Context, t *target.Target, token string) (*hostops.Pickup, forge.PR, error)

PickupFor is the PR the start argument names, or nil for a task id; a bare #n the host knows as no PR is a task id.

func RefuseStalled

func RefuseStalled(in StallCheck, ws *agentctl.Workspace, agent, root string) error

RefuseStalled stops a forward to an agent idle while its run says running: it sits on something f10 cannot see (a permission dialog, a question asked outside driven mode), and a prompt behind that would wait with it.

func RefuseStartParent

func RefuseStartParent(ctx context.Context, in StartInput) error

RefuseStartParent stops a parent with unfinished subtasks before anything is created, since its agent would ship the whole umbrella on one branch. A task with a branch was started already and reopens.

func Start

func Start(ctx context.Context, w io.Writer, in StartInput) error

Start runs the flow: the checkout and its agent, the prompt, the report. A workspace Herdr already showed keeps its agent, and nothing is prompted twice; one left with no agent gets its agent and its prompt.

func StartedMove

func StartedMove(t *target.Target) func(context.Context, ref.Ref) error

StartedMove moves a task to tracker.status's started word, or is nil when none is declared.

Types

type OpenedTask

type OpenedTask struct {
	Task   ref.Ref // the task, with the riders its branch ships
	Branch string
	Path   string
	Ws     agentctl.Opened
	Dep    *launch.Dependency
	Plan   string // the task's plan the worktree reads, or "" when none was saved or no agent was started
	Fresh  bool
	Notes  []string
	// Profile is what the agent was started on, when fresh; a report names
	// it when it is not the kind's default
	Profile agentctl.Profile
	// contains filtered or unexported fields
}

An OpenedTask is what OpenTask leaves behind; fresh says this call is to start the agent, which deliver does with its first prompt.

func OpenTask

func OpenTask(ctx context.Context, in StartInput) (OpenedTask, error)

OpenTask runs everything start does short of starting and prompting the agent, which deliver does with the first text. Every lookup that can refuse runs before the first thing is created, the worktree; drive adopts main's plan too but prompts the agent itself, skill by skill.

func (*OpenedTask) Deliver

func (o *OpenedTask) Deliver(ctx context.Context, id, suffix, text string) (string, bool, error)

Deliver sends text to the task's agent, starting it when its launch is pending: on its command line when the kind takes a first prompt, else typed right after. It names the agent that took the text, and typed says the text went through the input box, where its Enter can be lost.

type StallCheck

type StallCheck struct {
	StateDir   string
	Ttl        time.Duration
	Now, Since time.Time
}

A StallCheck is what RefuseStalled reads run state with: runs updated before since were written by an agent that is gone.

type StartInput

type StartInput struct {
	Main     string                // the main checkout: worktrees are its siblings
	Driver   *trackerdriver.Driver // nil without one
	Task     ref.Ref
	Suffix   string
	Mode     string
	Flow     runplan.ShipFlow                      // the flow ship runs; zero for default
	FlowKept bool                                  // drive records the flow and the pace itself, keeping what the branch has
	Pace     string                                // the --pace typed, recorded on the branch; "" records none
	After    string                                // task id whose branch is the base and whose plan is the contract, or ""
	Base     string                                // branch whose ref is the base, or ""
	Storage  storage.Root                          // the storage root every checkout shares
	Title    func(context.Context) (string, error) // the task's title, for the default branch's slug; nil when nothing answers
	Notes    []string                              // notes settled before the flow, printed beneath the report
	// Profile is what the agent starts on, resolved; profileFlagged says a
	// flag chose it, which wins over the profile the branch recorded
	Profile        agentctl.Profile
	ProfileFlagged bool
	Progress       io.Writer       // where a wait in progress is reported, or nil for nowhere
	Pick           *hostops.Pickup // the PR picked up, or nil for a task started by its id
	Note           string          // the user's words after the id, for the agent before it waits, or ""
	// Children is the task's subtasks, read to refuse a parent; nil skips the
	// check (see ChecksParent)
	Children func(ctx context.Context, task ref.Ref) ([]stack.ChildRow, error)
	// Started moves a task to tracker.status's started word; nil when none
	// is declared, or for a PR picked up, whose task someone else started
	Started func(ctx context.Context, task ref.Ref) error
}

StartInput is everything start needs once the target is settled, so the flow can be tested without a checkout.

Jump to

Keyboard shortcuts

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