@promptctl/cc-candybar 1.56.2 → 1.57.0

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
@@ -47,27 +47,24 @@ Drop a `.cc-candybar.json5` (or `.cc-candybar.json` — both extensions are acce
47
47
 
48
48
  JSON is a strict subset of JSON5, so the same parser handles both — `.json5` is the documented format (supports inline comments, trailing commas, unquoted keys), `.json` is the legacy/compat extension. When both exist at the same location, `.json5` wins and the bar shows a persistent warning so you can remove the shadowed duplicate.
49
49
 
50
- The file is a **complete** replacement for the bundled default — no merge layer. Start by copying `src/demo/statusline.json5` from the repo as a minimal example, or `src/config/default-dsl-config.ts` for the full standard library.
50
+ The file **merges onto the bundled default**, so it declares only what differs. `globals` merge per field; the named sections (`variables`, `segments`, `actions`, `helpers`, …) merge by name, your entry winning; `root` merges per named row (`identity` and `status` in the bundled default; a whole tree at `root` replaces every row). The bundled default is `src/config/default-dsl-config.ts`, and fuller starting points live under `examples/`. Run `cc-candybar check <path>` to load a file exactly as the daemon will: exit 0 means it renders, exit 1 prints the error with the path and line to fix.
51
51
 
52
- ```json5
53
- // minimal example — user, directory, branch, model, session, clock
52
+ <!-- The check:pass fence below is loaded by test/doc-snippets.test.ts through
53
+ `cc-candybar check` — edit it and run that test, so the README example
54
+ cannot drift from the loader. -->
55
+
56
+ ```json5 check:pass
57
+ // A theme, one new segment, and the row it joins. Everything else — the
58
+ // identity row, every other segment and variable — is inherited.
54
59
  {
55
- globals: { palette: 'textual-dark' },
60
+ globals: { palette: 'catppuccin-mocha' },
56
61
  variables: {
57
- user: { kind: 'env', name: 'USER', default: 'anon' },
58
- cwd: { kind: 'input', path: 'workspace.current_dir', default: '?' },
59
- branch: { kind: 'shell', command: 'git branch --show-current',
60
- cache: { ttl: '5s' }, default: '' },
61
- clock: { kind: 'time', layout: '15:04:05', cache: { ttl: '1s' } },
62
+ clock: { kind: 'time', layout: '15:04' }, // Go reference-time layout, re-read every second
62
63
  },
63
64
  segments: {
64
- user: { template: ' {{ .user }} ', bg: 'primary', fg: 'auto' },
65
- directory: { template: ' {{ basename .cwd }} ', bg: 'surface', fg: 'foreground' },
66
- branch: { template: ' {{ .branch }} ', bg: 'accent', fg: 'auto',
67
- when: '{{ ne .branch "" }}' },
68
- clock: { template: ' {{ .clock }} ', bg: 'primary', fg: 'auto' },
65
+ clock: { template: '{{ .clock }}' },
69
66
  },
70
- layout: ['user', 'directory', 'branch', 'clock'],
67
+ root: { rows: { status: { h: ['model', 'context', 'clock'] } } },
71
68
  }
72
69
  ```
73
70
 
@@ -113,7 +110,7 @@ Each segment is a DSL declaration with a `template` (text + interpolation + styl
113
110
 
114
111
  ## Themes
115
112
 
116
- The DSL config picks a base palette via `globals.palette` (e.g. `textual-dark`, `gruvbox`). Each segment may override with its own `palette:` field, and `bg`/`fg` evaluate as palette spec names (`primary`, `surface`, `panel`, `accent`, `foreground`, `auto`, `warning`, `error`, …). Color math runs through OKLCH for perceptual uniformity.
113
+ The DSL config picks a base palette via `globals.palette` (e.g. `textual-dark`, `gruvbox`). Each segment may override with its own `palette:` field, and `bg`/`fg` take a palette colour name (`primary`, `surface`, `panel`, `accent`, `foreground`, `warning`, `error`, …) or a computed colour such as `{{ darken (color "primary") 2 }}`; a segment that authors no `bg` wears the theme's decorative tint for its position. Color math runs through OKLCH for perceptual uniformity.
117
114
 
118
115
  ## Installation
119
116