示例
{
"requires": {
"interfaces": ["ledger", "mail"],
"plugins": [],
"tools": []
},
"skills": ["@example/skills/receipt-capture"],
"inputs": [
{
"key": "invoice_mailbox",
"label": "Mailbox that receives vendor invoices",
"type": "text",
"id": "finance.ap.invoice_mailbox",
"scope": "company",
"required": true,
"missing": "Ask the owner which mailbox to watch before processing invoices."
}
],
"memory": {
"mode": "separate",
"topics": [
{ "slug": "vendor", "description": "A supplier: terms, usual amounts, contacts, open disputes" }
]
},
"subscribes": ["finance.ap.*"],
"ceiling": { "ledger.bill.create": "approval" },
"workflows": {
"invoice-intake": {
"trigger": { "type": "watch", "plugin": "mail", "event": "email.new" },
"activities": [
{ "id": "record", "intent": "If the message in _watch_payload is a vendor invoice, record it as a bill." }
]
}
}
} 字段
| 字段 | 类型 | 含义 |
|---|---|---|
requires.interfaces | 字符串列表 | 岗位所需的能力,例如 mail 或 ledger。在聘用时授予;每项需要审批的操作仍然是一个审批项。参见“能力与审批”。 |
requires.plugins | 字符串列表 | 随员工一起安装的插件。只有当这个岗位确实依赖某一个插件时才使用;优先使用能力。 |
requires.tools | 字符串列表 | 从第一轮起就加载到员工会话中的工具。这永远不会绕过审批。 |
skills | 字符串列表 | 要安装并使用的市场技能:@org/skills/name,可选加上 @version,或者一个 SKIL- 代码。员工包自己 skills/ 文件夹中的技能无需填写。 |
inputs | list | 所有者在聘用时回答的问题。参见“输入”。 |
memory | object | 对话和记忆的保存方式。参见“人设与记忆”。 |
subscribes | 字符串列表 | 员工在发生变化时会重新读取的公司事实领域,例如 finance.ar.*。 |
ceiling | map | 操作到 "approval" 的映射。对这位员工而言,该操作始终要征得所有者同意。不接受其他任何值。 |
workflows | map | 工作流名称到工作流的映射。参见“工作流”。 |
tools | list | 由应用 sidecar 提供的 HTTP 工具。参见“Sidecar 工具”。 |
scopes | map | 由 tools、skills 和 plugins 组成的具名分组。某个范围启用时,会向员工描述该范围的 plugins。 |
输入
输入项是所有者在雇用时需要回答的问题。答案会在“Configured Inputs”下显示给员工,并填入监听触发器和文件夹触发器中的 {{key}} 占位符。
{
"key": "close_day",
"label": "Business day to finish the close",
"type": "select",
"options": [
{ "value": "3", "label": "Third business day" },
{ "value": "5", "label": "Fifth business day" }
],
"default": "5",
"scope": "company",
"id": "finance.close.day"
} | 字段 | 默认值 | 含义 |
|---|---|---|
key | 必需 | 在占位符中使用的名称。也接受 name 作为后备。 |
label | 取自 key | 向所有者显示的问题。 |
type | text | text、textarea、number、select、checkbox 或 radio。 |
required | false | 标记为所有者必须回答的问题。 |
default | 无 | 预填答案。金额问题不允许设置。 |
placeholder, description | 无 | 帮助文本。 |
options | 无 | 用于 select 和 radio:{value, label} 对象或普通字符串。 |
id | 无 | 事实的稳定、带点号的名称,例如 finance.ap.invoice_mailbox,以便其他员工共享。 |
scope | company | company:公司共享的事实。seat:仅限这次聘用。 |
missing | 无 | 问题尚未回答时员工会怎么做。 |
money | false | 标记为金额。金额问题不能有默认值。 |
Sidecar 工具
带有 sidecar 的应用会把 HTTP 端点作为工具提供给它的员工。Nebo 会把每一项注册为 app__<app>__<name>,并按照 method 和 path 将调用发送到 sidecar。参见应用 Sidecar。
"tools": [
{
"name": "list_entries",
"description": "List journal entries for a date range.",
"method": "GET",
"path": "/entries",
"input_schema": { "type": "object", "properties": { "from": { "type": "string" } } }
}
]