文件 v1.0.9

設定

檔案佈局

~/.config/agenvoy/
├── config.json                       主設定——模型、優先序、tier、路由角色、channel 旗標、回覆語言、輸出目錄、限制、policy 覆寫
├── daemon.log                        Daemon 日誌
├── runtime.uid                       Server 模式單例紀錄
├── mcp.json                          全域 MCP server
├── tasks.json                        一次性排程任務
├── crons.json                        週期性 cron 任務
├── allow_skill                       全域 skill always-allow 清單(一行一個名稱)
├── allow_tool                        全域工具自動核准清單(一行一個樣式,可用 `prefix*`)
├── .telegram / .discord              已授權聊天 ID(一行一個,OTP 驗證成功後寫入)
├── .store/
│   ├── history.db                    SQLite——session、message_meta、note + FTS5、messages + FTS5、action_history、file_history、usage
│   ├── db_0 ... db_3                 ToriiDB——工具與額度快取、對話向量、錯誤記憶、online marker
│   └── temp/                         被移除的檔案,加上時間戳後綴移至此
├── prompts/                          Session prompt 規則(.md,經 /v1/rules 暴露)
├── skills/                           Skill 儲存(git 版本控管)
│   ├── .system/                      內建 skill
│   ├── scheduler/                    Scheduler skill 目錄(<short>-<hash8>/SKILL.md)
│   └── .Trash/                       已移除 skill(可從 .Trash 復原)
├── tools/                            Tool 儲存(git 版本控管)
│   ├── api/                          API tool(各一份 JSON)
│   ├── script/                       Script tool(tool.json + script.py)
│   ├── .system/                      內建 tool
│   └── .extension/{api,script}/      由 extension 安裝的 tool
├── vendor/                           Web 儀表板的第三方資產,daemon 啟動時下載,於 /vendor/* 提供
├── knowledge/                        舊版筆記,僅讀取一次以遷移進 SQLite note 表
├── download/                         聊天收到的附件與下載檔案(內含 .Trash/);~/Downloads 不存在時的預設輸出目錄
└── sessions/
    ├── .Trash/                       已移除的 session
    └── <sid>/
        ├── history.json              近期對話,以差量追加
        ├── summary.json              滾動摘要
        ├── .summary_cursor           增量摘要游標
        ├── action.log                Tool call 稽核軌跡 —— [時間戳][window_hash][kind][task_hash] 內容
        ├── .cmd_history              該 session 的 TUI 輸入歷史
        └── pending/                  待決的 ask_user / confirm metadata,每個 task hash 一份 JSON

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

config.json

模型、路由與 channel 設定:

說明
models 已註冊模型,格式為 "<provider>@<model>" 字串;順序即 fallback 優先序
model_tag {model: tier},tier 為 S A B C pass;缺少時寫入 {}
dispatcher_model / summary_model Dispatcher 與 summary 角色
image_generator / stt_model / tts_model 圖像 provider 端點與音訊模型
compats 自訂 OpenAI 相容端點,[{provider, url}]
keys 存於 keychain 的憑證名稱(絕不含值)
telegram_enabled / discord_enabled Channel 旗標;telegram_username / discord_username 由 daemon 補上
admin_channel 驗證碼轉發目標
reply_lang 回覆語言,預設 "auto"(跟隨使用者)。接受 configs/jsons/reply_lang.json 中的代碼(enzh-TWzh-HKzh-CNjakoesfrdeptitruvithidar)或任何語言名稱
output_dir 未指定位置時為使用者產出檔案的存放處;預設 "" 代表 ~/Downloads,該資料夾不存在時為 ~/.config/agenvoy/download。會展開 ~;路徑無法使用時回到預設

reply_langoutput_dir 可由 TUI /config,或 GET / POST /v1/config/system/v1/config/output_dir 設定;/config 也可切換 Startup on login/v1/config/startup)。原本獨立的 startup、reply-language、output-dir TUI 指令已移除,改用 /config。Daemon 監看 config.json,每次寫入都會重新載入 agent registry 與 Telegram / Discord。

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

預設 說明
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 待處理續跑等待回答的時間上限

Daemon port 不可設定17989 為套件常數,limits.port 條目會被忽略。

config.json 的 policy 鍵。前兩者會與編譯進 binary 的內建值合併(使用者項目是追加,永不取代預設);其餘僅存在於使用者設定:

內建來源 用途
sensitive_path configs/jsons/sensitive_path.json 憑證與金鑰路徑——需經密碼驗證的 per-session 授權才能存取。分類:dirsfilesprefixesextensions
read_only_command configs/jsons/read_only_command.json 跳過 confirm gate 的指令(git statuslscat ...)
denied_command run_command 一律拒絕的 binary,sh -c 內亦然
denied_path 讀寫皆永久禁止的路徑;任何提示都無法核准。條目須為絕對路徑或以 ~/ 開頭;拒絕檔案系統根目錄
net_white_list 豁免 http_request SSRF 防護的 host

三個鍵已不再讀取,若存在會在啟動時記警告:sensitive_map(更名為 sensitive_path)、white_list(移除——不在 denied_command 的指令皆可執行)、path_white_list(移除——$HOME 之外的路徑改為逐 session 核准)。

v0.35.0 移除最後一批 pre-v0.28.9 相容路徑:limits.max_skill_iterations(由 limits.max_tool_iterations 取代)與 planner_model(由 dispatcher_model 取代,下次儲存時會從 config.json 刪除)不再被採用,舊的 api_tools/script_tools/ 目錄也不再讀取——工具改放 tools/api/tools/script/

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

專案內設定

configs/
├── jsons/
│   ├── sensitive_path.json           憑證 / 金鑰路徑
│   ├── exclude_list.json             列目錄 / 走訪時排除的路徑
│   ├── read_only_command.json        跳過確認的指令
│   ├── local_compat.json             內建本機端點(Ollama、llama.cpp)
│   ├── reply_lang.json               回覆語言代碼與標籤
│   └── tui_tools.json                僅限 TUI 的工具與 skill
└── prompts/                          System prompt 模板、reasoning guide、channel prompt

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

Session 人格

Session 設定存放在 ~/.config/agenvoy/.store/history.dbsession 表,不再是 per-session 檔案:nameself_idmodel(預設 auto)、reasoningrule(人格內文),以及聊天綁定(chat_idguild_idchannel_iduser_id)。self_id 會正規化為小寫,只接受最多 32 個 ASCII 字母、數字、_-;非空值必須唯一。

人格內文會在每一輪渲染進 system prompt 的 ## Bot Persona 區塊。編輯走 TUI /botGET / POST /v1/session/:id

Daemon 啟動時,舊版的 per-session bot.jsonbot.mdconfig.jsonstatus.jsonusage.logsummary.meta.json 會遷移進 SQLite,之後不再寫入。state 表本身已於 v0.35.3 移除——session 的存活狀態改為 ToriiDB online marker,不再是儲存的資料列。

權限模式

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

進入點 模式
TUI single-confirm,可用 Shift+Tab 逐 session 切換
POST /v1/send single-confirm;確認由 web 儀表板回應。請求欄位 allow_all 已移除
POST /v1/chat/completions always-allow
Telegram single-confirm(confirm gate 使用 Telegram inline-keyboard 選單)
Discord single-confirm(confirm gate 使用 Discord select menu)
續跑的待處理任務 沿用該任務儲存的模式
Subagent 繼承母 ctx

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

MCP 設定

單一檔案:~/.config/agenvoy/mcp.json。Session 範圍的層級已移除。完整 schema 與 ${VAR} 展開行為見 MCP 客戶端頁。

KuraDB

已無 kuradb_enabled 旗標,也沒有 /v1/kuradb 端點。KuraDB 與其他 MCP server 一樣註冊——在 mcp.json 加一筆條目——其工具以 mcp__kura__* 出現。TUI /kuradb 精靈已於 v0.35.0 移除:請自行以 kuradb.sh 安裝(需真實 TTY 處理 sudo),再透過 /mcp 註冊。

位置
kura server 條目 ~/.config/agenvoy/mcp.json
OPENAI_API_KEY keychain(agenvoy 服務)——與語意搜尋共用
Binary PATH 上的 kura/usr/local/bin/kura
KuraDB 自身設定 / 資料 ~/.config/kuradb/,完全由 KuraDB 管理

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 /channeladmin/admin-channel 已移除)

刻意不存放於此的東西

EN