task

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 5 Imported by: ? 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 task provides readymade planning and task-tracking tools for multi-step agent reasoning.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTaskInput

type CreateTaskInput struct {
	Title       string `json:"title" description:"Title or brief summary of the task"`
	Description string `json:"description,omitempty" description:"Detailed description or requirements for the task"`
}

CreateTaskInput defines parameters for creating a new task.

type ListTasksInput

type ListTasksInput struct {
	Status Status `json:"status,omitempty" description:"Optional filter by status (pending, in_progress, completed, canceled)"`
}

ListTasksInput defines parameters for listing tasks.

type ListTasksOutput

type ListTasksOutput struct {
	Tasks []Task `json:"tasks"`
	Total int    `json:"total"`
}

ListTasksOutput represents the list of tasks.

type Status

type Status string

Status represents the lifecycle status of a task.

const (
	// StatusPending indicates a task that has been planned but not yet started.
	StatusPending Status = "pending"
	// StatusInProgress indicates a task that is currently being executed.
	StatusInProgress Status = "in_progress"
	// StatusCompleted indicates a task that has finished successfully.
	StatusCompleted Status = "completed"
	// StatusCanceled indicates a task that was discarded or aborted.
	StatusCanceled Status = "canceled"
)

type Task

type Task struct {
	ID          string `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
	Status      Status `json:"status"`
}

Task represents an individual task in a plan.

type Tracker

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

Tracker provides thread-safe in-memory task management.

func NewTracker

func NewTracker() *Tracker

NewTracker creates an empty in-memory task tracker.

func (*Tracker) AllTools

func (t *Tracker) AllTools() ([]tool.Tool, error)

AllTools returns all task management tools (task_create, task_list, task_update).

func (*Tracker) NewCreateTaskTool

func (t *Tracker) NewCreateTaskTool() (tool.Tool, error)

NewCreateTaskTool returns a tool for adding a new task to the plan.

func (*Tracker) NewListTasksTool

func (t *Tracker) NewListTasksTool() (tool.Tool, error)

NewListTasksTool returns a tool for listing current tasks.

func (*Tracker) NewUpdateTaskTool

func (t *Tracker) NewUpdateTaskTool() (tool.Tool, error)

NewUpdateTaskTool returns a tool for modifying a task's status or details.

type UpdateTaskInput

type UpdateTaskInput struct {
	ID     string `json:"id" description:"The unique task ID to update"`
	Status Status `json:"status,omitempty" description:"New status (pending, in_progress, completed, canceled)"`
	Title  string `json:"title,omitempty" description:"Updated task title"`
}

UpdateTaskInput defines parameters for updating a task.

Jump to

Keyboard shortcuts

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