todo

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package todo is the agent's todo list: its items, their validation and how they are shown to the model.

Index

Constants

View Source
const MaxItemLength = 300

MaxItemLength bounds an item's content and active form, in characters.

View Source
const MaxItems = 50

MaxItems bounds a list so it stays a plan of the work, not a log of it.

View Source
const ToolName = "todo_write"

ToolName is the tool that replaces a session's todo list.

Variables

This section is empty.

Functions

func Text

func Text(items []Item) string

Text renders items for the model, one numbered line each.

Types

type Item

type Item struct {
	Content    string `json:"content"`
	ActiveForm string `json:"active_form,omitempty"`
	Status     Status `json:"status"`
}

Item is one piece of work; ActiveForm names it while it is in progress.

func Open

func Open(items []Item) []Item

Open lists the items not completed yet.

func Parse

func Parse(args json.RawMessage) ([]Item, error)

Parse reads todo_write arguments into a checked list; its errors tell the model what to correct.

func (Item) Label

func (i Item) Label() string

Label is how the item is shown: its active form while it is in progress.

type List

type List struct {
	SessionID    string    `json:"session_id"`
	Items        []Item    `json:"items"`
	ChainRunID   string    `json:"chain_run_id,omitempty"`
	UpdatedRunID string    `json:"updated_run_id,omitempty"`
	UpdatedAt    time.Time `json:"updated_at,omitzero"`
}

List is a session's todo list. ChainRunID is the first run of the run chain that wrote it, UpdatedRunID the run that wrote it last.

func (List) InChain

func (l List) InChain(chain []string) bool

InChain reports whether chain (a run and the runs it continues) wrote the list or began the chain it was written in.

type Status

type Status string

Status is where an item stands.

const (
	Pending    Status = "pending"
	InProgress Status = "in_progress"
	Completed  Status = "completed"
)

Jump to

Keyboard shortcuts

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