ccgauge 1.0.3 → 1.0.5

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.
Files changed (116) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +42 -42
  3. package/.next/standalone/.next/app-path-routes-manifest.json +9 -9
  4. package/.next/standalone/.next/build-manifest.json +2 -2
  5. package/.next/standalone/.next/server/app/_not-found/page.js +2 -2
  6. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/api/blocks/route_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/api/export/usage/route_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/api/projects/route.js +1 -1
  11. package/.next/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  12. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/api/scan/route_client-reference-manifest.js +1 -1
  14. package/.next/standalone/.next/server/app/api/sessions/route.js +1 -1
  15. package/.next/standalone/.next/server/app/api/sessions/route.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/api/usage/route.js +1 -1
  18. package/.next/standalone/.next/server/app/api/usage/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/usage/route_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/models/page.js +2 -2
  21. package/.next/standalone/.next/server/app/models/page.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/models/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/page.js +2 -2
  24. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/projects/[id]/page.js +2 -2
  27. package/.next/standalone/.next/server/app/projects/[id]/page.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/projects/[id]/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/projects/page.js +1 -1
  30. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/sessions/[id]/page.js +2 -2
  33. package/.next/standalone/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/sessions/page.js +1 -1
  36. package/.next/standalone/.next/server/app/sessions/page.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/settings/page.js +1 -1
  39. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/usage/page.js +3 -3
  41. package/.next/standalone/.next/server/app/usage/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/usage/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app-paths-manifest.json +9 -9
  44. package/.next/standalone/.next/server/chunks/287.js +1 -0
  45. package/.next/standalone/.next/server/chunks/517.js +1 -1
  46. package/.next/standalone/.next/server/chunks/567.js +2 -2
  47. package/.next/standalone/.next/server/chunks/730.js +1 -0
  48. package/.next/standalone/.next/server/chunks/98.js +1 -1
  49. package/.next/standalone/.next/server/functions-config-manifest.json +2 -2
  50. package/.next/standalone/.next/server/pages/500.html +1 -1
  51. package/.next/standalone/.next/static/chunks/148-6c2eaf5508bfe739.js +1 -0
  52. package/.next/standalone/.next/static/chunks/930-ca5c6f8b5cb6ac3d.js +1 -0
  53. package/.next/standalone/.next/static/chunks/app/layout-4f3538437c5e8366.js +1 -0
  54. package/.next/standalone/.next/static/chunks/app/page-3cda7f70ecf5017a.js +1 -0
  55. package/.next/standalone/.next/static/chunks/app/settings/page-1ba7c4a4c0fae2f8.js +1 -0
  56. package/.next/standalone/.next/static/css/{406e067663b8b429.css → fbd2c395e5bf32cb.css} +1 -1
  57. package/.next/standalone/node_modules/next/node_modules/@img/sharp-darwin-arm64/LICENSE +191 -0
  58. package/.next/standalone/node_modules/next/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  59. package/.next/standalone/node_modules/next/node_modules/@img/sharp-darwin-arm64/package.json +40 -0
  60. package/.next/standalone/node_modules/next/node_modules/@img/sharp-libvips-darwin-arm64/lib/index.js +1 -0
  61. package/.next/standalone/node_modules/next/node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib +0 -0
  62. package/.next/standalone/node_modules/next/node_modules/@img/sharp-libvips-darwin-arm64/package.json +36 -0
  63. package/.next/standalone/node_modules/next/node_modules/@img/sharp-libvips-darwin-arm64/versions.json +30 -0
  64. package/.next/standalone/node_modules/next/node_modules/sharp/lib/channel.js +177 -0
  65. package/.next/standalone/node_modules/next/node_modules/sharp/lib/colour.js +195 -0
  66. package/.next/standalone/node_modules/next/node_modules/sharp/lib/composite.js +212 -0
  67. package/.next/standalone/node_modules/next/node_modules/sharp/lib/constructor.js +499 -0
  68. package/.next/standalone/node_modules/next/node_modules/sharp/lib/index.js +16 -0
  69. package/.next/standalone/node_modules/next/node_modules/sharp/lib/input.js +809 -0
  70. package/.next/standalone/node_modules/next/node_modules/sharp/lib/is.js +143 -0
  71. package/.next/standalone/node_modules/next/node_modules/sharp/lib/libvips.js +207 -0
  72. package/.next/standalone/node_modules/next/node_modules/sharp/lib/operation.js +1016 -0
  73. package/.next/standalone/node_modules/next/node_modules/sharp/lib/output.js +1666 -0
  74. package/.next/standalone/node_modules/next/node_modules/sharp/lib/resize.js +595 -0
  75. package/.next/standalone/node_modules/next/node_modules/sharp/lib/sharp.js +121 -0
  76. package/.next/standalone/node_modules/next/node_modules/sharp/lib/utility.js +291 -0
  77. package/.next/standalone/node_modules/next/node_modules/sharp/package.json +202 -0
  78. package/.next/standalone/node_modules/semver/classes/comparator.js +143 -0
  79. package/.next/standalone/node_modules/semver/classes/range.js +557 -0
  80. package/.next/standalone/node_modules/semver/classes/semver.js +333 -0
  81. package/.next/standalone/node_modules/semver/functions/cmp.js +54 -0
  82. package/.next/standalone/node_modules/semver/functions/coerce.js +62 -0
  83. package/.next/standalone/node_modules/semver/functions/compare.js +7 -0
  84. package/.next/standalone/node_modules/semver/functions/eq.js +5 -0
  85. package/.next/standalone/node_modules/semver/functions/gt.js +5 -0
  86. package/.next/standalone/node_modules/semver/functions/gte.js +5 -0
  87. package/.next/standalone/node_modules/semver/functions/lt.js +5 -0
  88. package/.next/standalone/node_modules/semver/functions/lte.js +5 -0
  89. package/.next/standalone/node_modules/semver/functions/neq.js +5 -0
  90. package/.next/standalone/node_modules/semver/functions/parse.js +18 -0
  91. package/.next/standalone/node_modules/semver/functions/satisfies.js +12 -0
  92. package/.next/standalone/node_modules/semver/internal/constants.js +37 -0
  93. package/.next/standalone/node_modules/semver/internal/debug.js +11 -0
  94. package/.next/standalone/node_modules/semver/internal/identifiers.js +29 -0
  95. package/.next/standalone/node_modules/semver/internal/lrucache.js +42 -0
  96. package/.next/standalone/node_modules/semver/internal/parse-options.js +17 -0
  97. package/.next/standalone/node_modules/semver/internal/re.js +223 -0
  98. package/.next/standalone/node_modules/semver/package.json +78 -0
  99. package/.next/standalone/package.json +13 -2
  100. package/.next/standalone/public/codex-logo.png +0 -0
  101. package/.next/standalone/public/favicon.svg +19 -5
  102. package/CHANGELOG.md +287 -0
  103. package/README.md +8 -2
  104. package/README.zh-CN.md +11 -4
  105. package/bin/cli.mjs +404 -92
  106. package/dist/mcp/server.mjs +16 -16
  107. package/dist/report/index.mjs +196 -30
  108. package/package.json +14 -3
  109. package/.next/standalone/.next/server/chunks/971.js +0 -1
  110. package/.next/standalone/.next/static/chunks/148-0a1e1b0207b89e3f.js +0 -1
  111. package/.next/standalone/.next/static/chunks/930-3035d0b294080d0b.js +0 -1
  112. package/.next/standalone/.next/static/chunks/app/layout-2512ccdfb13aeb17.js +0 -1
  113. package/.next/standalone/.next/static/chunks/app/page-19d3e77d4aa35a63.js +0 -1
  114. package/.next/standalone/.next/static/chunks/app/settings/page-cfeb089549c94f88.js +0 -1
  115. /package/.next/standalone/.next/static/{alqi5oQtTQUdpxp2x0yAt → kdpS1dOlXPsnKYuNBuMt9}/_buildManifest.js +0 -0
  116. /package/.next/standalone/.next/static/{alqi5oQtTQUdpxp2x0yAt → kdpS1dOlXPsnKYuNBuMt9}/_ssgManifest.js +0 -0
package/README.md CHANGED
@@ -138,11 +138,12 @@ Background mode persists state under `~/.ccgauge/`:
138
138
  | `ccgauge start --background` | Start a detached background service. |
139
139
  | `ccgauge stop [--force]` | Stop the background service. |
140
140
  | `ccgauge restart [options]` | Stop and re-start with new options. |
141
- | `ccgauge status [--json]` | Inspect the background service. |
141
+ | `ccgauge status [--json]` | Inspect the background service. Plain-text mode exits **3** (systemd "not running") when nothing is up so shell can `if ccgauge status; then …`; `--json` always exits 0 — read `payload.running` instead. |
142
142
  | `ccgauge open` | Open the running dashboard in your browser. |
143
143
  | `ccgauge logs [-f] [-n <lines>]` | Print background-service log file (the server's stdout). |
144
144
  | `ccgauge report [options]` | Print a formatted **usage report** to stdout (one-shot, no server). |
145
145
  | `ccgauge mcp` | Start the MCP server on stdio so LLMs can query usage. |
146
+ | `ccgauge doctor` | One-screen diagnostic: version, env, build artifacts, state, indexer + per-provider scan. Paste into bug reports. |
146
147
 
147
148
  ### Report
148
149
 
@@ -384,7 +385,7 @@ debug "why did it answer X".
384
385
 
385
386
  | Symptom | Try |
386
387
  | --- | --- |
387
- | Client doesn't see ccgauge tools | Restart the client after editing the config; check `npx -y ccgauge mcp` runs in your shell |
388
+ | Client doesn't see ccgauge tools | Restart the client after editing the config; run `ccgauge mcp --check` (or `ccgauge doctor`) to verify the bundle, indexer, and detected providers without an MCP client |
388
389
  | First call is slow | First call after a cold start indexes all JSONL files (~1–3 s for 100 files); subsequent calls are O(1) |
389
390
  | "no providers detected" in the resource | The MCP process can't see `~/.claude/projects` / `~/.codex/sessions`; pass `CLAUDE_CONFIG_DIR` / `CCGAUGE_CODEX_DIR` via `env` in the MCP config |
390
391
  | Want to see what the server is logging | Watch the client's MCP log; ccgauge writes to **stderr** (stdout is reserved for JSON-RPC) |
@@ -461,6 +462,8 @@ pnpm test # codex parser smoke test (Node 22+)
461
462
  pnpm build # next build + copy static into .next/standalone
462
463
  pnpm start # run bin/cli.mjs against the standalone build
463
464
  pnpm screenshots # regenerate docs/screenshots/*.png
465
+ pnpm site:dev # marketing site dev server, http://localhost:4321
466
+ pnpm site:build # build only the site/ marketing site
464
467
  pnpm clean # rm -rf .next node_modules
465
468
  ```
466
469
 
@@ -473,8 +476,11 @@ pnpm publish --access public # runs `pnpm build` first via prepublishOnly
473
476
 
474
477
  ## Troubleshooting
475
478
 
479
+ > **First stop for any "why doesn't this work" question:** run `ccgauge doctor`. It prints version, env vars, build artifacts, background-service state, and the indexer's per-provider scan in one screen — perfect for pasting into a bug report.
480
+
476
481
  | Symptom | Try |
477
482
  | --- | --- |
483
+ | Anything unexpected | `ccgauge doctor` — one-screen diagnostic for everything below |
478
484
  | Port keeps drifting | `ccgauge --strict-port --port 3737` |
479
485
  | Stale background service | `ccgauge status`, then `ccgauge stop --force` |
480
486
  | Background didn't start | `ccgauge logs` reads `~/.ccgauge/ccgauge.log` |
package/README.zh-CN.md CHANGED
@@ -138,11 +138,12 @@ ccgauge stop
138
138
  | `ccgauge start --background` | 启动后台服务。 |
139
139
  | `ccgauge stop [--force]` | 停止后台服务。 |
140
140
  | `ccgauge restart [options]` | 停止再用新参数启动。 |
141
- | `ccgauge status [--json]` | 查看后台状态。 |
141
+ | `ccgauge status [--json]` | 查看后台状态。纯文本模式后台未运行时退出码 **3**(systemd 约定),shell 可用 `if ccgauge status; then …`;`--json` 始终退 0,请改读 `payload.running`。 |
142
142
  | `ccgauge open` | 在浏览器打开正在运行的看板。 |
143
143
  | `ccgauge logs [-f] [-n <lines>]` | 查看后台服务的日志(server stdout)。 |
144
144
  | `ccgauge report [options]` | 命令行**用量报告**,直接打到终端(一次性,不起服务)。 |
145
145
  | `ccgauge mcp` | 起 MCP 服务(stdio),让 LLM 查你的用量。 |
146
+ | `ccgauge doctor` | 一屏诊断:版本、env、构建产物、后台状态、indexer + 每个 provider 的扫描计数。报 issue 时直接粘。 |
146
147
 
147
148
  ### 命令行报告(report)
148
149
 
@@ -378,7 +379,7 @@ LLM 大概率会调的工具——方便你"为什么会这样回答"反查。
378
379
 
379
380
  | 现象 | 建议 |
380
381
  | --- | --- |
381
- | 客户端看不到 ccgauge 工具 | 改完配置重启客户端;终端里手动跑 `npx -y ccgauge mcp` 看是否能起 |
382
+ | 客户端看不到 ccgauge 工具 | 改完配置重启客户端;不连 MCP 客户端就能验证 bundle / indexer / providers 的话直接跑 `ccgauge mcp --check`(或 `ccgauge doctor`)|
382
383
  | 第一次调用比较慢 | 冷启动后第一次会全量索引(100 文件 ~1–3s);之后都是 O(1) |
383
384
  | Resource 显示 "no providers detected" | MCP 进程看不到 `~/.claude/projects` / `~/.codex/sessions`;通过 MCP 配置的 `env` 传 `CLAUDE_CONFIG_DIR` / `CCGAUGE_CODEX_DIR` |
384
385
  | 想看 server 在打什么日志 | 看客户端的 MCP 日志;ccgauge 把日志写到 **stderr**(stdout 被 JSON-RPC 占用)|
@@ -454,6 +455,8 @@ pnpm test # codex parser 烟测(Node 22+)
454
455
  pnpm build # next build + 把 static 拷进 .next/standalone
455
456
  pnpm start # 用 bin/cli.mjs 跑 standalone 产物
456
457
  pnpm screenshots # 重新生成 docs/screenshots/*.png
458
+ pnpm site:dev # 产品官网开发服务,http://localhost:4321
459
+ pnpm site:build # 只构建 site/ 产品官网
457
460
  pnpm clean # rm -rf .next node_modules
458
461
  ```
459
462
 
@@ -466,8 +469,11 @@ pnpm publish --access public # 会自动先跑 pnpm build(prepublishOnly)
466
469
 
467
470
  ## 排障
468
471
 
472
+ > **任何"为啥不工作"的问题先跑一下:** `ccgauge doctor`。一屏列出版本、env、构建产物、后台状态、indexer 扫描计数,报 issue 直接粘过去就行。
473
+
469
474
  | 现象 | 建议命令 |
470
475
  | --- | --- |
476
+ | 任何异常想先一屏看清 | `ccgauge doctor` — 下面所有项都在它的诊断里 |
471
477
  | 端口被自动换掉 | `ccgauge --strict-port --port 3737` |
472
478
  | 后台服务状态不对 | 先 `ccgauge status`,PID 仍存活但不响应再 `ccgauge stop --force` |
473
479
  | 后台启动失败 | `ccgauge logs` 查看 `~/.ccgauge/ccgauge.log` |
@@ -508,10 +514,11 @@ pnpm publish --access public # 会自动先跑 pnpm build(prepublishOnly)
508
514
  ## 产品官网
509
515
 
510
516
  产品官网(Astro + Tailwind 自建、中英双语、暗 / 亮主题、独立部署)放在
511
- [`site/`](./site/) 目录。它跟着主仓库一起在 git 里,但**不会**进 npm 包。
517
+ [`site/`](./site/) 目录。它跟着主仓库一起在 git 里,但**不会**进 npm 包;
518
+ 命令和依赖统一由根目录 `package.json` 管理。
512
519
 
513
520
  ```bash
514
- cd site && pnpm install && pnpm dev # http://localhost:4321
521
+ pnpm site:dev # http://localhost:4321
515
522
  ```
516
523
 
517
524
  构建 / 部署细节见 [`site/README.md`](./site/README.md)。