brain_deer.plugins.braindeer_ai.agent

Agentic multi-step tool-calling loop for BrainDeer AI.

When Agent mode is enabled, the assistant drives the viewer through provider-native function calling (OpenAI tools / Anthropic tool_use): it calls a command, sees the structured result, and continues until the task is done.

Safety policy inside the loop

  • read-only tools (get_*, suggest_*) run immediately, no checkpoint.

  • non-destructive state changes run immediately, each preceded by a JSON checkpoint.

  • destructive tools are never auto-run: the loop stops and returns them as pending proposals for the existing approval bar.

Classes

AgentRunner

Runs the tool-calling loop against the engine's command registry.

Module Contents

class brain_deer.plugins.braindeer_ai.agent.AgentRunner(engine: Any, on_event: AgentEvent | None = None, tool_executor: collections.abc.Callable[[str, dict[str, Any]], dict[str, Any]] | None = None)

Runs the tool-calling loop against the engine’s command registry.