agent

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeliveryArgv  = "argv"
	DeliveryStdin = "stdin"
)
View Source
const (
	PromptDraft = `` /* 256-byte string literal not displayed */

	PromptBaseline = `` /* 601-byte string literal not displayed */

	PromptBaselineSplit = `` /* 1113-byte string literal not displayed */

	PromptRefine = `` /* 367-byte string literal not displayed */

	PromptRefineFeature = `` /* 622-byte string literal not displayed */

	PromptApply = `` /* 361-byte string literal not displayed */

	PromptApplyFeature = `` /* 399-byte string literal not displayed */

)

Built-in prompt templates. Placeholders {{prompt}} and {{spec_path}} are substituted with a plain replacer — NOT Go text/template, whose delimiters collide with the placeholder syntax.

View Source
const (
	PlaceholderPrompt         = "{{prompt}}"
	PlaceholderSpecPath       = "{{spec_path}}"
	PlaceholderMasterSpecPath = "{{master_spec_path}}"
)

Variables

This section is empty.

Functions

func Build

func Build(tpl []string, delivery, prompt, specPath string) (*exec.Cmd, []byte, error)

Build validates the template and returns the prepared command. In stdin delivery the returned byte slice carries the prompt; in argv delivery it is nil.

func Expand

func Expand(tmpl, prompt, specPath string, masterSpecPath ...string) string

Expand substitutes placeholders in a prompt template. Replacement values are not rescanned: Expand performs a single pass, so prompt text that itself mentions template syntax is preserved verbatim. The optional masterSpecPath is used when refining or applying an individual feature spec.

Types

type Adapter

type Adapter struct {
	Command  []string
	Delivery string
	Env      []string
	Dir      string
}

Adapter is a resolved agent command: argv template + delivery mode + extras.

func (Adapter) Execute

func (a Adapter) Execute(ctx context.Context, prompt, specPath string, out io.Writer) (int, error)

Execute runs the adapter with the given instruction text. Agent stdout and stderr are captured by out, which must be safe for concurrent use (the stdout and stderr copiers both write it). Returns the exit code; a canceled context returns (-1, context.Canceled). Cancel kills the process group on Unix and the direct child on Windows. WaitDelay bounds the wait so orphaned descendants holding the output pipes cannot hang Wait forever.

Jump to

Keyboard shortcuts

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