# RedactLeaf Agent 安裝與使用入口

發行方：速度有限公司。適用 RedactLeaf macOS／Windows 0.13.0 以上，Skill 1.2.0；安全更新需要 App 0.12.7 以上。

開始處理使用者文件前，先閱讀以下 skill；不要先開啟使用者原始文件。

- Skill：https://sudolimit.com/redactleaf/agent/v1.2/redactleaf-agent/SKILL.md
- CLI 安裝與命令：https://sudolimit.com/redactleaf/agent/v1.2/redactleaf-agent/references/cli.md
- 摘要、轉格式與書狀規則：https://sudolimit.com/redactleaf/agent/v1.2/redactleaf-agent/references/writing.md
- Skill ZIP：https://sudolimit.com/redactleaf/agent/v1.2/redactleaf-agent-1.2.0.zip
- 版本、檔案大小與 SHA-256：https://sudolimit.com/redactleaf/agent/manifest.json
- App 安裝檔：https://sudolimit.com/redactleaf#download
- 人類閱讀頁：https://sudolimit.com/redactleaf/agents

## 安裝

1. 由使用者安裝官網符合平台的 RedactLeaf。CLI 已包含在 App 中，不需要 Python、Node、Xcode 或 .NET SDK。
2. 將 skill ZIP 解壓為 redactleaf-agent 資料夾，依目前 Agent 平台的方式載入。平台未支援 skill 自動發現時，直接讀使用者指定的 SKILL.md，並遵循引用的對應說明。
3. macOS CLI 位於已安裝的 RedactLeaf.app/Contents/MacOS/LocalRedactCLI。Windows 預設為 %LOCALAPPDATA%/Programs/RedactLeaf/app-arm64/worker/RedactLeaf.Cli.exe 或 app-x64/worker/RedactLeaf.Cli.exe，依安裝架構選存在的檔案。
4. 執行 help，確認有 agent-* 指令。沒有就請使用者更新；不要改用會輸出私有資料的舊命令。安裝提示由使用者自行完成，不自動關閉系統保護。

## 核心流程

agent-analyze 原檔路徑 → 人工在 GUI 檢查 → agent-status → agent-export → agent-check 核准副本 → Agent 才讀副本並整理 → agent-recommend AI產物 → agent-restore → 只交付還原路徑。

awaiting_review、blocked 或非零退出碼時停止依賴此文件的步驟。不能代按 confirm、修改私有 JSON、查看錯誤日誌或直接讀原文來排錯。

只在 agent-check 回傳 verified 且 readable:true 時讀編碼副本。需要回填時，匯出也須 restorable:true。AI 衍生稿另存，完整保留王○頭、王○頭2、電○1 等短代號（及舊版〔LR-…〕代號），不猜真實身分、不交換角色、不混入未核准來源。

agent-recommend 不輸出原始檔名、專案名或原文對照，只輸出候選 ID 與匹配資訊。唯一完整且未加密時可自動選用；歧義、不完整或需要密碼時由使用者在 GUI 操作。不要要求使用者把還原對照或密碼貼入對話。

agent-restore 成功後回傳 readable:false、containsPersonalData:true。不得開啟、預覽、引用或讀回還原後文件；由使用者自行在本機檢查。

這套規則不是 OS 沙箱。經人工確認的副本不保證零遺漏；編碼也不保證案情敘述已完全匿名。任何對外傳送仍須符合使用者授權。


## 協助更新 App（0.12.7 起）

先閱讀 https://sudolimit.com/redactleaf/agent/v1.2/redactleaf-agent/references/updates.md 。可以使用 update check、update download、update safety，以及經使用者授權的 update install。不能自己用 rm、搬移、sudo、taskkill 等命令取代這套流程。

- Mac：update install --app /Applications/RedactLeaf.app --yes；請使用實際安裝路徑。
- Windows：update install --yes 交接安裝程式後，再用 update status 核對完成與實際版本。installing 不等於 installed。
- 有任一 RedactLeaf 視窗或 CLI 工作時停止；請使用者正常關閉，不強制結束。
- 更新驗證套件並保留舊版備份，不清除模型、設定、案件及還原資料。safeToReplace 不是可刪除備份的授權。
- 第一次啟用這項功能，請先安裝 0.12.7；更舊的 CLI 沒有自動替換指令。

一般本機匯出不強制人工確認；此 Agent 交接流程仍只讀經確認的副本。短代號無法單靠文字保證跨案唯一；AI 整理稿的還原來源由使用者明確選擇，不以姓名相似度猜測。
