範例
{
"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" } } }
}
]