task

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIsolatedTaskSessionID

func NewIsolatedTaskSessionID(prefix string) string

Types

type InnerTurnDriver

type InnerTurnDriver interface {
	RunOneUserTurn(ctx context.Context, sess *dino.Session, in agenttypes.AgentInput) (*TurnSnapshot, StopReason, error)
}

type Plan

type Plan struct {
	Goal      string     `json:"goal,omitempty"`
	Steps     []PlanStep `json:"steps,omitempty"`
	Reasoning string     `json:"reasoning,omitempty"`
	Approved  bool       `json:"approved,omitempty"`
}

type PlanStep

type PlanStep struct {
	Index     int                    `json:"index"`
	Tool      string                 `json:"tool"`
	Input     map[string]interface{} `json:"input"`
	Reasoning string                 `json:"reasoning,omitempty"`
}

type SessionStore

type SessionStore interface {
	Save(ctx context.Context, session *TaskSession) error
	Load(ctx context.Context, taskID string) (*TaskSession, error)
	Delete(ctx context.Context, taskID string) error
	List(ctx context.Context, sessionID string) ([]*TaskSession, error)
}

type SessionSwapper

type SessionSwapper interface {
	Current() *dino.Session
	Handoff(ctx context.Context, t *Task) error
}

type StopReason

type StopReason int
const (
	StopReasonCompleted StopReason = iota
	StopReasonAgentIdle
	StopReasonMaxTurnsReached
	StopReasonMaxOuterIterations
	StopReasonMaxBudgetReached
	StopReasonContextOverflow
	StopReasonTimeout
	StopReasonFailed
	StopReasonUserCancelled
	StopReasonVerificationFailed
)

type Task

type Task struct {
	ID          string
	SessionID   string
	Description string
	Plan        *Plan
	Status      TaskStatus
	Result      *TaskResult

	Config   *TaskConfig
	Progress *TaskProgress

	PendingInput agenttypes.AgentInput

	CreatedAt time.Time
	UpdatedAt time.Time
}

type TaskConfig

type TaskConfig struct {
	MaxBudgetTokens        int
	MaxTurns               int
	MaxOuterIterations     int
	Timeout                time.Duration
	RetryLimit             int
	StallWindow            int
	CheckpointKeepVersions int
	CompactEveryNTurns     int
	ContextWindow          int
	ModelID                string
	Isolated               bool
	PreferContextReset     bool
	CompletionMarker       string
	ArtifactDir            string
	VerifyCommand          string
	VerifyTextMustContain  string
	VerifyLLMSystemPrompt  string
}

type TaskHooks

type TaskHooks struct {
	BeforeTurn func(ctx context.Context, p *TaskProgress) error
	AfterTurn  func(ctx context.Context, p *TaskProgress, res *TaskResult) error
}

type TaskProgress

type TaskProgress struct {
	CurrentTurn      int
	OuterIteration   int
	VerifyRetryCount int
	ConsumedTokens   int
	LastCheckpoint   time.Time
	LastCompactTurn  int
	CompactCount     int
	CompactHistory   []string
}

type TaskResult

type TaskResult struct {
	FinalSnapshot *TurnSnapshot
}

type TaskSession

type TaskSession struct {
	TaskID       string
	SessionID    string
	State        TaskState
	Messages     []string
	InputTokens  int
	OutputTokens int
	UpdatedAt    time.Time
}

type TaskState

type TaskState string

type TaskStatus

type TaskStatus string
const (
	TaskStatusPending   TaskStatus = "pending"
	TaskStatusRunning   TaskStatus = "running"
	TaskStatusCompleted TaskStatus = "completed"
	TaskStatusFailed    TaskStatus = "failed"
)

type TurnSnapshot

type TurnSnapshot struct {
	AssistantText       string
	Usage               *agenttypes.Usage
	HadError            bool
	ErrorMessage        string
	ArtifactFingerprint string
	VerifyExitCode      *int
	EngineStopCause     string
}

type Verifier

type Verifier interface {
	Verify(ctx context.Context, t *Task, snap *TurnSnapshot) (ok bool, vreason string)
}

Jump to

Keyboard shortcuts

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