Skip to content

Releases

v1.3.2 — auto 额度被撤掉后的显示

Choose a tag to compare

@zq0929 zq0929 released this 06 Nov 05:48

Upstream now reports autoLimitEnabled: false / autoLimitUsd: 0 while
autoUsedUsd keeps climbing: the auto bucket is metered but uncapped.

  • header chip renders usage only: auto $5.40 · 不限
  • no percentage is invented for a bucket without a limit
  • tool says "the API reports no monthly cap for this bucket" instead of
    calling it unconfigured
  • same handling for the high-cost-model bucket

v1.3.1 — 点击时的旋转反馈

Choose a tag to compare

@zq0929 zq0929 released this 04 Nov 06:30

Fix: a click refresh was silent once the first reading had arrived.

The shared store flipped to loading only before the first reading, so
afterwards a manual refresh changed nothing visually. Now the store keeps
a separate refreshing flag:

  • previous reading stays on screen (no blinking numbers)
  • the gauge spins, the label dims to 50%, cursor becomes progress
  • data-state="loading" + aria-busy="true" while in flight

Click still forces a fresh read (?refresh=1, bypassing the Host reuse
window); polling keeps using the reuse window.

v1.3.0 — 底部总用量 + 标题栏 auto 用量

Choose a tag to compare

@zq0929 zq0929 released this 04 Nov 06:13

两处座位各放最有用的一格:

位置 内容
输入框下方(conversation.composer.dock,order 2) ◔ 周期 $0.17 / $50.00 (0%) —— 本计费周期总用量
会话标题栏(conversation.session.header.utilities,order 10) ◔ auto $3.05/$15 —— auto 模型独立月额度
  • 两处各只有一段短文本,不再像 v1.1 那样把底部一行挤爆。
  • 共享一份快照:模块级 store 统一负责读取、复用窗口、点击强制刷新与轮询间隔,两个座位只是订阅;最后一个座位卸载时停止轮询。点任一处的胶囊,两处一起刷新。
  • 平台没有 auto 月额度时,标题栏那枚不渲染(周期总量已经在底部),不留空壳。
  • 悬停提示不变:套餐状态、周期已用/限额/百分比/剩余、auto 与高阶月额度、今日用量与告警阈值、重置时间、5h 窗口结束、读取时间。
  • 标题栏窄于 560px 时自动只留仪表图标(悬停仍有完整明细)。

Host 侧无改动,接口与 coding_plan_balance 工具输出不变。已用离线渲染把八种状态(含无 auto 桶、auto 用尽、套餐阻断、缺 Key、上游报错)和"两个座位只打一次请求"都跑过。

v1.2.0 — 挪到会话标题栏

Choose a tag to compare

@zq0929 zq0929 released this 04 Nov 06:04

胶囊从输入框下方的 dock 移到会话标题栏右侧的 utility 行。

为什么

composer dock 是输入框下方的一条横向空间:DSH 自带的 activity / usage、本插件、以及 workbuddy 的两项挤在一起,窗口不够宽就读不全——只能把窗口拉大。标题栏那一行是右对齐、不占垂直空间的,而且正是 DSH 自带 open-in-app、日程、导出按钮所在的位置。

变了什么

  • 注册点:conversation.composer.dock(order 2)→ conversation.session.header.utilities(order 10)。
  • 内容压到一段:有 auto 月额度时显示 auto $3.05/$15(auto(free) 模型实际在烧的就是这一桶),否则显示周期 $0.17/$50;已超额 / auto 已用尽 追加在后面。
  • 悬停提示不变:套餐状态、周期/剩余、auto 与高阶月额度、今日用量与告警阈值、重置时间、5h 窗口结束、读取时间。
  • 视觉对齐自带标题栏:22px 高、--dsw-radius-xs 圆角、12px 字号,只用主题 token。
  • 窄窗口:标题行是 inline-size 容器,宽度 < 560px 时只留仪表图标(悬停仍有完整明细),不再挤标题和右侧按钮。

Host 侧无改动,接口与工具输出不变。

v1.1.0 — auto 模型月额度

Choose a tag to compare

@zq0929 zq0929 released this 04 Nov 05:47

把 Coding Plan 里 auto 模型和高阶模型的独立月额度、以及今日用量接进胶囊、悬停详情与 coding_plan_balance 工具。

发现

GET /api/coding-plan/quota/me 的 data 里本来就带着文档没写的字段:

桶 字段 实测
周期 usedUsd / limitUsd / percent / resetAt $0.17 / $50.00
auto 模型 autoUsedUsd / autoLimitUsd / autoPlanExhausted $3.05 / $15.00
高阶模型 advancedModelUsedUsd / advancedModelLimitUsd $0.06 / $40.00
今日 todayUsedUsd / todayPercent / todayAlertPct $0.00 / 0% / 30%
5h fiveHourUsedUsd / fiveHourLimitUsd / fiveHourResetAt $0.00 / $50.00

另探测过 /api/coding-plan/{quota/auto,auto-usage,quota/daily,daily-usage,usage,quota,models} 全部 404,官方 ada CLI 也只读 quota/me,因此不需要新接口。

变化

  • 胶囊新增 auto $已用 / $限额 (百分比) 一段;cycle 段改为带百分比的写法。
  • 悬停详情新增 auto / 高阶两个桶、今日用量与告警阈值;上游报 autoPlanExhausted 时显示"auto 已用尽"。
  • 工具输出新增 auto models / high-cost models / Today 三行。
  • /api/coding-plan/5h-usage 失败时,5h 数值回退到 quota/me 里的副本,不再整段消失。
  • 这些是未公开文档的额外字段:缺失时胶囊不显示 auto 段、工具说明"没有独立限额",不会报错。

v1.0.1

Choose a tag to compare

@zq0929 zq0929 released this 10 Oct 08:31

轮询改为走 Host 的复用窗口。

  • 挂载与点击仍然强制取最新快照;定时轮询不再带 refresh,在 cacheSeconds(默认 10s)窗口内复用同一份快照,多个会话同时看只多打一次上游请求。
  • 并发读取依旧合并成一次请求(在飞请求合并)。
  • README 中 cacheSeconds 的说明与行为对齐。

Periodic polls now go through the Host's reuse window.

  • Mount and click still force a fresh snapshot; the timer omits refresh, so reads inside cacheSeconds (10s by default) reuse one snapshot and several sessions watching at once cost one upstream request.
  • Concurrent reads still collapse into one request.
  • README wording for cacheSeconds now matches the behavior.

v1.0.0

Choose a tag to compare

@zq0929 zq0929 released this 10 Oct 08:13

首个版本 / Initial release.

  • 输入框下方常驻胶囊:套餐名 · 周期已用/限额 · 百分比 · 5h 窗口用量;悬停显示剩余额度、重置时间与 5h 窗口时间;点击刷新,默认 60s 轮询,多会话共享 Host 端短复用窗口。
  • 凭据复用 profile 里 ctrip provider 的同一条 Key(apiKey → credentials.resolve(apiKeyEnv) → 进程环境变量),密钥只留在 Host 进程,页面只拿到额度数字。
  • 同一实现注册为 agent 工具 coding_plan_balance。
  • 只用 --dsw-alias-* 主题 token,文案走 Client locale(中/英);读取失败时胶囊保持可见并显示原因。

安装:dsh plugin add https://github.com/zq0929/dsh-coding-plan-balance,或在 Web「设置 → 插件 → 添加插件」里填同一地址;安装后刷新页面。


  • A composer-dock pill for DSH Web: plan name, cycle used/limit and percentage, plus the rolling 5-hour window usage. Hover for the remaining amount, reset time, and window end; click to refresh.
  • Reuses the profile's ctrip provider credential and never exposes it to the page.
  • Also available to the agent as the coding_plan_balance tool.
  • Theme tokens and Client locale only (zh/en); failed reads stay visible with their reason.

Install: dsh plugin add https://github.com/zq0929/dsh-coding-plan-balance, then refresh the page.