install.md: host add-on actions

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-28 06:12:09 +01:00
commit 740a2c84c3

View file

@ -246,6 +246,43 @@ Behaviour the table does not say, per action:
object, or an undo or redo). Selection totals are the mesh's own counts and the index scan stops at the cap. They are
observations: no intent is refused because of them.
### Host add-on actions
A host add-on (Aetheria's `aetheria_ships`, say) lets agents run some of its own operators by putting a file
`brokkr_actions.json` beside its `__init__.py`: `{"schema": "brokkr.blender.host_actions.v0", "actions": [row]}`.
The add-on imports nothing from Brokkr and registers nothing; the file is the whole contract.
`surfaces/blender/tests/fixtures/brokkr_host_fixture/` is a worked example.
A row is a built-in row (`name`, `doc`, `changesScene`, `editModeSafe`, `fields`) plus an optional `result`.
`name` is the `bl_idname` of an operator the same add-on registers (`addon.operator`, lower case, one dot, so
it never equals a built-in name). Fields are scalar only: `string` (with `enum`, `minLength`, `maxLength`,
`chars`, `prefixes`, `forbid`), `number` or `integer` (both with `minimum` and `maximum`) and `boolean`,
with `required` and `default` as for built-ins; no arrays, objects or free JSON, and no `envelope` or
`charsets` keys. The messages are the built-in ones.
Brokkr admits a file whole or not at all, at every intent and snapshot (a changed file is re-read; a
disabled add-on's actions are unknown at its next intent). Beyond the file's own shape it checks that each
named operator exists and is a Python class defined by that add-on's module, that every field is a property
of the operator of the matching type (a string with an `enum` is an enum property with the same
identifiers), that the operator's RNA hard limits contain the row's bounds, and that `result` names a
`StringProperty` on `bpy.types.WindowManager`. A refused file is reported in the host snapshot as
`hostActionErrors` (`brokkr-ctl blender status` prints each) and none of its rows runs.
An admitted action goes through the same agent turn as a built-in: Edit Mode refusal for rows that are not
`editModeSafe`, one labelled undo step when `changesScene`, a receipt. The operator is called with
`'EXEC_DEFAULT'` and exactly the declared fields. It runs on Blender's main thread, so a long operator
blocks the interface for as long as her own button would. `FINISHED` is `accepted`; `CANCELLED` is `failed`
with nothing pushed; an argument Blender will not convert, or an `ERROR` report or exception, is `failed`
(with the first line of the error). `result` is how an operator returns text (a dry-run's change lines): the
agent turn clears that WindowManager property before the call and copies it, up to 16000 characters and then
`[truncated]`, into the receipt's `hostResult` (empty for every other action).
The admitted rows are published in the host snapshot as `hostActions` (each with its `host` module).
`brokkr-ctl blender send --help --store <path>` lists them after the built-ins, `send` refuses an intent
they refuse before writing anything, and the add-on still decides. Human-only is absence: an operator only a
person may run (one that applies a change to a game's data) is left out of the file, so an intent naming it
is `Unsupported Blender command action`, as `runPython` is; the person still presses her own button.
The scene actions were run against Blender 5.2.3 LTS headless with
`surfaces/blender/tests/live/headless_smoke.py` (usage in its docstring). One real
failure it found: Blender's `engine` enum is dynamic, so `bl_rna` lists only