v0.3.1
Added
screenshotnow usesScreenCapture.CaptureScreenshotAsTexture()in play mode and a synchronous scene-view camera render in edit mode. The command returns immediately and fires ascreenshot_readynotification withpath,width, andheightwhen the image is saved.max_sizestill applies.- Notification system: AgentBridge writes
Temp/agent/notifications/<ts>-<uid>.jsonfiles for lifecycle events. Inservemode,dffrnt-agentpolls this directory every 500 ms and forwards each event to MCP clients as anotifications/message. Events:compile_started,compile_finished(includeserror_count),compile_failure(includes error details),refresh_started,refresh_finished,play_mode_entered,play_mode_exited,scene_opened(includesname,path,mode),screenshot_ready(includespath,width,height),script_started,script_failed. - Unity project auto-discovery:
dffrnt-agentchecks the current working directory and all immediate subdirectories for a Unity project (presence ofAssets/andProjectSettings/). Directories without a~suffix take priority. No--projectflag needed when running from the project root or a parent folder. - Tools list refresh: after
set_projectloads commands from Unity, the server sends anotifications/tools/list_changedevent so MCP clients pick up the new tools without a reconnect. agent_idfield: requests and responses include an optionalagent_idstring. Pass--agent-id <id>todffrnt-agentto tag all commands from one agent instance. The session heartbeat also includes the currentagent_idso multiple agents can see which agent holds the bridge.- Auto-compile timer: when a script file change is detected and no manual
compilecommand 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>.jsonon each heartbeat and deletes it on quit. The file contains the project path, PID, and timestamp.dffrnt-agentuses this to discover running projects without aset_projectcall. list_projectsMCP 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_projectsthenset_projectwhen no project is connected. MainThreadstatic class inScriptCommand.cs: providesMT.Run(() => ...)for scripts to marshal Unity API calls from the background thread back to the main thread. Available in allexecute_scriptsnippets via theusing MT = LLMDevTools.MainThreadalias injected by the wrapper.console_logsnow accepts an optionalfilterstring 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_scriptnow runs the compiled script on the Unity main thread. Unity API calls are safe withoutMT.Run. The command is still non-blocking: compilation runs on a background thread, and the script runs on the main thread once compiled.execute_scriptnow compiles with debug symbols (-debug+) and loads the PDB alongside the assembly. Exception stack traces include source line numbers.execute_scriptrejects code containingThread.Sleep: it blocks the main thread and freezes the Unity Editor.profiler_startnow works in edit mode and play mode. The play-mode-only restriction is removed.profiler_get_samplesreturns aunitfield ("ms"or"bytes") and includes aliasedlastMs/avgMs/minMs/maxMsfields for time markers.- When scripts need recompilation or assets need reimport, AgentBridge now triggers
compileorrefreshautomatically 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.SilentlyClearDirtyScenestoSaveDirtyScenesWithoutPrompt. The old name implied that the method discards changes, but it saves named scenes without a prompt. - Removed the unused
_wasPlayingBeforeReloadfield fromAgentBridge. Unity firesExitingPlayModebeforeOnBeforeReload, so the field was alwaysfalsewhen read. - Renamed
SceneBridge.FtoToFloatacross all callers, includingMaterialCommands. - Renamed
PathUtils.IsWritabletoIsAllowedWritePath. The method checks whether a path is in an allowed write location, not whether the file system permits writes. AppendLognow logs a Unity Console warning on failure instead of silently swallowing the exception.AgentLogWindownow displays notification events (from the notifications directory) as distinct log entries. Non-error notifications appear in yellow; error notifications appear in red.console_logsnow reads only the entries currently visible in the Unity Console window using the internalUnityEditor.LogEntriesAPI, instead of parsing the entireEditor.logfile. Returns only current console state, not historical data.
Removed
profiler_measure: removed. Useexecute_scriptto fire aProfilerMarkerandprofiler_get_samplesto read the results.- Historical log file parsing from
ConsoleBridge. Replaced with internalLogEntriesAPI 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