# v1.3.19 Release Notes

> v1.3.18 -> v1.3.19

## Summary

This hotfix extends manual human verification to page downloads with a session-scoped cache so users are not re-prompted across requests. It also skips interactive prompts in headless Linux environments and delegates shared browser checks upstream.

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

此 hotfix 將手動真人驗證擴展至頁面下載並加入會話級快取，避免使用者在同一請求脈絡下重複受詢。同時在無圖形介面的 Linux 環境略過互動視窗提示，並將共用的瀏覽器檢查委派至上游套件。

</details>

## Changes

### FEAT

- Add manual human verification to `download_file` (`render: true`) (@pardnchiu) [46189974]
    - Reuse existing session decisions with the configured challenge wait
    - Prompt on `ErrChallengeRequired` and skip as 403 when declined
    - Reset session challenge state and skip as 403 on `ErrChallengeClosed`
- Persist challenge verification decisions across calls per session (@pardnchiu) [46189974]
    - Cache enabled or declined decisions by `SessionID` for 30 minutes after last use
    - Refresh the expiry window on each subsequent read
    - Evict the cached entry when `ResetChallenge` is called

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

- 為 `download_file`（`render: true`）新增手動真人驗證流程
    - 沿用既有 session 決定並套用設定的驗證等待時間
    - 遇到 `ErrChallengeRequired` 時詢問使用者，拒絕則以 403 略過
    - 遇到 `ErrChallengeClosed` 時重設 session 驗證狀態並以 403 略過
- 依 session 跨次保留真人驗證決定
    - 以 `SessionID` 快取同意或略過狀態，於最後一次使用後保留 30 分鐘
    - 每次讀取時刷新到期時間
    - 呼叫 `ResetChallenge` 時清除快取項目

</details>

### FIX

- Skip manual verification prompts on headless Linux and WSL (@pardnchiu) [32ee3090, 46189974]
    - Return false from `askChallenge` when running under WSL
    - Require `DISPLAY` or `WAYLAND_DISPLAY` on non-WSL Linux before prompting

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

- 在無圖形介面的 Linux 與 WSL 環境略過手動驗證提示
    - 於 WSL 下執行時由 `askChallenge` 直接回傳 false
    - 非 WSL 的 Linux 需具備 `DISPLAY` 或 `WAYLAND_DISPLAY` 才進行詢問

</details>

### REFACTOR

- Extract challenge helpers and delegate page checks to `go-browser` (@pardnchiu) [46189974]
    - Move challenge text loading, prompting, and decline handling into `challenage.go`
    - Replace local URL, error-title, and Chrome profile helpers with `go-browser`

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

- 抽離驗證輔助函式並將頁面檢查委派至 `go-browser`
    - 將驗證提示文字載入、詢問與拒絕處理移至 `challenage.go`
    - 以 `go-browser` 取代本地網址、錯誤頁標題與 Chrome 設定檔判斷輔助函式

</details>

### CHORE

- Bump `github.com/pardnchiu/go-browser` from `v0.3.7` to `v0.3.8` (@pardnchiu) [46189974]

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

- 將 `github.com/pardnchiu/go-browser` 從 `v0.3.7` 升級至 `v0.3.8`

</details>

## Scope

- `internal/tools/fetchPage/` — FEAT, FIX, REFACTOR (`challenage.go`, `downloadFile.go`, `fetchPage.go`)
- `internal/tools/types/` — FEAT (`executor.go`)
- `go.mod`, `go.sum` — CHORE (`go-browser` v0.3.8)

---

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