Stage 2 of #429. Until now an agent could only look at the editor.
Now it reads the project and changes it through the same commands
the user's own edits run, so every change shows up live and one
Ctrl+Z takes back a whole agent call.
- Read tools: list_assets, get_asset, get_graph and catalog. The
catalog lists the commands with their arguments, the nodes of a
graph from the same palette the user sees, asset types and
variable kinds.
- run_commands runs its steps as one undo step named "Agent: ...".
A failing step rolls back the steps before it. The answer names
the step and the reason the editor gave.
- A step can name what it made ("as") and later steps use "$name".
Each step is built after the one before has run, so one call can
make a behavior and fill it.
- 23 commands cover assets, variables, scene objects and graphs.
Textures, fonts, sounds and videos need a file and are left out.
- open, select, play and undo/redo drive the editor.
- Deleting asks the user with the same text as their own delete.
The tab sends "wait", and the relay then gives the call 2 minutes
instead of 30 seconds.
- tools.json is the only source of the argument schemas. argCheck
checks every call against them before anything runs.
- An open menu now names its first entries in get_view, instead of
an empty title.
- The new host functions live in editorToolHost.ts, so Editor.ts
does not grow further.
Found while testing: e2e 71 hung for 30 s in Page.navigate after a
failure. The beforeunload guard of an unsaved project held the page
and hid the real error. The module now reports the error first and
waits for the save before it navigates.
Tests:
- Gate on melektaus-atx: CHECK EXIT 0, 317 files, 4903 tests.
- agent-edit 14/14, agent-view 10/10, relay 24/24.
- e2e 71 16/16 on atx and against the live site. One call builds a
sprite with an arrow-key behavior, play moves it from x 0 to -125,
and one undo restores the assets exactly.
- Counter-checks turned red: no rollback, a partial undo, no delete
question, a relay that ignores "wait".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude Code should be able to work inside the user's open editor tab.
This first stage connects the two and lets the agent look: what the
user sees and a picture of it. Changing the project comes in stage 2.
- An agent token per account opens only /mcp, no API route. The
dialog "Agent tokens..." in the account menu creates it once, shows
the ready "claude mcp add" line and revokes it. The server keeps
only its sha256 (api/lib/AgentTokens.php).
- Wrong tokens count into the sign-in brake from #427. Changing the
password, renaming or deleting an account ends its tokens.
- The relay (tools/mcp/) is a small Node service without packages,
WebSocket server included. It runs in the container feuerwerk-mcp
because PHP-FPM cannot hold connections. Whether a token or a tab
ticket is valid is still decided by the PHP API, through two routes
that answer only with the relay key.
- The tab joins over WebSocket on the same origin with the normal
session, an Origin check and a one-time ticket. It connects only
after "Agent" is switched on in the account menu. One tab per
account is active, a new one takes over. Guests get nothing.
- Tools: get_view (project, tab, document, selection with names,
camera, play state, open dialog) and screenshot. The resource
feuerwerk://view can be subscribed. Claude Code does not act on
that reliably, so a changed view is also noted on the next answer.
- A badge next to the account menu shows the connected agents. It
counts only agents with an open stream or a request in the last
two minutes.
- CI starts the relay in front of php -S (tools/ci/serve.sh), and
e2e 71 runs the whole path in the browser.
Found on the live test: the badge showed four agents because old
sessions of revoked tokens were still counted.
Tests:
- Gate on atx: 316 files, 4888 tests
- relay protocol test with fake API and fake tabs: 23/23
- get_view, tools, socketUrl: 16/16
- PHP agents 29, rights 103 checks
- e2e 71 on atx 10/10, against the live site 10/10, no CSP violation
- real Claude Code against the live site: get_view answered
- ZAP against /mcp: nothing at High or Medium
- every new check fails when the guard it covers is taken out (6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>