# Changelog 本插件的所有重要变更记录于此。版本号遵循 [SemVer](https://semver.org/lang/zh-CN/)。 All notable changes to this plugin are documented here. ## [0.2.0] - 2026-09-21 ### Added / 新增 - **自动刷新间隔可配置**:设置页新增「自动刷新间隔(分钟)」输入(1 – 1440,默认 30), 随其他配置一同持久化;指示器悬停提示会显示当前生效的间隔。 Configurable auto-refresh interval (1–1440 minutes, default 30), persisted with the rest of the config and reflected in the indicator tooltip. - **独立设置分区**:原先挂在「设置 → 通用」下的行改为独立的「GLM 余额」分区 (`settings.section`,导航标签本地化 zh/en)。 The settings moved out of the General section into a dedicated "GLM Balance" section of its own. ### Changed / 变更 - 默认轮询间隔由 5 分钟改为 **30 分钟**(`USAGE_POLL_MS` 固定值改为按配置计算)。 Default polling interval changed from 5 minutes to 30 minutes. - 轮询改为 15 秒心跳 + TTL 判定:改间隔立即生效,无需重建定时器;获取失败的 状态同样遵守间隔,不再每次心跳都重试。 Polling now uses a 15-second tick plus a TTL check, so interval changes apply immediately and error states are no longer retried on every tick. - 设置写入后即时同步本地缓存并触发一次刷新,无需重载页面。 Saving the settings updates the local cache and triggers a refresh immediately. - 包名 / 插件 id 统一为 `dsh-plugin-glm-balance`(与仓库同名)。从旧名 `dsh-glm-balance` 安装的环境请重新安装。 Package/plugin id unified as `dsh-plugin-glm-balance` (matches the repository); environments installed under the old name must reinstall. ### Config / 配置 `glm-balance.json`(默认 `~/.dsh/glm-balance.json`)新增字段,旧文件无需改动 (缺失时使用默认值 30): ```json { "authorization": "bigmodel.cn authorization 值", "providerId": "zai-coding-cn", "refreshMinutes": 30 } ``` ## [0.1.0] - 2026-09-21 ### Added / 新增 - 首个版本:输入框上下文用量旁的智谱 GLM 额度指示器(小时 / 每周两条迷你进度条, 含百分比与下次重置时间),仅当会话当前供应商为 `zai-coding-cn` 时显示。 First release: GLM quota indicator (hourly/weekly mini bars with percentage and next-reset time) beside the composer's context meter, shown only when the session's current provider is `zai-coding-cn`. - 点击立即刷新(带 spinner)、右键菜单(打开 bigmodel.cn 用量页面 / 刷新)。 Click to refresh with a spinner; right-click menu to open the usage page or refresh. - 认证状态提示:未配置 / 认证失效 / 上游失败,点击给出修复指引。 Auth states: no token / auth invalid / upstream failure, with a fix hint on click. - 宿主半代理路由 `GET/POST /glm-balance/api/config`、`GET /glm-balance/api/usage` (同源代理,规避浏览器 CORS)。 Host-half same-origin proxy routes avoiding browser CORS. - 配色全部走 `--dsw-*` 主题 token,自动适配浅色 / 深色 / 第三方主题。 All styling goes through `--dsw-*` theme tokens (light, dark, third-party themes). [0.2.0]: https://github.com/HoodyHuo/dsh-plugin-glm-balance/compare/v0.1.0...v0.2.0 [0.1.0]: https://github.com/HoodyHuo/dsh-plugin-glm-balance/releases/tag/v0.1.0