Skip to content

v0.3.1

Choose a tag to compare

@github-actions github-actions released this 11 Aug 03:55
· 7 commits to master since this release

Added

  • screenshot now uses ScreenCapture.CaptureScreenshotAsTexture() in play mode and a synchronous scene-view camera render in edit mode. The command returns immediately and fires a screenshot_ready notification with path, width, and height when the image is saved. max_size still applies.
  • Notification system: AgentBridge writes Temp/agent/notifications/<ts>-<uid>.json files for lifecycle events. In serve mode, dffrnt-agent polls this directory every 500 ms and forwards each event to MCP clients as a notifications/message. Events: compile_started, compile_finished (includes error_count), compile_failure (includes error details), refresh_started, refresh_finished, play_mode_entered, play_mode_exited, scene_opened (includes name, path, mode), screenshot_ready (includes path, width, height), script_started, script_failed.
  • Unity project auto-discovery: dffrnt-agent checks the current working directory and all immediate subdirectories for a Unity project (presence of Assets/ and ProjectSettings/). Directories without a ~ suffix take priority. No --project flag needed when running from the project root or a parent folder.
  • Tools list refresh: after set_project loads commands from Unity, the server sends a notifications/tools/list_changed event so MCP clients pick up the new tools without a reconnect.
  • agent_id field: requests and responses include an optional agent_id string. Pass --agent-id <id> to dffrnt-agent to tag all commands from one agent instance. The session heartbeat also includes the current agent_id so multiple agents can see which agent holds the bridge.
  • Auto-compile timer: when a script file change is detected and no manual compile command arrives within 10 seconds, AgentBridge triggers compilation automatically. This prevents stale compile state when the user switches back to the Editor after an agent writes scripts.
  • Global project registry: AgentBridge writes %APPDATA%/AgentBridge/<hash>.json on each heartbeat and deletes it on quit. The file contains the project path, PID, and timestamp. dffrnt-agent uses this to discover running projects without a set_project call.
  • list_projects MCP tool: returns all Unity projects currently running with AgentBridge. Validates each entry by PID liveness and a 30-second timestamp window.
  • MCP server startup instructions: the server now tells MCP clients to call list_projects then set_project when no project is connected.
  • MainThread static class in ScriptCommand.cs: provides MT.Run(() => ...) for scripts to marshal Unity API calls from the background thread back to the main thread. Available in all execute_script snippets via the using MT = LLMDevTools.MainThread alias injected by the wrapper.
  • console_logs now accepts an optional filter string argument. When provided, only entries whose message contains the filter string (case-insensitive) are returned. Omitting the argument returns all entries as before.

Changed

  • execute_script now runs the compiled script on the Unity main thread. Unity API calls are safe without MT.Run. The command is still non-blocking: compilation runs on a background thread, and the script runs on the main thread once compiled.
  • execute_script now compiles with debug symbols (-debug+) and loads the PDB alongside the assembly. Exception stack traces include source line numbers.
  • execute_script rejects code containing Thread.Sleep: it blocks the main thread and freezes the Unity Editor.
  • profiler_start now works in edit mode and play mode. The play-mode-only restriction is removed.
  • profiler_get_samples returns a unit field ("ms" or "bytes") and includes aliased lastMs/avgMs/minMs/maxMs fields for time markers.
  • When scripts need recompilation or assets need reimport, AgentBridge now triggers compile or refresh automatically and replays the blocked command after completion. Previously a hard error was returned. Commands that are always safe to run (log checks, script execution, asset writes) are not affected.
  • Renamed SceneBridge.SilentlyClearDirtyScenes to SaveDirtyScenesWithoutPrompt. The old name implied that the method discards changes, but it saves named scenes without a prompt.
  • Removed the unused _wasPlayingBeforeReload field from AgentBridge. Unity fires ExitingPlayMode before OnBeforeReload, so the field was always false when read.
  • Renamed SceneBridge.F to ToFloat across all callers, including MaterialCommands.
  • Renamed PathUtils.IsWritable to IsAllowedWritePath. The method checks whether a path is in an allowed write location, not whether the file system permits writes.
  • AppendLog now logs a Unity Console warning on failure instead of silently swallowing the exception.
  • AgentLogWindow now displays notification events (from the notifications directory) as distinct log entries. Non-error notifications appear in yellow; error notifications appear in red.
  • console_logs now reads only the entries currently visible in the Unity Console window using the internal UnityEditor.LogEntries API, instead of parsing the entire Editor.log file. Returns only current console state, not historical data.

Removed

  • profiler_measure: removed. Use execute_script to fire a ProfilerMarker and profiler_get_samples to read the results.
  • Historical log file parsing from ConsoleBridge. Replaced with internal LogEntries API that returns only current console window entries.

MCP context size

=== MCP context size (fixed tools only) ===
tool                        bytes  ~tokens
-------------------------------------------
screenshot                    234       58
help                          205       51
set_project                   138       34
-------------------------------------------
TOTAL (3 tools)               577      144
note: dynamic core tools from Unity are registered at runtime via the 'core' flag