yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::cli::agent::TodoManager Class Reference

Manages TODO lists for z3ed agent task execution. More...

#include <todo_manager.h>

Public Member Functions

 TodoManager ()
 
 TodoManager (const std::string &data_dir)
 
absl::Status Initialize ()
 Initialize the TODO manager and load persisted data.
 
absl::StatusOr< TodoItemCreateTodo (const std::string &description, const std::string &category="", int priority=0)
 Create a new TODO item.
 
absl::Status UpdateTodo (const std::string &id, const TodoItem &item)
 Update an existing TODO item.
 
absl::Status UpdateStatus (const std::string &id, TodoItem::Status status)
 Update TODO status.
 
absl::StatusOr< TodoItemGetTodo (const std::string &id) const
 Get a TODO item by ID.
 
std::vector< TodoItemGetAllTodos () const
 Get all TODO items.
 
std::vector< TodoItemGetTodosByStatus (TodoItem::Status status) const
 Get TODO items by status.
 
std::vector< TodoItemGetTodosByCategory (const std::string &category) const
 Get TODO items by category.
 
absl::StatusOr< TodoItemGetNextActionableTodo () const
 Get the next actionable TODO (respecting dependencies and priority)
 
absl::Status DeleteTodo (const std::string &id)
 Delete a TODO item.
 
absl::Status ClearCompleted ()
 Clear all completed TODOs.
 
absl::Status Save ()
 Save TODOs to persistent storage.
 
absl::Status Load ()
 Load TODOs from persistent storage.
 
absl::StatusOr< std::vector< TodoItem > > GenerateExecutionPlan () const
 Generate an execution plan based on dependencies.
 
std::string ExportAsJson () const
 Export TODOs as JSON string.
 
absl::Status ImportFromJson (const std::string &json)
 Import TODOs from JSON string.
 

Private Member Functions

std::string GenerateId ()
 
std::string GetTimestamp () const
 
bool CanExecute (const TodoItem &item) const
 

Private Attributes

std::string data_dir_
 
std::string todos_file_
 
std::vector< TodoItemtodos_
 
int next_id_ = 1
 

Detailed Description

Manages TODO lists for z3ed agent task execution.

Enables the AI agent to:

  • Create and track TODO lists for complex tasks
  • Break down goals into executable steps
  • Track dependencies between tasks
  • Persist state between sessions
  • Generate execution plans

Definition at line 53 of file todo_manager.h.

Constructor & Destructor Documentation

◆ TodoManager() [1/2]

yaze::cli::agent::TodoManager::TodoManager ( )

Definition at line 53 of file todo_manager.cc.

References data_dir_, yaze::util::PlatformPaths::GetAppDataSubdirectory(), and todos_file_.

Here is the call graph for this function:

◆ TodoManager() [2/2]

yaze::cli::agent::TodoManager::TodoManager ( const std::string &  data_dir)
explicit

Definition at line 63 of file todo_manager.cc.

Member Function Documentation

◆ Initialize()

absl::Status yaze::cli::agent::TodoManager::Initialize ( )

◆ CreateTodo()

absl::StatusOr< TodoItem > yaze::cli::agent::TodoManager::CreateTodo ( const std::string &  description,
const std::string &  category = "",
int  priority = 0 
)

◆ UpdateTodo()

absl::Status yaze::cli::agent::TodoManager::UpdateTodo ( const std::string &  id,
const TodoItem item 
)

Update an existing TODO item.

Definition at line 113 of file todo_manager.cc.

References GetTimestamp(), yaze::cli::agent::TodoItem::id, Save(), todos_, and yaze::cli::agent::TodoItem::updated_at.

Here is the call graph for this function:

◆ UpdateStatus()

absl::Status yaze::cli::agent::TodoManager::UpdateStatus ( const std::string &  id,
TodoItem::Status  status 
)

Update TODO status.

Definition at line 129 of file todo_manager.cc.

References GetTimestamp(), Save(), and todos_.

Here is the call graph for this function:

◆ GetTodo()

absl::StatusOr< TodoItem > yaze::cli::agent::TodoManager::GetTodo ( const std::string &  id) const

Get a TODO item by ID.

Definition at line 143 of file todo_manager.cc.

References todos_.

Referenced by CanExecute().

◆ GetAllTodos()

std::vector< TodoItem > yaze::cli::agent::TodoManager::GetAllTodos ( ) const

Get all TODO items.

Definition at line 154 of file todo_manager.cc.

References todos_.

Referenced by yaze::cli::tui::ChatTUI::CreateTodoPopup(), and yaze::cli::anonymous_namespace{tui.cc}::TodoManagerComponent().

◆ GetTodosByStatus()

std::vector< TodoItem > yaze::cli::agent::TodoManager::GetTodosByStatus ( TodoItem::Status  status) const

Get TODO items by status.

Definition at line 158 of file todo_manager.cc.

References todos_.

◆ GetTodosByCategory()

std::vector< TodoItem > yaze::cli::agent::TodoManager::GetTodosByCategory ( const std::string &  category) const

Get TODO items by category.

Definition at line 165 of file todo_manager.cc.

References todos_.

◆ GetNextActionableTodo()

absl::StatusOr< TodoItem > yaze::cli::agent::TodoManager::GetNextActionableTodo ( ) const

Get the next actionable TODO (respecting dependencies and priority)

Definition at line 186 of file todo_manager.cc.

References yaze::cli::agent::TodoItem::BLOCKED, CanExecute(), yaze::cli::agent::TodoItem::PENDING, and todos_.

Here is the call graph for this function:

◆ DeleteTodo()

absl::Status yaze::cli::agent::TodoManager::DeleteTodo ( const std::string &  id)

Delete a TODO item.

Definition at line 210 of file todo_manager.cc.

References Save(), and todos_.

Here is the call graph for this function:

◆ ClearCompleted()

absl::Status yaze::cli::agent::TodoManager::ClearCompleted ( )

Clear all completed TODOs.

Definition at line 222 of file todo_manager.cc.

References Save(), and todos_.

Here is the call graph for this function:

◆ Save()

absl::Status yaze::cli::agent::TodoManager::Save ( )

Save TODOs to persistent storage.

Definition at line 283 of file todo_manager.cc.

References todos_, and todos_file_.

Referenced by ClearCompleted(), CreateTodo(), DeleteTodo(), ImportFromJson(), UpdateStatus(), and UpdateTodo().

◆ Load()

◆ GenerateExecutionPlan()

absl::StatusOr< std::vector< TodoItem > > yaze::cli::agent::TodoManager::GenerateExecutionPlan ( ) const

Generate an execution plan based on dependencies.

Definition at line 231 of file todo_manager.cc.

References todos_.

◆ ExportAsJson()

std::string yaze::cli::agent::TodoManager::ExportAsJson ( ) const

Export TODOs as JSON string.

Definition at line 363 of file todo_manager.cc.

References todos_.

◆ ImportFromJson()

◆ GenerateId()

std::string yaze::cli::agent::TodoManager::GenerateId ( )
private

Definition at line 81 of file todo_manager.cc.

References next_id_.

Referenced by CreateTodo().

◆ GetTimestamp()

std::string yaze::cli::agent::TodoManager::GetTimestamp ( ) const
private

Definition at line 85 of file todo_manager.cc.

Referenced by CreateTodo(), UpdateStatus(), and UpdateTodo().

◆ CanExecute()

bool yaze::cli::agent::TodoManager::CanExecute ( const TodoItem item) const
private

Definition at line 172 of file todo_manager.cc.

References yaze::cli::agent::TodoItem::COMPLETED, yaze::cli::agent::TodoItem::dependencies, and GetTodo().

Referenced by GetNextActionableTodo().

Here is the call graph for this function:

Member Data Documentation

◆ data_dir_

std::string yaze::cli::agent::TodoManager::data_dir_
private

Definition at line 142 of file todo_manager.h.

Referenced by Initialize(), and TodoManager().

◆ todos_file_

std::string yaze::cli::agent::TodoManager::todos_file_
private

Definition at line 143 of file todo_manager.h.

Referenced by Initialize(), Load(), Save(), and TodoManager().

◆ todos_

◆ next_id_

int yaze::cli::agent::TodoManager::next_id_ = 1
private

Definition at line 145 of file todo_manager.h.

Referenced by GenerateId(), and Load().


The documentation for this class was generated from the following files: