Phase 4 updates

Phase 4 · Slice 9 ·

MCP resources, prompts and exec

  • mcp_server speaks resources, with templates, resources/read and subscriptions, and prompts. After each message, subscribed resources are read again, and notifications/resources/updated goes out for the ones whose contents changed.
  • Resources:
    • the scene hierarchy (edit or live);
    • the console;
    • the latest compile's errors;
    • the project settings as applied (build scenes, layers, axes, gravity, timestep);
    • the review state;
    • the Scripting API: an index plus one page per type, generated from UnityEngine.CoreModule by reflection, so it always matches the build;
    • a compatibility matrix. There's no selection resource yet, because the editor has no selection.
  • Prompts: playtest, fix_errors and port_check.
  • exec runs C# snippets through Roslyn's script compilation, not the scripting package: the factory entry point is called directly. Snippets compile against UnityEngine and the current script assemblies, load into a collectible context, and the result is described as JSON. The default usings leave out System, so Object and Random mean Unity's.
  • The person controls exec in the review panel: never, ask each time (the default), or always. Snippets waiting for approval show with their code, Run and Reject, and their results. The agent gets a request id and fetches the result later. The setting survives launcher swaps. The launcher also replays resource subscriptions to a new build and tells the client that resources and prompts may have changed.
  • New CoreModule API: Object.FindObjectsByType, FindFirstObjectByType, FindAnyObjectByType, FindObjectOfType and FindObjectsOfType. A new find_objects conformance scenario records Unity's rules:
    • InstanceID order (the newest runtime object first);
    • inactive objects are left out unless asked for, and disabled components are included;
    • runtime ScriptableObjects count, assets don't;
    • an object destroyed with Destroy is still found that frame. 26 scenarios pass.
  • Next: .csproj generation for IDEs, precompiled plugin DLLs, JsonUtility.