SuperAPI AI 工具集

delegation

智能体与模型

查看项目

更新于 10-16 09:55

技能介绍

用途:在 Synapse A2A 中配置智能体间的自动任务委派,依据自然语言规则把任务路由给合适的目标智能体。

配置方式:使用 synapse init 生成含模板文件的 .synapse/ 目录;synapse config 提供交互式 TUI 编辑;也可直接编辑文件。核心文件为 .synapse/settings.json(开启/关闭委派并设置 A2A 流程模式)和 .synapse/delegate.md(定义委派规则与智能体职责)。

主要能力:settings.json 中通过 a2a.flow 选择 roundtrip、oneway 或 auto,通过 delegation.enabled 控制自动委派。delegate.md 使用 YAML frontmatter 定义 version、agents、rules 和 fallback。agents 可按名称声明 responsibilities 与 default_priority;rules 按顺序求值,首个匹配规则生效,匹配条件包括 keywords(对任务文本做不区分大小写的子串匹配)与 file_patterns(对提及的文件路径做 glob 匹配),多个条件为 AND 逻辑;每条规则可指定 target、priority(1-5,默认 3)和 flow。无规则命中时执行 fallback,可选 manual、ask 或 default_agent(后者配合 default_agent 字段)。

使用方式:可用 @agent 模式发任务,如 @codex Please refactor this function;也可编程式调用,例如 synapse send codex "Refactor this function" --from claude(fire and forget),或 synapse send gemini "Analyze this code" --response --from claude 等待响应;回复 --response 请求须使用 synapse reply,如 synapse reply "Here is the analysis..." --from gemini。支持 orchestrator(分析、委派、等待、整合)、passthrough(直接转发)与 manual(默认,不自动委派)三种模式。

委派前检查:用 synapse list 查看智能体是否 READY,用 synapse file-safety locks 检查文件锁,用 git branch --show-current 检查分支。智能体状态包括 READY、WAITING、PROCESSING、DONE,对应不同处理动作;priority 1-2 为低优先级后台任务,3 为普通,4 为紧急跟进,5 为关键任务。资料列出可用智能体 claude、gemini、codex、opencode、copilot 及其端口区间,例如 claude 为 8100-8109。

限制与未提供:版本、平台支持范围、收费情况等资料未说明;schema 版本当前为 1。其他细节见 references/modes.md、references/file-safety.md、references/examples.md。