# runtime

> 启动编辑器、运行/停止项目、获取调试输出、运行测试、获取 Godot 版本。

| 属性 | 值 |
|------|-----|
| 所属层 | bridge |
| 安全级别 | danger-api |
| 需要 Godot | 是 |
| 需要编辑器 | 否 |
| 只读 | 否 |
| 长耗时 | 是 |

## Actions

- `launch_editor`
- `run_project`
- `stop_project`
- `get_debug_output`
- `run_tests`
- `get_godot_version`
- `record_start`
- `record_stop`
- `record_save`
- `record_load`
- `record_play`

## Parameters

| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| `action` | enum (11 项) | ✓ | 操作类型 |
| `project_path` | string |  | Godot 项目目录路径（可选，默认使用 GODOT_PROJECT_PATH 环境变量或当前目录） |
| `timeout` | number |  | 自动停止秒数（默认 30。游戏冷启动 >30s 的项目传更大值如 120；wait_for_bridge 时自动取 max(bridge_timeout+10, timeout) 防与 bridge 就绪 race） |
| `wait_for_bridge` | boolean |  | true 时 spawn 后轮询 bridge 就绪(默认 false,向后兼容) |
| `profiling` | boolean |  | true 时 spawn 前绑 debugger 端口并传 --remote-debug(函数级 profiling 前置;之后用 profiler 工具 action=capture_functions 采样;仅 spawn 模式,attach/已运行会话无 debugger 通道) |
| `bridge_timeout` | number |  | wait_for_bridge 轮询总预算(秒,默认 10) |
| `test_script` | string |  | 测试脚本或目录路径（默认 res://test/） |
| `quit_flag` | enum: gquit | gexit |  | run_tests 的 GUT 退出标志。默认 gquit(GUT ≤9.5);GUT 9.6+ 移除 -gquit(报 Unknown arguments: -gquit)时切 gexit |
| `events_json` | string |  | 录制：JSON 格式的事件序列字符串 |
| `file_name` | string |  | 录制保存:始终自动命名 recording_YYYYMMDD_HHmmss.json(file_name 入参被忽略);但 file_name 须匹配 recording_*.json 格式(否则 INVALID_FILE_NAME),禁止含 / \\ .. |
| `speed` | number |  | 录制：回放速度倍率（默认 1.0） |
| `load_autoloads` | boolean |  | 是否加载 Autoload 上下文（默认 true） |
| `godot_path` | string |  | 覆盖 Godot 二进制路径（可选，优先于项目配置和环境变量） |

## 风险分布

读 3 / 写 4 / 进程 4

---
<!-- AUTO-GENERATED by scripts/gen-tool-docs.mjs from capability-matrix.json v0.32.21. DO NOT edit manually; re-run npm run gen:tool-docs after tool changes. -->
