run

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResumeSession

func ResumeSession(ctx context.Context, opts SessionRunOpts) (string, string, error)

func Run

func Run(opts Options) (string, error)

func StartSession

func StartSession(ctx context.Context, opts SessionRunOpts) (string, string, error)

Types

type FileChange

type FileChange struct {
	Path   string `json:"path"`
	Status string `json:"status"`
}

type Logger

type Logger interface {
	Log(msg string)
}

type Options

type Options struct {
	Dir    string
	Model  string
	Prompt string
	Logger Logger
}

type SessionOpts

type SessionOpts struct {
	Model       string   `json:"model,omitempty"`
	Agent       string   `json:"agent,omitempty"`
	Dir         string   `json:"dir,omitempty"`
	File        []string `json:"file,omitempty"`
	Command     string   `json:"command,omitempty"`
	Variant     string   `json:"variant,omitempty"`
	NoSubAgents bool     `json:"noSubAgents,omitempty"`
	Thinking    bool     `json:"thinking,omitempty"`
}

type SessionRunOpts

type SessionRunOpts struct {
	AgentPath        string
	Dir              string
	Env              []string
	SessionID        string
	Prompt           string
	Model            string
	Agent            string
	Command          string
	Variant          string
	File             []string
	Thinking         bool
	NoSubAgents      bool
	DisableSubAgents bool
	OnEvent          StreamCallback
}

type StreamCallback

type StreamCallback func(event StreamEvent)

type StreamEvent

type StreamEvent struct {
	Type          string           `json:"type"`
	Timestamp     int64            `json:"timestamp,omitempty"`
	SessionID     string           `json:"sessionID,omitempty"`
	Text          string           `json:"text,omitempty"`
	ToolUse       *ToolUseEvent    `json:"toolUse,omitempty"`
	Error         string           `json:"error,omitempty"`
	Reasoning     string           `json:"reasoning,omitempty"`
	ReasoningTime *StreamEventTime `json:"reasoningTime,omitempty"`
	File          *FileChange      `json:"file,omitempty"`
	Done          bool             `json:"done,omitempty"`
}

type StreamEventTime

type StreamEventTime struct {
	Start int64 `json:"start"`
	End   int64 `json:"end"`
}

type ToolUseEvent

type ToolUseEvent struct {
	ID      string `json:"id"`
	Tool    string `json:"tool"`
	Status  string `json:"status"`
	Summary string `json:"summary,omitempty"`
	Output  string `json:"output,omitempty"`
	Error   string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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