@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.
- package/LICENSE +23 -0
- package/README.md +925 -0
- package/addons/godot_agent_loop/LICENSE +23 -0
- package/addons/godot_agent_loop/README.md +31 -0
- package/addons/godot_agent_loop/plugin.cfg +8 -0
- package/addons/godot_agent_loop/plugin.gd +417 -0
- package/agent-plugin/.claude-plugin/plugin.json +19 -0
- package/agent-plugin/.codex-plugin/plugin.json +37 -0
- package/agent-plugin/.mcp.json +14 -0
- package/agent-plugin/adapter-manifest.json +45 -0
- package/agent-plugin/pi/extension.ts +136 -0
- package/agent-plugin/skills/build-godot-game/SKILL.md +41 -0
- package/agent-plugin/skills/debug-godot-game/SKILL.md +37 -0
- package/agent-plugin/skills/ship-godot-game/SKILL.md +46 -0
- package/agent-plugin/skills/ship-godot-game/agents/openai.yaml +4 -0
- package/agent-plugin/skills/verify-godot-change/SKILL.md +35 -0
- package/build/authoring-session-manager.js +237 -0
- package/build/domain-tool-registries.js +207 -0
- package/build/editor-bridge-protocol.js +1 -0
- package/build/editor-connection.js +112 -0
- package/build/editor-mutation-guard.js +30 -0
- package/build/editor-plugin-installer.js +220 -0
- package/build/engine-api/extension_api-4.7.stable.official.5b4e0cb0f.json +356830 -0
- package/build/game-command-service.js +49 -0
- package/build/game-connection.js +337 -0
- package/build/godot-executable.js +156 -0
- package/build/godot-process-manager.js +112 -0
- package/build/godot-subprocess.js +23 -0
- package/build/headless-operation-runner.js +68 -0
- package/build/headless-operation-service.js +65 -0
- package/build/index.js +478 -0
- package/build/interaction-server-installer.js +234 -0
- package/build/opencode-setup.js +199 -0
- package/build/project-support.js +219 -0
- package/build/runtime-protocol.js +202 -0
- package/build/scripts/godot_operations.gd +1534 -0
- package/build/scripts/mcp_editor_plugin.gd +417 -0
- package/build/scripts/mcp_interaction_server.gd +1255 -0
- package/build/scripts/mcp_runtime/audio_animation_domain.gd +568 -0
- package/build/scripts/mcp_runtime/command_params.gd +339 -0
- package/build/scripts/mcp_runtime/core_domain.gd +591 -0
- package/build/scripts/mcp_runtime/input_domain.gd +695 -0
- package/build/scripts/mcp_runtime/networking_domain.gd +356 -0
- package/build/scripts/mcp_runtime/physics_domain.gd +653 -0
- package/build/scripts/mcp_runtime/privileged_command_policy.gd +81 -0
- package/build/scripts/mcp_runtime/rendering_domain.gd +807 -0
- package/build/scripts/mcp_runtime/runtime_domain.gd +108 -0
- package/build/scripts/mcp_runtime/scene_2d_domain.gd +527 -0
- package/build/scripts/mcp_runtime/scene_3d_domain.gd +573 -0
- package/build/scripts/mcp_runtime/system_domain.gd +277 -0
- package/build/scripts/mcp_runtime/ui_domain.gd +619 -0
- package/build/scripts/mcp_runtime/variant_codec.gd +335 -0
- package/build/scripts/validate_script.gd +28 -0
- package/build/server-instructions.js +11 -0
- package/build/session-timing.js +20 -0
- package/build/tool-argument-validation.js +120 -0
- package/build/tool-definitions.js +2727 -0
- package/build/tool-handlers/game-tool-handlers.js +1345 -0
- package/build/tool-handlers/lifecycle-tool-handlers.js +346 -0
- package/build/tool-handlers/project-handler-services.js +1458 -0
- package/build/tool-handlers/project-tool-handlers.js +1506 -0
- package/build/tool-handlers/visual-regression-service.js +139 -0
- package/build/tool-manifest.js +1193 -0
- package/build/tool-mutation-policy.js +122 -0
- package/build/tool-registry.js +34 -0
- package/build/tool-surface.js +70 -0
- package/build/utils.js +273 -0
- package/package.json +110 -0
- package/product.json +52 -0
- package/scripts/prepare-package.js +42 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/** Versioned JSON-RPC 2.0 contract for the Godot runtime TCP endpoint. */
|
|
2
|
+
export const RUNTIME_PROTOCOL_VERSION = '1.0';
|
|
3
|
+
export const RUNTIME_CAPABILITIES = ['runtime-commands', 'godot-json-values'];
|
|
4
|
+
export const AUTHORING_COMMANDS_CAPABILITY = 'authoring-commands';
|
|
5
|
+
export const RENDERING_CONTEXT_CAPABILITY = 'rendering-context';
|
|
6
|
+
export const HANDSHAKE_METHOD = 'godot.runtime.handshake';
|
|
7
|
+
export const COMMAND_METHOD_PREFIX = 'godot.runtime.';
|
|
8
|
+
export const CANCEL_METHOD = 'godot.runtime.cancel';
|
|
9
|
+
export const CANCELLABLE_RUNTIME_COMMANDS = ['wait', 'await_signal', 'resource', 'http_request'];
|
|
10
|
+
export const PRIVILEGED_RUNTIME_CAPABILITY = 'privileged-commands';
|
|
11
|
+
export const SESSION_AUTHENTICATION_CAPABILITY = 'session-authentication';
|
|
12
|
+
export const PRIVILEGED_RUNTIME_GROUPS = ['reflection', 'code-execution', 'network'];
|
|
13
|
+
export const PRIVILEGED_RUNTIME_COMMANDS = [
|
|
14
|
+
'call_method',
|
|
15
|
+
'eval',
|
|
16
|
+
'get_property',
|
|
17
|
+
'http_request',
|
|
18
|
+
'rpc',
|
|
19
|
+
'script',
|
|
20
|
+
'set_property',
|
|
21
|
+
'websocket',
|
|
22
|
+
];
|
|
23
|
+
export const PRIVILEGED_RUNTIME_COMMAND_GROUPS = {
|
|
24
|
+
call_method: 'reflection',
|
|
25
|
+
eval: 'code-execution',
|
|
26
|
+
get_property: 'reflection',
|
|
27
|
+
http_request: 'network',
|
|
28
|
+
rpc: 'network',
|
|
29
|
+
script: 'code-execution',
|
|
30
|
+
set_property: 'reflection',
|
|
31
|
+
websocket: 'network',
|
|
32
|
+
};
|
|
33
|
+
export function privilegedGroupCapability(group) {
|
|
34
|
+
return `privileged-${group}`;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Every runtime command in the published contract, sorted. The manifest of
|
|
38
|
+
* record is `x-runtime-contract.commands` in docs/runtime-api.schema.json;
|
|
39
|
+
* this mirror lets the TypeScript binding reject unknown commands before they
|
|
40
|
+
* reach the wire, and the contract test verifies the two never drift.
|
|
41
|
+
*/
|
|
42
|
+
export const RUNTIME_COMMANDS = [
|
|
43
|
+
'3d_effects',
|
|
44
|
+
'add_collision',
|
|
45
|
+
'animation_control',
|
|
46
|
+
'animation_tree',
|
|
47
|
+
'audio_bus',
|
|
48
|
+
'audio_bus_layout',
|
|
49
|
+
'audio_effect',
|
|
50
|
+
'audio_play',
|
|
51
|
+
'audio_spatial',
|
|
52
|
+
'await_signal',
|
|
53
|
+
'bone_pose',
|
|
54
|
+
'call_method',
|
|
55
|
+
'camera_attributes',
|
|
56
|
+
'canvas',
|
|
57
|
+
'canvas_draw',
|
|
58
|
+
'change_scene',
|
|
59
|
+
'click',
|
|
60
|
+
'connect_signal',
|
|
61
|
+
'create_animation',
|
|
62
|
+
'create_joint',
|
|
63
|
+
'create_timer',
|
|
64
|
+
'csg',
|
|
65
|
+
'debug_draw',
|
|
66
|
+
'disconnect_signal',
|
|
67
|
+
'emit_signal',
|
|
68
|
+
'environment',
|
|
69
|
+
'eval',
|
|
70
|
+
'find_nodes_by_class',
|
|
71
|
+
'gamepad',
|
|
72
|
+
'get_audio',
|
|
73
|
+
'get_camera',
|
|
74
|
+
'get_node_info',
|
|
75
|
+
'get_nodes_in_group',
|
|
76
|
+
'get_performance',
|
|
77
|
+
'get_property',
|
|
78
|
+
'get_scene_tree',
|
|
79
|
+
'get_ui_elements',
|
|
80
|
+
'gi',
|
|
81
|
+
'gridmap',
|
|
82
|
+
'http_request',
|
|
83
|
+
'input_action',
|
|
84
|
+
'input_state',
|
|
85
|
+
'instantiate_scene',
|
|
86
|
+
'key_hold',
|
|
87
|
+
'key_press',
|
|
88
|
+
'key_release',
|
|
89
|
+
'light_2d',
|
|
90
|
+
'light_3d',
|
|
91
|
+
'list_signals',
|
|
92
|
+
'locale',
|
|
93
|
+
'manage_group',
|
|
94
|
+
'mesh_instance',
|
|
95
|
+
'mouse_drag',
|
|
96
|
+
'mouse_move',
|
|
97
|
+
'multimesh',
|
|
98
|
+
'multiplayer',
|
|
99
|
+
'navigate_path',
|
|
100
|
+
'navigation_3d',
|
|
101
|
+
'os_info',
|
|
102
|
+
'parallax',
|
|
103
|
+
'path_2d',
|
|
104
|
+
'path_3d',
|
|
105
|
+
'pause',
|
|
106
|
+
'physics_2d',
|
|
107
|
+
'physics_3d',
|
|
108
|
+
'physics_body',
|
|
109
|
+
'play_animation',
|
|
110
|
+
'procedural_mesh',
|
|
111
|
+
'process_mode',
|
|
112
|
+
'raycast',
|
|
113
|
+
'remove_node',
|
|
114
|
+
'render_settings',
|
|
115
|
+
'reparent_node',
|
|
116
|
+
'resource',
|
|
117
|
+
'rpc',
|
|
118
|
+
'screenshot',
|
|
119
|
+
'script',
|
|
120
|
+
'scroll',
|
|
121
|
+
'serialize_state',
|
|
122
|
+
'set_camera',
|
|
123
|
+
'set_particles',
|
|
124
|
+
'set_property',
|
|
125
|
+
'set_shader_param',
|
|
126
|
+
'shape_2d',
|
|
127
|
+
'skeleton_ik',
|
|
128
|
+
'sky',
|
|
129
|
+
'spawn_node',
|
|
130
|
+
'terrain',
|
|
131
|
+
'tilemap',
|
|
132
|
+
'time_scale',
|
|
133
|
+
'touch',
|
|
134
|
+
'tween_property',
|
|
135
|
+
'ui_control',
|
|
136
|
+
'ui_item_list',
|
|
137
|
+
'ui_menu',
|
|
138
|
+
'ui_popup',
|
|
139
|
+
'ui_range',
|
|
140
|
+
'ui_tabs',
|
|
141
|
+
'ui_text',
|
|
142
|
+
'ui_theme',
|
|
143
|
+
'ui_tree',
|
|
144
|
+
'video',
|
|
145
|
+
'viewport',
|
|
146
|
+
'visual_shader',
|
|
147
|
+
'wait',
|
|
148
|
+
'websocket',
|
|
149
|
+
'window',
|
|
150
|
+
'world_settings',
|
|
151
|
+
];
|
|
152
|
+
const RUNTIME_COMMAND_SET = new Set(RUNTIME_COMMANDS);
|
|
153
|
+
/**
|
|
154
|
+
* File-backed operations exposed only by the harness-owned authoring session.
|
|
155
|
+
* They share the runtime transport, but remain distinct from game commands so
|
|
156
|
+
* tools can migrate from the subprocess backend one at a time.
|
|
157
|
+
*/
|
|
158
|
+
export const AUTHORING_COMMANDS = [
|
|
159
|
+
'authoring_add_node',
|
|
160
|
+
'authoring_attach_script',
|
|
161
|
+
'authoring_create_resource',
|
|
162
|
+
'authoring_create_scene',
|
|
163
|
+
'authoring_export_mesh_library',
|
|
164
|
+
'authoring_get_uid',
|
|
165
|
+
'authoring_load_sprite',
|
|
166
|
+
'authoring_manage_resource',
|
|
167
|
+
'authoring_manage_scene_signals',
|
|
168
|
+
'authoring_manage_scene_structure',
|
|
169
|
+
'authoring_manage_theme_resource',
|
|
170
|
+
'authoring_modify_node',
|
|
171
|
+
'authoring_read_scene',
|
|
172
|
+
'authoring_remove_node',
|
|
173
|
+
'authoring_resave_resources',
|
|
174
|
+
'authoring_save_scene',
|
|
175
|
+
];
|
|
176
|
+
export const SESSION_COMMANDS = [...RUNTIME_COMMANDS, ...AUTHORING_COMMANDS].sort();
|
|
177
|
+
const AUTHORING_COMMAND_SET = new Set(AUTHORING_COMMANDS);
|
|
178
|
+
export function isRuntimeCommand(command) {
|
|
179
|
+
return RUNTIME_COMMAND_SET.has(command);
|
|
180
|
+
}
|
|
181
|
+
export function isAuthoringCommand(command) {
|
|
182
|
+
return AUTHORING_COMMAND_SET.has(command);
|
|
183
|
+
}
|
|
184
|
+
export function isSessionCommand(command) {
|
|
185
|
+
return isRuntimeCommand(command) || isAuthoringCommand(command);
|
|
186
|
+
}
|
|
187
|
+
export function commandMethod(command) { return `${COMMAND_METHOD_PREFIX}${command}`; }
|
|
188
|
+
export function isJsonRpcResponse(value) {
|
|
189
|
+
if (!value || typeof value !== 'object')
|
|
190
|
+
return false;
|
|
191
|
+
const response = value;
|
|
192
|
+
return response.jsonrpc === '2.0'
|
|
193
|
+
&& (typeof response.id === 'number' || typeof response.id === 'string' || response.id === null)
|
|
194
|
+
&& (Object.hasOwn(response, 'result') || typeof response.error === 'object');
|
|
195
|
+
}
|
|
196
|
+
export function isHandshakeResult(value) {
|
|
197
|
+
if (!value || typeof value !== 'object')
|
|
198
|
+
return false;
|
|
199
|
+
const result = value;
|
|
200
|
+
return typeof result.protocolVersion === 'string' && Array.isArray(result.capabilities)
|
|
201
|
+
&& result.capabilities.every(capability => typeof capability === 'string');
|
|
202
|
+
}
|