文件 v0.30.0

設定

檔案佈局

~/.config/agenvoy/
├── config.json                       主設定——模型、限制、channel 旗標、policy 覆寫
├── daemon.log                        Daemon 日誌
├── mcp.json                          全域 MCP server
├── tasks.json                        一次性排程任務
├── crons.json                        週期性 cron 任務
├── allow_skill                       全域 skill always-allow 清單(一行一個名稱)
├── .telegram / .discord              已授權聊天 ID(一行一個,OTP 驗證成功後寫入)
├── .store/                           ToriiDB 儲存——歷史、摘要、錯誤記憶、設定旗標
├── prompts/                          使用者 prompt 覆寫
├── skills/                           Skill 儲存(git 版本控管)
│   ├── .system/                      內建 skill
│   ├── scheduler/                    Scheduler skill 目錄(<short>-<hash8>/SKILL.md)
│   └── .Trash/                       已移除 skill(可用 restore_revision 復原)
├── tools/                            Tool 儲存(git 版本控管)
│   ├── api/                          API tool(各一份 JSON)
│   ├── script/                       Script tool(tool.json + script.py)
│   ├── .system/                      內建 tool
│   └── .extension/                   由 extension 安裝的 tool
├── errors/                           錯誤記憶產物
├── download/                         聊天收到的附件與下載檔案
└── sessions/
    └── <sid>/
        ├── bot.md                    Agent 人格(frontmatter + 內文)
        ├── status.json               執行中任務清單 / 狀態
        ├── action.log                Tool call 稽核軌跡(外部行程寫入的行帶前綴)
        ├── summary.json              滾動摘要
        ├── summary.meta.json         增量摘要游標
        ├── usage.log                 各模型 token 用量紀錄
        ├── input_history             該 session 的 TUI 輸入歷史
        └── mcp.json                  Session 範圍的 MCP server

~/.config/kuradb/
├── endpoint                          純文字 URL(隨機 port),KuraDB 啟動時寫入
└── runtime.uid                       KuraDB 單例鎖

<專案根>/.config/agenvoy/              專案範圍的 tool 與 skill
├── tools/{api,script}/
└── skills/
<專案根>/.agenvoy/allow_skill          專案範圍的 skill always-allow 清單(與全域取聯集)

config.json

除了模型與 channel 設定,config.json 也承載 runtime 限制與可選的 policy 覆寫。缺少的限制欄位會以預設值補齊並於啟動時寫回。

預設 說明
limits.port 17989 本機 HTTP daemon port
limits.max_tool_iterations 128 單次執行的 tool 迭代上限
limits.agent_send_timeout_seconds 600 模型請求 timeout
limits.max_history_messages 24 保留的近期歷史訊息數
limits.max_history_bytes 5242880 歷史大小上限

不從 config.json 讀取的套件層預設值:

常數 預設 說明
MaxSessionTasks NumCPU × 4 每個 session 的並行任務數;超出者排隊而非失敗
MaxSubagentTimeoutMin 30 Subagent timeout(分鐘)
MaxResumeWaitMin 60 待處理續跑等待回答的時間上限

config.json 內的 policy 陣列會與編譯進 binary 的內建值合併(使用者項目是追加,永不取代預設):

內建來源 用途
denied_map configs/jsons/denied_map.json 沙箱拒絕曝露的路徑
white_list configs/jsons/white_list.json run_command 可執行的 binary
read_only_command configs/jsons/read_only_command.json 跳過 confirm gate 的指令(git statuslscat …)
net_white_list configs/jsons/net_white_list.json 豁免 send_http_request SSRF 防護的 host

Runtime 限制沒有環境變數——env 覆寫已移除,config.json 是唯一調整點。

專案內設定

configs/
├── jsons/
│   ├── denied_map.json               沙箱拒絕路徑
│   ├── exclude_list.json             列目錄 / 走訪時排除的路徑
│   ├── white_list.json               允許執行的指令 binary
│   ├── read_only_command.json        跳過確認的指令
│   ├── net_white_list.json           SSRF 防護豁免
│   ├── never_open.json               永不開啟的系統目錄
│   └── tui_tools.json                TUI 工具顯示 metadata
└── prompts/                          System prompt 模板、reasoning guide、channel prompt

Repo 內不再附帶供應商與模型目錄——模型清單改由各供應商 API 即時取得。

bot.md 格式

***
name: <session display name>     # 供 :name 路由與 invoke_subagent 的 name 參數使用
***

<自由格式 markdown 的人格內容>

內文會在每一輪渲染進 system prompt 的 ## Bot Persona 區塊。未設定時 frontmatter name 預設為 session id。建立與改名 session 走 TUI(/new/bot)或本機 API(POST / PUT /v1/session)。

權限模式

生效的權限模式(single-confirmalways-allow)由進入點決定:

進入點 模式
agen cli single-confirmAllowAll=false
agen run always-allowAllowAll=true
TUI single-confirm,可用 Shift+Tab 逐 session 切換
Discord / REST always-allow
Telegram single-confirm(confirm gate 使用 Telegram inline-keyboard 選單)
Subagent 繼承母 ctx

模式會渲染進 system prompt 的 ## Permission Mode。位於唯讀指令清單的指令在任何模式下都跳過 gate。

MCP 設定

兩層;session 覆寫全域。完整 schema 與 ${VAR} 展開行為見 MCP 客戶端頁。

KuraDB

啟用狀態為 config.jsonkuradb_enabled。以 TUI /kuradb 切換;已安裝的實例也可用 POST /v1/kuradb 啟動 / 停止(安裝仍需真實 TTY 處理 sudo)。

位置
kuradb_enabled config.json
OPENAI_API_KEY keychain(agenvoy 服務)——與語意搜尋共用
Endpoint URL(runtime) ~/.config/kuradb/endpoint(純文字,每次啟動隨機 port)
Binary /usr/local/bin/kura

Telegram / Discord 啟用

位置
telegram_enabled / discord_enabled config.json
TELEGRAM_TOKEN / DISCORD_TOKEN keychain(agenvoy 服務)
已授權聊天 ID ~/.config/agenvoy/.telegram~/.config/agenvoy/.discord(6 位數 OTP 驗證成功後寫入)
驗證碼轉發目標 config.jsonadmin_channel(TUI /admin-channel

刻意不存放於此的東西

EN