Skip to content

Add 蹬王之王 / Expiry Sentinel: spend whichever credit expires first - #1

Closed
Hylouis233 wants to merge 2 commits into
mainfrom
feat/expiry-sentinel
Closed

Hylouis233 wants to merge 2 commits into
mainfrom
feat/expiry-sentinel

Conversation

@Hylouis233

@Hylouis233 Hylouis233 commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

中文说明

这个 Mini App 做什么

MiniMax Code 的积分和重置卡都会到期。放着不管,最快到期的那笔会悄悄作废,而你一直在用最耐放的那笔。

蹬王之王把每笔余额和到期日摊开给你看,然后「先过期先用」——不浪费,也不过期。

决策规则

5 小时或周限额耗尽时,请求开始扣积分——这就是该动手的时刻。应用会比两个日期:

情况 决策 原因
重置卡比最早到期的积分更早过期 用卡 重置额度,保住更耐放的积分
积分比重置卡更早过期 留卡 让积分先消耗掉,卡留到以后更有价值
额度未耗尽 不动 还没在烧积分

Node 服务和后台守护进程实现同一套规则,并有逐字比对的一致性校验,防止两边漂移。

三种使用方式

  • 只看不动(默认)——打开看板读数据,不消耗任何东西。
  • 页面内自动执行——页面开着时按设定间隔判定并执行。
  • 全天候后台执行——launchd 代理在页面关闭后继续运行。

三条路径共用同一套决策规则,服务端按幂等键去重——即使同时开着,卡也不会被扣两次。

截图

来自应用的实际运行:一张是看板全景,一张是重置卡列表与已用统计。

Review 说明

  • 应用界面是中文的;README 提供英文与简体中文两份。
  • 扣卡是真实写操作。 自动执行会真实消耗重置卡,默认是只读模式。
  • 后台守护进程在 daemon/ 下,以 Rust 源码形式提供,不提交构建产物;用 cargo build --release 构建。它暴露一个 --selftest 模式,喂给它与 Node 服务相同的一组用例,一致性检查比对的就是这两者。
  • 已在 macOS(Apple Silicon)上对真实账号验证,包括额度耗尽时触发的自动执行路径。未验证:跨平台表现与其他客户端版本。
  • 守护进程会读取桌面端的 OAuth lease socket:~/.minimax/run/mcode-auth-lease-v1.sock —— 这是内部路径,已在 ## Data & access 中说明。
  • 只访问两个网络地址,均为 MiniMax:www.minimaxi.com 与 agent.minimaxi.com。无遥测、无外部服务。
  • 页面不展示卡号,只展示序号与到期日。

npm run check 对本包报告 OK,无警告。

A Mini App that tracks MiniMax Code credit and reset card expiry, then
automatically spends whichever lapses first so nothing expires unused.

- Dashboard shows expiry alerts, 5-hour quota, credit balance, next expiry
- Decision rule compares the earliest-expiring credit against the
  earliest-expiring reset card; a parity test keeps the Node service and
  the Rust daemon from drifting apart
- Optional Rust daemon keeps checking via launchd after the page is closed
- README in English and Simplified Chinese, with screenshots from a live run
Copilot AI balanced review requested due to automatic review settings October 16, 2026 19:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Hylouis233

Copy link
Copy Markdown
Owner Author

这个 PR 是本插件的第一版(目录名还是 expiry-sentinel),已被全面取代,先关掉。

之后的演进都在 main 上,最终形态见:

@Hylouis233 Hylouis233 closed this Oct 20, 2026
@Hylouis233
Hylouis233 deleted the feat/expiry-sentinel branch October 20, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants