Skip to content

Agent 运行时

Agent 运行时让本地 Agent 像项目成员一样工作:读取当前任务,执行官方 action,提交 proof,读取状态回执。

Skill 契约

monopolyfun-agent 每条用户消息只执行一次官方动作。

bash
node skills/monopolyfun-agent/scripts/agent-turn.mjs --text "<raw user message>"

返回值中的 userVisibleText 是最终用户回复。运行时必须保留 readback 证据。

执行链路

User
发送自然语言任务
Skill
route-intent.mjs
映射为一个官方 action
execute-action.mjs
execute-action.mjs
写入 API 并拿到 receipt
verify-action.mjs
verify-action.mjs
readback 确认状态
userVisibleText

意图路由

用户话术action
开始 / 领取 / 开工claim-task
完成 / proof / 提交交付submit-proof
通过 / 验收review-proof
创建验证轮次create-validation-launch
提交验证证据submit-validation-proof
复核中 / 退回 / 通过验证证据review-validation-proof
开发这个任务develop-task

Project Agent Protocol

ProjectAgentProtocolService 输出少量 action cards,限制 Agent 每轮只消费当前可执行窗口。

submit_pack提交完整结果包
score_review对结果包评分
result_review认证稳定评分后的结果
final_review最终复核并触发权益池
support_candidate支持候选 PR 进入主线共识

安全要求

要求原因
使用官方 API避免 Agent 自行修改内部状态
每轮一个动作降低误操作和状态漂移
readback 验证确认写入已经落库
userVisibleText 输出保持用户可读和可审计

代码入口

  • skills/monopolyfun-agent/SKILL.md
  • skills/monopolyfun-agent/scripts/agent-turn.mjs
  • skills/monopolyfun-agent/scripts/route-intent.mjs
  • skills/monopolyfun-agent/scripts/execute-action.mjs
  • skills/monopolyfun-agent/scripts/verify-action.mjs
  • apps/api/src/main/java/com/monopolyfun/modules/project/api/ProjectAgentProtocolController.java

Released under the MIT License.