# v0.5.0 Release Notes

> v0.4.0 -> v0.5.0

## Summary

Add three new built-in tools (`fetch_page`, `search_web`, `calculate`) and a headless Chrome browser subsystem, bringing the total to 14 tools. Simultaneously refactor the tool executor routing layer by extracting per-package `Routes` functions, improving modularity and Context propagation across the execution pipeline.

<details>
<summary>翻譯</summary>
新增三個內建工具（`fetch_page`、`search_web`、`calculate`）與 Chrome 無頭瀏覽器子系統，工具總數達 14 個。同步重構工具執行器路由層，將各套件邏輯抽離為獨立 `Routes` 函式，改善模組化程度與整個執行管線的 Context 傳遞。
</details>

## Changes

### FEAT

- Add `fetch_page` tool: launch headless Chrome with stealth JS injection, wait for full JS render, return page content as Markdown
- Add `search_web` tool: concurrent Brave Search + DuckDuckGo query with deduplication, time-range filtering, and configurable result limit (max 50)
- Add `calculate` tool: evaluate math expressions supporting `+`, `-`, `*`, `/`, `%`, `^` (power), parentheses, and functions (`sqrt`, `abs`, `pow`, `ceil`, `floor`, `round`, `log`, `log2`, `log10`, `sin`, `cos`, `tan`)
- Add `search_content` as a first-class file package tool, moved from executor dispatch into `file` package

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

- 新增 `fetch_page` 工具：以 stealth JS 注入啟動 Chrome 無頭瀏覽器，等待完整 JS 渲染後以 Markdown 格式返回頁面內容
- 新增 `search_web` 工具：並行查詢 Brave Search 與 DuckDuckGo，支援去重、時間範圍過濾及可設定的結果數量上限（最大 50）
- 新增 `calculate` 工具：計算數學表達式，支援四則運算、`%`、`^`（冪次）、括號及數學函式
- 將 `search_content` 正式遷移至 `file` 套件，成為獨立工具路由

</details>

### REFACTOR

- Extract `file.Routes` function to consolidate all file tool dispatch (`read`, `list`, `glob`, `write`, `patch`, `search`) into the `file` package, removing inline logic from executor
- Extract `apis.Routes` function to consolidate API tool dispatch (`yahoo_finance`, `google_rss`, `weather`, `http_request`, `fetch_page`, `search_web`) into the `apis` package
- Rename file tool source files to shorter names (`readFile.go` → `read.go`, `listFiles.go` → `list.go`, etc.) for consistency
- Refactor tool confirmation flow to synchronous reply-channel pattern; fix Context cancellation propagation through Execute loop
- Pass `context.Context` through `tools.Execute` call chain to enable per-tool timeout and cancellation

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

- 抽離 `file.Routes` 函式，將所有檔案工具 dispatch 邏輯（讀取、列表、glob、寫入、patch、搜尋）統一至 `file` 套件
- 抽離 `apis.Routes` 函式，將 API 工具 dispatch 統一至 `apis` 套件
- 將檔案工具原始碼重新命名為較簡短的形式（`readFile.go` → `read.go` 等）以保持一致性
- 重構工具確認流程為同步回覆通道模式；修正 Execute 迴圈中的 Context 取消傳遞
- 將 `context.Context` 傳入 `tools.Execute` 呼叫鏈，支援每個工具的逾時與取消

</details>

### UPDATE

- Change Copilot default model from `gpt-5-mini` to `gpt-4.1`
- Increase `run_command` execution timeout from 120s to 300s
- Update system prompt and base system prompt to document new tools and revised execution guidelines
- Add raw-body shortcut in `utils.GET` and `utils.POST` generic functions: if `T` is `string`, response body is read as plain text without JSON/XML decode

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

- 將 Copilot 預設模型從 `gpt-5-mini` 改為 `gpt-4.1`
- 將 `run_command` 執行逾時從 120 秒增加至 300 秒
- 更新系統提示詞與基礎系統提示詞，補充新工具說明與修訂執行指引
- 在 `utils.GET` 和 `utils.POST` 泛型函式中加入純文字快取路徑：若 `T` 為 `string`，直接以原始文字讀取 Response Body，略過 JSON/XML 解碼

</details>

***

## Files Changed

| File | Status | Tag |
|------|--------|-----|
| `internal/tools/browser/load.go` | Added | FEAT |
| `internal/tools/browser/extract.go` | Added | FEAT |
| `internal/tools/browser/embed/stealth.js` | Added | FEAT |
| `internal/tools/browser/embed/listener.js` | Added | FEAT |
| `internal/tools/apis/searchWeb/SearchWeb.go` | Added | FEAT |
| `internal/tools/apis/searchWeb/fetchDDG.go` | Added | FEAT |
| `internal/tools/calculator/calculate.go` | Added | FEAT |
| `internal/tools/file/search.go` | Added | FEAT |
| `internal/tools/embed/tools.json` | Modified | FEAT |
| `internal/tools/apis/routes.go` | Added | REFACTOR |
| `internal/tools/file/routes.go` | Added | REFACTOR |
| `internal/tools/executor.go` | Modified | REFACTOR |
| `internal/tools/tools.go` | Modified | REFACTOR |
| `internal/agents/exec.go` | Modified | REFACTOR |
| `internal/tools/file/glob.go` | Renamed | REFACTOR |
| `internal/tools/file/list.go` | Renamed | REFACTOR |
| `internal/tools/file/patch.go` | Renamed | REFACTOR |
| `internal/tools/file/read.go` | Renamed | REFACTOR |
| `internal/tools/file/write.go` | Renamed | REFACTOR |
| `internal/agents/provider/copilot/send.go` | Modified | UPDATE |
| `internal/tools/tools.go` | Modified | UPDATE |
| `internal/agents/prompt/sysPrompt.md` | Modified | UPDATE |
| `internal/agents/prompt/sysPromptBase.md` | Modified | UPDATE |
| `internal/agents/types/event.go` | Modified | UPDATE |
| `internal/utils/utils.go` | Modified | UPDATE |
| `internal/tools/apis/weatherReport/fetch.go` | Modified | UPDATE |
| `cmd/cli/main.go` | Modified | UPDATE |
| `doc.md` | Modified | DOC |
| `doc.zh.md` | Modified | DOC |
| `README.md` | Modified | DOC |
| `README.zh.md` | Modified | DOC |
| `go.mod` | Modified | CHORE |
| `go.sum` | Modified | CHORE |

***

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