Help us shape the future of Go! Take the 2026 Go Developer Survey

steering

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package steering feeds a person's input into a running loop.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Control

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

Control turns JSONL lines from a file or FIFO into steering, so a program can steer a run the way a person does at the terminal. One line is one command:

{"type":"stop"}
{"type":"inject","message":"focus on go.mod"}
{"type":"modify_config","max_iterations":20,"temperature":0.1}

wait_ms on any line delays it, counted from the previous line. An inject is also how an ask_user or confirm question gets its answer. A bad line is reported and skipped; it never ends the run.

func NewControl

func NewControl(in io.Reader, stderr io.Writer) Control

func (Control) Steer

func (c Control) Steer(ctx context.Context, loop *loop2.Loop)

Steer applies lines until the input ends or ctx ends. A FIFO never ends on its own; closing the file (run does, after the loop) ends the read.

type None

type None struct{}

None is used when nobody is at a terminal.

func (None) Steer

func (None) Steer(context.Context, *loop2.Loop)

type Terminal

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

Terminal turns each line typed during the run into steering. "/stop" stops the loop; anything else is injected as a user message, which is also how an ask_user or confirm question (steerloop/internal/gates) gets its answer.

func NewTerminal

func NewTerminal(in io.Reader, stderr io.Writer) Terminal

func (Terminal) Steer

func (t Terminal) Steer(ctx context.Context, loop *loop2.Loop)

Steer reads lines until stdin closes or ctx ends. Scan blocks on stdin, so this goroutine can outlive the run; the process exits right after, so that is harmless here.

Jump to

Keyboard shortcuts

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