Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatAgentMessage ¶
FormatAgentMessage parses a JSON line from the agent's stdout and returns a human-readable message to send to the channel. Returns empty string for messages that should not be forwarded (status messages, tool results, etc.).
Types ¶
type ExecFunc ¶
ExecFunc matches exec.CommandContext. It is a type alias (not a defined type) so callers' own named exec-override types stay assignable without conversion.
type Options ¶
type Options struct {
BinaryPath string
Exec ExecFunc
SessionID string
Prompt string
Model string
Files []string
RequireApproval bool
Remote bool
Heartbeat bool
ResultFile string
ExtraEnv []string
Stdin *os.File
KeepAlive bool
OnLine func(line []byte)
Approval func(ipc.ApprovalRequest) ipc.ApprovalResponse
}
Options configures a single `infer headless` subprocess run.
type Result ¶
Result is the outcome of a subprocess run.
func Run ¶
Run spawns `infer headless ...`, streams stdout line-by-line, optionally brokers tool approval over stdin, and returns the harvested final assistant message. The run logs JSON to stderr, collected into this process's log as it runs. The returned error is the subprocess setup/exit error. Callers format their own user-facing messages from it.