Entropic 2.14.3
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic::TodoTool Class Reference

Tool for managing a persistent todo list. More...

Inheritance diagram for entropic::TodoTool:
Collaboration diagram for entropic::TodoTool:

Public Member Functions

 TodoTool (ToolDefinition def)
 Construct from tool definition.
 
ServerResponse execute (const std::string &args_json) override
 Execute todo action (add/update/remove).
 
std::string anchor_key (const std::string &args_json) const override
 Anchor key for todo state replacement.
 
bool release (const std::string &key)
 Forget a session's list (gh#158).
 
std::size_t session_count () const
 Sessions holding a list (gh#158).
 
- Public Member Functions inherited from entropic::ToolBase
 ToolBase (ToolDefinition def)
 Construct with a pre-built definition.
 
const std::string & name () const
 Get the tool name.
 
const ToolDefinition & definition () const
 Get the full tool definition.
 
virtual MCPAccessLevel required_access_level () const
 Minimum access level required to execute this tool.
 

Additional Inherited Members

- Protected Attributes inherited from entropic::ToolBase
ToolDefinition definition_
 Tool definition.
 

Detailed Description

Tool for managing a persistent todo list.

gh#158 (v2.13.0): one list PER SESSION. The tool object is one per EntropicServer, and the handle's default set serves every unbound session, so a list kept on the object was shared — session B's result listed session A's items (and before that, two sessions appending raced the vector into heap corruption). The list is now keyed by the calling session and released with that session's conversation.

@dg_internal

Version
2.13.0 [reviewed]

Definition at line 65 of file entropic_server.cpp.

Constructor & Destructor Documentation

◆ TodoTool()

entropic::TodoTool::TodoTool ( ToolDefinition  def)
inlineexplicit

Construct from tool definition.

Parameters
defTool definition loaded from entropic/todo.json. @dg_internal
Version
1.8.5

Definition at line 73 of file entropic_server.cpp.

Member Function Documentation

◆ anchor_key()

std::string entropic::TodoTool::anchor_key ( const std::string &  args_json) const
overridevirtual

Anchor key for todo state replacement.

Anchor key for context replacement.

Parameters
args_jsonArguments (unused).
Returns
"todo_state" anchor key. @dg_internal
Version
1.8.5
Parameters
args_jsonArguments (unused).
Returns
"todo_state". @dg_internal
Version
1.8.5

Reimplemented from entropic::ToolBase.

Definition at line 126 of file entropic_server.cpp.

◆ execute()

ServerResponse entropic::TodoTool::execute ( const std::string &  args_json)
overridevirtual

Execute todo action (add/update/remove).

Execute the todo tool (add/update/remove) and emit directives.

Parameters
args_jsonJSON with "action", "content", "index", "status".
Returns
ServerResponse with todo state and directives. @dg_internal
Version
1.8.5

gh#158 (v2.13.0): acts on THE CALLING SESSION's list — the session the ToolExecutor routed this call on, published to its thread. The action and the render run under ONE hold of the list's lock, so the list a call returns is the list its own action produced.

Parameters
args_jsonJSON with "action" plus the action's own fields.
Returns
On success, the re-rendered list with context_anchor + notify_presenter directives; on an out-of-range index, the declared out_of_range error with NO directives (v2.14.0). @req REQ-MCP-024 @req REQ-LOOP-009
Version
2.14.0

Implements entropic::ToolBase.

Definition at line 234 of file entropic_server.cpp.

◆ release()

bool entropic::TodoTool::release ( const std::string &  key)
inline

Forget a session's list (gh#158).

Parameters
keySession key.
Returns
true when the session had a list. @dg_internal
Version
2.13.0

Definition at line 102 of file entropic_server.cpp.

◆ session_count()

std::size_t entropic::TodoTool::session_count ( ) const
inline

Sessions holding a list (gh#158).

Returns
Session count. @dg_internal
Version
2.13.0

Definition at line 110 of file entropic_server.cpp.


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