# v0.16.0 Release Notes

> v0.15.2 -> v0.16.0

## Summary

Introduced script tool as a first-class tool subsystem, allowing agents to discover and execute local JavaScript and Python scripts via a stdin/stdout JSON protocol — mirroring the existing API tool architecture. Also refactored internal package structure and fixed Discord file upload reliability.
<details>
<summary>翻譯</summary>
新增 script tool 子系統，讓 agent 可自動發現並執行本地 JavaScript 與 Python 腳本（stdin/stdout JSON 協定），架構與現有 API tool 對稱。同時重構內部套件結構，並修正 Discord 上傳問題。
</details>

## Changes

### FEAT
- **Script Tool Runtime** — Add `internal/scriptAdapter` package mirroring `internal/apiAdapter`. On startup, the executor scans `~/.config/agenvoy/script_tools/` and `<workdir>/.config/agenvoy/script_tools/` for subdirectories containing a `tool.json` manifest (name, description, parameters schema) and an executable `script.js` or `script.py`. Discovered tools are registered as first-class agent tools with the `script_` prefix and dispatched via stdin/stdout JSON, identical to the API tool contract.
- Add git tools for skill management (`skill_git_commit`, `skill_git_log`, `skill_git_rollback`)
- Add Copilot token auto-relogin on 401 during token refresh

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

- **Script Tool 執行環境** — 新增 `internal/scriptAdapter`，架構與 `internal/apiAdapter` 對稱。啟動時掃描 `~/.config/agenvoy/script_tools/` 與 `<workdir>/.config/agenvoy/script_tools/`，自動載入包含 `tool.json`（name、description、parameters）與 `script.js`/`script.py` 的子目錄。已發現的工具以 `script_` 前綴註冊為一等工具，透過 stdin/stdout JSON 協定執行，與 API tool 完全一致。
- 新增 skill 管理用 git 工具（commit、log、rollback）
- 新增 Copilot token 401 時自動重新登入

</details>

### FIX
- Fix Discord file upload failure caused by non-ASCII filenames (Japanese, special chars) in multipart upload
- Fix system message ordering and multi-system-prompt merging for Nvidia provider

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

- 修正 Discord 上傳含日文等非 ASCII 字元檔名時 multipart 上傳失敗的問題
- 修正 Nvidia provider 的 system message 排序與多 prompt 合併邏輯

</details>

### UPDATE
- Add file size validation (10MB limit) before Discord upload with user-facing warning
- Update default download path to prefer `~/Downloads` over `~/.config/agenvoy/download`

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

- 新增 Discord 上傳前檔案大小驗證（10MB 限制），超限時向用戶回報警告
- 預設下載路徑改為優先使用 `~/Downloads`

</details>

### REFACTOR
- Rename `internal/tools/apis/adapter` → `internal/apiAdapter` and `internal/tools/apis` → `internal/tools/api` for consistent naming alongside the new `scriptAdapter`

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

- 重命名 `internal/tools/apis/adapter` → `internal/apiAdapter`，`internal/tools/apis` → `internal/tools/api`，與新增的 `scriptAdapter` 形成對稱命名

</details>

### ADD
- Add `script-tool-creator` skill with Python initializer to scaffold new script tools
- Add yt-dlp downloader and info query as example script tools

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

- 新增 `script-tool-creator` skill 及 Python 腳手架腳本，快速建立新 script tool
- 新增 yt-dlp 下載與資訊查詢作為 script tool 使用範例

</details>

***

## Files Changed

| File | Status | Tag |
|------|--------|-----|
| `internal/scriptAdapter/ececute.go` | Added | FEAT |
| `internal/scriptAdapter/translator.go` | Added | FEAT |
| `internal/tools/executor.go` | Modified | FEAT |
| `internal/tools/types/executor.go` | Modified | FEAT |
| `internal/tools/git/skillCommit.go` | Added | FEAT |
| `internal/tools/git/skillLog.go` | Added | FEAT |
| `internal/tools/git/skillRollback.go` | Added | FEAT |
| `internal/tools/git/register.go` | Added | FEAT |
| `internal/agents/provider/copilot/refresh.go` | Modified | FEAT |
| `internal/discord/reply.go` | Modified | FIX |
| `internal/agents/provider/nvidia/send.go` | Modified | FIX |
| `internal/filesystem/filesystem.go` | Modified | UPDATE |
| `internal/tools/browser/download.go` | Modified | UPDATE |
| `internal/tools/browser/register.go` | Modified | UPDATE |
| `internal/tools/file/writeFile.go` | Modified | UPDATE |
| `internal/apiAdapter/` (from `tools/apis/adapter`) | Renamed | REFACTOR |
| `internal/tools/api/` (from `tools/apis`) | Renamed | REFACTOR |
| `internal/tools/register.go` | Modified | REFACTOR |
| `extensions/skills/script-tool-creator/SKILL.md` | Added | ADD |
| `extensions/skills/script-tool-creator/scripts/init_script_tool.py` | Added | ADD |
| `extensions/scripts/example-yt-dlp-downloader/` | Added | ADD |
| `extensions/scripts/example-yt-dlp-info/` | Added | ADD |
| `internal/filesystem/git.go` | Added | FEAT |
| `configs/prompts/system_prompt.md` | Modified | UPDATE |
| `go.mod` | Modified | CHORE |

***

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