Documentation
¶
Index ¶
- Constants
- func ClassifyExit(err error) (code int, reason string)
- func ConfigError(err error) error
- func TimeoutError(err error) error
- func ToolPolicyError() error
- func UsageError(msg string) error
- type Event
- func AssistantDelta(turn int, channel, delta string) Event
- func AssistantEnd(turn int, content, reasoning string, toolCalls []map[string]any) Event
- func AssistantStart(turn, checkpointSeq int) Event
- func ErrorEvent(code int, message string) Event
- func RunEnd(exitCode int, exitReason, finalContent string, usage any) Event
- func RunStart(prompt, model, provider, projHex string, ephemeral bool) Event
- func ToolResult(turn int, id, name string, result json.RawMessage, errMsg string) Event
- func ToolStart(turn int, id, name string, arguments json.RawMessage) Event
- type ExecCLIOpts
- type JSONCollector
- type JSONLEmitter
- type ReportMeta
- type RunError
- type RunReport
- type Sink
Constants ¶
View Source
const ( ExitOK = 0 ExitGeneric = 1 ExitUsage = 2 ExitConfig = 3 ExitLLM = 4 ExitTool = 5 ExitTimeout = 6 )
View Source
const ( TypeRunStart = "run_start" TypeAssistantStart = "assistant_start" TypeAssistantDelta = "assistant_delta" TypeAssistantEnd = "assistant_end" TypeToolStart = "tool_start" TypeToolResult = "tool_result" TypeError = "error" TypeRunEnd = "run_end" )
View Source
const ( ChannelContent = "content" ChannelReasoning = "reasoning" )
View Source
const SchemaVersion = 1
Variables ¶
This section is empty.
Functions ¶
func ClassifyExit ¶
func ConfigError ¶
func TimeoutError ¶
func ToolPolicyError ¶
func ToolPolicyError() error
func UsageError ¶
Types ¶
type Event ¶
func AssistantDelta ¶
func AssistantEnd ¶
func AssistantStart ¶
func ErrorEvent ¶
func ToolResult ¶
type ExecCLIOpts ¶ added in v0.20260525.0
type ExecCLIOpts struct {
JSON bool
JSONL bool
NoColor bool
FailOnToolError bool
EnvFile string
Prompt string
}
func ParseExecCLIArgs ¶ added in v0.20260525.0
func ParseExecCLIArgs(args []string) (ExecCLIOpts, error)
type JSONCollector ¶
type JSONCollector struct {
// contains filtered or unexported fields
}
func NewJSONCollector ¶
func NewJSONCollector(out io.Writer) *JSONCollector
func (*JSONCollector) Emit ¶
func (c *JSONCollector) Emit(ev Event)
func (*JSONCollector) Events ¶
func (c *JSONCollector) Events() []Event
func (*JSONCollector) FlushReport ¶
func (c *JSONCollector) FlushReport(meta ReportMeta, exitCode int, exitReason, finalContent string, usage any) error
func (*JSONCollector) StreamMode ¶
func (c *JSONCollector) StreamMode() bool
type JSONLEmitter ¶
type JSONLEmitter struct {
// contains filtered or unexported fields
}
func NewJSONLEmitter ¶
func NewJSONLEmitter(out io.Writer) *JSONLEmitter
func (*JSONLEmitter) Emit ¶
func (e *JSONLEmitter) Emit(ev Event)
func (*JSONLEmitter) Events ¶
func (e *JSONLEmitter) Events() []Event
func (*JSONLEmitter) FlushReport ¶
func (e *JSONLEmitter) FlushReport(ReportMeta, int, string, string, any) error
func (*JSONLEmitter) StreamMode ¶
func (e *JSONLEmitter) StreamMode() bool
type ReportMeta ¶
type RunReport ¶
type RunReport struct {
V int `json:"v"`
Prompt string `json:"prompt"`
Model string `json:"model"`
Provider string `json:"provider"`
ProjHex string `json:"proj_hex"`
Ephemeral bool `json:"ephemeral"`
Events []Event `json:"events"`
ExitCode int `json:"exit_code"`
ExitReason string `json:"exit_reason"`
FinalContent string `json:"final_content,omitempty"`
Usage any `json:"usage,omitempty"`
Error string `json:"error,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.