AiWriteTools.h header

#include <ew/app/AiWriteTools.h>

Namespace ew::app

WriteToolResult struct

struct ew::app::WriteToolResult

The outcome of one act-mode write tool call (docs/AI_FOLDER_CONVERSION.md §4b): the result text is fed back to the model AND shown in the chat transcript ("Created entity 'Aria' (Characters)."), or carries an honest refusal/error so the model can correct itself.

Members

bool ew::app::WriteToolResult::ok = false

True when the project was changed (or the call was a valid no-op).

QString ew::app::WriteToolResult::message

The human-readable outcome, in the same voice as the conversion report.

Functions

std::vector< AiToolSpec > ew::app::agentWriteTools()

The write tools the act-mode assistant may call, mirroring the Script Console's world API: create_category, create_entity, set_entity_field, set_entity_aliases, set_entity_lifespan, create_document, set_document_body, set_document_title, create_timeline_event, create_spreadsheet. Attach ALONGSIDE agentTools() (the read tools) on an act-mode request so the assistant can look things up before changing them.

WriteToolResult ew::app::executeWriteTool(ew::core::Project &project, ew::core::CommandStack &stack, const AiToolCall &call)

Executes one write tool call against the LIVE project through the undoable stack – every mutation is a pushed command, so with a group open (CommandStack::beginGroup) one user request undoes as one step. Must run on the thread that owns project (the GUI thread); the off-thread agent loop marshals each call here. Unknown tools, malformed arguments, unknown names, and dates the project calendar cannot parse fail with an honest message; an object marked "Exclude from AI" is untouchable and reported as such.