app

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 32 Imported by: 1 module, 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

Terminal application that composes the harness, the window manager and the cards, with a headless runner for scripts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Headless

func Headless(ctx context.Context, opts HeadlessOptions) int

Runs one prompt, mission or workflow to completion without a terminal and returns the exit code

func StartMission

func StartMission(objective string) tea.Msg

Message that starts a mission handed on the command line once the program is up

func StartPrompt

func StartPrompt(text string) tea.Msg

Message that starts a prompt handed on the command line once the program is up

func StartWorkflow

func StartWorkflow(name, arg string) tea.Msg

Message that starts a workflow handed on the command line once the program is up

Types

type HeadlessOptions

type HeadlessOptions struct {
	Config harness.Config
	Resume string
	Dir    string
	// Prompt to run, read from Input when empty
	Prompt string
	// Objective a mission is started with instead of a plain prompt
	Mission string
	// Kind the session runs as, none when empty
	Kind string
	// Workflow run with the prompt as its argument instead of a plain run
	Workflow string
	// Writes every bridge message as one JSON object per line instead of text
	Print bool
	// Answers every approval yes, every approval is denied otherwise
	Yes bool
	Out io.Writer
	Err io.Writer
	In  io.Reader
}

What a scripted run needs beside the configuration

type Line

type Line struct {
	Type     string             `json:"type"`
	Time     time.Time          `json:"time"`
	Run      string             `json:"run,omitempty"`
	Seq      int64              `json:"seq,omitempty"`
	Agent    string             `json:"agent,omitempty"`
	Parent   string             `json:"parent,omitempty"`
	Depth    int                `json:"depth,omitempty"`
	Round    int                `json:"round,omitempty"`
	Event    string             `json:"event,omitempty"`
	Kind     string             `json:"kind,omitempty"`
	Index    int                `json:"index,omitempty"`
	Delta    string             `json:"delta,omitempty"`
	Text     string             `json:"text,omitempty"`
	Call     *protocol.ToolCall `json:"call,omitempty"`
	Result   json.RawMessage    `json:"result,omitempty"`
	IsError  bool               `json:"is_error,omitempty"`
	Error    string             `json:"error,omitempty"`
	Usage    *protocol.Usage    `json:"usage,omitempty"`
	Duration float64            `json:"duration_ms,omitempty"`
	Data     json.RawMessage    `json:"data,omitempty"`
	Verdict  string             `json:"verdict,omitempty"`
	Status   int                `json:"status,omitempty"`
	Path     string             `json:"path,omitempty"`
	// Number of the approval an approval line asks for and an approval_done line answers
	Approval int `json:"approval,omitempty"`
	// Number of the ask a question line puts and a question_done line answers
	Question int `json:"question,omitempty"`
	// Endpoint an attempt line hit
	URL string `json:"url,omitempty"`
	// Id the provider gave the response of a turn_end, run_end or run_done line
	ResponseID string `json:"response_id,omitempty"`
	// Neutral stop reason of that response and the wire value it came from
	Stop    string `json:"stop,omitempty"`
	RawStop string `json:"raw_stop,omitempty"`
	// Count a progress line reports done and the count it works toward
	Done  int `json:"done,omitempty"`
	Total int `json:"total,omitempty"`
}

One bridge message as the print mode writes it

type Model

type Model struct {
	// contains filtered or unexported fields
}

Bubble Tea model running the harness behind the window manager

func New

func New(ctx context.Context, opts Options) (*Model, error)

Builds the application, opening providers and stores from the configuration

func (*Model) Attach

func (m *Model) Attach(p *tea.Program)

Attaches the running program so harness messages reach it

func (*Model) Filter

func (m *Model) Filter(_ tea.Model, msg tea.Msg) tea.Msg

Program filter that runs the shutdown before any quit message, whichever card or signal raised it

func (*Model) Init

func (m *Model) Init() tea.Cmd

Starts the manager and restored cards, lists models, watches the keybind file and fires the session start hooks

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Handles the message, then writes the layout when anything but a frame changed it

func (*Model) View

func (m *Model) View() tea.View

type Options

type Options struct {
	Config  harness.Config
	Resume  string
	Dir     string
	Version string
	// Kind the first session runs as, none when empty
	Kind string
}

Options the shell passes beside the configuration

Jump to

Keyboard shortcuts

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