Skip to content

tools

diapason.mesh.tools

What may be asked of a device remotely — and nothing else.

Spec §21 forbids a universal tool. That is not a style preference: an assistant that can call remote.execute(action, params) has, in practice, been handed the other device's shell, and every permission check upstream becomes decoration. The prohibition is enforced structurally here —

  • every tool declares its parameters by name, with a type;
  • unknown parameters are refused, never forwarded;
  • no parameter may be named action, command, method, code, script or sql — the shapes a passthrough always takes;
  • a tool with no declared parameters accepts no arguments at all.

A test (test_no_universal_tool) re-checks these on the whole registry, so adding a fourteenth tool cannot quietly reintroduce the thirteenth's escape hatch.

RemoteToolSpec dataclass

One narrow, explicitly-shaped remote capability.

validate(arguments)

Refuse anything the tool did not explicitly ask for.

list_remote_tools()

The catalogue, as the assistant's tool router should advertise it.