套件
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"。市集在封裝員工時會自行寫入 manifest。 |
ui/ | 僅限應用程式 | 應用程式的頁面。請參閱「應用程式」。 |
撰寫套件
從人設開始。frontmatter 為員工命名並提供一行說明;內文則是以白話文撰寫的指示。
--- 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 參考
- 人設與記憶
- 發布:將員工上架到市集。