Documentation
¶
Overview ¶
Package oneshot is the non-interactive entry point: read one prompt, run one agent turn, print the final answer to stdout, exit. The TUI is great for working sessions; oneshot is what scripts and CI pipelines call.
Output convention:
- stdout: the model's *content* tokens (the answer)
- stderr: reasoning tokens, tool-call status, errors
That way `yottacode run "summarize x" > out.md` produces a clean file with reasoning visible only on the terminal.
Index ¶
Constants ¶
const ( // ExitReasonOK means the turn reached a final tool-free assistant answer. ExitReasonOK = "ok" // ExitReasonError means the turn returned a process-failing error. ExitReasonError = "error" // ExitReasonIterCap means the turn exhausted its iteration budget. ExitReasonIterCap = "iter_cap" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RunResult ¶ added in v0.5.0
type RunResult struct {
Content string `json:"content"`
ToolCalls []ToolCallSummary `json:"tool_calls"`
Usage adapter.Usage `json:"usage"`
ExitReason string `json:"exit_reason"`
Error *string `json:"error"`
SessionID string `json:"session_id"`
}
RunResult is the primary stdout contract for `yottacode run --format json`. Error is a pointer so successful runs encode an explicit JSON null value.
type RunStatus ¶ added in v0.5.0
type RunStatus struct {
Status string `json:"status"`
Error string `json:"error,omitempty"`
Iterations int `json:"iterations"`
Tools map[string]ToolRunStatus `json:"tools,omitempty"`
ChangedFiles []string `json:"changed_files,omitempty"`
}
RunStatus is the machine-readable receipt emitted by `yottacode run --json`. Stdout still carries only the final assistant response; this envelope belongs on stderr so shell pipelines and CI can parse metadata independently.
type StreamOptions ¶ added in v0.5.0
StreamOptions carries script-facing output switches for the oneshot event drain. Keep this small: `run` stdout is deliberately stable, while stderr can grow metadata needed by integrations.
type ToolCallSummary ¶ added in v0.5.0
ToolCallSummary is the stable, intentionally small record exposed to scripts. Summary reuses the same bounded, human-safe preview shown in text-mode status.
type ToolRunStatus ¶ added in v0.5.0
ToolRunStatus summarizes one tool's execution count for the JSON status envelope. Errored counts tool-level errors already surfaced to the model.