Agent Bridge: Let Terminal Coding Agents Drive the Editor
ShipYourGame
$0.0
(no ratings)
Jump AssetStore
Local, token-protected HTTP bridge so a terminal coding agent can compile, run tests, read logs, inspect the hierarchy, play, screenshot and profile inside the running editor. Editor-only.Close the loop your terminal coding agent is missing: edit a script, compile, read the real errors, run the tests, look at the game, fix, repeat, without a human alt-tabbing to press Play.Agent Bridge is a small, editor-only package that runs a token-protected HTTP/JSON server on the loopback interface inside the editor. Any terminal coding agent (or any script) talks to it through the bundled command line client: one bash script, one PowerShell script, no plugin, no protocol server, nothing to install on the agent side. Full C# source, no DLLs, 52 EditMode tests behind it.WHAT THE AGENT CAN DOcompile: refresh assets, compile, wait through the domain reload, print errors as file:line:col (exit 2 on errors).tests: run EditMode or PlayMode tests with a regex filter or exact names; pass/fail counts and failure messages.logs: read recent Console entries with levels, ids and a since cursor; stack traces on request.hierarchy / scene: dump the loaded scenes as a tree with components; dirty state, prefab stage, build scene list.play / stop / pause / resume / step: control Play Mode; the player loop keeps stepping while the editor is unfocused.screenshot: render any camera to a PNG the agent can open, in Edit Mode or Play Mode.stats: FPS, frame-time average and p95, draw calls, batches, triangles, GC allocation per frame.status: everything an agent needs to decide what to do next, answered from a cache that never waits on the main thread.exec: compile and run a C# snippet inside the live editor, refused until you turn Safe Mode off.Nineteen HTTP endpoints behind those commands, all documented, all returning compact JSON with an ok flag, an error code and a hint an agent can act on. Exit codes 0 / 1 / 2 / 3 (ok / error / failures / busy) so the agent knows whether to fix, wait or ask.SAFETY MODEL, IN PLAIN WORDSLoopback only: the server binds to the numeric IPv4 loopback address; another machine cannot connect. A new random 256-bit token every editor session, required on every request, compared in constant time, deleted when the editor quits, rotatable from the window. Safe Mode is on by default: exec, the only endpoint that runs arbitrary C#, answers 403 until you switch Safe Mode off in the window and confirm a dialog. No CORS, ever: requests carrying a browser Origin header are refused and the Host header must be loopback. Every request is logged to the Console with the [AgentBridge] prefix and listed in the window. Request size limit (1 MB), JSON-only bodies, no path traversal, screenshot paths confined to the project or temp folder, no listener in batch mode, nothing in player builds.BUILT FOR THE EDITOR'S SHARP EDGESSurvives domain reloads: the listener re-arms after every compile, and compile results and test progress are persisted. Test-run lock with stale-run recovery: no asset refresh while the Test Runner is mid-run, no overlapping runs, a stuck run can be reset. Scene guard: the "save changes?" modal that the Test Runner opens on dirty scenes is prevented; the agent is told which scenes are dirty and can opt in to a silent save. Never blocks the main thread: work is queued to the editor loop and answered with 503 if the editor is busy.ALSO INCLUDEDEditor window (Window > ShipYourGame > Agent Bridge): status, address, token copy/rotate, Safe Mode toggle, port and limits, recent requests, one-click copy of the clients into tools/. Documentation: install, a two-minute agent quick start with a ready-made instructions block for the agent's project file, endpoint reference, security and threat model, troubleshooting, manual smoke test.REQUIREMENTS2022.3 or newer (verified on 6000.6.0f1). Test Framework package (installed by default). curl for the bash client (macOS, Linux, Git Bash) or PowerShell 5.1+ for the Windows client.WHAT IT IS NOTNot an agent, not a model, not a protocol server: it is an HTTP door into the editor plus a script any agent with a shell can call. Not a network service: it cannot be reached from another machine and must never be port-forwarded or tunnelled. Not a sandbox: with Safe Mode off, an agent can run any C# in the editor with your user permissions; keep Safe Mode on unless you are actively using exec. Not a runtime component: nothing from the package ends up in a player build.Full source, XML-documented public API, one editor assembly definition.2022.3+ (verified on 6000.6.0f1), editor-only, C# source only (no DLLs, no native plugins), assembly definition ShipYourGame.AgentBridge.EditorEditor: 27 scripts (HTTP listener on a worker thread, main-thread queue, router, JSON, token, compile tracker, test runner bridge, scene guard, snippet compiler, frame stats, window)Clients: Tools/agentbridge.sh (bash, curl; jq optional), Tools/agentbridge.ps1 (PowerShell 5.1+). No plugin or protocol server needed on the agent sideEndpoints: GET /, /status, /compile, /tests, /logs, /hierarchy, /stats, /scene; POST /compile, /tests, /tests/reset, /exec, /logs/clear, /play, /stop, /pause, /step, /screenshotFiles written in the project (do not commit): Library/AgentBridge/{token, bridge.json, compile.json, tests.json, screenshot.png, snippets/, scene-backup/}, UserSettings/AgentBridgeSettings.json; tools/agentbridge.* when you press the copy buttonNetwork: binds the numeric IPv4 loopback address only, default port 17330 (configurable), no listener in batch modeSafe Mode on by default: /exec refused (403) until disabled in the window with a confirmation dialogDependencies: com.unity.test-framework (default in every project). Nothing elseSupported OS: Windows, macOS, Linux (editor)52 EditMode tests in the source repository; manual smoke test documentedCode, documentation and store copy were written with the help of terminal AI coding agents and then reviewed, compiled, unit-tested (52 EditMode tests) and smoke-tested against a live editor by the publisher. Key images and screenshots were composed with AI-assisted illustration and image generation; terminal captures come from the real smoke test. No third-party assets were used.




