员工包
support-coordinator/
├── AGENT.md # required: who the employee is and how it works
├── agent.json # optional: capabilities, inputs, workflows, memory
└── skills/ # optional: skills only this employee uses
└── reply-drafting/
└── SKILL.md | 文件 | 必需 | 用途 |
|---|---|---|
AGENT.md | 是 | 人设:这位员工是谁、如何工作,以及它的规则。参见“人设与记忆”。 |
agent.json | 否 | 它所需的能力、要问所有者的问题、工作流、记忆设置和审批上限。参见“agent.json 参考”。 |
skills/ | 否 | 标准 SKILL.md 格式的技能。只有这位员工能看到它们。 |
manifest.json | 仅限应用 | 带有 "type": "app" 的身份信息。市场在打包员工时会自行写入清单。 |
ui/ | 仅限应用 | 应用的页面。参见“应用”。 |
编写员工包
从人设开始。前置元数据为员工命名并给出一句话描述;正文是用平实文字写的指令。
--- name: Support Coordinator description: Answers every customer message the day it arrives and escalates what it cannot settle. --- # Support Coordinator You answer customer email for the company. Reply within the configured window, in the company's voice, and keep every thread moving until the customer has an answer. ## How you work - Read the whole thread before you reply. - Use the reply-drafting skill for every customer reply. - When a message is about money, draft a proposal for the owner instead of promising anything. ## Rules - Never promise a refund, a discount or a date you cannot confirm.
当岗位需要某个系统、需要所有者提供某项设置,或者需要它在没人吩咐时主动做事时,就添加 agent.json。下面这个例子需要 mail 能力,在聘用时问一个问题,并在每封新邮件到达时进行回复。
{
"requires": { "interfaces": ["mail"] },
"inputs": [
{
"key": "reply_window_hours",
"label": "Reply within (hours)",
"type": "number",
"id": "support.reply_window_hours",
"scope": "company",
"default": 24
}
],
"workflows": {
"new-mail": {
"trigger": { "type": "watch", "plugin": "mail", "event": "email.new" },
"description": "Handle each customer message as it arrives.",
"activities": [
{
"id": "reply",
"intent": "Read the message in _watch_payload, draft a reply within reply_window_hours, and escalate anything about money to the owner."
}
]
}
}
} 这个监视器指定的是能力 mail,而不是某个产品。运行时,它会解析为所有者为邮件连接的那个插件。触发器和活动请参见工作流。
在机器人上加载
把文件夹放到 <data>/user/agents/<name>/。Nebo 会监视 AGENT.md、agent.json 和 manifest.json,并在发生变更后大约一秒重新加载该员工。移除这个文件夹会停用该员工,但会保留它的记录。
Nebo 从三个来源加载员工,后面的来源优先:Nebo 内置的员工、<data>/nebo/agents/ 中密封的市场员工包,以及 <data>/user/agents/ 中的文件夹。员工也可以用它的 create_employee 和 update_employee 工具为你创建或修改员工包,这两个工具写入的也是同样的文件夹。
聘用时会发生什么
当所有者从市场或使用 AGNT- 代码聘用你的员工时,Nebo 会:
- 不询问任何模型,直接读取员工包的需求:
requires.interfaces中的每项能力、requires.plugins中的每个插件,以及监视触发器指定的每项能力或插件。 - 就这些需求向所有者展示一句同意说明,并在聘用时将它们作为长期权限授予这位员工。需要审批的操作仍然需要审批。参见能力与审批。
- 安装依赖:
requires.plugins中的插件、skills和各活动中指定的市场技能,以及员工包发布时声明的依赖。 - 向所有者提出
inputs中的问题,并通过收件箱告知所有者哪些能力还没有连接。
如果某个工作流所需的能力尚未连接,该工作流会被保留并标记为降级,同时注明原因。一旦所有者连接了某个系统,它就会开始工作。
Nebo 会检查什么
Nebo 读取 agent.json 时比较宽松。未知的键会被忽略。不符合结构定义的工作流会被跳过,所有者会在收件箱收到一条它不会运行的通知;该员工的其余部分仍会正常加载。以下问题会导致整个文件被拒绝:
event触发器的sources列表为空。- 同一个工作流中有两个
id相同的活动。 - 某个输入的
scope不是company或seat,或者某个金额问题带有默认值。 ceiling的值不是"approval"。- 电话呼叫树没有恰好一个问候语,或没有至少一个具名意图。
有些检查在工作流启动时才运行,而不是在加载时,比如每种活动类型所需的参数。参见活动。
写职责,不要写工具。员工包指定的是能力,例如 ledger 或 mail,而从不指定某个具体的产品、公司或行业。由所有者决定用哪个系统来承担每项能力,这样一个员工包就能服务每一家聘用它的公司。
下一步
- agent.json 参考
- 人设与记忆
- 发布:把员工上架到市场。