cc-cream 0.1.15 → 0.1.16

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/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to cc-cream are documented here. Format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
5
5
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.1.16] — 2026-05-29
8
+
9
+ ### Fixed
10
+ - **The status bar silently rendered nothing when `~/.claude` is a symlink** (dotfile managers like stow/chezmoi/yadm, or an iCloud/Dropbox-synced config dir). The "am-I-the-entrypoint" guard compared `import.meta.url` (which Node's ESM loader canonicalizes — symlinks resolved) against `pathToFileURL(process.argv[1])` (left as-invoked, through the symlink). Under a symlinked path the two never matched, so `main()` never ran and the bar appeared as an empty line with no error — invisible to diagnose. The guard now compares **realpaths** (falling back to the href check if realpath fails), so a symlinked install renders correctly. Found while verifying a fresh v0.1.15 plugin install.
11
+
7
12
  ## [0.1.15] — 2026-05-29
8
13
 
9
14
  ### Fixed
@@ -129,6 +134,7 @@ line and prints a colored ≤3-row bar — zero tokens, the model never sees it.
129
134
  - Supports **macOS and Linux**; Windows is a planned fast-follow.
130
135
  - Requires Claude Code **2.1.132+** (`effort` / `thinking` need 2.1.145+).
131
136
 
137
+ [0.1.16]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.15...v0.1.16
132
138
  [0.1.15]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.14...v0.1.15
133
139
  [0.1.6]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.5...v0.1.6
134
140
  [0.1.5]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.4...v0.1.5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-cream",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Claude Code cache/context/cost status-line tool",
5
5
  "directories": {
6
6
  "doc": "docs"
package/src/cc-cream.js CHANGED
@@ -3,10 +3,11 @@
3
3
  // Reads the session JSON Claude Code pipes on stdin and prints a colored
4
4
  // <=3-row bar. Hard rule: degrade, never crash.
5
5
 
6
+ import { realpathSync } from 'node:fs';
6
7
  import os from 'node:os';
7
8
  import path from 'node:path';
8
9
  import process from 'node:process';
9
- import { pathToFileURL } from 'node:url';
10
+ import { fileURLToPath, pathToFileURL } from 'node:url';
10
11
  import { loadConfig, readConfigFile } from './config.js';
11
12
  import { render } from './render.js';
12
13
  import {
@@ -72,6 +73,23 @@ async function main() {
72
73
  process.exit(0);
73
74
  }
74
75
 
75
- if (import.meta.url === pathToFileURL(process.argv[1] || '').href) {
76
+ // Robust "is this module the entrypoint?" check. Node's ESM loader canonicalizes
77
+ // import.meta.url (symlinks resolved), but process.argv[1] stays as it was invoked.
78
+ // A plain href comparison therefore fails silently when cc-cream runs from a
79
+ // symlinked path — e.g. a ~/.claude managed by a dotfile manager (stow/chezmoi/yadm)
80
+ // or synced via iCloud/Dropbox — skipping main() so the bar renders NOTHING with no
81
+ // error. Comparing realpaths makes the symlinked and canonical paths match. Falls
82
+ // back to the href comparison if realpath fails (e.g. a path that no longer exists).
83
+ function isEntrypoint() {
84
+ const arg = process.argv[1];
85
+ if (!arg) return false;
86
+ try {
87
+ return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(arg);
88
+ } catch {
89
+ return import.meta.url === pathToFileURL(arg).href;
90
+ }
91
+ }
92
+
93
+ if (isEntrypoint()) {
76
94
  main();
77
95
  }