agent-forge.plugin.edit-coordinator
意图租约协调插件(file.coordination@1):多会话/多子代理写同一文件前先声明意图,提前暴露重叠; advisory 层,不承担写入正确性(正确性由 coding-tools 的跨进程锁与版本校验保证,见 docs/design/文件写入协调设计.md)。
提供面
file.coordination@1 service:check / reserve / release / list 四个请求(op 区分)。coding-tools 的 edit/write 在持有文件锁期间用它检查重叠;第三方可按同一磁盘布局替换实现。
file_lease 工具(非 readonly 会话注册):reserve / release / list。再次 reserve 同一路径即刷新 TTL(固定 300s),waitMs(默认 5s、上限 120s)在锁外等待冲突解除。
- 会话结束清扫:观察宿主
session.end@1,删除该 session id 名下的全部租约(只动自己的;崩溃会话仍走 TTL 自然过期)。
/conflicts 命令:列出活跃租约、孤儿临时记录与写锁恢复标记;/conflicts recover-lock <path> [--force] 是唯一的人工写锁恢复入口(损坏记录需 --force)。
配置(agent-forge.json config 面)
| 键 | 语义 |
cwd | 路径解析基准目录(缺省进程 cwd) |
writeScope | 与子代理档案相同的相对写入 glob;file_lease reserve 越界拒绝 |
协调根不设插件配置:租约存储与 coding-tools 的写锁必须同根(设计 §8.8"同一目标文件的所有写者必须使用同一个 root"),根只由 @agent-forge/host/file-lock 的缺省解析决定,进程级可用 AGENT_FORGE_COORDINATION_DIR 覆盖;插件级旁路旋钮会让租约校验与实际写锁分叉,每次 edit 都会得到 file_lock_lost。
禁用/替换本插件只关闭 advisory 层,写锁与版本校验不受影响。
关于 @ai-agent-forge/plugin-edit-coordinator 的常见问题
@ai-agent-forge/plugin-edit-coordinator 是什么?
Edit-coordinator capability plugin for Agent Forge (file.coordination@1 intent leases, file_lease tool, /conflicts command)
如何安装 @ai-agent-forge/plugin-edit-coordinator?
在项目目录运行 npm install @ai-agent-forge/plugin-edit-coordinator,或使用 pnpm add / yarn add / bun add。
@ai-agent-forge/plugin-edit-coordinator 支持 TypeScript 吗?
支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。
@ai-agent-forge/plugin-edit-coordinator 支持 ESM 还是 CommonJS?
以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。
@ai-agent-forge/plugin-edit-coordinator 需要什么版本的 Node.js?
package.json 的 engines 字段要求 Node.js >=22.19.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。
@ai-agent-forge/plugin-edit-coordinator 可以商用吗?
@ai-agent-forge/plugin-edit-coordinator 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。
@ai-agent-forge/plugin-edit-coordinator 的下载量有多少?
根据 npm 官方下载统计,@ai-agent-forge/plugin-edit-coordinator 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,578 次,日均约 86 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。
@ai-agent-forge/plugin-edit-coordinator 还在维护吗?
最新版本 0.88.28 发布于 2026/11/02(5 天前);至今共发布 15 个版本,其中过去 12 个月发布了 15 个;首次发布于 2026/10/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。