agent-usage-all-in-one 0.8.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CONTRIBUTING.md CHANGED
@@ -6,7 +6,9 @@ accounting are release requirements rather than optional polish.
6
6
 
7
7
  ## Development
8
8
 
9
- Use macOS, Node.js 24+, and pnpm 10.33.3.
9
+ Use macOS, Node.js 24+, and pnpm 10.33.3. That runtime is the product boundary
10
+ (ADR 017); do not add Linux CI or a second install channel without superseding
11
+ it.
10
12
 
11
13
  ```bash
12
14
  pnpm install
package/README.md CHANGED
@@ -8,23 +8,36 @@
8
8
  [![npm](https://img.shields.io/npm/v/agent-usage-all-in-one.svg)](https://www.npmjs.com/package/agent-usage-all-in-one)
9
9
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
10
10
 
11
+ > **Local multi-agent usage center on macOS — one dashboard, no cloud, no auto-switch.**
12
+
11
13
  Agent Usage is a macOS-first, fully local usage center for Codex, Claude Code,
12
- OpenCode, Grok, dsh, and Antigravity. One command opens a dashboard for native quota windows,
14
+ OpenCode, Grok, dsh, Antigravity, and Cursor. One command opens a dashboard for native quota windows,
13
15
  reset times, tokens, model rankings, equivalent API cost, history, and diagnostics.
14
16
  It offers advice but never switches agents automatically.
15
17
 
18
+ ## Compared
19
+
20
+ Honest category axes and when to prefer Agent Usage vs provider UIs, exporters, or FinOps dashboards: [docs/comparison.md](docs/comparison.md).
21
+
22
+ Sourced named competitors (ccusage, CodeBurn, Token Monitor, TokenTracker): [docs/named-competitors.md](docs/named-competitors.md).
23
+
24
+ **Boundaries:** Cursor quota is experimental (no Tokens/history yet) · macOS only · multi-agent usage center for listed providers (don’t oversell “all-in-one”).
25
+
16
26
  ## Dashboard
17
27
 
18
28
  The dashboard has two primary tabs:
19
29
 
20
30
  - **Agent usage** preserves each provider's native five-hour, weekly, monthly,
21
31
  All models, and Fable-only quota labels and reset times.
22
- - **Tokens & model costs** supports 24-hour, 7-day, and 30-day ranges. It puts
23
- totals first, then a GitHub-style last-year usage wall of headline-included
24
- recorded Tokens, charts Provider share and the interactive daily trend, and
25
- shows model rankings with visual share bars and the public API retail
26
- equivalent of eligible token usage. The year wall is independent of the
27
- selected 24-hour, 7-day, or 30-day window.
32
+ - **Tokens & model costs** supports 24-hour, 7-day, and 30-day ranges. The
33
+ selected window, metric, and currency sit in the same sticky header as the
34
+ primary tabs. The summary board leads with the headline amount beside a
35
+ GitHub-style last-year usage wall of headline-included recorded Tokens, then
36
+ charts each known model separately by agent and billing domain on the share
37
+ pie and the interactive daily trend, and shows model
38
+ rankings with visual share bars and the public API retail equivalent of
39
+ eligible token usage. The year wall is independent of the selected 24-hour,
40
+ 7-day, or 30-day window.
28
41
  - **Settings** provides a centered two-column modal organized into five dedicated
29
42
  categories: Connections, Custom model rates, Monitoring, Diagnostics, and
30
43
  Data & privacy.
@@ -44,11 +57,13 @@ Cached results are available immediately while discovery, provider usage, model
44
57
  pricing, and retention run as independent background modules. Each dashboard tab
45
58
  shows only its own update indicator and completed sections remain usable.
46
59
 
47
- Transcript scans use a persistent, path-redacted file index. Historical retail
48
- pricing is recalculated only when the pricing catalog version changes. SQLite
49
- time/provider/model indexes and retention compaction run in a worker after
50
- provider collection, while price backfill processes bounded pages. Settings
51
- includes an explicitly confirmed
60
+ Transcript scans use a persistent, path-redacted file index. Refresh derives API
61
+ retail equivalent only for new or changed Token observations. Historical retail
62
+ pricing backfills remaining unpriced observations when the pricing catalog
63
+ version changes. SQLite time/provider/model indexes and retention compaction run
64
+ in a worker after provider collection only when those jobs have work. Price
65
+ backfill processes bounded pages. Token and cost refresh bars follow price
66
+ derivation, not connector collection or retention. Settings includes an explicitly confirmed
52
67
  **Hard rebuild all data** action for troubleshooting. It ignores these caches, can
53
68
  use substantial resources, and may take a long time without blocking the web UI.
54
69
 
@@ -67,7 +82,17 @@ browser closed.
67
82
 
68
83
  ## Install and run
69
84
 
70
- Agent Usage requires macOS and Node.js 24 or newer.
85
+ Agent Usage requires macOS and Node.js 24 or newer. That floor is the supported
86
+ runtime (built-in `node:sqlite`, Keychain, LaunchAgent), not a documentation
87
+ oversight — see [ADR 017](docs/adr/017-macos-node24-npm-runtime.md) and the
88
+ [platform roadmap](docs/platform-roadmap.md). Linux and Homebrew / DMG are not
89
+ shipped.
90
+
91
+ ```bash
92
+ npx agent-usage-all-in-one
93
+ ```
94
+
95
+ Optional global install:
71
96
 
72
97
  ```bash
73
98
  npm install --global agent-usage-all-in-one
@@ -113,10 +138,15 @@ agent-usage clear --yes
113
138
  | Grok · xAI API | No subscription quota | Official Management API aggregation | Actual USD amounts, balance, limit, and invoice when available |
114
139
  | dsh · DeepSeek API | No subscription quota | Local dsh session logs across every profile, including front ends composed on dsh | API retail equivalent at DeepSeek published peak/off-peak rates |
115
140
  | Antigravity · Gemini Code Assist | Official-client 5-hour sprint window and weekly baseline limit from live language server RPC, with local session observation fallback | Local conversation SQLite databases (~/.gemini/antigravity-cli and ~/.gemini/antigravity) | API retail equivalent at published Google Gemini and third-party model rates |
141
+ | Cursor | Experimental official Agent CLI `/usage` screen: Included percent and On-Demand spend-limit window; account-wide | Not collected in this version | On-Demand dollars are a quota window, not a bill |
116
142
 
117
143
  Every value retains its authority and observation time. Account-wide and this-Mac
118
144
  evidence remain visibly distinct.
119
145
 
146
+ ## First launch / empty state
147
+
148
+ Until connectors find local client data, the dashboard shows an honest empty state — connect or use an installed agent first.
149
+
120
150
  ## Credentials and privacy
121
151
 
122
152
  Official-client credentials stay in their owning clients and are neither copied
@@ -128,7 +158,7 @@ All usage data remains local. JSON and CSV exports omit account identifiers,
128
158
  session IDs, cookies, OAuth tokens, and secret values by default. Raw observations
129
159
  are retained for 90 days, then transactionally compacted into UTC daily aggregates.
130
160
  Clearing local usage never deletes credentials owned by Codex, Claude Code,
131
- OpenCode, Grok, dsh, or Antigravity.
161
+ OpenCode, Grok, dsh, Antigravity, or Cursor.
132
162
 
133
163
  ## Verification
134
164
 
@@ -146,6 +176,13 @@ See the [official pricing evidence](docs/research/official-pricing-sources-2026-
146
176
  [connector receipts](docs/release/connector-receipts-2026-08-28.md), and
147
177
  [open-source notices](docs/open-source.md).
148
178
 
179
+ ## Roadmap vision (not shipped)
180
+
181
+ Linux, Homebrew, and DMG stay off the product until the conditions in
182
+ [docs/platform-roadmap.md](docs/platform-roadmap.md) are met.
183
+
184
+ > **VISION only — not shipped.** Menu bar / always-available glance is tracked in [issue #19](https://github.com/Blackman99/agent-usage-all-in-one/issues/19). Do not treat the mock as a current feature.
185
+
149
186
  ## License and community
150
187
 
151
188
  MIT — see [LICENSE](LICENSE). Also see [CONTRIBUTING.md](CONTRIBUTING.md),
package/README.zh-CN.md CHANGED
@@ -8,16 +8,26 @@
8
8
  [![npm](https://img.shields.io/npm/v/agent-usage-all-in-one.svg)](https://www.npmjs.com/package/agent-usage-all-in-one)
9
9
  [![许可证:MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
10
10
 
11
+ > **macOS 上的本地多 Agent 用量中心——一个仪表盘,无云端,不自动切换。**
12
+
11
13
  Agent Usage 是一个 macOS 优先、完全在本地运行的用量中心。一次启动即可统一查看
12
- Codex、Claude Code、OpenCode、Grok、dsh 与 Antigravity 的原生额度窗口、刷新时间、Token、模型排行、
14
+ Codex、Claude Code、OpenCode、Grok、dsh、AntigravityCursor 的原生额度窗口、刷新时间、Token、模型排行、
13
15
  API 对等费用、历史与诊断。它只提供建议,不会自动切换 Agent。
14
16
 
17
+ ## 对比说明
18
+
19
+ 按类别对比何时更适合用 Agent Usage,而非各平台官网、导出工具或通用 FinOps 看板:[docs/comparison.md](docs/comparison.md)。
20
+
21
+ 具名竞品对照(ccusage、CodeBurn、Token Monitor、TokenTracker):[docs/named-competitors.md](docs/named-competitors.md)。
22
+
23
+ **边界:** Cursor 额度为实验性(尚无 Token/历史)· 仅 macOS · 对已列出的 Provider 做多 Agent 用量中心(不夸大 “all-in-one”)。
24
+
15
25
  ## 核心页面
16
26
 
17
27
  页面只有两个主要标签页:
18
28
 
19
29
  - **Agent 用量**:保留各平台原生的 5 小时、周、月、All models 和 Fable only 等额度标签与刷新时间。
20
- - **Token 与模型费用**:支持 24 小时、7 天和 30 天范围。顶部优先展示汇总信息,接着是过去一年的 GitHub 风格用量墙(只统计计入摘要的已记录 Token),随后用图表展示 Provider 占比和可交互的每日趋势,再以占比条呈现模型排行及符合条件的 Token 按公开 API 价格计算出的对等费用。用量墙与所选的 24 小时 / 7 天 / 30 天窗口相互独立。
30
+ - **Token 与模型费用**:支持 24 小时、7 天和 30 天范围。所选窗口、指标与币种和主标签页共用同一条吸顶导航。汇总卡片左侧是金额或 Token 头条,右侧是过去一年的 GitHub 风格用量墙(只统计计入摘要的已记录 Token),随后用图表按 agent、计费域和模型分开展示占比与可交互的每日趋势,再以占比条呈现模型排行及符合条件的 Token 按公开 API 价格计算出的对等费用。用量墙与所选的 24 小时 / 7 天 / 30 天窗口相互独立。
21
31
  - **设置面板**:采用居中双栏结构,将连接管理、自定义模型费率、运行监控、系统诊断与数据隐私划分为 5 个独立分类,方便高效维护各项配置。
22
32
 
23
33
  实际账单、平台报告估算、固定订阅费和 API 对等零售价是四类互不混合的证据。
@@ -31,9 +41,9 @@ Grok Build/SuperGrok 与 xAI API 是两个独立计费域,其额度、Token
31
41
  本地 Web 服务会先启动,再在后台运行连接发现、平台用量、模型定价和保留整理四个独立模块。
32
42
  已有缓存会立即展示;每个标签页只在自己的数据区域显示更新状态,已经完成的内容始终可用。
33
43
 
34
- 本地会话记录扫描使用跨进程持久化且不保存原始个人路径的文件索引。历史费用只在价格目录版本变化时
35
- 重新计算,并按有限批次处理;时间、平台、模型和计费域索引及保留期整理会在平台采集完成后交给后台
36
- 工作线程执行。设置里提供需要明确确认的
44
+ 本地会话记录扫描使用跨进程持久化且不保存原始个人路径的文件索引。刷新只为新增或定价输入已变化的
45
+ Token 观测计算 API 对等零售价;历史费用只在价格目录版本变化时补算仍未定价的观测,并按有限批次处理。
46
+ 时间、平台、模型和计费域索引及保留期整理会在平台采集完成后交给后台工作线程,且仅在确有工作(索引尚未建立、或存在超过 90 天的原始观测)时执行。Token 与费用区域的刷新条只在价格推导实际运行时显示,不等待连接器采集或保留整理。设置里提供需要明确确认的
37
47
  **硬重算全部数据**:它会忽略缓存、消耗较多资源,并且可能等待很久,但不会阻塞页面。
38
48
 
39
49
  ## 开发调试
@@ -49,7 +59,13 @@ pnpm dev
49
59
 
50
60
  ## 安装与启动
51
61
 
52
- 要求 macOS 和 Node.js 24 或更高版本。
62
+ 要求 macOS 和 Node.js 24 或更高版本。这是受支持的运行时(内置 `node:sqlite`、钥匙串、LaunchAgent),不是文档疏漏——见 [ADR 017](docs/adr/017-macos-node24-npm-runtime.md) 和 [平台路线图](docs/platform-roadmap.md)。尚未提供 Linux,也没有 Homebrew / DMG。
63
+
64
+ ```bash
65
+ npx agent-usage-all-in-one
66
+ ```
67
+
68
+ 可选全局安装:
53
69
 
54
70
  ```bash
55
71
  npm install --global agent-usage-all-in-one
@@ -95,6 +111,7 @@ agent-usage clear --yes
95
111
  | Grok · xAI API | 没有订阅额度 | 官方 Management API 聚合 | 可用时展示实际美元金额、余额、上限与账单 |
96
112
  | dsh · DeepSeek API | 没有订阅额度 | 本机 dsh 全部 profile 的会话日志,含基于 dsh 的终端前端 | 按 DeepSeek 公布的峰谷价计算 API 对等零售价 |
97
113
  | Antigravity · Gemini Code Assist | 通过官方 Language Server 本地 RPC 获取 5 小时冲刺窗口与周度基准额度,支持本地会话分析平滑降级 | 本地会话 SQLite 数据库(~/.gemini/antigravity-cli 与 ~/.gemini/antigravity) | 按公布的 Google Gemini 及第三方模型公开价格计算 API 对等零售价 |
114
+ | Cursor | 实验性官方 Agent CLI `/usage` 屏幕:Included 百分比与 On-Demand 花费上限;账户全局 | 本版不采集 | On-Demand 美元是额度窗口,不是账单 |
98
115
 
99
116
  每个数字都会保留来源权威等级和观测时间;账户全局与仅此 Mac 的证据始终明确区分。
100
117
 
@@ -106,7 +123,7 @@ Agent Usage 管理的凭据,存储在 macOS 钥匙串。本地页面使用一
106
123
 
107
124
  所有用量数据都留在本机。JSON/CSV 导出默认排除账户标识、会话 ID、Cookie、OAuth Token
108
125
  和密钥值。原始观测保留 90 天,之后在事务中压缩为 UTC 日汇总。清理本地用量永远不会删除
109
- Codex、Claude Code、OpenCode、Grok、dsh 或 Antigravity 官方客户端拥有的凭据。
126
+ Codex、Claude Code、OpenCode、Grok、dsh、AntigravityCursor 官方客户端拥有的凭据。
110
127
 
111
128
  ## 验证
112
129
 
@@ -124,6 +141,12 @@ pnpm test:e2e
124
141
  [连接验证收据](docs/release/connector-receipts-2026-08-28.md)与
125
142
  [开源说明](docs/open-source.md)。
126
143
 
144
+ ## 路线图愿景(未交付)
145
+
146
+ Linux、Homebrew 和 DMG 在满足 [docs/platform-roadmap.md](docs/platform-roadmap.md)
147
+ 中的条件之前不会进入产品。菜单栏一览见 [issue #19](https://github.com/Blackman99/agent-usage-all-in-one/issues/19),
148
+ 仓库中的示意图只是愿景,不是现有功能。
149
+
127
150
  ## 许可证与社区
128
151
 
129
152
  MIT,详见 [LICENSE](LICENSE)。另请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)、