executor

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package executor wraps agent CLIs as subprocesses behind the Executor interface (§8.3, opción A). devclean does not implement its own tool loop: it inherits editing, context and tools from the CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claude

type Claude struct{}

Claude wraps the claude CLI (Claude Code) in print mode.

func (Claude) Available

func (Claude) Available() error

func (Claude) Name

func (Claude) Name() string

func (Claude) Run

func (e Claude) Run(ctx context.Context, req Request) (Result, error)

type Executor

type Executor interface {
	Name() string
	Available() error // verifica binario y versión
	Run(ctx context.Context, req Request) (Result, error)
}

Executor is the adapter contract of §8.3.

type OpenCode

type OpenCode struct{}

OpenCode wraps the opencode CLI (https://opencode.ai).

func (OpenCode) Available

func (OpenCode) Available() error

func (OpenCode) Name

func (OpenCode) Name() string

func (OpenCode) Run

func (e OpenCode) Run(ctx context.Context, req Request) (Result, error)

type Request

type Request struct {
	RoomPath     string   // cwd del agente, su cuarto
	Prompt       string   // contrato + resultado del intento anterior
	AllowedGlobs []string // tocar_solo
	Model        string
	Timeout      time.Duration
	// Env carries the room's own variables (PORT, ...) — §6.2.
	Env []string
}

Request is one agent invocation.

type Result

type Result struct {
	FilesChanged []string `json:"files_changed"`
	Tokens       Usage    `json:"tokens"`
	Stdout       string   `json:"stdout"`
	Text         string   `json:"text"` // la respuesta textual del agente, si el adaptador la saca
	ExitCode     int      `json:"exit_code"`
}

Result is what one invocation produced.

type Usage

type Usage struct {
	Input  int `json:"input"`
	Output int `json:"output"`
}

Usage is the token spend of one invocation, best-effort per adapter.

Jump to

Keyboard shortcuts

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