@mai0313/vct 2.4.1 → 2.5.1

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/README.md CHANGED
@@ -319,7 +319,7 @@ For noninteractive `usage` and `analysis` scans, vct exits with an error when ev
319
319
  ```
320
320
 
321
321
  - **Claude** — plan tier, 5-hour, weekly, and per-model weekly usage from the official OAuth usage API (`GET /api/oauth/usage`), read from `~/.claude/.credentials.json`, plus your credit balance. Polled about once a minute to stay under the endpoint's rate limit; a red `LIMIT` flag appears in the title when a cap is hit. The per-model weekly row is best-effort and simply hides when that scope is not returned.
322
- - **Codex** — plan tier, 5-hour and weekly usage, credit balance, and the earliest fetched available earned-reset expiry from the ChatGPT backend (`wham/usage` + `wham/rate-limit-reset-credits`) using `~/.codex/auth.json` (with approximate remaining messages / spend cap when applicable); falls back to the newest `rate_limits` in your Codex session logs when the API is unavailable (the title shows `Codex` vs `Codex (session)`).
322
+ - **Codex** — plan tier, available 5-hour and weekly usage windows, credit balance, and the earliest fetched available earned-reset expiry from the ChatGPT backend (`wham/usage` + `wham/rate-limit-reset-credits`) using `~/.codex/auth.json` (with approximate remaining messages / spend cap when applicable); falls back to the newest `rate_limits` in your Codex session logs when the API is unavailable (the title shows `Codex` vs `Codex (session)`).
323
323
  - **Copilot** — plan tier plus your premium-request quota, shown as two gauges: percent used and the used / total request count (e.g. `45/1500`), from GitHub's Copilot API (`GET /copilot_internal/user`), read from `~/.copilot/config.json`. The request impersonates the Copilot CLI. The token is long-lived, so there is no refresh; a `401` / `403` shows a `run: copilot login` hint.
324
324
  - **Cursor** — plan tier, total / auto / API percent **used**, and on-demand spend from cursor.com (`GET /api/usage-summary`), using the session token in `~/.config/cursor/auth.json`. Refresh is reactive: vct re-reads the file each poll and uses the token while it is valid, since the official Cursor client keeps it fresh.
325
325
  - **Grok** — plan tier plus your included-allowance usage for the current weekly or monthly period, from the Grok CLI's own billing endpoint (`GET /v1/billing?format=credits`), read from `~/.grok/auth.json`. A prepaid balance is shown only once it is non-zero, and pay-as-you-go spend once you have either spent something or set a cap. The request impersonates the Grok CLI; a `401` / `403` shows a `run: grok login` hint.
@@ -461,9 +461,13 @@ Codex code-mode sessions expose a completed JavaScript `exec` cell but no struct
461
461
 
462
462
  ## Update Command
463
463
 
464
- **Keep your installation up-to-date automatically.**
464
+ **Keep supported direct installations up to date automatically.**
465
465
 
466
- The update command works for **all installation methods** (npm/pip/cargo/manual) by directly downloading and replacing the binary from GitHub releases.
466
+ At startup, vct silently checks for a newer release at most once per UTC day. A newer release is downloaded and applied only when the current binary was installed by the official `scripts/install.sh` or `scripts/install.ps1` installer and carries its `.vct-managed` marker. The check, download, and replacement never print to stdout or stderr. A network failure, rate limit, read-only directory, or another running vct process only leaves the current command running; the reason is recorded in the diagnostic log. `VCT_OFFLINE=1` skips the check completely.
467
+
468
+ After a Unix update, vct re-executes the current command with the new binary. On Windows, the current command finishes and a helper applies the replacement afterwards. The automatic path never modifies installs from cargo, npm, PyPI, a distro package, or an unmarked manual or development build. Update those through their package manager instead. To add automatic updates to an existing direct install, run the current official installer once more so it creates the marker.
469
+
470
+ Set `general.auto_update = false` in `~/.vct/config.toml` to disable startup checks and automatic updates. The explicit `vct update` command retains its existing manual behavior.
467
471
 
468
472
  ### Basic Usage
469
473
 
@@ -560,9 +564,12 @@ vct keeps its user settings in `~/.vct/config.toml`. The file is **created with
560
564
  # Default time range when no --daily/--weekly/--monthly/--all flag is given.
561
565
  # One of: "daily" | "weekly" | "monthly" | "all".
562
566
  default_time_range = "all"
567
+ # Check for a newer release at startup and automatically update supported direct installs.
568
+ # Set to false to disable this behavior.
569
+ auto_update = true
563
570
  # Layout version of this file, stamped by vct. Only the upgrade pass reads it;
564
571
  # leave it alone unless you want a past upgrade to run again.
565
- version = 2
572
+ version = 3
566
573
 
567
574
  [usage]
568
575
  # Start the usage dashboard with models merged across provider prefixes.
@@ -610,6 +617,7 @@ retention_days = 7
610
617
  | Setting | Effect |
611
618
  | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
612
619
  | `general.default_time_range` | Period used when you pass no `--daily/--weekly/--monthly/--all`. An explicit flag always wins. |
620
+ | `general.auto_update` | Check once per UTC day at startup and automatically update only official-installer direct installs. Set to `false` to disable. |
613
621
  | `general.version` | Layout version vct stamps on the file, so a panel added by a later release is offered to you exactly once. |
614
622
  | `usage.merge_models` | Seeds the dashboard merged; the `m` toggle saves your last choice back here. `--merge-providers` forces on. |
615
623
  | `usage.refresh_interval` | Redraw cadence of the `usage` dashboard (seconds). |
package/README.zh-CN.md CHANGED
@@ -319,7 +319,7 @@ Grok 的 `usage` 是单一时点的本地 context 估算:vct 会把 `signals.j
319
319
  ```
320
320
 
321
321
  - **Claude** — 方案类型、5 小时、每周以及单模型每周用量,来自官方 OAuth 用量 API(`GET /api/oauth/usage`),从 `~/.claude/.credentials.json` 读取,并显示额度余额。约每分钟轮询一次以避开该端点的速率限制;触及上限时标题会出现红色 `LIMIT` 标记。单模型每周那一行属于尽力而为,未返回该范围时就自动隐藏。
322
- - **Codex** — 套餐类型、5 小时和每周用量、额度余额以及已获取的可用 reset credit 中最早的到期时间,使用 `~/.codex/auth.json` 从 ChatGPT 后端(`wham/usage` + `wham/rate-limit-reset-credits`)获取(在适用时显示大致剩余讯息数 / 消费上限);API 不可用时回退到 Codex 会话日志中最新的 `rate_limits`(标题显示 `Codex` 或 `Codex (session)`)。
322
+ - **Codex** — 套餐类型、可用的 5 小时和每周用量周期、额度余额以及已获取的可用 reset credit 中最早的到期时间,使用 `~/.codex/auth.json` 从 ChatGPT 后端(`wham/usage` + `wham/rate-limit-reset-credits`)获取(在适用时显示大致剩余讯息数 / 消费上限);API 不可用时回退到 Codex 会话日志中最新的 `rate_limits`(标题显示 `Codex` 或 `Codex (session)`)。
323
323
  - **Copilot** — 方案类型,以及你的 premium 请求额度,以两个进度条呈现:已用百分比,以及已用 / 总量的请求数(例如 `45/1500`),来自 GitHub 的 Copilot API(`GET /copilot_internal/user`),从 `~/.copilot/config.json` 读取。该请求会模拟 Copilot CLI。token 为长期有效,因此不需要刷新;遇到 `401` / `403` 时会显示 `run: copilot login` 提示。
324
324
  - **Cursor** — 方案类型、total / auto / API **已用**百分比,以及按需消费,来自 cursor.com(`GET /api/usage-summary`),使用 `~/.config/cursor/auth.json` 中的 session token。刷新是被动式的:vct 每次轮询都会重新读取该文件,并在 token 有效期内使用它,因为官方 Cursor 客户端会让它保持最新。
325
325
  - **Grok** — 方案类型,以及当前每周或每月周期内的方案内含额度用量,来自 Grok CLI 自己的计费端点(`GET /v1/billing?format=credits`),从 `~/.grok/auth.json` 读取。预付余额只有在非零时才会显示;按量付费的消费则在你有过消费、或设置了上限之后才会显示。该请求会模拟 Grok CLI;遇到 `401` / `403` 时会显示 `run: grok login` 提示。
@@ -461,9 +461,13 @@ Codex code mode session 会提供已完成的 JavaScript `exec` cell, 但没有
461
461
 
462
462
  ## Update 命令
463
463
 
464
- **自动保持安装版本为最新。**
464
+ **自动让受支持的直接安装保持最新版本.**
465
465
 
466
- update 命令适用于**所有安装方式**(npm/pip/cargo/手动安装),它会直接从 GitHub releases 下载并替换二进制文件。
466
+ vct 启动时每天 UTC 日期最多检查一次新版. 只有通过官方 `scripts/install.sh` 或 `scripts/install.ps1` 安装, 并且带有 `.vct-managed` marker 的二进制文件, 才会下载并应用新版. 检查, 下载和替换都不会输出到 stdout 或 stderr. 网络失败, rate limit, 只读目录或另一个 vct process 正在运行时, 当前命令仍会照常继续, 原因只会写入 diagnostic log. `VCT_OFFLINE=1` 会完全跳过检查.
467
+
468
+ Unix 应用更新后, vct 会用新版 binary 重新执行当前命令. Windows 会先让当前命令结束, 再由 helper 应用替换. 自动流程绝不会修改通过 cargo, npm, PyPI, distro package 安装的版本, 也不会修改没有 marker 的手动安装或 development build. 请通过相应的 package manager 更新. 现有直接安装只要再运行一次当前官方 installer, 就会创建 marker 并启用自动更新.
469
+
470
+ 在 `~/.vct/config.toml` 中设置 `general.auto_update = false` 可以关闭启动检查和自动更新. 显式执行的 `vct update` 会保留原有手动行为.
467
471
 
468
472
  ### 基本用法
469
473
 
@@ -560,9 +564,12 @@ vct 会把用户设置保存在 `~/.vct/config.toml` 中。该文件会在**首
560
564
  # 未指定 --daily/--weekly/--monthly/--all flag 时使用的默认时间范围
561
565
  # 取值之一: "daily" | "weekly" | "monthly" | "all"
562
566
  default_time_range = "all"
567
+ # 启动时检查新版, 并自动更新由官方 installer 创建的受支持直接安装.
568
+ # 设为 false 可关闭此行为.
569
+ auto_update = true
563
570
  # 该文件的布局版本, 由 vct 标记. 只有升级流程会读取它;
564
571
  # 除非你想让某次过去的升级再跑一遍, 否则不要动它.
565
- version = 2
572
+ version = 3
566
573
 
567
574
  [usage]
568
575
  # 启动 usage 面板时就把跨 provider 前缀的 model 合并显示
@@ -609,6 +616,7 @@ retention_days = 7
609
616
  | 设置项 | 作用 |
610
617
  | ------------------------------ | --------------------------------------------------------------------------------------------------------------- |
611
618
  | `general.default_time_range` | 当你没有传入 `--daily/--weekly/--monthly/--all` 时使用的时间范围。显式传入的 flag 始终优先。 |
619
+ | `general.auto_update` | 启动时每天 UTC 日期最多检查一次, 并且只更新官方 installer 的直接安装. 设为 `false` 可关闭. |
612
620
  | `general.version` | vct 标记在文件上的布局版本,让后续版本新增的面板只会向你提供一次。 |
613
621
  | `usage.merge_models` | 让面板启动时就处于合并状态;`m` 切换会把你上次的选择保存回这里。`--merge-providers` 会强制开启。 |
614
622
  | `usage.refresh_interval` | `usage` 面板的自动刷新间隔(秒)。 |
package/README.zh-TW.md CHANGED
@@ -319,7 +319,7 @@ Grok 的 `usage` 是單一當下的本地 context 估算:vct 會把 `signals.j
319
319
  ```
320
320
 
321
321
  - **Claude** — 方案類型、5 小時、每週以及單模型每週用量,來自官方 OAuth 用量 API(`GET /api/oauth/usage`),從 `~/.claude/.credentials.json` 讀取,並顯示額度餘額。約每分鐘輪詢一次以避開該端點的速率限制;觸及上限時標題會出現紅色 `LIMIT` 標記。單模型每週那一行屬於盡力而為,未回傳該範圍時就自動隱藏。
322
- - **Codex** — 方案類型、5 小時和每週用量、額度餘額以及已取得的可用 reset credit 中最早的到期時間,使用 `~/.codex/auth.json` 從 ChatGPT 後端(`wham/usage` + `wham/rate-limit-reset-credits`)取得(在適用時顯示大致剩餘訊息數 / 消費上限);API 無法使用時回退到 Codex 工作階段紀錄中最新的 `rate_limits`(標題顯示 `Codex` 或 `Codex (session)`)。
322
+ - **Codex** — 方案類型、可用的 5 小時和每週用量週期、額度餘額以及已取得的可用 reset credit 中最早的到期時間,使用 `~/.codex/auth.json` 從 ChatGPT 後端(`wham/usage` + `wham/rate-limit-reset-credits`)取得(在適用時顯示大致剩餘訊息數 / 消費上限);API 無法使用時回退到 Codex 工作階段紀錄中最新的 `rate_limits`(標題顯示 `Codex` 或 `Codex (session)`)。
323
323
  - **Copilot** — 方案類型以及你的 premium 請求額度,以兩個進度條呈現:已用百分比,以及已用 / 總量請求數(例如 `45/1500`),來自 GitHub 的 Copilot API(`GET /copilot_internal/user`),從 `~/.copilot/config.json` 讀取。該請求會模擬 Copilot CLI。token 為長期有效,因此不需要刷新;遇到 `401` / `403` 時會顯示 `run: copilot login` 提示。
324
324
  - **Cursor** — 方案類型、total / auto / API **已用**百分比,以及按需消費,來自 cursor.com(`GET /api/usage-summary`),使用 `~/.config/cursor/auth.json` 中的 session token。刷新是被動式的:vct 每次輪詢都會重新讀取該檔案,並在 token 有效期內使用它,因為官方 Cursor 用戶端會讓它保持最新。
325
325
  - **Grok** — 方案類型以及目前每週或每月週期的內含額度用量,來自 Grok CLI 自己的計費端點(`GET /v1/billing?format=credits`),從 `~/.grok/auth.json` 讀取。預付餘額只有在不為零時才會顯示;按量計費的消費則在你有過消費、或設定了上限之後才會顯示。該請求會模擬 Grok CLI;遇到 `401` / `403` 時會顯示 `run: grok login` 提示。
@@ -461,9 +461,13 @@ Codex code mode session 會提供已完成的 JavaScript `exec` cell, 但沒有
461
461
 
462
462
  ## Update 指令
463
463
 
464
- **自動保持安裝為最新版本。**
464
+ **自動讓受支援的直接安裝維持最新版本.**
465
465
 
466
- Update 指令適用於**所有安裝方式**(npm/pip/cargo/手動安裝),透過直接從 GitHub releases 下載並替換執行檔來完成更新。
466
+ vct 啟動時最多每天 UTC 日期檢查一次新版. 只有透過官方 `scripts/install.sh` 或 `scripts/install.ps1` 安裝, 且帶有 `.vct-managed` marker 的執行檔, 才會下載並套用新版. 檢查, 下載與替換都不會印到 stdout 或 stderr. 網路失敗, rate limit, 唯讀目錄或另一個 vct process 正在執行時, 目前指令仍會照常繼續, 原因只會寫入 diagnostic log. `VCT_OFFLINE=1` 會完全略過檢查.
467
+
468
+ Unix 套用更新後, vct 會用新版 binary 重新執行目前指令. Windows 則會讓目前指令結束, 再由 helper 套用替換. 自動流程絕不會修改透過 cargo, npm, PyPI, distro package 安裝的版本, 或沒有 marker 的手動與 development build. 請透過對應 package manager 更新. 既有的直接安裝只要再執行一次目前的官方 installer, 就會建立 marker 並啟用自動更新.
469
+
470
+ 在 `~/.vct/config.toml` 設定 `general.auto_update = false` 可關閉啟動檢查與自動更新. 明確執行的 `vct update` 會保留原有的手動行為.
467
471
 
468
472
  ### 基本用法
469
473
 
@@ -560,9 +564,12 @@ vct 會把使用者設定存放在 `~/.vct/config.toml`。這個檔案會在**
560
564
  # 未指定 --daily/--weekly/--monthly/--all flag 時使用的預設時間範圍。
561
565
  # 可選值:"daily" | "weekly" | "monthly" | "all"
562
566
  default_time_range = "all"
567
+ # 啟動時檢查新版, 並自動更新由官方 installer 建立的受支援直接安裝.
568
+ # 設為 false 可關閉此行為.
569
+ auto_update = true
563
570
  # 這個檔案的版面版本,由 vct 標記。只有升級流程會讀取它;
564
571
  # 除非你想讓過去的升級再跑一次,否則別去動它。
565
- version = 2
572
+ version = 3
566
573
 
567
574
  [usage]
568
575
  # 啟動 usage 儀表板時,是否先把不同 provider 前綴的 model 合併。
@@ -609,6 +616,7 @@ retention_days = 7
609
616
  | 設定項 | 效果 |
610
617
  | ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
611
618
  | `general.default_time_range` | 未指定 `--daily/--weekly/--monthly/--all` 時使用的時間範圍。明確指定的 flag 一律優先。 |
619
+ | `general.auto_update` | 啟動時每天 UTC 日期最多檢查一次, 並只更新官方 installer 的直接安裝. 設為 `false` 可關閉. |
612
620
  | `general.version` | vct 標記在檔案上的版面版本,讓後續版本新增的面板只會向你提議一次。 |
613
621
  | `usage.merge_models` | 讓儀表板一開始就是合併狀態;`m` 切換會把你最後的選擇存回這裡。`--merge-providers` 會強制開啟。 |
614
622
  | `usage.refresh_interval` | `usage` 儀表板自動刷新的間隔(秒)。 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mai0313/vct",
3
- "version": "2.4.1",
3
+ "version": "2.5.1",
4
4
  "description": "Vibe Coding Tracker - AI coding assistant telemetry/usage parser, aggregate JSONL events into CodeAnalysis results",
5
5
  "author": "Wei Lee <mai@mai0313.com>",
6
6
  "license": "MIT",