@beremaran/godot-agent-loop 1.0.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 (70) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +925 -0
  3. package/addons/godot_agent_loop/LICENSE +23 -0
  4. package/addons/godot_agent_loop/README.md +31 -0
  5. package/addons/godot_agent_loop/plugin.cfg +8 -0
  6. package/addons/godot_agent_loop/plugin.gd +417 -0
  7. package/agent-plugin/.claude-plugin/plugin.json +19 -0
  8. package/agent-plugin/.codex-plugin/plugin.json +37 -0
  9. package/agent-plugin/.mcp.json +14 -0
  10. package/agent-plugin/adapter-manifest.json +45 -0
  11. package/agent-plugin/pi/extension.ts +136 -0
  12. package/agent-plugin/skills/build-godot-game/SKILL.md +41 -0
  13. package/agent-plugin/skills/debug-godot-game/SKILL.md +37 -0
  14. package/agent-plugin/skills/ship-godot-game/SKILL.md +46 -0
  15. package/agent-plugin/skills/ship-godot-game/agents/openai.yaml +4 -0
  16. package/agent-plugin/skills/verify-godot-change/SKILL.md +35 -0
  17. package/build/authoring-session-manager.js +237 -0
  18. package/build/domain-tool-registries.js +207 -0
  19. package/build/editor-bridge-protocol.js +1 -0
  20. package/build/editor-connection.js +112 -0
  21. package/build/editor-mutation-guard.js +30 -0
  22. package/build/editor-plugin-installer.js +220 -0
  23. package/build/engine-api/extension_api-4.7.stable.official.5b4e0cb0f.json +356830 -0
  24. package/build/game-command-service.js +49 -0
  25. package/build/game-connection.js +337 -0
  26. package/build/godot-executable.js +156 -0
  27. package/build/godot-process-manager.js +112 -0
  28. package/build/godot-subprocess.js +23 -0
  29. package/build/headless-operation-runner.js +68 -0
  30. package/build/headless-operation-service.js +65 -0
  31. package/build/index.js +478 -0
  32. package/build/interaction-server-installer.js +234 -0
  33. package/build/opencode-setup.js +199 -0
  34. package/build/project-support.js +219 -0
  35. package/build/runtime-protocol.js +202 -0
  36. package/build/scripts/godot_operations.gd +1534 -0
  37. package/build/scripts/mcp_editor_plugin.gd +417 -0
  38. package/build/scripts/mcp_interaction_server.gd +1255 -0
  39. package/build/scripts/mcp_runtime/audio_animation_domain.gd +568 -0
  40. package/build/scripts/mcp_runtime/command_params.gd +339 -0
  41. package/build/scripts/mcp_runtime/core_domain.gd +591 -0
  42. package/build/scripts/mcp_runtime/input_domain.gd +695 -0
  43. package/build/scripts/mcp_runtime/networking_domain.gd +356 -0
  44. package/build/scripts/mcp_runtime/physics_domain.gd +653 -0
  45. package/build/scripts/mcp_runtime/privileged_command_policy.gd +81 -0
  46. package/build/scripts/mcp_runtime/rendering_domain.gd +807 -0
  47. package/build/scripts/mcp_runtime/runtime_domain.gd +108 -0
  48. package/build/scripts/mcp_runtime/scene_2d_domain.gd +527 -0
  49. package/build/scripts/mcp_runtime/scene_3d_domain.gd +573 -0
  50. package/build/scripts/mcp_runtime/system_domain.gd +277 -0
  51. package/build/scripts/mcp_runtime/ui_domain.gd +619 -0
  52. package/build/scripts/mcp_runtime/variant_codec.gd +335 -0
  53. package/build/scripts/validate_script.gd +28 -0
  54. package/build/server-instructions.js +11 -0
  55. package/build/session-timing.js +20 -0
  56. package/build/tool-argument-validation.js +120 -0
  57. package/build/tool-definitions.js +2727 -0
  58. package/build/tool-handlers/game-tool-handlers.js +1345 -0
  59. package/build/tool-handlers/lifecycle-tool-handlers.js +346 -0
  60. package/build/tool-handlers/project-handler-services.js +1458 -0
  61. package/build/tool-handlers/project-tool-handlers.js +1506 -0
  62. package/build/tool-handlers/visual-regression-service.js +139 -0
  63. package/build/tool-manifest.js +1193 -0
  64. package/build/tool-mutation-policy.js +122 -0
  65. package/build/tool-registry.js +34 -0
  66. package/build/tool-surface.js +70 -0
  67. package/build/utils.js +273 -0
  68. package/package.json +110 -0
  69. package/product.json +52 -0
  70. package/scripts/prepare-package.js +42 -0
@@ -0,0 +1,81 @@
1
+ extends RefCounted
2
+
3
+ # Trust policy for runtime commands that can execute arbitrary code, invoke
4
+ # arbitrary engine APIs, mutate scripts, call peers, or reach external hosts.
5
+ # Authentication proves possession of the per-launch session secret; this
6
+ # separate least-privilege gate still keeps dangerous commands disabled unless
7
+ # the project owner explicitly opts in.
8
+
9
+ const CAPABILITY: String = "privileged-commands"
10
+ const ENVIRONMENT_VARIABLE: String = "GODOT_MCP_ALLOW_PRIVILEGED_COMMANDS"
11
+ const GROUP_ENVIRONMENT_VARIABLE: String = "GODOT_MCP_PRIVILEGED_GROUPS"
12
+ const ERROR_CODE: int = -32007
13
+ const GROUPS: Array[String] = ["reflection", "code-execution", "network"]
14
+ const COMMANDS: Array[String] = [
15
+ "call_method",
16
+ "eval",
17
+ "get_property",
18
+ "http_request",
19
+ "rpc",
20
+ "script",
21
+ "set_property",
22
+ "websocket",
23
+ ]
24
+ const COMMAND_GROUPS: Dictionary = {
25
+ "call_method": "reflection",
26
+ "eval": "code-execution",
27
+ "get_property": "reflection",
28
+ "http_request": "network",
29
+ "rpc": "network",
30
+ "script": "code-execution",
31
+ "set_property": "reflection",
32
+ "websocket": "network",
33
+ }
34
+
35
+
36
+ func is_privileged(command: String) -> bool:
37
+ return COMMANDS.has(command)
38
+
39
+
40
+ func is_enabled(command: String, explicit_opt_in: bool) -> bool:
41
+ return enabled_groups(explicit_opt_in).has(group_for(command))
42
+
43
+
44
+ func enabled_groups(explicit_opt_in: bool) -> Array[String]:
45
+ if explicit_opt_in:
46
+ return GROUPS.duplicate()
47
+ var environment_value: String = OS.get_environment(ENVIRONMENT_VARIABLE).strip_edges().to_lower()
48
+ if ["1", "true", "yes", "on"].has(environment_value):
49
+ return GROUPS.duplicate()
50
+ var result: Array[String] = []
51
+ for requested: String in OS.get_environment(GROUP_ENVIRONMENT_VARIABLE).split(","):
52
+ var group: String = requested.strip_edges().to_lower()
53
+ if GROUPS.has(group) and not result.has(group):
54
+ result.append(group)
55
+ return result
56
+
57
+
58
+ func group_for(command: String) -> String:
59
+ return str(COMMAND_GROUPS.get(command, ""))
60
+
61
+
62
+ func capabilities(base_capabilities: Array[String], explicit_opt_in: bool) -> Array[String]:
63
+ var result: Array[String] = base_capabilities.duplicate()
64
+ var groups: Array[String] = enabled_groups(explicit_opt_in)
65
+ for group: String in groups:
66
+ result.append("privileged-%s" % group)
67
+ if groups.size() == GROUPS.size():
68
+ result.append(CAPABILITY)
69
+ return result
70
+
71
+
72
+ func denial_details(command: String) -> Dictionary:
73
+ var group: String = group_for(command)
74
+ return {
75
+ "reason": "privileged_command_disabled",
76
+ "command": command,
77
+ "group": group,
78
+ "capability": "privileged-%s" % group,
79
+ "enable_group_with": "%s=%s" % [GROUP_ENVIRONMENT_VARIABLE, group],
80
+ "enable_all_with": ENVIRONMENT_VARIABLE,
81
+ }