Skip to main content

Module formal_ai_tool

Module formal_ai_tool 

Source
Expand description

Runs one Formal AI tool call for --use-formal-ai (issue #255). Mirrors js/src/lib/formal-ai-tool.js.

The call is the argv vector the effect policy approved, spawned without a shell in the caller’s working directory and with the execution’s START_* environment. It gets no stdin, its own process group, a time limit and an output cap; stdout and stderr are mirrored live and the exit status is the real one (a signal maps to 128+N like a direct run).

Structs§

ToolOptions
How to run one approved call.
ToolReceipt
What one tool call did.

Functions§

format_refusal
Result text for a call start refused before running it.
format_tool_result
The result text sent back to Formal AI: the shell envelope its tool-result reader parses (Command/Directory/Output/Error/Exit Code), wrapped as untrusted context because the output is file data, not instructions.
run_tool
Run one approved call to completion, a timeout or cancellation.