# v1.4.0 Release Notes

> v1.3.23 -> v1.4.0

## Summary

Introduces a sandboxed lifecycle hook system with dedicated management tools so scripts can inspect, log, or block execution at key task checkpoints, with hook messages shown in both the TUI and the web UI. Adds embedded default denied-path protections merged with user configuration. Simplifies HTML report generation and updates platform setup documentation.

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

引入具沙盒隔離的生命週期 hook 系統與專屬管理工具，讓腳本能在關鍵任務節點檢查、記錄或攔截執行，hook 訊息同時呈現於 TUI 與 Web UI。新增內嵌預設拒絕路徑清單並與使用者設定合併。簡化 HTML 報告產出並更新平台安裝說明。

</details>

## Changes

### FEAT

- Add sandboxed lifecycle hook system for Python and JavaScript scripts (@pardnchiu) [04d8a013, 3e7dace1, 3124f803, 293606be, 0bf1f57e, 14ecf413]
    - Run `.py` or `.js` scripts across seven lifecycle states (`before_user_send`, `before_tool_call`, `after_tool_call`, `after_tool_error`, `after_ask_user`, `after_task_done`, `after_task_cancel`) from global and workspace hook directories with a 30s timeout.
    - Pass session metadata, tool inputs and results, `ask_user` answers, task output and duration, and token usage totals via stdin JSON, applying pass, block, or steer decisions from the final stdout JSON line.
    - Stream non-empty hook debug output as `EventHookLog` in the TUI, log tailer, and session action logs, and bundle Python and JavaScript demo scripts for every state in `makefile` and release archives.
    - Skip a hook whose script file was removed mid-task instead of treating the missing file as a block.
- Add `write_hook`, `read_hook`, and `test_hook` tools with the `hook` guide topic (@pardnchiu) [52d4f53c]
    - Inspect state demos and installed hooks with `read_hook`, write, patch, or trash hooks with `write_hook`, and verify sample stdin payloads with `test_hook`.
    - Add the `hook` topic to `reasoning_guide`, exclude `write_hook` and `test_hook` from subagent tool sets, and wire TUI diff previews and confirmation popups.
- Render hook messages in the web UI (@pardnchiu) [14ecf413]
    - Show hook messages and hook stop reasons in a fixed-height, scrollable block under each assistant message, paged with previous and next buttons and jumping to the newest entry as it arrives.
    - Record hook stop reasons in the session action log and rebuild the block from it on page reload.
- Embed default denied-path protection list and merge with user configuration (@pardnchiu) [e69605ee]
    - Load `configs/jsons/denied_path.json` (protecting Agenvoy runtime files, browser profiles, keyrings, and AI CLI credentials) and combine it with user `denied_path` entries during runtime initialization.

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

- 新增支援 Python 與 JavaScript 的沙盒化生命週期 hook 系統
    - 從全域與工作區 hook 目錄載入 `.py` 或 `.js` 腳本，於七個生命週期節點（`before_user_send`、`before_tool_call`、`after_tool_call`、`after_tool_error`、`after_ask_user`、`after_task_done`、`after_task_cancel`）執行，單次逾時上限為 30 秒。
    - 透過 stdin JSON 傳入會話中繼資料、工具輸入與結果、`ask_user` 回答、任務輸出與耗時以及 token 用量總計，並依最後一行 stdout JSON 套用放行、阻斷或引導決策。
    - 將非空的 hook 除錯輸出以 `EventHookLog` 串流至 TUI、日誌追蹤器與會話動作日誌，並於 `makefile` 與發行壓縮檔內隨附各節點的 Python 與 JavaScript 範例腳本。
    - 任務執行中途 hook 腳本被移除時直接略過，不再將找不到檔案視為攔截。
- 新增 `write_hook`、`read_hook` 與 `test_hook` 工具及 `hook` 引導主題
    - 透過 `read_hook` 檢視範例與已安裝的 hook，透過 `write_hook` 建立、修補或移至垃圾桶，並以 `test_hook` 使用測試 stdin payload 驗證腳本。
    - 於 `reasoning_guide` 加入 `hook` 主題，將 `write_hook` 與 `test_hook` 排除於 subagent 工具集之外，並串接 TUI 差異預覽與確認彈窗。
- 於 Web UI 呈現 hook 訊息
    - 在每則 assistant 訊息下方以固定高度、可捲動的區塊顯示 hook 訊息與 hook 攔截原因，提供上一頁／下一頁切換，新訊息到達時自動跳至最新一筆。
    - 將 hook 攔截原因寫入會話動作日誌，重新整理頁面時據此重建區塊。
- 新增內嵌預設拒絕路徑保護清單並與使用者設定合併
    - 於執行期初始化時載入 `configs/jsons/denied_path.json`（保護 Agenvoy 執行檔、瀏覽器設定檔、金鑰圈與 AI CLI 憑證），並與使用者設定的 `denied_path` 合併。

</details>

### UPDATE

- Simplify HTML report generation and validation without QuickUI or MapLibre (@pardnchiu) [e4619daa]
    - Update the `html_render` guide to use plain HTML, inline scripts, and pinned CDN library versions for ECharts, Font Awesome, highlight.js, KaTeX, and Mermaid.
    - Replace QuickUI validation in `write_result` with `<script>` JS syntax parsing and `T.init` container checks, and remove obsolete `pre.prettyprint` CSS rules.
    - Downgrade non-browser `fetch_page` fetch error logs from error to debug level.

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

- 簡化 HTML 報告產出與驗證流程並移除 QuickUI 與 MapLibre 相依
    - 更新 `html_render` 引導為純 HTML 與內嵌腳本，並固定 ECharts、Font Awesome、highlight.js、KaTeX 與 Mermaid 的 CDN 版本。
    - 將 `write_result` 中的 QuickUI 驗證改為 `<script>` JS 語法解析與 `T.init` 容器檢查，並移除過時的 `pre.prettyprint` CSS 規則。
    - 將 `fetch_page` 非瀏覽器擷取錯誤的日誌層級由 error 降為 debug。

</details>

### REFACTOR

- Move locale JSON files into `configs/jsons/locale/` (@pardnchiu) [cc3e58f5]
    - Relocate `confirm/*.json`, `reply_lang.json`, and `refusal_messages.json` under `configs/jsons/locale/` and update embed declarations and `internal/locale/` log paths.

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

- 將語系 JSON 檔案移至 `configs/jsons/locale/`
    - 將 `confirm/*.json`、`reply_lang.json` 與 `refusal_messages.json` 統一搬遷至 `configs/jsons/locale/`，並同步更新 embed 宣告與 `internal/locale/` 日誌路徑。

</details>

### CHORE

- Bump NanoMD vendored parser from 2.0.12 to 2.0.14 (@pardnchiu) [e4619daa, e870547f]

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

- 將內嵌 NanoMD 解析器版本由 2.0.12 升級至 2.0.14

</details>

## Scope

- `.github/workflows/release.yml` — FEAT
- `README.md` — DOC
- `configs/` — FEAT, UPDATE, REFACTOR (multiple files, including `hooks/demo/`)
- `doc/` — DOC (`README.zh.md`, `doc.md`, `doc.zh.md`)
- `internal/agents/exec/` — FEAT (multiple files)
- `internal/agents/exec/hook/` — FEAT (`answers.go`, `call.go`, `load.go`, `run.go`)
- `internal/agents/types/` — FEAT (`event.go`)
- `internal/filesystem/` — FEAT (`path.go`, `runtime.go`)
- `internal/locale/` — REFACTOR (`askUser.go`, `challenge.go`, `chatbotCode.go`, `confirm.go`, `refusal.go`)
- `internal/runtime/tui/` — FEAT (multiple files)
- `internal/session/log/` — FEAT (`format.go`, `record.go`)
- `internal/tools/` — FEAT, UPDATE (multiple files)
- `internal/utils/` — FEAT (`toolFormat.go`)
- `makefile` — FEAT
- `page/` — FEAT, UPDATE, CHORE (`public/index.css`, `public/index.js`, `src/js/`, `src/sass/right-content/`, `vendor.json`)

***

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