@v1nvn/statusline 0.27.3 → 0.29.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 +78 -51
- package/dist/index.js +2024 -673
- package/dist/index.js.map +1 -1
- package/dist/render.mjs +1452 -0
- package/dist/render.mjs.map +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,64 +1,61 @@
|
|
|
1
1
|
# @v1nvn/statusline
|
|
2
2
|
|
|
3
|
-
The
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
The statusline package: the CLI that writes the two settings keys painting
|
|
4
|
+
Claude Code's status line and agent panel, and the renderer those keys spawn —
|
|
5
|
+
`dist/render.mjs`, synced into the plugin data dir and run with `node`. Pure
|
|
6
|
+
TypeScript, zero bash.
|
|
7
7
|
|
|
8
8
|
User-facing docs: [root README § statusline](../../README.md#statusline).
|
|
9
9
|
|
|
10
10
|
## Quickstart
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Install once (the runtime the keys point at lives in the plugin cache):
|
|
12
|
+
Install once:
|
|
15
13
|
|
|
16
14
|
```sh
|
|
17
15
|
claude plugin marketplace add v1nvn/agentic
|
|
18
16
|
claude plugin install statusline@agentic
|
|
19
17
|
```
|
|
20
18
|
|
|
21
|
-
In Claude Code — type `/lab
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
! npx -y @v1nvn/statusline@0.27.3 configure
|
|
26
|
-
```
|
|
19
|
+
In Claude Code — type `/lab`: the agent sketches the themes as plain renders,
|
|
20
|
+
offers the picker in chat, and writes the pick.
|
|
27
21
|
|
|
28
|
-
In a terminal —
|
|
22
|
+
In a terminal outside Claude Code — the wizard, the terminal guide:
|
|
29
23
|
|
|
30
24
|
```sh
|
|
31
|
-
npx -y @v1nvn/statusline@0.
|
|
25
|
+
npx -y @v1nvn/statusline@0.29.0 configure
|
|
32
26
|
```
|
|
33
27
|
|
|
34
|
-
`j/k`
|
|
35
|
-
|
|
28
|
+
Pass one stacks the five theme bars: `j/k` focus · `w` width · enter picks.
|
|
29
|
+
Pass two refines the pick: `j/k` move · `h/l` variant · `s` none · `t` back
|
|
30
|
+
to the themes · `w` width · enter saves · `q` cancels.
|
|
36
31
|
|
|
37
32
|
## Usage
|
|
38
33
|
|
|
39
|
-
One CLI, both ways: `/lab` inside a session runs these same
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
One CLI, both ways: `/lab` inside a session runs these same commands; `npx`
|
|
35
|
+
runs them in a terminal. Every subcommand takes `--home <dir>` to operate on
|
|
36
|
+
another home instead of `$HOME`.
|
|
42
37
|
|
|
43
|
-
| Command
|
|
44
|
-
|
|
45
|
-
| `configure` |
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
38
|
+
| Command | Does |
|
|
39
|
+
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
40
|
+
| `configure` | the sole writer — writes both settings keys and syncs the bundled renderer into the data dir. Bare on a TTY: the wizard. With flags: `--theme <name>` (quiet, lean, classic, rich, custom) is the base design, item flags override it, `--layout` overrides its layout; a layout item nothing picks is an error naming it; a foreign key needs `--force` |
|
|
41
|
+
| `preview` | render the candidate bar and panel row through the same resolver the keys paint with, writing nothing; `--plain` strips the color escapes so glyphs survive chat |
|
|
42
|
+
| `catalog` | the themes block (`*` marks the theme the key names) then one line per item, `*` marking the resolved variant; `--themes` cuts to the block |
|
|
43
|
+
| `status` | one row per fact — node, the data-dir renderer, both keys, the theme the key names, backup, captures — plus a verdict; exit 0 healthy, 1 needs action, every action row names its fix |
|
|
44
|
+
| `restore` | both keys back to their pre-lab values from `backup.json`, then deletes the lab data — `--dry-run` prints the plan; `--force` splices over a key changed after the takeover |
|
|
49
45
|
|
|
50
46
|
```sh
|
|
51
|
-
npx -y @v1nvn/statusline@0.
|
|
52
|
-
npx -y @v1nvn/statusline@0.
|
|
53
|
-
npx -y @v1nvn/statusline@0.
|
|
54
|
-
npx -y @v1nvn/statusline@0.
|
|
55
|
-
npx -y @v1nvn/statusline@0.
|
|
47
|
+
npx -y @v1nvn/statusline@0.29.0 preview --theme rich --plain # chat-safe sketch, nothing written
|
|
48
|
+
npx -y @v1nvn/statusline@0.29.0 configure --theme rich # the write — live on the next paint
|
|
49
|
+
npx -y @v1nvn/statusline@0.29.0 configure --theme rich --bar percent # one swap on top of the theme
|
|
50
|
+
npx -y @v1nvn/statusline@0.29.0 catalog --themes
|
|
51
|
+
npx -y @v1nvn/statusline@0.29.0 status
|
|
52
|
+
npx -y @v1nvn/statusline@0.29.0 restore
|
|
56
53
|
```
|
|
57
54
|
|
|
58
55
|
## Develop
|
|
59
56
|
|
|
60
57
|
```sh
|
|
61
|
-
yarn workspace @v1nvn/statusline build # vite → dist/
|
|
58
|
+
yarn workspace @v1nvn/statusline build # vite → dist/ (index.js + render.mjs)
|
|
62
59
|
yarn workspace @v1nvn/statusline test # vitest
|
|
63
60
|
yarn lint && yarn typecheck # from the repo root
|
|
64
61
|
```
|
|
@@ -67,28 +64,58 @@ Node ≥ 22. One workspace dep: `@v1nvn/agentic-core` (usage/exit helpers).
|
|
|
67
64
|
|
|
68
65
|
## Modules
|
|
69
66
|
|
|
70
|
-
| File
|
|
71
|
-
|
|
72
|
-
| `src/cli.ts`
|
|
73
|
-
| `src/index.ts`
|
|
74
|
-
| `src/configure.ts`
|
|
75
|
-
| `src/resolve.ts`
|
|
76
|
-
| `src/restore.ts`
|
|
77
|
-
| `src/status.ts`
|
|
78
|
-
| `src/catalog.ts`
|
|
79
|
-
| `src/
|
|
80
|
-
| `src/
|
|
81
|
-
| `
|
|
67
|
+
| File | Role |
|
|
68
|
+
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
69
|
+
| `src/cli.ts` | commander wiring — five subcommands, help text |
|
|
70
|
+
| `src/index.ts` | bin entry — verb dispatch, exit codes, wizard TTY deps |
|
|
71
|
+
| `src/configure.ts` | the writer — validation, diff-from-base flags, ours-matcher, JSON splice engine, backup write, renderer sync |
|
|
72
|
+
| `src/resolve.ts` | the settings keys — composition, ours-matching, and parsing back into decisions |
|
|
73
|
+
| `src/restore.ts` | revert decision tree + explicit-path cleanup |
|
|
74
|
+
| `src/status.ts` | diagnostic rows + verdict — node, renderer, keys, theme |
|
|
75
|
+
| `src/catalog.ts` | themes block + item listing, resolved picks starred |
|
|
76
|
+
| `src/themes.ts` | the five theme bundles — layout, one variant per item, summary |
|
|
77
|
+
| `src/preview.ts` | the preview command — a candidate rendered, nothing written |
|
|
78
|
+
| `src/wizard.ts` · `src/wizard-tui.ts` | the terminal wizard — theme pass, then refinement of the pick's overrides |
|
|
79
|
+
| `src/payloads.ts` · `src/demo-repo.ts` | preview plumbing — fixtures anchored to the moment, in-process renders; demo git repo |
|
|
80
|
+
| `src/render/entry.ts` | the `render.mjs` entry the keys spawn — argv to line or panel, both capture tees |
|
|
81
|
+
| `src/render/argv.ts` | the renderer's argv grammar — `node:util` parseArgs, never commander |
|
|
82
|
+
| `src/render/theme.ts` | `resolvePaint` — the one theme resolver, shared by paint and display |
|
|
83
|
+
| `src/render/engine.ts` | the line engine — compose, `vlen`, the fit ladder |
|
|
84
|
+
| `src/render/items.ts` | the item registry — 16 items, defaults, rungs, `DEFAULT_LAYOUT` |
|
|
85
|
+
| `src/render/segments.ts` | the per-item segment renderers |
|
|
86
|
+
| `src/render/payload.ts` | the stdin payload types + parse |
|
|
87
|
+
| `src/render/git.ts` | the git reads |
|
|
88
|
+
| `src/render/panel.ts` | the agent-panel renderer — its own `vlen` and fit ladder |
|
|
89
|
+
| `src/render/awk.ts` | printf-style decimal formatting on exact IEEE bits |
|
|
90
|
+
| `src/render/capture.ts` | the capture tee + `DATA_DIR` |
|
|
91
|
+
| `src/render/index.ts` | the in-process barrel the CLI renders through |
|
|
92
|
+
| `assets/` | preview fixtures — `payloads/p1–p4.json` (main surface), `ticks/multi.json` (panel) |
|
|
82
93
|
|
|
83
94
|
## Contracts
|
|
84
95
|
|
|
85
|
-
- `configure` writes
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
|
|
96
|
+
- `configure` is the sole writer: one run writes both keys and syncs the
|
|
97
|
+
bundled `render.mjs` into the data dir — its only other write is
|
|
98
|
+
`backup.json`. `preview`, `catalog`, and `status` write nothing;
|
|
99
|
+
`captures/` is the renderer's paint-time tee, not a CLI write.
|
|
100
|
+
- The key value is one direct data-dir command:
|
|
101
|
+
`node "$HOME/.claude/plugins/data/statusline-agentic/render.mjs" --theme=lean --bar=gauge || true`
|
|
102
|
+
— no glob resolver, no plugin-cache coupling; the panel key adds the `panel`
|
|
103
|
+
positional. Key spellings are pinned byte-exact by tests.
|
|
104
|
+
- Decisions ride argv: `--theme` first, then one `--<item>=<alt>` per pick
|
|
105
|
+
that differs from the theme's own, `--layout` only when passed. Ambient
|
|
106
|
+
state stays env — `NO_COLOR`, `COLUMNS`, `HOME`.
|
|
107
|
+
- The renderer resolves the theme at paint: item flags beat it, `--layout`
|
|
108
|
+
beats its layout — one resolver, no second path. `catalog` stars through
|
|
109
|
+
it, `preview` and the wizard render through it in-process, and `status`
|
|
110
|
+
reads the theme name straight from the key.
|
|
111
|
+
- The theme name rides the key: `status` and `catalog` read it straight from
|
|
112
|
+
the key, swaps appended — `theme: lean +bar=gauge` — so a swap keeps the
|
|
113
|
+
name.
|
|
114
|
+
- The renderer bundle is dependency-free (node built-ins only) and parses its
|
|
115
|
+
own argv — never commander, never `@v1nvn/agentic-core` — so any node ≥ 18
|
|
116
|
+
the host has paints.
|
|
91
117
|
- One splice home: the settings.json span primitives live in `configure.ts`;
|
|
92
118
|
`restore` imports them.
|
|
93
|
-
- `restore` never
|
|
119
|
+
- `restore` never runs the renderer — it works uninstalled, deleting
|
|
120
|
+
`render.mjs` with the rest of the lab data by explicit path.
|
|
94
121
|
- Deletion is explicit paths only — no globs, no recursive rm.
|