@promptctl/cc-candybar 1.61.0 → 1.61.2

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 (3) hide show
  1. package/README.md +35 -18
  2. package/dist/index.mjs +26 -26
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -84,27 +84,44 @@ Saving the file triggers a hot-reload of every active session.
84
84
  ```
85
85
 
86
86
  - **Daemon** (`src/daemon/`) — long-lived background process. One per user. Caches git state via filesystem watchers, usage data, and per-session key/value state. Runs until it exits on an RSS backstop (default 512 MB via `CC_CANDYBAR_RSS_LIMIT_MB`; the V8 heap cap the spawner passes is twice that, a margin wide enough that the graceful backstop fires first under any growth its 60 s poll can see) or the host restarts; there is no idle or age timeout.
87
- - **Client** (`src/daemon/client.ts`) — each Claude Code hook invocation connects to the daemon, sends a render request, and prints the ANSI response. On failure, spawns a fresh daemon and emits empty output.
88
- - **Renderer** (`src/render/`, `src/segments/`) — segments produce styled output from cached data. Themes cascade from defaults through palette resolution using OKLCH color math.
89
- - **TUI grid** (`src/tui/`) — CSS Grid-inspired layout engine with breakpoints, column sizing (`auto`, `1fr`, fixed), spanning, and automatic culling of empty segments.
87
+ - **Client** (`rust-client/src/main.rs`) — the Rust binary installed as `bin/cc-candybar`, and the only thing on the per-render path: it connects to the daemon, sends the hook JSON, and prints the ANSI response. On a daemon miss it spawns one detached and prints an empty line, so the next refresh finds a warm daemon. Every subcommand (`install`, `daemon`, `check`, `doctor`, …) execs the Node bundle at `dist/index.mjs`, which carries a socket relay of its own (`src/daemon/client.ts`) as the fallback when no native binary is staged.
88
+ - **Renderer** (`src/dsl/render.ts`) — `renderDsl` is the single render path; the daemon, the demo and the tests all call it. It walks the config's layout tree, evaluates each segment's templates against the daemon's payload, and hands the styled cells to `src/render/` (strip and joiner selection, pickers and menus, the diagnostic strip). The payload's data comes from the providers in `src/segments/` — git, session, context, metrics, tmux, pricing.
89
+ - **Themes** (`src/themes/`) — palette construction plus name policy (which theme, style, charset and colour depth names resolve to what). The colour arithmetic itself — blending, contrast, OKLCH transposition — lives in the separate `rich-js` package; this repo does none of it.
90
90
 
91
91
  ## Segments
92
92
 
93
- | Segment | Shows | Symbol |
94
- |---------|-------|--------|
95
- | directory | CWD name (`full`, `fish`, `basename`) | — |
96
- | git | Branch, SHA, working tree, upstream, stash, tags | `⎇` |
97
- | model | Current Claude model | `✱` |
98
- | session | Per-session cost/tokens/breakdown | `§` |
99
- | today | Daily usage with budget monitoring | `☉` |
100
- | context | Context window usage with auto-compact threshold | `◔` |
101
- | block | 5-hour rate-limit utilization | `◱` |
102
- | weekly | 7-day rolling rate-limit utilization | `◑` |
103
- | metrics | Response time, duration, lines changed | `⧖` |
104
- | version | Claude Code version | `◈` |
105
- | tmux | tmux session name | — |
106
- | sessionId | Session identifier (cmd-click to copy) | `⌗` |
107
- | env | Arbitrary environment variable | `⚙` |
93
+ These are the segment names `DEFAULT_DSL_CONFIG` declares, each available to a user's `root` whether or not the default bar places it.
94
+
95
+ | Segment | Shows | Visible |
96
+ |---------|-------|---------|
97
+ | `directory` | the cwd, abbreviated fish-style (`~/c/cc-candybar`) | always |
98
+ | `model` | `✱` and the model's display name | always |
99
+ | `sessionId` | `⌗` and the first 8 characters of the session id | always |
100
+ | `version` | `◈ v` and the Claude Code version | always |
101
+ | `tmux` | `tmux:` and the tmux session name | inside tmux |
102
+ | `host` | `⇄ user@host` | over SSH |
103
+ | `git` | repo, `⎇` branch, sha, ahead/behind, worktree, upstream, stash, working-tree status | in a repo |
104
+ | `gitaculous` | the same facts in gitaculous's spelling — `(git)`, repo, operation, sha, `S`/`U`/`?`/`!` counts, upstream, stashes, time since the last commit | in a repo |
105
+ | `gitPr` | `⇆ #N` linked to the pull request, or `⚠ PR` when the forge lookup failed | when a PR or a lookup error is known |
106
+ | `toolbar` | click affordances — copy the session id, open the project dir, the transcript and the repo page, toggle edit mode | always |
107
+ | `session` | `§` this session's cost and tokens, plus budget status | always |
108
+ | `today` | `☉` today's cost and tokens across sessions, plus budget status | always |
109
+ | `block` | `◱` the 5-hour rate-limit window's utilization | while that window is active |
110
+ | `weekly` | `◑` the 7-day rolling rate limit's utilization | while that window is active |
111
+ | `burnrate` | `⚡` cost per hour, then ETA to the 5-hour and weekly limits | while either window is active |
112
+ | `speed` | `⇅` output, input and total tokens per second | once the session has tokens |
113
+ | `tokenSparkline` | `⚡` a sparkline over the last 24 speed samples | once speed samples exist |
114
+ | `cacheTimer` | `◴` minutes until the prompt cache expires, or `cold` | while a cache expiry is known |
115
+ | `context` | `◔` context tokens used and the percentage left | when context tokens are known |
116
+ | `metrics` | `Δ` last response time, `⧖` response time, `⧗` session duration, `◆` message count, lines changed | when any of those exist |
117
+
118
+ Three more declarations are controls for the settings drawer rather than things the bar reports. Each pairs a picker with a `↺` reset:
119
+
120
+ | Control | Sets |
121
+ |---------|------|
122
+ | `charsetControl` | the joiner glyph vocabulary (`unicode` or `ascii`) |
123
+ | `colorCompatControl` | the output colour depth (truecolor, 256, ansi, none) |
124
+ | `directoryPaletteControl` | `🎨 directory` — the palette pinned to the `directory` segment alone |
108
125
 
109
126
  Each segment is a DSL declaration with a `template` (text + interpolation + style functions), a `bg`/`fg` palette spec, and optional `when` predicate. Templates compose freely — every formatter in the bundled function library (`formatCost`, `formatTokens`, `formatLongTimeRemaining`, `budgetStatus`, `link`, `urlEncode`, the sprig string/list/dict library, …) is available in every segment.
110
127