cc-cream 0.1.15 → 0.1.17

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,19 @@ 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.17] — 2026-05-29
8
+
9
+ ### Fixed
10
+ - **`cc-cream-setup` and the `/cc-cream:*` slash commands silently did nothing when `~/.claude` is a symlink.** `install.js` had the same symlink-fragile entrypoint guard fixed in the renderer for 0.1.16 (`import.meta.url` is canonicalized by Node's ESM loader; `process.argv[1]` is not), so running it from a symlinked path skipped `main()` entirely — exit 0, no output, settings.json untouched. The "am-I-the-entrypoint?" check is now a single symlink-robust helper (`isEntrypoint` in `src/utils.js`) shared by both `cc-cream.js` and `install.js`. Caught by the new install-journey smoke tests.
11
+
12
+ ### Added
13
+ - **End-to-end install/uninstall journey smoke tests** (`features/27-install-journey.feature`, CREAM-fxsusmgd). They stage a real plugin cache the way `/plugin install` lays it out, run the actual `SessionStart` hook and `install.js` as child processes, and execute the baked statusLine command through `sh -c` exactly as Claude Code does — guarding the *seams* unit specs can't: cache layout, the settings.json lifecycle, command order, the empty-cache guard (0.1.15), and symlinked config dirs (0.1.16). CI-safe; no live `claude` CLI needed.
14
+
15
+ ## [0.1.16] — 2026-05-29
16
+
17
+ ### Fixed
18
+ - **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.
19
+
7
20
  ## [0.1.15] — 2026-05-29
8
21
 
9
22
  ### Fixed
@@ -129,6 +142,8 @@ line and prints a colored ≤3-row bar — zero tokens, the model never sees it.
129
142
  - Supports **macOS and Linux**; Windows is a planned fast-follow.
130
143
  - Requires Claude Code **2.1.132+** (`effort` / `thinking` need 2.1.145+).
131
144
 
145
+ [0.1.17]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.16...v0.1.17
146
+ [0.1.16]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.15...v0.1.16
132
147
  [0.1.15]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.14...v0.1.15
133
148
  [0.1.6]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.5...v0.1.6
134
149
  [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.17",
4
4
  "description": "Claude Code cache/context/cost status-line tool",
5
5
  "directories": {
6
6
  "doc": "docs"
package/src/cc-cream.js CHANGED
@@ -6,7 +6,6 @@
6
6
  import os from 'node:os';
7
7
  import path from 'node:path';
8
8
  import process from 'node:process';
9
- import { pathToFileURL } from 'node:url';
10
9
  import { loadConfig, readConfigFile } from './config.js';
11
10
  import { render } from './render.js';
12
11
  import {
@@ -16,6 +15,7 @@ import {
16
15
  readState,
17
16
  writeState,
18
17
  } from './state.js';
18
+ import { isEntrypoint } from './utils.js';
19
19
 
20
20
  export { DEFAULTS } from './defaults.js';
21
21
  export { loadConfig } from './config.js';
@@ -72,6 +72,9 @@ async function main() {
72
72
  process.exit(0);
73
73
  }
74
74
 
75
- if (import.meta.url === pathToFileURL(process.argv[1] || '').href) {
75
+ // isEntrypoint (src/utils.js) is symlink-robust see its comment. A plain
76
+ // import.meta.url === pathToFileURL(argv[1]) check fails under a symlinked path and
77
+ // renders nothing with no error.
78
+ if (isEntrypoint(import.meta.url)) {
76
79
  main();
77
80
  }
package/src/install.js CHANGED
@@ -14,7 +14,7 @@ import os from 'node:os';
14
14
  import path from 'node:path';
15
15
  import process from 'node:process';
16
16
  import readline from 'node:readline';
17
- import { pathToFileURL } from 'node:url';
17
+ import { isEntrypoint } from './utils.js';
18
18
 
19
19
  const TRUST_NOTE =
20
20
  'Claude Code must be trusted and possibly restarted for the status line to appear.';
@@ -328,6 +328,9 @@ async function main() {
328
328
  }
329
329
  }
330
330
 
331
- if (import.meta.url === pathToFileURL(process.argv[1] || '').href) {
331
+ // isEntrypoint (src/utils.js) is symlink-robust: a plain href comparison fails when
332
+ // install.js runs from a symlinked path (e.g. a dotfile-managed ~/.claude), which
333
+ // would make `cc-cream-setup` / the slash commands silently do nothing.
334
+ if (isEntrypoint(import.meta.url)) {
332
335
  main();
333
336
  }
package/src/utils.js CHANGED
@@ -1,5 +1,25 @@
1
+ import { realpathSync } from 'node:fs';
2
+ import process from 'node:process';
3
+ import { fileURLToPath, pathToFileURL } from 'node:url';
1
4
  import { ANSI } from './defaults.js';
2
5
 
6
+ // Robust "is this module the process entrypoint?" check, shared by every module
7
+ // that may run both as a script and as an import (cc-cream.js, install.js). Node's
8
+ // ESM loader canonicalizes import.meta.url (symlinks resolved) but leaves
9
+ // process.argv[1] as-invoked, so a plain href comparison fails when the module runs
10
+ // from a symlinked path — e.g. a ~/.claude managed by a dotfile manager
11
+ // (stow/chezmoi/yadm) or synced via iCloud/Dropbox — silently skipping main().
12
+ // Comparing realpaths fixes it; falls back to the href compare if realpath throws
13
+ // (e.g. a path that no longer exists). Pass the caller's import.meta.url.
14
+ export function isEntrypoint(metaUrl, arg = process.argv[1]) {
15
+ if (!arg) return false;
16
+ try {
17
+ return realpathSync(fileURLToPath(metaUrl)) === realpathSync(arg);
18
+ } catch {
19
+ return metaUrl === pathToFileURL(arg).href;
20
+ }
21
+ }
22
+
3
23
  export const clone = (o) => JSON.parse(JSON.stringify(o));
4
24
  export const isNum = (v) => typeof v === 'number' && Number.isFinite(v);
5
25
  export const numOr = (v, d) => (isNum(v) ? v : d);