tasks

package
v0.1.29 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxParallelPrompts    = 8
	DefaultMaxTokens      = 800
	DefaultMaxToolIters   = 12
	DefaultSummaryMaxChar = 8 * 1024
)

Variables

This section is empty.

Functions

func BuildReadOnlyRegistry

func BuildReadOnlyRegistry(parent *core.ToolRegistry) (*core.ToolRegistry, error)

func NewTools

func NewTools(r *Runner) []core.Tool

func ReadOnlyTools

func ReadOnlyTools(parent *core.ToolRegistry) []core.Tool

Types

type ParallelReasonRequest

type ParallelReasonRequest struct {
	Prompts   []string `json:"prompts"`
	Model     string   `json:"model,omitempty"`
	MaxTokens int      `json:"max_tokens,omitempty"`
}

type ParallelReasonResponse

type ParallelReasonResponse struct {
	Model   string                 `json:"model"`
	Results []ParallelReasonResult `json:"results"`
	Usage   llm.Usage              `json:"usage"`
}

type ParallelReasonResult

type ParallelReasonResult struct {
	Index  int       `json:"index"`
	Prompt string    `json:"prompt"`
	Output string    `json:"output,omitempty"`
	Error  string    `json:"error,omitempty"`
	Usage  llm.Usage `json:"usage,omitempty"`
}

type ProviderFactory

type ProviderFactory func(model string, maxTokens int) (llm.Provider, error)

type Runner

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

func NewRunner

func NewRunner(cfg RunnerConfig) *Runner

func (*Runner) ParallelReason

func (*Runner) SpawnSubagent

func (r *Runner) SpawnSubagent(ctx context.Context, req SpawnSubagentRequest) (SpawnSubagentResponse, error)

func (*Runner) SpawnSubagentWithProgress

func (r *Runner) SpawnSubagentWithProgress(ctx context.Context, req SpawnSubagentRequest, progress func(core.ToolProgress)) (SpawnSubagentResponse, error)

type RunnerConfig

type RunnerConfig struct {
	ProviderFactory      ProviderFactory
	ParentTools          *core.ToolRegistry
	MessageStore         store.MessageStore
	SessionsDir          string
	ParentSessionID      string
	ParentSessionIDFunc  func() string
	WorkspaceRoot        string
	MemoryEnabled        bool
	MemoryMaxChars       int
	MemoryFileOrder      []string
	AutoCompact          bool
	AutoCompactThreshold float64
	DefaultModel         string
	DefaultMaxTokens     int
	DefaultMaxToolIters  int
	SummaryMaxChars      int
	UsageLogPath         string
}

type SpawnSubagentError

type SpawnSubagentError struct {
	SessionID string
	Code      string
	Message   string
	Err       error
}

func (*SpawnSubagentError) Error

func (e *SpawnSubagentError) Error() string

func (*SpawnSubagentError) Unwrap

func (e *SpawnSubagentError) Unwrap() error

type SpawnSubagentRequest

type SpawnSubagentRequest struct {
	Task             string `json:"task"`
	Role             string `json:"role,omitempty"`
	Model            string `json:"model,omitempty"`
	MaxToolIters     int    `json:"max_tool_iters,omitempty"`
	ParentToolCallID string `json:"-"`
}

type SpawnSubagentResponse

type SpawnSubagentResponse struct {
	SessionID         string   `json:"session_id"`
	Role              string   `json:"role"`
	Model             string   `json:"model"`
	PermissionProfile string   `json:"permission_profile"`
	Status            string   `json:"status"`
	Summary           string   `json:"summary"`
	Error             string   `json:"error,omitempty"`
	Truncated         bool     `json:"truncated"`
	ToolCalls         []string `json:"tool_calls,omitempty"`
	DurationMS        int64    `json:"duration_ms"`
	CompletedAt       string   `json:"completed_at"`
}

Jump to

Keyboard shortcuts

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