Files
Genarrative/plugins
suzmii 2965023337
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 2m36s
Project CI / Backend tests (pull_request) Failing after 54s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 4m10s
Project CI / Repository checks (pull_request) Failing after 22s
Project CI / AI game creator shell Rust crates (pull_request) Failing after 4m58s
Project CI / Frontend tests (pull_request) Successful in 3m59s
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
fix(agc): 修 Linux 目标下被新警告门禁判死的两个插件 crate(CI 红因)
根因(CI run 3572 的 job 日志):godot-editor-bridge 的 src/files.rs:346 `pub fn verified_module_path` 在 Linux 库构建里无调用方(唯一库内调用点在 platform.rs 的 #[cfg(windows)] 分支),被切片一新增的 [lints.rust] warnings = "deny" 判为 `-D dead-code` 错误;5 个 job(Rust lane 1/2、lane 2/2、Rust crates、Native shell tests、Repository checks)全部死在这一条上。

修法(godot):给 `verified_module_path` 加 `#[cfg(any(windows, test))]` 并补 3 行文档说明——Windows 库路径才是它的活调用方,跨平台单测 official_loader_copy_requires_exact_parent_and_trusted_bytes 继续在 Linux 覆盖该逻辑;不新增 allow、不删测试、不改实现。

修法(unity):tests/protocol.rs 里 Windows-only 用例(shared_service_executes_serially_and_retains_uncertain_state_across_instances)专用的 2 条 import(editor_adapter_api::EditorAdapter、unity_editor_bridge::{configure_helper_candidates, disconnect_unity_editor, execute_unity_editor_code_for_project, UnityEditorAdapter})与 `fn project()` helper 补上与该用例一致的 `#[cfg(all(windows, target_arch = "x86_64"))]`;Linux 侧仍保留 helper_timeout_eof_oversized_frame_and_blocked_write_are_bounded 用例。

验证(本地复现 CI 的 Linux 口径:cargo check --target x86_64-unknown-linux-gnu --all-targets + 门禁):godot bridge RC=0、unity bridge RC=0、cocos bridge RC=0;3 个 exclude crate(agent-runtime-core / agent-runtime-orchestration / editor-adapter-api)RC=0;platform-agent 仅因本机缺 x86_64-linux-gnu-gcc 交叉编译器而失败(环境性,CI 原生 Linux 构建)。

验证(Windows 口径不变):unity bridge --all-targets RC=0、godot bridge --all-targets RC=0;godot 单测 30 passed(含受影响用例)、unity 单测 12 passed + 集成 3 passed,全 0 failed。

验证(仓库检查):npm run check:rustfmt(4 个 workspace)rc=0、npm run check:encoding rc=0(5406 文件)、git diff --check rc=0;零新增 #[allow]。
2026-10-06 18:40:27 +08:00
..

AGC 插件工作区

本目录是 AGC 插件的工作区,每个一级子目录是一个 Agent Plugins 包,随 AGC 客户端分发。

plugins/
├─ agc-godot-editor/      Godot GDExtension 编辑器桥接(Windows x64)
│  ├─ src/               AGC 插件协议入口
│  └─ native/            GDExtension 载荷、实例缓存与 EditorAdapter
├─ agc-unity-editor/      Unity Mono 编辑器桥接(Windows x64)
│  ├─ src/               AGC 插件协议入口
│  ├─ native/            通用 EditorAdapter 与 helper 生命周期
│  └─ dotnet/            固定版本 DotCraft Attach、helper、许可与构建脚本
└─ agc-cocos-editor/
   ├─ plugin.json          Agent Plugins 标准清单 + AGC Runtime 扩展
   ├─ package.json         npm workspace 成员,声明 SDK 版本契约
   ├─ panels/              自包含面板 HTML
   ├─ src/                 运行时入口与适配器翻译
   └─ native/              插件自带 native 模块(Cargo 包)

清单格式

plugin.json 使用 OpenAI Agent Plugins 标准 schema,AGC 专属字段放在 extensions.world.genarrative.agc:

{
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
  "name": "agc-cocos-editor",
  "version": "0.1.0",
  "extensions": {
    "com.openai": {
      "interface": { "displayName": "Cocos Creator 编辑器桥接" }
    },
    "world.genarrative.agc": {
      "apiVersion": "v1",
      "entry": "./src/entry.mjs",
      "adapter": "cocos-editor",
      "permissions": [
        "events.subscribe",
        "editor.rpc",
        "ui.register",
        "capability.register"
      ],
      "panels": []
    }
  }
}

约束与通用宿主一致:插件目录内最多一个 Plugin;entry 必须是包内普通文件; 未知权限、非法入口或不支持的 apiVersion 会让插件进入 invalid 状态,不启动进程。

宿主如何加载

宿主按以下顺序解析插件工作区,任一命中即生效:

  1. 环境变量 AGC_PLUGIN_WORKSPACE(本地联调与测试)。
  2. 随包资源目录 <resource_dir>/plugins(安装包)。
  3. 开发构建的仓库 plugins/ 目录。

工作区插件是内置插件:随客户端分发、不能卸载,只能通过可用开关控制是否生效。 开关状态保存在 AppData extensions/builtin-plugins.json,内置插件优先级高于同名 导入插件,不会被 AppData 覆盖或删除。插件运行入口由宿主以插件目录为 cwd 启动 (.mjs 用系统 node,其它入口直接执行),stdio 上使用一行一个 JSON-RPC 2.0 消息。

新增插件

  1. 新建 plugins/<kebab-case-name>/,写 plugin.json,name 与目录名保持一致。
  2. 运行时插件提供 src/entry.mjs,按 agc.plugin.v1 协议注册命令、面板和能力; 仅打包 Skill/MCP 的插件可以没有 entry,宿主会按 package 状态展示。
  3. 需要编辑器原生能力时,在 native/ 下放插件自己的 Cargo 包,并实现 editor-adapter-api 的 EditorAdapter;plugin.json 的 adapter 字段必须与 EditorAdapter::id() 一致。
  4. 在根 package.json、scripts/check-npm-workspaces.mjs 登记 workspace 成员。
  5. 更新 docs/technical/ 里的插件或编辑器方案文档。

Unity 插件沿用相同开关与项目门禁。Windows 开发/发行的 unity-editor-execute feature 会构建自包含 Attach helper,并只将运行文件与许可放入 staging;构建机需要 .NET 10 SDK 与 Visual Studio C++ x64 工具链,最终用户不需另装这两项。 源码来源、执行归属和验收边界见 [Unity 插件接入](../docs/technical/【技术方案】AGC Unity编辑器插件接入-2026-09-18.md)。

Godot 插件通过 godot-editor-execute feature 构建并校验 GDExtension 载荷,只分发 运行入口、DLL、元数据及许可。原生引导使用固定版本的官方 godot-cpp;构建机需要 Visual Studio C++ x64、CMake 和 Python,首次构建下载并校验绑定源码。DLL 原件留在安装资源, 每个编辑器的临时加载副本放在 AGC 私有缓存。连接时维护工程内受管 .gdextension 引用及其 UID,通过 Godot 聚焦扫描首次加载。文件归属、真实执行和卸载规则见 Godot 插件接入。