Help us shape the future of Go! Take the 2026 Go Developer Survey

todo

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package todo provides a context provider that gives agents todo list management tools for tracking work items during long-running complex tasks.

The provider exposes five tools to the agent: todos_add, todos_complete, todos_remove, todos_get_remaining, and todos_get_all.

Todo state is stored in the agent session and persists across invocations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID          int    `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
	IsComplete  bool   `json:"isComplete"`
}

Item represents a single todo item.

type Options

type Options struct {
	// Instructions overrides the default instructions provided to the agent.
	Instructions *string

	// SuppressTodoListMessage, when true, prevents injecting the current todo
	// list summary message on each invocation.
	SuppressTodoListMessage bool

	// TodoListMessageBuilder, if set, is used to format the todo list summary
	// message instead of the default formatter.
	TodoListMessageBuilder func([]Item) string
}

Options configures the todo provider.

type Provider

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

Provider is an agent context provider that manages todo items. Use New to create. Provider can be used directly in agent configuration.

func New

func New(opts *Options) *Provider

New creates a new todo provider with the given options. If opts is nil, defaults are used.

func (*Provider) AllTodos added in v0.1.1

func (p *Provider) AllTodos(session *agent.Session) []Item

AllTodos returns all todo items stored in session.

func (*Provider) Invoked

func (p *Provider) Invoked(ctx context.Context, invoked agent.InvokedContext) error

Invoked implements agent.ContextProvider by delegating to the wrapped provider. The wrapped provider is configured without a Store, so this is a no-op on success.

func (*Provider) Invoking

func (p *Provider) Invoking(ctx context.Context, invoking agent.InvokingContext) ([]*message.Message, []agent.Option, error)

Invoking implements agent.ContextProvider by delegating to the wrapped provider, applying this provider's context/instructions to the invocation.

func (*Provider) RemainingTodos added in v0.1.1

func (p *Provider) RemainingTodos(session *agent.Session) []Item

RemainingTodos returns only the incomplete todo items stored in session.

Jump to

Keyboard shortcuts

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