# Changelog

All notable changes to this project are documented in this file.

## 0.3.13 - Unreleased

- 合并新版工作区选择修复与完整的 Harness 0.1.5-alpha.1 适配；0.3.12 因发布时间早于最后修复提交，保留为过渡版本。 / Include the final workspace-selection fix and complete Harness 0.1.5-alpha.1 adaptation; 0.3.12 remains a transitional release because it predates the final fix.

## 0.3.12 - 2026-09-09

- 修复新版宿主中钱包模型目录调用缺少 `remote.session` 注入而中断工作区/会话界面的问题。 / Declare the remote session dependency required by model-directory calls so workspace/session rendering does not fail on newer hosts.
- 增加 DSH `0.1.5-alpha.1` 的精确兼容声明；健康检查只对清单中明确记录的版本显示兼容，未来版本保持“尚未验证”。 / Declare exact DSH `0.1.5-alpha.1` compatibility; health checks keep unverified future releases unknown instead of assuming every newer host is compatible.
- 更新中英文介绍、兼容验证范围、源码位置、账本容量和汇率估算说明，区分钱包功能与宿主删除能力。 / Refresh bilingual feature and compatibility descriptions, source paths, ledger bounds, and currency-estimate limitations; distinguish wallet features from host-provided deletion.

## 0.3.11 - 2026-09-05

- 切换账户时清除旧余额并启动独立刷新，取消旧请求并忽略其迟到成功或失败；删除当前账户后重新读取宿主凭据对应的余额。 / Clear cached balance on account switches, start a fresh request, and discard stale successes or failures; refresh the host-credential balance after removing the active account.
- 设置备份按顺序发送，失败重试保留最新编辑，避免旧请求覆盖已保存的新设置，同时保留有限次数重试。 / Serialize preference backups and retain the newest queued edits across bounded retries so older requests cannot overwrite newer settings.
- 浏览器拒绝访问 localStorage 属性时，客户端仍可初始化并使用内存回退和宿主设置备份；桌面存储桥保持优先。 / Keep client initialization, memory storage, and host preference hydration working when access to the localStorage property is denied, preserving desktop storage bridge precedence.

## 0.3.10 - 2026-09-05

- 拆分可读客户端源码并提交可复现的精简加载产物，使每个文件低于 DSH STORE 的 256 KiB 自动审核上限；安装仍不需要构建或运行依赖。 / Split readable client sources and commit a reproducible compact loader artifact below DSH STORE's 256 KiB per-file review bound, retaining build-free installation and zero runtime dependencies.
- 声明 alpha.3、alpha.4、alpha.5、rc.1 的精确 DSH 兼容状态；alpha.4/alpha.5/rc.1 均完成隔离 Profile 安装、冷启动、钱包接口与客户端资源验证、卸载和回退。 / Declare exact DSH compatibility for alpha.3, alpha.4, alpha.5, and rc.1; the latter three passed disposable-profile installation, cold start, wallet endpoints/client resource delivery, removal, and rollback.
- 增加产物复现与文件体积检查，保留全部钱包、账户、套餐及分时计价回归。 / Add artifact reproducibility and byte-bound checks while retaining wallet, account, plan and time-of-use pricing regressions.

## 0.3.9 - 2026-09-04

- 第三方 API 自定义价格新增分时计价（Issue #37）：每个精确 Provider/模型可在基础价之上配置多个 IANA 时区、适用星期和起止时间规则，并为输入、缓存读、缓存写、输出分别定价；支持跨午夜时段，当前命中的价格段会在设置和钱包详情中显示。 / Added time-of-use custom third-party API pricing (Issue #37): each exact Provider/model route can define multiple IANA-timezone, weekday, and start/end windows over a base rate, with separate input, cache-read, cache-write, and output prices; cross-midnight windows are supported and the active price segment is shown in Settings and wallet details.
- 分时规则会拒绝无效时区、日期、时间和重叠范围；365 天账本与当前会话按每条保留用量的发生时间重新估算，缺少时间戳的旧聚合或已清除历史安全回退基础价，且 v0.3.8 固定价格规则无需迁移配置。 / Time-window validation rejects invalid timezones, weekdays, times, and overlaps; the 365-day ledger and live session reprice each retained usage event by occurrence time, while legacy aggregates or cleared history without timestamps safely use the base rate and existing v0.3.8 fixed-price rules remain compatible.
- 将峰谷时钟渲染测试固定到明确的工作日时间，避免测试结果随执行当天是否周末而波动。 / Pinned the peak-clock rendering test to an explicit weekday so its result no longer depends on the day the suite runs.
- Vision Toolkit 透明包装的 Z.ai 路由会还原为对应套餐 Provider，模型切换后继续显示 5 小时 Token 与月度 MCP 摘要，而不会误显示为普通第三方价格；DeepSeek 与其他包装路由的既有分桶规则保持不变。 / Z.ai routes transparently wrapped by Vision Toolkit now resolve back to their plan provider so model switches retain five-hour Token and monthly MCP summaries instead of looking like ordinary third-party pricing; existing DeepSeek and other wrapper classification remains unchanged.

## 0.3.8 - 2026-09-02

- 新增第三方 API 自定义价格（Issue #36）：可按精确 Provider/模型设置币种以及每百万 Token 的输入、缓存读、缓存写和输出价格；本会话与 365 天账本会按当前规则重新估算，并始终标注为用户自定义估算。 / Added custom third-party API pricing (Issue #36) with exact Provider/model matching, currency, and per-million input/cache-read/cache-write/output rates; current-session and 365-day ledger totals are recalculated from the active user rule and always labeled as estimates.
- 自定义价格保存在本机 `wallet.json`，支持修改、删除、观察到的路由建议、输入边界与官方/套餐 Provider 隔离；不会保存 API Key，也不会更改历史 Token。 / Custom prices persist locally in `wallet.json`, support editing, deletion, observed-route suggestions, bounded inputs, and strict separation from official/plan providers; no API keys or historical token counts are changed.

## 0.3.7 - 2026-09-01

- 适配 DeepSeek Harness `0.1.2-alpha.3` 的新客户端包结构：移除已被官方删除的 `@deepseek-ai/dsh-client-runtime` 清单边，继续通过 Cordis `sessions` 服务和现存 UI slot 合约工作；同时保留 `0.1.1-rc.2` 兼容。 / Adapted to the new DeepSeek Harness `0.1.2-alpha.3` client package layout by removing the retired `@deepseek-ai/dsh-client-runtime` manifest edge while continuing to consume the Cordis `sessions` service and surviving UI-slot contracts; `0.1.1-rc.2` compatibility is retained.
- 在隔离的 alpha.3 构建和数据目录中完成 npm 安装、完整 Harness 构建、Web 启动、插件后端、设置页、365 天账本、背景选项和健康检查验证，未向测试环境写入真实凭据。 / Verified npm installation, a full Harness build, Web startup, plugin host routes, settings UI, 365-day ledger, background controls, and health checks in isolated alpha.3 source/data directories without copying real credentials into the test environment.

## 0.3.6 - 2026-08-28

- 峰谷时钟新增明确的「透明 / 实色」背景选择，不加入自动模式；透明模式常态不铺底，悬停时使用主题实色，实色模式保持原有卡片背景。 / Added an explicit peak-clock background choice between transparent and solid, without an automatic mode; transparent mode removes the normal fill and uses the themed solid hover surface, while solid mode keeps the existing card background.
- 设置页和时钟控制面板共享该偏好，并同步保存到宿主钱包存储；覆盖默认、悬浮、竖排、浅色和深色主题，避免透明卡片文字或悬浮卡片背景异常。 / The setting is shared by the settings page and clock control panel and backed by the host wallet store; default, floating, vertical, light, and dark-theme paths are covered so transparent cards remain readable and floating cards keep a valid surface.

## 0.3.5 - 2026-08-27

- 修复 BigModel / Z.ai 中国区 Coding Plan 接口将 `TOKENS_LIMIT` 改名为 `CREDIT_LIMIT` 后被误判为“套餐接口返回格式已变化”的问题；兼容新旧字段，支持只有新额度字段的响应，并在接口提供时显示已用/总量、剩余量和重置时间。 / Fixed BigModel / Z.ai China Coding Plan responses being misclassified as “the plan response format changed” after `TOKENS_LIMIT` was renamed to `CREDIT_LIMIT`; both names are supported, credit-only responses are accepted, and available used/total, remaining, and reset values are shown when provided.
- 增加新旧字段共存时优先保留信息更完整的额度数据，并补充接口归一化与回归测试；当前 126/126 测试通过。 / Prefer the richer quota record when old and new names coexist, with normalization and regression coverage; 126/126 tests pass.

## 0.3.4 - 2026-08-25

- 修复 DSH Desktop 重启后部分插件设置因 WebView origin/localStorage 命名空间变化而丢失的问题：显示内容、输入框标签、仅显示余额、标签比例、提醒、峰谷卡和永久删除偏好现在会即时写入浏览器并同步备份到本地 `wallet.json`；宿主已有值优先恢复，宿主缺失的旧设置才从浏览器迁移，避免旧标签页在重启后反向覆盖新选择。 / Fixed wallet preferences disappearing after a DSH Desktop restart when the WebView origin/localStorage namespace changes: display, composer-label, primary-value, scale, reminder, peak-card, and permanent-delete preferences now write locally and mirror into `wallet.json`; existing host values restore authoritatively, while browser values migrate only for host-missing keys so stale tabs cannot undo newer choices after restart (Fixes #31).
- 新增受白名单和长度限制的 `/api/wallet/preferences` 读写接口，拒绝未知键和敏感字段；偏好沿用账本的主备恢复、失败锁写和退出前刷新机制。 / Added an allowlisted, length-bounded `/api/wallet/preferences` endpoint that rejects unknown or sensitive fields and inherits the ledger's backup recovery, fail-closed writes, and shutdown flush behavior.
- 新增宿主完整重载、Desktop 本地键丢失恢复、恶意字段拒绝和 keepalive 双写回归测试；当前 123/123 测试通过。 / Added host-reload persistence, missing-Desktop-key hydration, malicious-field rejection, and keepalive dual-write regressions; 123/123 tests pass.

## 0.3.3 - 2026-08-25

- 新增通用官方套餐适配器契约，并首批接入 Z.ai Coding Plan 全球区与中国区；每个来源固定绑定官方域名和独立的 DSH 凭据引用，浏览器不会收到 Key、接口路径或原始响应。 / Added a generic official subscription-plan adapter contract with initial Z.ai Coding Plan Global and China adapters; each source is pinned to its official domain and its own DSH credential reference, while the browser receives no key, endpoint path, or raw response.
- 套餐页分别显示 5 小时模型 Token 额度与月度 MCP 工具额度，以从 100% 向下消耗的剩余比例为主，已用比例和可用时的已用/总量为辅，并显示重置时间、套餐等级、更新时间和来源域名；剩余不高于 50% 变黄、不高于 20% 变红，也不把套餐额度换算成人民币余额。 / The plan view separates the 5-hour model-token window from monthly MCP-tool quota, leading with remaining percentage that drains from 100% while retaining used percentage and available used/total values; it also shows reset time, plan level, update time, and source domain, turns yellow at 50% remaining and red at 20%, and never converts quota into currency.
- 后台按来源独立解析凭据、5 分钟缓存并合并并发刷新；网络失败保留最近成功快照并标记缓存，401、限流、超时与响应结构变化只返回安全错误枚举。 / Each source resolves credentials independently, caches for five minutes, and deduplicates concurrent refreshes; failures preserve the latest successful snapshot and expose bounded error enums for authorization, rate limits, timeouts, and response changes.
- 钱包设置页在账户管理之后常态显示套餐卡片，紧凑钱包与悬浮窗提供可折叠入口；新增响应式、浅深色、无嵌套交互控件和进度条可访问性样式。 / Wallet settings keeps plan cards visible after account management, while compact and floating wallet panels expose a collapsible entry with responsive, theme-native, non-nested controls and accessible progress bars.
- 钱包标签与侧边栏时钟改为跟随当前会话的实时 Provider/模型：选择 Z.ai 时隐藏 DeepSeek 余额、充值与峰谷时钟，标签切换为 5 小时 Token、月度 MCP 和本场 Token 摘要；其他第三方只显示自身会话 Token，切回 DeepSeek V4 后恢复原视图。 / Made the composer chip and sidebar clock follow the current session's live provider/model selection: Z.ai hides DeepSeek balance, recharge, and peak pricing in favor of 5-hour Token, monthly MCP, and session-token summaries; other providers show only their own session usage, and DeepSeek V4 restores the original view.
- 修复 maid-atelier 皮肤的通用 `aria-haspopup="dialog"` 按钮规则把钱包主按钮强制压成 30×30、继而误触发 compact 的问题：标准标签在该皮肤下与 38px 工具栏对齐并使用主题变量，圆角裁剪也阻止模糊层和外阴影产生矩形漏色；设置页提供独立的“显示输入框标签”与“仅显示余额”开关，隐藏只影响输入框标签，不停止提醒、设置、套餐或账本；皮肤压窄侧栏时峰谷卡会按实际文本溢出换行，测量过程不再改动被监听卡片；模型菜单打开时临时停用皮肤的合成模糊层并使用不透明菜单面，避免 Edge 切换模型时重排或重绘卡住；峰谷卡在应用浅/深色模式下都沿用工作栏的深蓝金边配色，兼顾对比度与整体融合。 / Fixed maid-atelier's broad dialog-trigger rule forcing the wallet button to 30×30 and falsely triggering compact mode: the standard chip now aligns with the skin's 38px toolbar using theme tokens, with rounded clipping that prevents rectangular blur/shadow bleed; settings exposes independent composer-label visibility and primary-value-only switches; constrained peak cards wrap only on real text overflow using read-only measurement; the model picker temporarily disables the skin's composited blur in favor of an opaque menu surface to prevent Edge repaint stalls; and peak cards retain the workbar's navy-and-gold palette in both app themes for readable, integrated visuals (Fixes #30).
- 修复 Z.ai 套餐 Provider 被错误列入 DeepSeek“官方计费分桶”的问题：Z.ai 全球区与中国区现在是不可提升的独立套餐来源，旧勾选和误记费用会在载入时清理；控制面板新增 DeepSeek / Z.ai 手动查看切换与明确的拖动标题栏，且设置页会解释峰谷时钟在非 DeepSeek V4 模型下为何自动隐藏。 / Prevented Z.ai plan providers from appearing in or being promoted through DeepSeek's official-billing alias control: both regions are now reserved independent plan sources and stale selections or mispriced history are repaired on load; the details panel adds manual DeepSeek/Z.ai views and an explicit drag handle, while settings explains why the peak clock auto-hides outside DeepSeek V4.
- 新增套餐响应归一化、缓存迁移、官方域名白名单、路由安全、失败保留和 UI 回归测试，并使用本机已配置的 Z.ai 中国区 Coding Plan 做了不输出敏感信息的真实接口验证。 / Added coverage for response normalization, cache migration, official-origin pinning, route safety, stale-success retention, and UI behavior, plus a redacted real-interface verification against the locally configured Z.ai China Coding Plan.

## 0.3.2 - 2026-08-23

- 新增 365 天本地 Token 用量账本与折叠式热力图：按日期、会话、模型和官方/第三方 provider 展示调用次数、Token、缓存命中率与可定价费用。 / Added a 365-day local Token ledger and collapsible heatmap grouped by date, session, model, and official/third-party provider.
- 稳定的 `(turn, step)` 或请求标识会去重，后到的最终样本替换先前样本；费用在用量发生时锁定，未知价格只保留 Token。 / Stable `(turn, step)` or request identities are deduplicated, later final samples replace earlier ones, and cost is locked at usage time while unknown prices retain tokens only.
- 历史账本与当前会话清除分开，历史数据只写入本机钱包存储，不保存提示词、工具参数或回答正文；支持独立清除全部历史账本。 / History clearing is separate from current-session clearing; the local store keeps no prompts, tool arguments, or response bodies and exposes an independent clear-history action.
- 新增 `/api/wallet/history` 与 `/api/wallet/clear-history`，并补充跨平台、价格锁定、去重和 UI 回归测试。 / Added the history endpoints and regression coverage for cross-platform persistence, price locking, deduplication, and the heatmap UI.
- 提高浅色与深色主题下辅助文字的对比度，覆盖历史说明、统计标签、星期、账户数量、密钥掩码和版本号。 / Raised auxiliary-text contrast in light and dark themes across history labels, weekday markers, account metadata, masked keys, and version text.
- 重排钱包设置页：账户管理与常态展开的 365 天热力图紧跟余额概览，健康检查和显示/提醒偏好后移；紧凑钱包面板仍可折叠历史区。 / Reordered wallet settings so account management and the always-visible 365-day heatmap follow the balance overview, while compact wallet panels keep the history section collapsible.
- 全面加固账本准确性：去重键加入 provider/模型，修复清除会话后晚到样本少算、未定价状态无法恢复，并阻止在线价格同步覆盖历史固定价策略。 / Hardened ledger accuracy by isolating dedup keys per provider/model, fixing late replacements after session clearing, recovering unpriced state, and preventing live pricing sync from mutating historical flat-rate policies.
- 为 `wallet.json` 与 `accounts.json` 补齐主备恢复和失败锁写；Windows DPAPI 与 macOS/Linux AES-GCM 均覆盖损坏密文、权限、无明文和重启读取测试。 / Added primary/backup recovery and fail-closed writes for both stores, with Windows DPAPI and macOS/Linux AES-GCM coverage for corrupt ciphertext, permissions, plaintext exclusion, and reloads.
- 修复 320–390px 设置页被宿主导航挤压、热力图 resize 后偏离最新日期、365 个空白键盘焦点、异步旧响应覆盖和浅深色强度/对比度问题。当前 110/110 测试通过。 / Fixed narrow settings layout, recent-date tracking across resize, excessive empty keyboard stops, stale async responses, and light/dark heatmap contrast. 110/110 tests pass.

## 0.3.1 - 2026-08-23

- 修复 Windows DPAPI 账户密钥在重启后无法解密的问题，并在加密文件损坏或密钥不可用时锁定写入，避免覆盖原数据。 / Fixed Windows DPAPI account keys failing to decrypt after restart and locked writes when encrypted data cannot be recovered, preventing accidental overwrite.
- 修复 Electron/Tauri 同步通知句柄的点击/关闭回调断链，并让所有充值入口统一经过桌面端外链适配与首次域名确认。 / Fixed callback wiring for synchronous Electron/Tauri notification handles and routed every recharge entry through the desktop external-link adapter and first-use domain confirmation.
- 修复官方价格页改用“周一至周五”表述后同步被误判为结构变化的问题，并把视觉模型的计费生效时间校正为 2026-08-21 上线日。 / Accepted the official pricing page's current weekday-only wording and corrected vision-model billing to its 2026-08-21 launch date.
- 将周五 18:00 至周一 09:00 作为连续低谷周期：周五提示“周末全天低谷”，周六/周日分别显示当天全天低谷，周一 09:00 前显示剩余多久进入高峰；跨午夜不重复提醒。 / Treated Friday 18:00 through Monday 09:00 as one continuous off-peak period: Friday previews the all-weekend rule, Saturday/Sunday name the current day, Monday shows time remaining to peak, and midnight boundaries do not repeat alerts.
- 旧客户端在周末收到空峰值窗口，避免未强刷的 Edge 标签页继续误报高峰；账户文件现在自动保留加密 `.bak`，主文件缺失时可自动恢复。当前 91/91 通过。 / Weekend snapshots give stale clients no peak windows so an old Edge tab cannot keep falsely reporting peak; encrypted account files now keep a `.bak` fallback that restores a missing primary file. 91/91 tests pass.

## 0.3.0 - 2026-08-23

- 新增 `deepseek-v4-flash-vision-exp` 视觉模型计费，沿用 V4 Flash 的峰谷价格；图片 token 由 Harness 上报后与文本 token 一起计入。 / Added billing for `deepseek-v4-flash-vision-exp` using V4 Flash peak/off-peak rates; image tokens reported by Harness are counted with text tokens.
- 新增官方价格页自动检查：成功解析并完整校验后才应用新规则，网络失败或页面结构变化时保留内置规则并显示状态。 / Added official pricing-page sync: new rules apply only after complete validation; network failures or schema changes keep the built-in policy and expose the status.
- 新增 Harness 健康检查：显示宿主/插件版本、兼容性、价格同步状态与无敏感信息的诊断复制。 / Added Harness health checks for host/plugin versions, compatibility, pricing-sync status, and safe diagnostic copying.
- 多账户 API Key 改为加密存储：Windows 使用当前用户 DPAPI，其他系统使用 AES-GCM 本地密钥文件；兼容旧版明文账户文件并在下次保存时迁移。 / Encrypted multi-account API keys at rest with Windows DPAPI or an AES-GCM local key file; legacy plaintext account files migrate on the next save.

## 0.2.6 - 2026-08-23

- 跟随 DeepSeek 官方规则更新峰谷计费：自 2026-08-23 北京时间 00:00 起，周六、周日全天按低谷价计费；工作日高峰仍为 09:00–12:00、14:00–18:00。 / Updated peak/off-peak billing to match DeepSeek's official rule: from 2026-08-23 00:00 Beijing, Saturday and Sunday are all-day off-peak; weekday peak windows remain 09:00–12:00 and 14:00–18:00.
- 环形卡片同步显示周末全天低谷，并将倒计时指向下一个工作日 09:00。 / Updated the ring card to show weekend all-day off-peak and count down to the next weekday 09:00.

## 0.2.5 - 2026-08-23

- 修复浮动峰谷卡片在窗口缩放、卡片放大或历史坐标过期后可能跑出视口的问题；加载、缩放、排版切换和 resize 都会重新钳制位置。 / Fixed floating peak cards escaping the viewport after resize, scale changes, or stale saved coordinates; load, scale, layout changes, and resize now re-clamp the position.
- 恢复 Portal 挂载，确保自由浮动卡片和控制面板脱离侧边栏溢出裁剪。 / Restored Portal mounting so floating cards and the control panel escape sidebar overflow clipping.
- 完成主题回退清理，移除峰谷控制面板、浮动卡片和开关中的硬编码浅色背景/文字回退。 / Completed theme fallback cleanup for the peak panel, floating card, and switches.
- 保留账户安全、存储权限、刷新异常和偏好同步加固，并避免原始凭证错误文本进入日志或浏览器。 / Kept account-safety, storage-permission, refresh-failure, and preference-sync hardening without exposing raw credential errors to logs or the browser.
- 新增浮动坐标边界、Portal 和完整主题回退回归测试；当前测试基线为 78/78。 / Added regression coverage for floating-coordinate bounds, Portal mounting, and complete theme fallbacks; the test baseline is now 78/78.

## 0.2.4 - 2026-08-22

- 彻底修复暗色模式（Dark Mode）主题适配（Issue #26）：移除所有未主题化的浅色硬编码回退（`--dsw-alias-bg-elevated,#fff`、`--dsw-alias-bg-overlay,#fff` 等），全站统一使用 DSH 原生主题变量（`--dsw-alias-bg-layer-*` 与 `--dsw-alias-label-dimmed`），在深色模式下完美融入背景。 / Fully fixed Dark Mode theme compliance (Issue #26): replaced unthemed hardcoded light fallbacks with DSH native theme variables (`--dsw-alias-bg-layer-*`), rendering dark themes seamlessly without blinding white boxes.
- 新增峰谷时钟专属控制面板（Dedicated Control Panel）：点击时钟卡片即可就地弹出专属浮动控制面板，支持实时查看峰谷优惠说明、账户余额明细与快速充值，并提供排版切换、缩放调节与归位管理。 / Added a dedicated peak clock control popover: clicking the clock card opens an interactive panel for live rate info, quick recharge, orientation toggles, and layout controls.
- 峰谷时钟支持自由拖拽与持久化记忆：卡片支持在屏幕上任意拖拽移动，脱离侧边栏限制（Portal 渲染），拖拽释放自动持久化坐标，并在浮动卡片右上角和控制面板提供一键「↩ 归位」回到侧边栏底部。 / Added free-floating drag & drop for the peak clock: smoothly movable across the viewport with boundary clamping, position persistence in localStorage, and one-click dock reset.
- 峰谷时钟横向与纵向排版自由切换：支持标准的横向卡片与 ~140px 纤细纵向胶囊卡片（侧边栏内居中、浮动时轻巧紧凑）。 / Added customizable layout: seamlessly toggle between horizontal card layout and slim ~140px vertical capsule layout.
- 充值按钮内嵌排版优化：将充值按钮移至第三行倒计时右侧，彻底消除竖排按钮对第二行金额造成的水平挤压与 `¥...` 截断问题，金额与本场消耗 100% 完整显示。 / Relocated recharge button inline next to the countdown row, completely eliminating text truncation on the balance and session cost line.
- 新增时钟缩放滑条（100% ~ 120%）与充值按钮独立开关：支持按需放大时钟或收缩整体卡片尺寸。 / Added a dedicated scale slider (100% ~ 120%) and recharge button visibility toggle in both the popup panel and settings page.

## 0.2.3 - 2026-08-21

- 修复 Provider 分桶实际未参与计费的问题；已勾选的包装路由现在真正进入官方 token/花费桶，并记录新观察到的 Provider。 / Fixed provider aliases not reaching the billing path: opted-in wrapper routes now enter the official token/cost bucket, and newly observed providers are recorded.
- 修复首次添加账户时凭证同步失败仍显示为当前账户的问题；失败会回滚激活状态。 / Rolled back first-account activation when the host refuses credential synchronization.
- 修复删除账户后账户专属阈值未写回钱包存储的问题。 / Persisted removal of account-specific thresholds when an account is deleted.
- 余额错误改为安全枚举，避免把上游错误原文暴露到浏览器；美元/多余额记录的明细选择也统一。 / Replaced raw balance errors with safe enums and aligned multi-currency balance selection.
- 统一提醒设置的本地存储格式，并兼容旧的毫秒字段；API Key 输入框默认隐藏。 / Unified reminder storage with migration from the legacy millisecond field and made API-key inputs password fields.

## 0.2.2 - 2026-08-20

- 新增 24h 峰谷计费分时时钟：在侧边栏左下角常驻展示当前时段（高峰/低谷半价）、剩余倒计时、实时余额与本场/本约花费；折叠导轨模式下自动收拢为 42px 紧凑环形钟。 / Added a 24h peak/off-peak ring clock in the sidebar footer: live pricing window (peak / 50% off-peak), switch countdown, live balance and session spend; collapses into a 42px compact circle in rail mode.
- 侧边栏时钟卡片视觉重构：三行式清爽信息流，字号与容器全面放大，右侧内置紧凑竖排「充值」按钮直达官方充值后台，消除横向挤压与文本截断。 / Restyled the sidebar footer card: three-line spacious flow, larger typography, and a compact vertical recharge button that opens official top-up without text truncation.
- 峰谷切换系统通知：跨越峰谷时段时自动推送桌面系统通知（可在设置中随心开启/关闭），不错过半价调用的省钱窗口。 / Added peak/off-peak desktop switch reminders with a dedicated toggle in settings.
- 跨组件毫秒级实时同步：输入框钱包芯片与侧边栏时钟卡片通过全局事件总线（`dshw-snapshot-update` / `dshw-refresh`）毫秒级联动，账户切换与会话消耗实时双向一致。 / Cross-component event sync: wallet composer chip and sidebar clock card stay 100% in sync across account switches and live session token usage.
- 会话花费彻底杜绝 `--` 占位：始终常驻真实货币金额（无消耗显示 $0.00 / ¥0.00），随多币种账户（USD/CNY）实时切换对应格式与估算/精确标签。 / Always-visible numeric session cost: never drops to `--`, defaults to $0.00/¥0.00, and hot-adapts to active account currency (USD/CNY).

## 0.2.1 - 2026-08-20

- 标签上「本场」恢复常显（¥0.00 也显示，新会话不再缺席）；仅未定价模型仍隐藏。/ The chip shows the session cost again even at ¥0.00; only unpriced models stay hidden.
- 面板/浮动窗版本号移至底部右下角，不再与顶栏按钮挤压。 / Panel version tags moved to the footer, clear of the header buttons.

## 0.2.0 - 2026-08-19

- 新增多账户管理与热切换：面板内“账户管理”可添加多个账户（名称 + API Key），切换后无需重启，下一次 LLM 调用即按新账户计费；key 界面掩码显示，余额查询跟随当前账户（contributed in PR #4 by mxchen-xyz）。 / Added multi-account management with hot switching: manage accounts in the panel, and the very next LLM call is billed with the newly activated key — no restart needed; keys stay masked in the UI and balance follows the active account.
- 面板视觉重做：余额横排摘要卡、设置合并为分组卡片（胶囊开关、行内滑块、阈值保存贴边）、账户列表限高两行滚动、主操作并列与安静的清除入口。 / Restyled the panel: horizontal balance summary card, grouped settings card (chip toggles, inline slider, threshold save inline), two-row scrollable account list, and paired primary actions with a quiet destructive entry.
- 宿主设置面板（视觉工具下方）新增「钱包」设置页：余额、阈值、显示内容、芯片比例、完成提醒与账户管理，与标签面板实时同步。 / Added a 钱包 (Wallet) page to the host settings panel below Visual tools: balance, threshold, visibility, chip scale, completion reminders, and account management, kept in sync with the chip panel.
- 设置页钱包页两列网格布局铺满宿主内容列，余额行横排。 / The settings wallet page lays controls out in a two-column grid that fills the host settings column.
- 会话花费跟随当前账户货币：美元账户显示「本约 $x」（按 CNY 价折算的估算值，标签承担约算含义），人民币账户显示精确的「本场 ¥x」。 / Session cost follows the active account currency: USD accounts show 本约 $x (a labeled estimate converted from the CNY table), CNY accounts show the exact 本场 figure.
- 芯片上低于显示精度的会话花费（如 $0.00）直接隐藏，面板照常显示，高缩放下更容易保持完整布局。 / Sub-cent session spend is hidden on the chip (kept in panels) so the full layout survives high scale factors.
- 输入框位置缩放上限进一步收紧为 105%（悬浮/侧边仍 125%）。 / Tightened the composer-docked scale cap to 105%, while floating and side docks retain 125%.
- 包装官方的路由（如 dsh-vision-proxy 的 deepseek-vision）可勾选计入官方计费桶：设置页新增「Provider 分桶」，自动列出出现过的 provider，勾选即按官方价格计入本场花费（Fixes #21, reported by @wenjie0112）。 / Wrapper provider routes (e.g. deepseek-vision from dsh-vision-proxy) can be checked into the official billing bucket: the settings page gains a Provider section listing observed providers; checked ones bill officially.
- 账户激活通过宿主凭据接口写入 `DEEPSEEK_API_KEY`；若启动环境变量覆盖该值，则安全拒绝切换，避免显示虚假的激活状态。 / Account activation writes through the host credentials seam and safely refuses switching when a launch-time environment variable shadows `DEEPSEEK_API_KEY`.
- 新增账户列表、激活和移除 API，并补充账户存储辅助函数测试。 / Added account list, activation, and removal APIs with account-store helper coverage.

## 0.1.5 - 2026-08-18

- 修复输入框内的余额标签被固定压缩成 44px 极简显示的问题，现在按实际可用空间在完整 / 紧凑 / 极简三档间自动切换。 / Fixed the composer chip always collapsing to its 44px compact value; it now switches between full, fit, and compact layouts by measured space.
- 修复缩放比例不等于 100% 时被误判为空间不足的问题。 / Fixed compact mode being mis-triggered whenever the scale was not 100%.
- 修复芯片拖到输入框旁悬浮时被其他面板遮挡的问题。 / Fixed docked chips being covered by neighbouring host panels.
- 输入框内缩放上限调整为 120%，悬浮 / 侧边停靠时仍可到 125%。 / The scale slider is capped at 120% in the composer row; floating and side docks keep the full 75–125% range.

## 0.1.4 - 2026-08-17

- Reworked wallet placement around direct manipulation: the chip can stay in the composer, move freely, or snap to the composer bottom, viewport sides, and the main-content divider. Dragging now previews the destination and can cross from one region to another in a single gesture instead of being trapped by an intermediate snap.
- Added compact horizontal and vertical dock layouts, narrowed the side-dock frame without shrinking its text, and kept every vertical value directly below its label. When a narrow composer cannot fit the full home chip, it now preserves a clickable 44px balance/token value instead of overflowing under the model selector.
- Added a 75–125% live scale slider and independent official/third-party visibility controls, while preventing both data sources from being hidden at once.
- Made the details panel draggable with a remembered, viewport-clamped position. “Minimize” now goes directly to a freely movable circular wallet instead of creating a second floating state.
- Expanded conversation-completion reminders with persistent or timed dismissal, simultaneous-completion queueing, deduplication, cross-tab ownership, click-to-open behavior, and an in-page fallback when system notifications cannot be delivered.
- Added a single desktop-wrapper compatibility adapter for notifications, notification permission, local storage, external links, and optional host capabilities. Synchronous, fire-and-forget, Promise-based, and failure-fallback notification bridges are covered by regression tests.
- Added a host-gated permanent-deletion preference. The npm plugin exposes the preference only when the surrounding DSH host advertises a real deletion implementation; unsupported hosts show a disabled control. The separate “clear wallet data” action was renamed and documented to make clear that it removes only this conversation's wallet counters, not the conversation.
- Added a versioned Agent host-integration kit for permanent deletion: bilingual guides, a complete adaptation prompt, compatibility manifest, read-only preflight, upstream/license notice, and a reference patch pinned to DSH commit `47f943859bef60e4160492346772ded9b24f765a` (`0.1.0-rc.5`). The npm plugin still does not claim to be the deletion engine.
- Tightened the control-panel layout and labels without reducing the base font size, including clearer completion-reminder and permanent-deletion controls.
- Replaced screenshot-dependent README sections with detailed English and Chinese product introductions, package-safe language navigation, explicit compatibility evidence levels, and clearer trust and host-capability boundaries.
- Expanded the zero-dependency test suite with release metadata, documentation-resource, HTTP route-boundary, layout, reminder, desktop fallback, and capability-gating checks; added exact npm archive verification for the 0.1.4 release candidate.
- Expanded validation to Windows, Ubuntu, and macOS on Node 22.19 and 24, added cross-platform reference-patch checks and focused DSH deletion-chain tests, and added npm OIDC trusted publishing for formal GitHub Releases.

## 0.1.3 - 2026-08-16

- Fixed the recharge shortcut so its first click reliably opens the anti-phishing confirmation, including when the detail panel is closed (contributed in PR #2 by QZYWQ).
- Fixed the detail panel opening below the viewport; it now uses viewport-aware fixed positioning and flips above the chip when needed.
- Session cost is now accumulated at the price active when each usage event arrives, so historical spend no longer changes at peak/off-peak or policy boundaries. Existing stores migrate once to schema v2 and keep the migrated estimate.
- Added currency-aware balance formatting and stopped applying the CNY low-balance threshold to non-CNY accounts.
- Reworked floating drag with pointer events for mouse and touch, fixed click-without-drag crashes, and clamp positions using the actual dot/window dimensions.
- Replaced nested clickable markup with native buttons, added dialog semantics, focus handling, Escape support, and keyboard focus styles.
- Moved the interactive chip to the Harness `conversation.input.left` slot, deduplicated concurrent balance refreshes, and flush pending persisted changes during plugin shutdown.
- Expanded regression coverage and CI to run tests and package verification on Linux and Windows with Node 22 and 24.
- Added capability-based browser/desktop adaptation: optional wrapper bridges for notifications, storage, and external links; in-page notification, cross-tab lease, and CSS-scale fallbacks; and host capability discovery that disables unsupported permanent-delete controls instead of exposing a dead switch.
- Fixed completion reminders for the currently selected conversation by detecting its running-to-idle transition; desktop notification bridges now also support fire-and-forget, Promise-based, and native callback APIs.

## 0.1.2 - 2026-08-15

- Fixed the client bundle loader id to match the package name (`deepseek-harness-wallet`); 0.1.1 still registered the old `dsh-wallet` id, which aborted the whole plugin boot ("loaded without registering") after the rename. Regression test added.
- Implemented the 2026-08-17 peak/off-peak pricing for the v4 models (Beijing 09:00–12:00 / 14:00–18:00 peak; off-peak is half the peak rate).
- Fixed the v4 pricing effective date in the READMEs (2026-04-24, matching the V4 preview launch).
- Balance total now prefers the CNY record and never sums mixed currencies (fixes wrong totals and false low-balance alerts on international accounts).
- Hardened the persisted store: threshold values are coerced on load, saves are atomic (temp file + rename), and boot-retry timers are cleaned up on plugin stop.
- Floating window drag now clamps by the dragged element's real size, so the panel can no longer be pushed mostly off-screen.

## 0.1.1 - 2026-08-14

- Added floating window mode: detach the wallet panel into a draggable floating window with a persistent position, or minimize it to a dot that turns red when the balance is below the threshold.
- Replaced the control-panel screenshot with floating-window screenshots in the READMEs.

## 0.1.0 - 2026-08-14

- Initial public release.
- Added official DeepSeek balance monitoring and manual refresh.
- Added per-session DeepSeek cost estimation and provider-aware token counters.
- Added configurable low-balance alerts and desktop notifications.
- Added a guarded shortcut to the official DeepSeek recharge page.
- Added English and Simplified Chinese documentation.
