runtime

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CapabilityOptions

type CapabilityOptions struct {
	SkillsEnabled          bool
	SkillSources           []string
	SkillPromptBudgetBytes int
}

type Event added in v0.3.0

type Event struct {
	Type         string         `json:"type"`
	TraceID      TraceID        `json:"trace_id,omitempty"`
	RunID        RunID          `json:"run_id,omitempty"`
	ThreadID     ThreadID       `json:"thread_id,omitempty"`
	TurnID       TurnID         `json:"turn_id,omitempty"`
	Step         int            `json:"step,omitempty"`
	Provider     string         `json:"provider,omitempty"`
	Model        string         `json:"model,omitempty"`
	Message      string         `json:"message,omitempty"`
	Result       string         `json:"result,omitempty"`
	Error        string         `json:"error,omitempty"`
	ToolID       string         `json:"tool_id,omitempty"`
	ToolName     string         `json:"tool_name,omitempty"`
	ToolKind     string         `json:"tool_kind,omitempty"`
	ArgsHash     string         `json:"args_hash,omitempty"`
	FinishReason string         `json:"finish_reason,omitempty"`
	Metadata     map[string]any `json:"metadata,omitempty"`
	Timestamp    time.Time      `json:"timestamp,omitempty"`
}

type EventSink added in v0.3.0

type EventSink interface {
	EmitEvent(Event)
}

type Host added in v0.3.0

func NewHost added in v0.3.0

func NewHost(opts HostOptions) (Host, error)

type HostOptions added in v0.3.0

type HostOptions struct {
	Config       config.Config
	Store        *Store
	Tools        *tools.Registry
	Approver     tools.Approver
	Sink         EventSink
	IDGenerator  func(string) string
	LoopLimits   LoopLimits
	Capabilities CapabilityOptions
}

type LoopLimits added in v0.3.0

type LoopLimits struct {
	MaxEmptyProviderRetries int
	NoProgressLimit         int
	DuplicateToolLimit      int
	WallTime                time.Duration
}

type PromptScopeID added in v0.3.0

type PromptScopeID string

type RetryTurnRequest added in v0.3.0

type RetryTurnRequest struct {
	ThreadID ThreadID
	Reason   string
	Labels   RunLabels
}

type RunID added in v0.3.0

type RunID string

type RunLabels added in v0.3.0

type RunLabels struct {
	Correlation map[string]string
	Host        map[string]string
}

type RunTurnRequest added in v0.3.0

type RunTurnRequest struct {
	ThreadID ThreadID
	TurnID   TurnID
	Input    string
	Labels   RunLabels
}

type StartThreadRequest added in v0.3.0

type StartThreadRequest struct {
	ThreadID ThreadID
}

type Store added in v0.3.0

type Store struct {
	// contains filtered or unexported fields
}

func NewMemoryStore added in v0.3.0

func NewMemoryStore() *Store

func OpenSQLiteStore added in v0.3.0

func OpenSQLiteStore(path string) (*Store, error)

func (*Store) Close added in v0.3.0

func (s *Store) Close() error

type ThreadID added in v0.3.0

type ThreadID string

type ThreadMessage added in v0.3.0

type ThreadMessage struct {
	Role      string    `json:"role"`
	Content   string    `json:"content"`
	TurnID    TurnID    `json:"turn_id,omitempty"`
	CreatedAt time.Time `json:"created_at"`
}

type ThreadPhase added in v0.3.0

type ThreadPhase string
const (
	ThreadPhaseIdle ThreadPhase = "idle"
	ThreadPhaseTurn ThreadPhase = "turn"
)

type ThreadSnapshot added in v0.3.0

type ThreadSnapshot struct {
	ID               ThreadID        `json:"id"`
	Title            string          `json:"title,omitempty"`
	TitleStatus      string          `json:"title_status,omitempty"`
	TitleSource      string          `json:"title_source,omitempty"`
	TitleUpdatedAt   time.Time       `json:"title_updated_at,omitempty"`
	TitleError       string          `json:"title_error,omitempty"`
	CreatedAt        time.Time       `json:"created_at"`
	UpdatedAt        time.Time       `json:"updated_at"`
	Phase            ThreadPhase     `json:"phase"`
	Status           ThreadStatus    `json:"status"`
	LatestTurnID     TurnID          `json:"latest_turn_id,omitempty"`
	WaitingPrompt    string          `json:"waiting_prompt,omitempty"`
	Recoverable      bool            `json:"recoverable"`
	CanAppendMessage bool            `json:"can_append_message"`
	CanRetry         bool            `json:"can_retry"`
	Messages         []ThreadMessage `json:"messages"`
}

type ThreadStatus added in v0.3.0

type ThreadStatus string
const (
	ThreadStatusIdle        ThreadStatus = "idle"
	ThreadStatusRunning     ThreadStatus = "running"
	ThreadStatusCompleted   ThreadStatus = "completed"
	ThreadStatusWaiting     ThreadStatus = "waiting"
	ThreadStatusFailed      ThreadStatus = "failed"
	ThreadStatusCancelled   ThreadStatus = "cancelled"
	ThreadStatusInterrupted ThreadStatus = "interrupted"
)

type TraceID added in v0.3.0

type TraceID string

type TurnID added in v0.3.0

type TurnID string

type TurnResult added in v0.3.0

type TurnResult struct {
	ID                 TurnID            `json:"id"`
	Status             TurnStatus        `json:"status"`
	Output             string            `json:"output,omitempty"`
	Error              string            `json:"error,omitempty"`
	Diagnostics        map[string]string `json:"diagnostics,omitempty"`
	CompletionReason   string            `json:"completion_reason,omitempty"`
	ContinuationReason string            `json:"continuation_reason,omitempty"`
	FinishReason       string            `json:"finish_reason,omitempty"`
	RawFinishReason    string            `json:"raw_finish_reason,omitempty"`
	FinishInferred     bool              `json:"finish_inferred,omitempty"`
}

type TurnStatus added in v0.3.0

type TurnStatus string
const (
	TurnStatusCompleted TurnStatus = "completed"
	TurnStatusWaiting   TurnStatus = "waiting"
	TurnStatusFailed    TurnStatus = "failed"
	TurnStatusCancelled TurnStatus = "cancelled"
)

Jump to

Keyboard shortcuts

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