@beremaran/godot-agent-loop 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +59 -34
  2. package/addons/godot_agent_loop/README.md +26 -16
  3. package/addons/godot_agent_loop/plugin.cfg +3 -2
  4. package/addons/godot_agent_loop/plugin.gd +840 -25
  5. package/agent-plugin/.claude-plugin/plugin.json +1 -1
  6. package/agent-plugin/.codex-plugin/plugin.json +1 -1
  7. package/agent-plugin/.mcp.json +1 -1
  8. package/agent-plugin/adapter-manifest.json +3 -3
  9. package/agent-plugin/pi/extension.ts +1 -1
  10. package/agent-plugin/skills/build-godot-game/SKILL.md +26 -5
  11. package/agent-plugin/skills/debug-godot-game/SKILL.md +20 -7
  12. package/agent-plugin/skills/ship-godot-game/SKILL.md +13 -3
  13. package/agent-plugin/skills/verify-godot-change/SKILL.md +17 -2
  14. package/build/authoring-session-manager.js +24 -1
  15. package/build/domain-tool-registries.js +5 -1
  16. package/build/editor-authoring-router.js +228 -0
  17. package/build/editor-bridge-protocol.js +2 -1
  18. package/build/editor-connection.js +29 -24
  19. package/build/editor-mutation-guard.js +3 -1
  20. package/build/editor-plugin-installer.js +2 -1
  21. package/build/editor-session-registry.js +392 -0
  22. package/build/editor-sync-queue.js +135 -0
  23. package/build/index.js +208 -29
  24. package/build/lifecycle-trace.js +80 -0
  25. package/build/scripts/mcp_editor_plugin.gd +840 -25
  26. package/build/scripts/mcp_interaction_server.gd +76 -2
  27. package/build/scripts/mcp_runtime/core_domain.gd +2 -1
  28. package/build/scripts/mcp_runtime/system_domain.gd +2 -0
  29. package/build/server-instructions.js +5 -5
  30. package/build/session-timing.js +17 -1
  31. package/build/tool-definitions.js +99 -6
  32. package/build/tool-handlers/game-tool-handlers.js +21 -4
  33. package/build/tool-handlers/lifecycle-tool-handlers.js +361 -27
  34. package/build/tool-handlers/project-handler-services.js +45 -6
  35. package/build/tool-handlers/project-tool-handlers.js +4 -4
  36. package/build/tool-manifest.js +29 -1
  37. package/build/tool-mutation-policy.js +1 -0
  38. package/build/tool-surface.js +4 -4
  39. package/build/utils.js +2 -2
  40. package/package.json +4 -3
  41. package/product.json +7 -5
package/README.md CHANGED
@@ -7,7 +7,7 @@ An MCP automation loop for Godot 4.
7
7
  [![npm version](https://img.shields.io/npm/v/%40beremaran%2Fgodot-agent-loop)](https://www.npmjs.com/package/@beremaran/godot-agent-loop)
8
8
  [![Godot integration tests](https://github.com/beremaran/godot-agent-loop/actions/workflows/godot-integration.yml/badge.svg)](https://github.com/beremaran/godot-agent-loop/actions/workflows/godot-integration.yml)
9
9
  <!-- generated-coverage-badge:start -->
10
- [![E2E tools: 167/167](https://img.shields.io/badge/E2E_tools-167%2F167-brightgreen)](docs/coverage/coverage-report.md)
10
+ [![E2E tools: 171/171](https://img.shields.io/badge/E2E_tools-171%2F171-brightgreen)](docs/coverage/coverage-report.md)
11
11
  <!-- generated-coverage-badge:end -->
12
12
  [![MCP Server](https://badge.mcpx.dev?type=server 'MCP Server')](https://modelcontextprotocol.io/introduction)
13
13
  [![Made with Godot](https://img.shields.io/badge/Made%20with-Godot-478CBF?style=flat&logo=godot%20engine&logoColor=white)](https://godotengine.org)
@@ -36,20 +36,21 @@ claude mcp add godot-agent-loop -- npx -y @beremaran/godot-agent-loop
36
36
  ```
37
37
 
38
38
  Then point the agent at a project directory—or an empty directory—and describe
39
- the playable result. The compact default surface exposes 39 tools for the loop
39
+ the playable result. The compact default surface exposes 40 tools for the loop
40
40
  above; the `godot_tools` meta-tool searches, describes, and dispatches the full
41
- 167-tool catalog on demand. Runtime and editor bridges are installed
42
- transiently and cleaned up automatically.
41
+ 171-tool catalog on demand. Runtime injection is transient; watched projects
42
+ can use the optional persistent editor addon.
43
43
 
44
44
  Using Cline, Cursor, or another MCP client? See
45
45
  [Configuration](#configuration).
46
46
 
47
47
  ## Proof before claims
48
48
 
49
- - **167/167 tools** exercised through the complete MCP-to-Godot path, with
50
- **358 public actions** traced to resolving tests; see the generated
49
+ - **171/171 tools** exercised through the complete MCP-to-Godot path, with
50
+ **365 public actions** traced to resolving tests; see the generated
51
51
  [coverage report](docs/coverage/coverage-report.md).
52
- - **201 full-path MCP E2E tests** run against real Godot builds in CI.
52
+ - **171/171 tools have full-path MCP E2E coverage**, with the complete serial
53
+ real-Godot matrix enforced in CI.
53
54
  - A cold agent built and independently verified a playable win/lose game with
54
55
  zero human corrections, in under seven minutes, using 103 MCP calls and no
55
56
  built-in tools; see the [launch evidence](docs/launch/launch-evidence.md) and
@@ -57,17 +58,18 @@ Using Cline, Cursor, or another MCP client? See
57
58
  - Privileged reflection, code execution, and networking groups are denied by
58
59
  default, and the editor provides a human **Pause Agent** control.
59
60
 
60
- Support is deliberately bounded: Godot 4.4 is the compatibility floor and 4.7
61
- the primary target; editor UI/rendering depth is verified on Linux, while
62
- Windows and macOS receive the documented portable acceptance path. Full
63
- debugger automation, native extension builds, and unbounded engine control are
64
- not claimed. Details in the
61
+ Support is deliberately bounded: Godot 4.7 is both the compatibility floor and
62
+ the primary target. Editor attachment is verified on Linux CI and in a headed
63
+ macOS 4.7.1 acceptance run; Windows retains the documented portable acceptance
64
+ path but not an editor-UI claim. Full debugger automation, native extension
65
+ builds, and unbounded engine control are not claimed. Details in the
65
66
  [verified support boundary](#verified-support-boundary).
66
67
 
67
68
  ## Highlights
68
69
 
69
- - **Author without running** — create and edit scenes, nodes, scripts,
70
- resources, shaders, and project settings directly in project files.
70
+ - **Author with or without an editor** — attach securely to a normally opened
71
+ project for undoable scene/resource transactions, or retain detached and CI
72
+ authoring with explicit synchronization metadata.
71
73
  - **Run and observe** — launch the game, capture logs and errors
72
74
  incrementally, take screenshots, and run visual-regression comparisons with
73
75
  baselines, masks, and retained diffs.
@@ -81,9 +83,10 @@ not claimed. Details in the
81
83
  - **Reach into the runtime** — inspect and manipulate any node, signal,
82
84
  animation, physics body, or UI control through 100+ runtime tools;
83
85
  `game_eval` executes GDScript with `await` support (privileged, opt-in).
84
- - **Drive the editor** — `editor_control` applies reversible edits through
85
- `EditorUndoRedoManager`, with a live Agent Activity dock and a human
86
- **Pause Agent** lock.
86
+ - **Drive the editor** — `editor_session ensure` discovers the matching
87
+ project, editor-routed tools and `editor_transaction` apply reversible edits
88
+ through `EditorUndoRedoManager`, and the Agent Activity dock replays the
89
+ bounded correlated trace with a human **Pause Agent** lock.
87
90
  - **.NET / C# support** — scaffold C# projects with a `Godot.NET.Sdk` matched
88
91
  to your installed Godot, generate idiomatic scripts, and restore/build/run
89
92
  via `verify_dotnet_project`.
@@ -93,7 +96,7 @@ not claimed. Details in the
93
96
 
94
97
  ## Tool catalog
95
98
 
96
- The full inventory of 167 tools — runtime interaction, scene authoring,
99
+ The full inventory of 171 tools — runtime interaction, scene authoring,
97
100
  project management, verification, 2D/3D rendering, audio, UI, networking, and
98
101
  more — lives in [docs/tools.md](docs/tools.md). Per-tool verification status
99
102
  and test references are in the generated
@@ -101,8 +104,7 @@ and test references are in the generated
101
104
 
102
105
  ## Requirements
103
106
 
104
- - [Godot Engine](https://godotengine.org/download) 4.4 or later; the latest
105
- stable release, currently Godot **4.7**, is recommended
107
+ - [Godot Engine](https://godotengine.org/download) 4.7 or later
106
108
  - (Optional) [.NET SDK](https://dotnet.microsoft.com/download) 8.0+ and the
107
109
  Godot .NET (C#) build, only if you use `create_project`'s `dotnet: true`
108
110
  flag or `create_csharp_script`
@@ -111,27 +113,28 @@ and test references are in the generated
111
113
 
112
114
  ### Godot compatibility policy
113
115
 
114
- Development targets the latest stable Godot release. The project also keeps a
115
- tested compatibility floor while the same implementation remains cleanly
116
- portable; currently, CI covers Godot 4.4 and 4.7. The floor may be raised when
117
- it blocks useful features or creates meaningful maintenance cost. In that case,
118
- the last compatible release remains available, and an older-version maintenance
119
- branch will be created only when user demand justifies maintaining it. Such a
120
- branch would receive critical fixes rather than new features.
116
+ Development targets the latest stable Godot release. Godot 4.7 is the current
117
+ compatibility floor and primary target, and CI covers that exact release. The
118
+ floor may be raised when it blocks useful features or creates meaningful
119
+ maintenance cost.
120
+ In that case, the last compatible release remains available, and an
121
+ older-version maintenance branch will be created only when user demand
122
+ justifies maintaining it. Such a branch would receive critical fixes rather
123
+ than new features.
121
124
 
122
125
  ### Verified support boundary
123
126
 
124
127
  | Area | Status | Evidence or limitation |
125
128
  | --- | --- | --- |
126
- | Linux headed (desktop or Xvfb), Godot 4.4 and 4.7 | Verified in CI | Full MCP E2E under Xvfb, direct runtime, subprocess operations, and strict script parsing |
129
+ | Linux headed (desktop or Xvfb), Godot 4.7 | Verified in CI | Full MCP E2E under Xvfb, direct runtime, subprocess operations, and strict script parsing |
127
130
  | GDScript project and running-game workflows | Verified for advertised tools | See the generated [coverage report](docs/coverage/coverage-report.md) |
128
131
  | Privileged runtime commands | Opt-in only | Disabled by default; intended for trusted localhost development |
129
- | Godot .NET/C# | Scaffold, compile, and editor-load verification | Godot .NET 4.4 and 4.7 with .NET SDK 8 |
130
- | Linux exports | Release/debug template export and smoke-run verification | Godot 4.4 and 4.7 installed templates; other targets are not claimed |
132
+ | Godot .NET/C# | Scaffold, compile, and editor-load verification | Godot .NET 4.7 with .NET SDK 8 |
133
+ | Linux exports | Release/debug template export and smoke-run verification | Godot 4.7 installed templates; other targets are not claimed |
131
134
  | Rendering and screenshots | A headed rendering context is required | Compatibility and Forward+ on Linux software rendering; display-less sessions fail fast with desktop/Xvfb remediation |
132
- | Windows and macOS | Portable acceptance verified | Godot 4.7 process, Unicode path, runtime input, window query, and teardown workflows |
133
- | Windows/macOS editor UI, rendering, and exports | Not claimed | Verified on Linux only; Windows/macOS support is bounded to the portable acceptance suite |
134
- | Editor state and undo/redo bridge | Verified in MCP E2E | The headed editor bridge is authenticated and uses `EditorInterface` plus `EditorUndoRedoManager` |
135
+ | Windows | Portable acceptance verified | Godot 4.7 process, Unicode path, runtime input, window query, and teardown workflows; editor UI, rendering, and exports are not claimed |
136
+ | macOS | Portable acceptance and attached-editor workflow verified | Godot 4.7.1 headed replay opens Godot normally, reconnects the MCP, authors and synchronizes without focus switching/manual reload, exercises undoable transactions, and cleans the discovery record; see the [interactive acceptance record](docs/coverage/interactive-golden-agent-run.json) |
137
+ | Editor state and undo/redo bridge | Verified on Linux CI and headed macOS 4.7.1 | Protocol 2 uses private per-project discovery, `EditorInterface`, and `EditorUndoRedoManager`; Windows editor UI remains outside the claimed boundary |
135
138
  | Full debugger control | Not claimed | Breakpoints, stack inspection, and frame-local evaluation remain outside the supported boundary |
136
139
  | Profiler, leak, asset, localization, and accessibility audits | Verified in MCP E2E | `game_performance` and `analyze_project_integrity` return bounded live/static evidence; native extension builds remain unsupported |
137
140
  | GDExtension builds | Not claimed | `analyze_project_integrity` inspects declarations and libraries without invoking arbitrary native toolchains |
@@ -141,6 +144,28 @@ branch would receive critical fixes rather than new features.
141
144
  The [quickstart](#quickstart) `npx` command is all most setups need. The
142
145
  sections below cover other clients and a source checkout.
143
146
 
147
+ ### Interactive editor setup
148
+
149
+ For a project the user watches, copy
150
+ [`addons/godot_agent_loop`](addons/godot_agent_loop) into the project at that
151
+ same path, enable **Godot Agent Loop** under **Project > Project Settings >
152
+ Plugins**, and restart Godot once. Thereafter Godot may be opened normally;
153
+ `editor_session` discovers the matching project without launching a duplicate.
154
+ The dock remains visible and waits cleanly when no agent is connected.
155
+
156
+ The addon publishes a private, untracked record at
157
+ `.godot/godot_agent_loop/editor-session.json` with a fresh token and ephemeral
158
+ loopback port for each editor start. The token is never returned or logged.
159
+ Multiple editors are routed by canonical project path. To uninstall, disable
160
+ the plugin, close Godot, remove `addons/godot_agent_loop`, and optionally remove
161
+ a stale `.godot/godot_agent_loop` directory. MCP cleanup removes only its own
162
+ unmodified transient bridge, never this persistent addon.
163
+
164
+ An editor already started without an enabled compatible addon cannot receive a
165
+ new `EditorPlugin` safely at runtime. Install/enable once and restart. See the
166
+ [interaction architecture](docs/architecture/editor-interaction.md) for states,
167
+ protocol migration, unsaved-conflict recovery, and fallback semantics.
168
+
144
169
  ### Portable agent bundle
145
170
 
146
171
  The repository ships one neutral bundle that starts the matching npm MCP server
@@ -283,7 +308,7 @@ the event name, runtime component, numeric session ID, and timestamp.
283
308
  | `GODOT_MCP_ALLOWED_DIRS` | Optional. Restrict `run_project` to projects under these roots (`;`, `,`, or `:` separated). When unset, any project path is allowed. |
284
309
  | `GODOT_MCP_RUNTIME_SECRET` | Optional explicit shared runtime secret. The MCP server generates a fresh 256-bit value when omitted and passes it only to Godot processes it launches. Set the same value manually only when connecting to a separately launched runtime. |
285
310
  | `GODOT_MCP_EDITOR_START_PAUSED` | Optional, default `false`. Start the editor addon's cooperative lock in human-editing mode so mutating MCP tools are refused until **Resume Agent** is pressed. |
286
- | `GODOT_MCP_TOOL_SURFACE` | Optional, default `core`. Set to `full` to advertise the complete static tool catalog instead of the compact 39-tool core, which includes `godot_tools` discovery/dispatch. |
311
+ | `GODOT_MCP_TOOL_SURFACE` | Optional, default `core`. Set to `full` to advertise the complete static tool catalog instead of the compact 40-tool core, which includes `godot_tools` discovery/dispatch. |
287
312
  | `GODOT_MCP_PRIVILEGED_GROUPS` | Optional comma-separated least-privilege grants: `reflection`, `code-execution`, and/or `network`. All are denied by default. |
288
313
  | `GODOT_MCP_ALLOW_PRIVILEGED_COMMANDS` | Optional, default `false`. Explicitly enable runtime `eval`, arbitrary property/method access, script control, RPC, HTTP, and WebSocket commands for a trusted localhost developer workflow. |
289
314
 
@@ -2,30 +2,40 @@
2
2
 
3
3
  An optional Godot 4 editor addon for
4
4
  [Godot Agent Loop](https://github.com/beremaran/godot-agent-loop). It adds a
5
- dock with authenticated connection status, live Agent Activity, human
6
- Pause/Resume Agent control, protocol and Godot compatibility diagnostics, and
7
- setup help for Claude Code, Codex, OpenCode, and Pi.
5
+ dock with authenticated connection status, live and replayed Agent Activity,
6
+ human Pause/Resume Agent control, and compatibility diagnostics.
7
+
8
+ Godot 4.7 or later is required.
8
9
 
9
10
  ## Install
10
11
 
11
- Copy `addons/godot_agent_loop/` into a Godot project, then enable **Godot Agent
12
- Loop Bridge** under **Project > Project Settings > Plugins**. Installing the
13
- addon is optional: the external MCP package creates and removes a transient
14
- bridge when this persistent addon is absent.
12
+ Install this directory as `addons/godot_agent_loop` in the Godot project, then
13
+ enable **Godot Agent Loop** under **Project > Project Settings > Plugins** and
14
+ restart the editor once. The **Agent Activity** dock remains present and says it
15
+ is waiting while no MCP is connected. Opening Godot normally is the recommended
16
+ interactive workflow; `editor_session ensure` discovers it by project.
17
+
18
+ The addon publishes a private, untracked session record at
19
+ `.godot/godot_agent_loop/editor-session.json`. It contains a fresh per-start
20
+ token and ephemeral loopback port. Do not copy or commit `.godot/`. The record
21
+ is removed on clean editor exit and stale records are rejected by the server.
15
22
 
16
- The addon listens only on loopback. It accepts commands only after a secret
17
- authenticated protocol handshake from an editor launched through Godot Agent
18
- Loop. A normally launched editor shows setup diagnostics but does not accept
19
- agent commands.
23
+ To uninstall, disable the plugin, close Godot, and remove
24
+ `addons/godot_agent_loop`. You may also remove a stale
25
+ `.godot/godot_agent_loop` directory while Godot is closed. MCP cleanup never
26
+ removes this persistent addon.
27
+
28
+ If an editor was started before the addon was installed and enabled, restart it
29
+ after installation. Godot does not expose a safe public API for loading a new
30
+ `EditorPlugin` into an already running editor.
20
31
 
21
32
  ## Human control
22
33
 
23
34
  Use **Pause Agent** before editing shared project state. Inspection remains
24
35
  available, while subsequent agent mutations are refused before dispatch. Use
25
- **Resume Agent** to return control.
36
+ **Resume Agent** to return control. An unsaved scene conflict is preserved and
37
+ reported; the addon never reloads over it.
26
38
 
27
39
  This addon does not install Node.js, an MCP client, or an AI agent. Follow the
28
- client setup in the main project documentation, then use `launch_editor` so the
29
- bridge receives its per-session authentication secret.
30
-
31
- Licensed under the MIT License; see [LICENSE](LICENSE).
40
+ client setup in the main project documentation. It is licensed under the MIT
41
+ License; see [LICENSE](LICENSE).
@@ -3,6 +3,7 @@
3
3
  name="Godot Agent Loop Bridge"
4
4
  description="Authenticated agent activity, pause control, compatibility diagnostics, and setup help for Godot Agent Loop."
5
5
  author="Berke Arslan"
6
- version="1.0.1"
6
+ version="1.1.0"
7
7
  script="plugin.gd"
8
- protocol_version="1"
8
+ protocol_version="2"
9
+ minimum_godot_version="4.7"