todo

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ToolName = "todo"

ToolName is the canonical name used by the planning tool.

Variables

This section is empty.

Functions

func ContextWithReporter

func ContextWithReporter(ctx context.Context, reporter Reporter) context.Context

ContextWithReporter 将本次运行的 todo reporter 写入 ctx。

Types

type Mode

type Mode string

Mode 描述解析后的待办输出是快照还是更新。

const (
	ModeSnapshot Mode = "snapshot"
	ModeUpdate   Mode = "update"
)

type Options

type Options struct {
	RunID string
	Sink  events.Sink
}

Options 配置 Tracker。

type ParseResult

type ParseResult struct {
	Items []events.RuntimeTodoItem
	Mode  Mode
	Merge bool
}

ParseResult 是运行时待办更新的标准化解析结果。

type Reporter

type Reporter interface {
	// Snapshot 替换当前待办列表并发出快照事件。
	Snapshot(ctx context.Context, items []events.RuntimeTodoItem) error
	// Update 更新当前待办列表并发出更新事件。
	Update(ctx context.Context, items []events.RuntimeTodoItem, merge bool) error
	// List 返回当前待办列表的副本。
	List() []events.RuntimeTodoItem
}

func ReporterFrom

func ReporterFrom(ctx context.Context) (Reporter, bool)

ReporterFrom 从 ctx 中读取本次运行的 todo reporter。

type Status

type Status string

Status 表示待办事项的状态。

const (
	StatusPending    Status = "pending"
	StatusInProgress Status = "in_progress"
	StatusCompleted  Status = "completed"
	StatusCancelled  Status = "cancelled"
)

type Tracker

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

Tracker 维护一次运行的内存中待办列表。

func NewTracker

func NewTracker(opts Options) *Tracker

NewTracker 创建运行时待办跟踪器。

func (*Tracker) List

func (t *Tracker) List() []events.RuntimeTodoItem

List 返回当前待办列表的副本。

func (*Tracker) Snapshot

func (t *Tracker) Snapshot(ctx context.Context, items []events.RuntimeTodoItem) error

Snapshot 替换当前待办列表并发出快照事件。

func (*Tracker) Update

func (t *Tracker) Update(ctx context.Context, items []events.RuntimeTodoItem, merge bool) error

Update 更新当前待办列表并发出更新事件。

Jump to

Keyboard shortcuts

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