tasktool

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package tasktool implements TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, and TaskStop tools backed by an in-process task store.

Mirrors src/tools/Task*Tool/ and src/utils/tasks.ts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderTaskList

func RenderTaskList(store *Store) string

RenderTaskList returns a compact text summary of all tasks (for TUI display).

Types

type Status

type Status string

Status mirrors TaskStatus from tasks.ts.

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

type Store

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

Store is a thread-safe in-memory task store shared across all Task tools within one agent session.

func GlobalStore

func GlobalStore() *Store

GlobalStore returns the shared task store for live UI consumers like the coordinator footer panel. Don't mutate via this handle — use the dedicated tools so updates flow through the same entry points.

func (*Store) Create

func (s *Store) Create(subject, description, activeForm string, metadata map[string]any) *Task

func (*Store) Delete

func (s *Store) Delete(id string)

func (*Store) Get

func (s *Store) Get(id string) (*Task, bool)

func (*Store) List

func (s *Store) List() []*Task

func (*Store) Update

func (s *Store) Update(id string, fn func(*Task)) error

type Task

type Task struct {
	ID          string
	Subject     string
	Description string
	Status      Status
	ActiveForm  string // present-continuous form e.g. "Running tests"
	Metadata    map[string]any
	Output      string
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

Task is one item in the task list.

type TaskCreateTool

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

func NewCreate

func NewCreate() *TaskCreateTool

func (*TaskCreateTool) Description

func (*TaskCreateTool) Description() string

func (*TaskCreateTool) Execute

func (t *TaskCreateTool) Execute(_ context.Context, raw json.RawMessage) (tool.Result, error)

func (*TaskCreateTool) InputSchema

func (*TaskCreateTool) InputSchema() json.RawMessage

func (*TaskCreateTool) IsConcurrencySafe

func (*TaskCreateTool) IsConcurrencySafe(json.RawMessage) bool

func (*TaskCreateTool) IsReadOnly

func (*TaskCreateTool) IsReadOnly(json.RawMessage) bool

func (*TaskCreateTool) Name

func (*TaskCreateTool) Name() string

type TaskGetTool

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

func NewGet

func NewGet() *TaskGetTool

func (*TaskGetTool) Description

func (*TaskGetTool) Description() string

func (*TaskGetTool) Execute

func (t *TaskGetTool) Execute(_ context.Context, raw json.RawMessage) (tool.Result, error)

func (*TaskGetTool) InputSchema

func (*TaskGetTool) InputSchema() json.RawMessage

func (*TaskGetTool) IsConcurrencySafe

func (*TaskGetTool) IsConcurrencySafe(json.RawMessage) bool

func (*TaskGetTool) IsReadOnly

func (*TaskGetTool) IsReadOnly(json.RawMessage) bool

func (*TaskGetTool) Name

func (*TaskGetTool) Name() string

type TaskListTool

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

func NewList

func NewList() *TaskListTool

func (*TaskListTool) Description

func (*TaskListTool) Description() string

func (*TaskListTool) Execute

func (t *TaskListTool) Execute(_ context.Context, raw json.RawMessage) (tool.Result, error)

func (*TaskListTool) InputSchema

func (*TaskListTool) InputSchema() json.RawMessage

func (*TaskListTool) IsConcurrencySafe

func (*TaskListTool) IsConcurrencySafe(json.RawMessage) bool

func (*TaskListTool) IsReadOnly

func (*TaskListTool) IsReadOnly(json.RawMessage) bool

func (*TaskListTool) Name

func (*TaskListTool) Name() string

type TaskOutputTool

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

func NewOutput

func NewOutput() *TaskOutputTool

func (*TaskOutputTool) Description

func (*TaskOutputTool) Description() string

func (*TaskOutputTool) Execute

func (t *TaskOutputTool) Execute(_ context.Context, raw json.RawMessage) (tool.Result, error)

func (*TaskOutputTool) InputSchema

func (*TaskOutputTool) InputSchema() json.RawMessage

func (*TaskOutputTool) IsConcurrencySafe

func (*TaskOutputTool) IsConcurrencySafe(json.RawMessage) bool

func (*TaskOutputTool) IsReadOnly

func (*TaskOutputTool) IsReadOnly(json.RawMessage) bool

func (*TaskOutputTool) Name

func (*TaskOutputTool) Name() string

type TaskStopTool

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

func NewStop

func NewStop() *TaskStopTool

func (*TaskStopTool) Description

func (*TaskStopTool) Description() string

func (*TaskStopTool) Execute

func (t *TaskStopTool) Execute(_ context.Context, raw json.RawMessage) (tool.Result, error)

func (*TaskStopTool) InputSchema

func (*TaskStopTool) InputSchema() json.RawMessage

func (*TaskStopTool) IsConcurrencySafe

func (*TaskStopTool) IsConcurrencySafe(json.RawMessage) bool

func (*TaskStopTool) IsReadOnly

func (*TaskStopTool) IsReadOnly(json.RawMessage) bool

func (*TaskStopTool) Name

func (*TaskStopTool) Name() string

type TaskUpdateTool

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

func NewUpdate

func NewUpdate() *TaskUpdateTool

func (*TaskUpdateTool) Description

func (*TaskUpdateTool) Description() string

func (*TaskUpdateTool) Execute

func (t *TaskUpdateTool) Execute(_ context.Context, raw json.RawMessage) (tool.Result, error)

func (*TaskUpdateTool) InputSchema

func (*TaskUpdateTool) InputSchema() json.RawMessage

func (*TaskUpdateTool) IsConcurrencySafe

func (*TaskUpdateTool) IsConcurrencySafe(json.RawMessage) bool

func (*TaskUpdateTool) IsReadOnly

func (*TaskUpdateTool) IsReadOnly(json.RawMessage) bool

func (*TaskUpdateTool) Name

func (*TaskUpdateTool) Name() string

Jump to

Keyboard shortcuts

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