# v0.2.0 Release Notes

> v0.1.0 -> v0.2.0

## Summary

Add complete filesystem toolchain (list_files, glob_files, write_file, search_content, run_command) with command whitelisting, safe delete mechanism, interactive confirmation prompts, and refactor Scanner architecture with Copilot authentication flow improvements.
<details>
<summary>翻譯</summary>
新增完整檔案系統工具鏈（list_files、glob_files、write_file、search_content、run_command），包含指令白名單、安全刪除機制、互動式確認提示，並重構 Scanner 架構與 Copilot 認證流程。
</details>

## Changes

### FEAT
- Add `list_files` tool with recursive directory listing and exclusion support
- Add `glob_files` tool with `**` wildcard pattern matching
- Add `write_file` tool for file creation and overwriting
- Add `search_content` tool with regex pattern matching and file filtering
- Add `run_command` tool with command whitelist, shell operator support, and 120s timeout
- Add safe delete mechanism that moves files to `.Trash` instead of permanent deletion
- Add interactive confirmation prompt (promptui) before each tool call execution
- Add `--allow` CLI flag to skip tool call confirmation in auto mode
- Add command whitelist covering git, go, node, python, file operations, and text processing
- Add directory exclusion mechanism for `.git`, `node_modules`, `vendor`, `dist`, etc.

<details>
<summary>翻譯</summary>

- 新增 `list_files` 工具，支援遞迴目錄列表與排除機制
- 新增 `glob_files` 工具，支援 `**` 萬用字元模式比對
- 新增 `write_file` 工具，用於檔案建立與覆寫
- 新增 `search_content` 工具，支援正規表示式模式比對與檔案篩選
- 新增 `run_command` 工具，含指令白名單、shell 操作符支援與 120 秒逾時
- 新增安全刪除機制，將檔案移至 `.Trash` 而非永久刪除
- 新增工具呼叫前的互動式確認提示（promptui）
- 新增 `--allow` CLI 旗標以在自動模式下跳過工具呼叫確認
- 新增指令白名單，涵蓋 git、go、node、python、檔案操作與文字處理
- 新增目錄排除機制，排除 `.git`、`node_modules`、`vendor`、`dist` 等

</details>

### REFACTOR
- Restructure Scanner to auto-scan on creation and expose `Skills` as exported field
- Merge `skill.go` types into `scanner.go` and remove redundant file
- Convert `CopilotLogin` from package function to `(*CopilotAgent).Login` method receiver
- Move token persistence logic from `Login` to `getAccessToken` for atomic save
- Rename `checkAndRefresnToken` to `checkExpires` and extract `refresh` method
- Replace inline system prompt string with embedded `sysPrompt.md` template using `{{.WorkPath}}`/`{{.SkillPath}}`/`{{.Content}}` placeholders
- Split tool implementations into `file.go` (filesystem ops) and `tools.go` (command execution)
- Rename `getPath` to `getFullPath` and add `isExclude` path filtering

<details>
<summary>翻譯</summary>

- 重構 Scanner 為建立時自動掃描並將 `Skills` 匯出為公開欄位
- 將 `skill.go` 的型別合併至 `scanner.go` 並移除冗餘檔案
- 將 `CopilotLogin` 從套件函式轉為 `(*CopilotAgent).Login` method receiver
- 將 token 持久化邏輯從 `Login` 移至 `getAccessToken` 實現原子性儲存
- 將 `checkAndRefresnToken` 重新命名為 `checkExpires` 並抽離 `refresh` 方法
- 以 embedded `sysPrompt.md` 模板取代內嵌 system prompt 字串，使用 `{{.WorkPath}}`/`{{.SkillPath}}`/`{{.Content}}` 佔位符
- 將工具實作拆分為 `file.go`（檔案系統操作）與 `tools.go`（指令執行）
- 將 `getPath` 重新命名為 `getFullPath` 並新增 `isExclude` 路徑過濾

</details>

### UPDATE
- Increase `MaxToolIterations` from 20 to 128 for complex skill workflows
- Add `allowAll bool` parameter to `Execute` method signature
- Add context timeout (30s) for token refresh on startup
- Improve error wrapping with descriptive `fmt.Errorf("%w")` across all client methods

<details>
<summary>翻譯</summary>

- 將 `MaxToolIterations` 從 20 提高至 128 以支援複雜 skill 工作流程
- 在 `Execute` 方法簽章中新增 `allowAll bool` 參數
- 新增啟動時 token 刷新的 context timeout（30 秒）
- 改善所有 client 方法的錯誤包裝，使用描述性 `fmt.Errorf("%w")`

</details>

***

## Files Changed

| File | Status | Tag |
|------|--------|-----|
| `cmd/cli/main.go` | Modified | FEAT |
| `go.mod` | Modified | CHORE |
| `go.sum` | Added | CHORE |
| `internal/client/copilot.go` | Modified | REFACTOR |
| `internal/client/exec.go` | Modified | FEAT |
| `internal/client/login.go` | Modified | REFACTOR |
| `internal/client/refresh.go` | Modified | REFACTOR |
| `internal/client/sysPrompt.md` | Added | REFACTOR |
| `internal/skill/parser.go` | Modified | REFACTOR |
| `internal/skill/scanner.go` | Modified | REFACTOR |
| `internal/skill/skill.go` | Deleted | REFACTOR |
| `internal/tools/executor.go` | Modified | FEAT |
| `internal/tools/file.go` | Added | FEAT |
| `internal/tools/tools.go` | Added | FEAT |
| `internal/tools/tools.json` | Modified | UPDATE |
| `README.md` | Modified | DOC |
| `README.zh.md` | Modified | DOC |

***

Generated by [SKILL](https://github.com/pardnchiu/skill-version-generate)
