Skip to content

agent

Types

Todo

ts
type Todo = {
  id: string;
  text: string;
  status: "pending" | "in_progress" | "completed"
}

(source)

Functions

todoWrite

ts
todoWrite(todos: Todo[]): Todo[]

Replace the current todo list. Each todo has an id, text, and status (one of 'pending', 'in_progress', 'completed'). Use this to track multi-step work as you go: mark a todo 'in_progress' before starting it and 'completed' when done. Returns the new list.

Parameters:

NameTypeDefault
todosTodo[]

Returns: Todo[]

(source)

todoList

ts
todoList(): Todo[]

Return the current todo list.

Returns: Todo[]

(source)

question

ts
question(prompt: string): string

Ask the user a question and wait for their reply. Unlike input(), this raises an interrupt so the host (CLI, web UI, etc.) can present the prompt in its own way; the host resolves the interrupt with the answer string.

Parameters:

NameTypeDefault
promptstring

Returns: string

Throws: std::question

(source)