Module: Brute::Tools::TodoList::Store

Defined in:
lib/brute/tools/todo_list/store.rb

Overview

In-memory todo list storage. The agent uses this to track multi-step tasks via the todo_read / todo_write tools. The list is replaced wholesale on each todo_write call.

Class Method Summary collapse

Class Method Details

.allObject

Return all current items.



24
25
26
# File 'lib/brute/tools/todo_list/store.rb', line 24

def all
  @mutex.synchronize { @items.dup }
end

.clear!Object

Clear all items.



29
30
31
# File 'lib/brute/tools/todo_list/store.rb', line 29

def clear!
  @mutex.synchronize { @items.clear }
end

.replace(items) ⇒ Object

Replace the entire todo list.



19
20
21
# File 'lib/brute/tools/todo_list/store.rb', line 19

def replace(items)
  @mutex.synchronize { @items = items.dup }
end