Documentation
¶
Index ¶
Constants ¶
View Source
const ( HeadlessFormatText = "text" HeadlessFormatJSON = "json" )
Variables ¶
View Source
var ErrCompletionSignalMissing = errors.New("completion signal not found in response")
ErrCompletionSignalMissing is returned when a --completion-signal was configured but the final response did not contain it. The caller should continue the loop with another iteration.
Functions ¶
Types ¶
type HeadlessRunOptions ¶
type HeadlessRunOptions struct {
WorkingDir string
Config *config.ResolvedConfig
GlobalConfig *config.GlobalConfig
MCPRuntime keenmcp.Runtime
Client llm.LLMClient
SessionID string
Prompt string
Format string
CompletionSignal string
Out io.Writer
// Progress, when set and Format is text, receives live text chunks and
// tool end lines as the run happens.
Progress io.Writer
}
type HeadlessRunResult ¶
type HeadlessRunResult struct {
SessionID string `json:"session_id"`
OpenCodeSessionID string `json:"opencode_session_id"`
Text string `json:"text"`
Usage *headlessUsage `json:"usage,omitempty"`
}
func RunHeadless ¶
func RunHeadless(ctx context.Context, opts HeadlessRunOptions) (*HeadlessRunResult, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.