explain

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListRecentSessions added in v0.0.60

func ListRecentSessions(limit int) (sessions []sessionDir, total int, err error)

ListRecentSessions returns sessions sorted by dirname timestamp descending, limited to at most limit entries, plus the total count before limiting. limit is normalized the same way as the list CLI: <=0 → default 10, cap 100.

func RunExplain

func RunExplain(args []string) error

func RunExplainWithRunner

func RunExplainWithRunner(rawArgs []string, runner Runner) error

func RunList added in v0.0.60

func RunList(args []string) error

RunList handles `explain list` with optional --limit and --color. It never starts or resumes an agent.

Types

type MatchResult

type MatchResult struct {
	SessionDir   string
	Data         SessionData
	MatchedCount int
}

type Message

type Message struct {
	Role    string `json:"role"`
	Message string `json:"message"`
}

type Runner

type Runner interface {
	Start(ctx context.Context, model string, prompt string) (sessionID string, output string, err error)
	Resume(ctx context.Context, model string, prompt string, meta json.RawMessage) (output string, err error)
}

type RunnerMeta

type RunnerMeta map[string]json.RawMessage

type Runtime

type Runtime struct {
	AgentRunner string
}

func (*Runtime) Resume

func (r *Runtime) Resume(ctx context.Context, model string, prompt string, meta json.RawMessage) (string, error)

func (*Runtime) Start

func (r *Runtime) Start(ctx context.Context, model string, prompt string) (string, string, error)

type SessionData

type SessionData struct {
	AgentRunner      string     `json:"agent_runner"`
	Model            string     `json:"model"`
	AgentRunnersMeta RunnerMeta `json:"agent_runners_meta"`
	Messages         []Message  `json:"messages"`
}

Jump to

Keyboard shortcuts

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