@v1nvn/statusline 0.22.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 ADDED
@@ -0,0 +1,92 @@
1
+ # @v1nvn/statusline
2
+
3
+ The CLI behind the statusline plugin: it composes the two settings keys
4
+ that paint Claude Code's status line and agent panel, then reverts and checks
5
+ them. Pure TypeScript — the bash runtime it points at ships inside the plugin
6
+ (`plugins/statusline/runtime/`), not in this package.
7
+
8
+ User-facing docs: [root README § statusline](../../README.md#statusline).
9
+
10
+ ## Quickstart
11
+
12
+ The wizard is the way to configure — both surfaces, live previews, enter saves.
13
+
14
+ Install once (the runtime the keys point at lives in the plugin cache):
15
+
16
+ ```sh
17
+ claude plugin marketplace add v1nvn/agentic
18
+ claude plugin install statusline@agentic
19
+ ```
20
+
21
+ In Claude Code — type `/lab`, run the wizard it hands you (`!`
22
+ runs it in your session with a real terminal):
23
+
24
+ ```
25
+ ! npx -y @v1nvn/statusline configure
26
+ ```
27
+
28
+ In a terminal — same command, bare:
29
+
30
+ ```sh
31
+ npx -y @v1nvn/statusline configure
32
+ ```
33
+
34
+ `j/k` move · `h/l` switch design · `w` width · enter saves · `q` cancels.
35
+
36
+ ## Usage
37
+
38
+ One CLI, both ways: `/lab` inside a session runs these same
39
+ commands; `npx` runs them in a terminal.
40
+
41
+ | Command | Does |
42
+ |---|---|
43
+ | `configure` | bare on a TTY: the wizard. With flags: strict — every layout item needs a variant flag or `--fallback=default\|existing`; `--dry-run` renders without writing; a foreign key needs `--force` |
44
+ | `catalog` | one line per item, `*` marks the live variant |
45
+ | `status` | one row per fact plus a verdict — exit 0 healthy, 1 needs action, every action row names its fix |
46
+ | `restore` | both keys back to their pre-lab values from `backup.json`, then deletes the lab data — run it before uninstalling |
47
+
48
+ ```sh
49
+ npx -y @v1nvn/statusline catalog
50
+ npx -y @v1nvn/statusline configure --model block --bar gauge --fallback=default --dry-run # preview, write nothing
51
+ npx -y @v1nvn/statusline configure --model block --bar gauge --fallback=default # the write
52
+ npx -y @v1nvn/statusline status
53
+ npx -y @v1nvn/statusline restore
54
+ ```
55
+
56
+ ## Develop
57
+
58
+ ```sh
59
+ yarn workspace @v1nvn/statusline build # vite → dist/, chmod +x the bin
60
+ yarn workspace @v1nvn/statusline test # vitest
61
+ yarn lint && yarn typecheck # from the repo root
62
+ ```
63
+
64
+ Node ≥ 22. One workspace dep: `@v1nvn/agentic-core` (usage/exit helpers).
65
+
66
+ ## Modules
67
+
68
+ | File | Role |
69
+ |---|---|
70
+ | `src/cli.ts` | commander wiring — four subcommands, help text |
71
+ | `src/index.ts` | bin entry — verb dispatch, exit codes, wizard TTY deps |
72
+ | `src/configure.ts` | the writer — key composition, ours-matcher, JSON splice engine, backup write, dry-run render |
73
+ | `src/resolve.ts` | runtime resolution + key parsing — the one resolution way |
74
+ | `src/restore.ts` | revert decision tree + explicit-path cleanup |
75
+ | `src/status.ts` | diagnostic rows + verdict |
76
+ | `src/catalog.ts` | item listing, live variant starred |
77
+ | `src/wizard.ts` · `src/wizard-tui.ts` | the terminal wizard — previews both surfaces, saves via `configure` |
78
+ | `src/payloads.ts` · `src/demo-repo.ts` | preview plumbing — spawns the runtime with env + stdin; demo git repo for fixtures |
79
+ | `assets/` | preview fixtures — `payloads/p1–p4.json` (main surface), `ticks/multi.json` (panel) |
80
+
81
+ ## Contracts
82
+
83
+ - `configure` writes exactly two keys of `~/.claude/settings.json` — nothing
84
+ else on disk except `backup.json` and `captures/`.
85
+ - The key value is one inline shell command: resolver statement first, env
86
+ assignments hugging `bash` last; statement order is pinned by golden tests.
87
+ - One resolution way: the newest-plugin-cache glob — `installed_plugins.json`
88
+ is read nowhere.
89
+ - One splice home: the settings.json span primitives live in `configure.ts`;
90
+ `restore` imports them.
91
+ - `restore` never resolves the runtime — it works uninstalled.
92
+ - Deletion is explicit paths only — no globs, no recursive rm.
@@ -0,0 +1,92 @@
1
+ {
2
+ "session_id": "a1b2c3d4demo",
3
+ "session_name": "statusline-makeover",
4
+ "transcript_path": "/Users/vineet/.claude/projects/demo/x.jsonl",
5
+ "version": "2.1.275",
6
+ "cwd": "/demo/atlas-web",
7
+ "model": {
8
+ "id": "claude-opus-5",
9
+ "display_name": "Opus"
10
+ },
11
+ "workspace": {
12
+ "current_dir": "/demo/atlas-web",
13
+ "project_dir": "/demo/atlas-web",
14
+ "added_dirs": [],
15
+ "repo": {
16
+ "host": "github.com",
17
+ "owner": "vineet",
18
+ "name": "atlas-web"
19
+ }
20
+ },
21
+ "output_style": {
22
+ "name": "default"
23
+ },
24
+ "effort": {
25
+ "level": "high"
26
+ },
27
+ "thinking": {
28
+ "enabled": true
29
+ },
30
+ "fast_mode": false,
31
+ "vim": {
32
+ "mode": "NORMAL"
33
+ },
34
+ "pr": {
35
+ "number": 4821,
36
+ "url": "https://github.com/vineet/atlas-web/pull/4821",
37
+ "review_state": "pending"
38
+ },
39
+ "cost": {
40
+ "total_cost_usd": 3.87,
41
+ "total_duration_ms": 4925000,
42
+ "total_api_duration_ms": 742000,
43
+ "total_lines_added": 156,
44
+ "total_lines_removed": 23
45
+ },
46
+ "context_window": {
47
+ "total_input_tokens": 116800,
48
+ "total_output_tokens": 8400,
49
+ "context_window_size": 200000,
50
+ "used_percentage": 58.4,
51
+ "remaining_percentage": 41.6,
52
+ "current_usage": {
53
+ "input_tokens": 8200,
54
+ "output_tokens": 8400,
55
+ "cache_creation_input_tokens": 18400,
56
+ "cache_read_input_tokens": 90200
57
+ }
58
+ },
59
+ "exceeds_200k_tokens": false,
60
+ "prompt_cache": {
61
+ "warm": true,
62
+ "caching_observed": true,
63
+ "ttl": "1h",
64
+ "expires_at": 1788869062,
65
+ "requests": 214,
66
+ "misses": 3,
67
+ "expected_rebuilds": 1,
68
+ "hit_ratio": 0.94,
69
+ "cache_write_tokens": 352000,
70
+ "miss_recache_tokens": 310200,
71
+ "last_miss_at": 1788865162,
72
+ "last_miss_cause": {
73
+ "causes": ["tools_changed"],
74
+ "tools_added": 2,
75
+ "tools_removed": 0
76
+ }
77
+ },
78
+ "rate_limits": {
79
+ "five_hour": {
80
+ "used_percentage": 23.5,
81
+ "resets_at": 1788880972
82
+ },
83
+ "seven_day": {
84
+ "used_percentage": 41.2,
85
+ "resets_at": 1789385542
86
+ },
87
+ "spend_limit": {
88
+ "used_percentage": 62.8,
89
+ "resets_at": 1789817542
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "session_id": "e5f6demo02",
3
+ "cwd": "/demo/atlas-web",
4
+ "model": {
5
+ "id": "claude-sonnet-5",
6
+ "display_name": "Sonnet"
7
+ },
8
+ "workspace": {
9
+ "current_dir": "/demo/atlas-web",
10
+ "project_dir": "/demo/atlas-web"
11
+ },
12
+ "version": "2.1.275",
13
+ "output_style": {
14
+ "name": "default"
15
+ },
16
+ "effort": {
17
+ "level": "low"
18
+ },
19
+ "cost": {
20
+ "total_cost_usd": 0.42,
21
+ "total_duration_ms": 412000,
22
+ "total_api_duration_ms": 96000,
23
+ "total_lines_added": 12,
24
+ "total_lines_removed": 0
25
+ },
26
+ "context_window": {
27
+ "total_input_tokens": 22400,
28
+ "total_output_tokens": 1800,
29
+ "context_window_size": 200000,
30
+ "used_percentage": 11.2,
31
+ "remaining_percentage": 88.8,
32
+ "current_usage": {
33
+ "input_tokens": 4200,
34
+ "output_tokens": 1800,
35
+ "cache_creation_input_tokens": 6200,
36
+ "cache_read_input_tokens": 12000
37
+ }
38
+ },
39
+ "prompt_cache": {
40
+ "warm": true,
41
+ "caching_observed": true,
42
+ "ttl": "5m",
43
+ "expires_at": 1788869542,
44
+ "requests": 9,
45
+ "misses": 0,
46
+ "expected_rebuilds": 0,
47
+ "hit_ratio": 0.99,
48
+ "cache_write_tokens": 26100,
49
+ "miss_recache_tokens": 0,
50
+ "last_miss_at": 1788865642
51
+ },
52
+ "rate_limits": {
53
+ "five_hour": {
54
+ "used_percentage": 6.1,
55
+ "resets_at": 1788883312
56
+ },
57
+ "seven_day": {
58
+ "used_percentage": 8.4,
59
+ "resets_at": 1789437142
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "session_id": "c9d0demo03",
3
+ "cwd": "/demo/atlas-web",
4
+ "model": {
5
+ "id": "claude-opus-5",
6
+ "display_name": "Opus"
7
+ },
8
+ "workspace": {
9
+ "current_dir": "/demo/atlas-web",
10
+ "project_dir": "/demo/atlas-web"
11
+ },
12
+ "version": "2.1.275",
13
+ "output_style": {
14
+ "name": "default"
15
+ },
16
+ "effort": {
17
+ "level": "high"
18
+ },
19
+ "thinking": {
20
+ "enabled": true
21
+ },
22
+ "cost": {
23
+ "total_cost_usd": 8.91,
24
+ "total_duration_ms": 6110000,
25
+ "total_api_duration_ms": 1030000,
26
+ "total_lines_added": 412,
27
+ "total_lines_removed": 87
28
+ },
29
+ "context_window": {
30
+ "total_input_tokens": 190800,
31
+ "total_output_tokens": 22400,
32
+ "context_window_size": 200000,
33
+ "used_percentage": 95.4,
34
+ "remaining_percentage": 4.6,
35
+ "current_usage": {
36
+ "input_tokens": 19800,
37
+ "output_tokens": 22400,
38
+ "cache_creation_input_tokens": 22000,
39
+ "cache_read_input_tokens": 149000
40
+ }
41
+ },
42
+ "exceeds_200k_tokens": false,
43
+ "prompt_cache": {
44
+ "warm": false,
45
+ "caching_observed": true,
46
+ "ttl": "1h",
47
+ "expires_at": 1788867132,
48
+ "requests": 312,
49
+ "misses": 9,
50
+ "expected_rebuilds": 2,
51
+ "hit_ratio": 0.71,
52
+ "cache_write_tokens": 412000,
53
+ "miss_recache_tokens": 399100,
54
+ "last_miss_at": 1788867117,
55
+ "last_miss_cause": {
56
+ "causes": ["ttl_expired_1h"]
57
+ }
58
+ },
59
+ "rate_limits": {
60
+ "five_hour": {
61
+ "used_percentage": 88.4,
62
+ "resets_at": 1788869232
63
+ },
64
+ "seven_day": {
65
+ "used_percentage": 63.1,
66
+ "resets_at": 1789157142
67
+ }
68
+ }
69
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "session_id": "b7a8demo04",
3
+ "session_name": "auth-refactor",
4
+ "cwd": "/demo/atlas-web",
5
+ "model": {
6
+ "id": "claude-opus-5",
7
+ "display_name": "Opus"
8
+ },
9
+ "workspace": {
10
+ "current_dir": "/demo/atlas-web",
11
+ "project_dir": "/demo/atlas-web",
12
+ "git_worktree": "fix-auth"
13
+ },
14
+ "version": "2.1.275",
15
+ "output_style": {
16
+ "name": "explanatory"
17
+ },
18
+ "effort": {
19
+ "level": "medium"
20
+ },
21
+ "vim": {
22
+ "mode": "INSERT"
23
+ },
24
+ "agent": {
25
+ "name": "code-reviewer"
26
+ },
27
+ "pr": {
28
+ "number": 5102,
29
+ "url": "https://github.com/vineet/atlas-web/pull/5102",
30
+ "review_state": "approved"
31
+ },
32
+ "worktree": {
33
+ "name": "fix-auth",
34
+ "path": "/demo/atlas-web-wt",
35
+ "branch": "worktree-fix-auth",
36
+ "original_cwd": "/demo/atlas-web",
37
+ "original_branch": "main"
38
+ },
39
+ "cost": {
40
+ "total_cost_usd": 12.4,
41
+ "total_duration_ms": 8420000,
42
+ "total_api_duration_ms": 1490000,
43
+ "total_lines_added": 1240,
44
+ "total_lines_removed": 312
45
+ },
46
+ "context_window": {
47
+ "total_input_tokens": 148400,
48
+ "total_output_tokens": 14100,
49
+ "context_window_size": 200000,
50
+ "used_percentage": 74.2,
51
+ "remaining_percentage": 25.8,
52
+ "current_usage": {
53
+ "input_tokens": 16200,
54
+ "output_tokens": 14100,
55
+ "cache_creation_input_tokens": 30200,
56
+ "cache_read_input_tokens": 102000
57
+ }
58
+ },
59
+ "prompt_cache": {
60
+ "warm": true,
61
+ "caching_observed": true,
62
+ "ttl": "1h",
63
+ "expires_at": 1788867742,
64
+ "requests": 401,
65
+ "misses": 5,
66
+ "expected_rebuilds": 1,
67
+ "hit_ratio": 0.88,
68
+ "cache_write_tokens": 388000,
69
+ "miss_recache_tokens": 341000,
70
+ "last_miss_at": 1788863842
71
+ },
72
+ "rate_limits": {
73
+ "five_hour": {
74
+ "used_percentage": 52.7,
75
+ "resets_at": 1788882142
76
+ },
77
+ "seven_day": {
78
+ "used_percentage": 44.0,
79
+ "resets_at": 1789407142
80
+ },
81
+ "spend_limit": {
82
+ "used_percentage": 35.2,
83
+ "resets_at": 1788988933
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "columns": 200,
3
+ "tasks": [
4
+ {
5
+ "id": "row-explore",
6
+ "label": "Explore",
7
+ "name": "explore",
8
+ "description": "Reading unit 2's landed pattern",
9
+ "model": "Sonnet [1m]",
10
+ "effort": "high",
11
+ "contextWindowSize": 200000,
12
+ "tokenCount": 142300,
13
+ "startTime": 1788862735
14
+ },
15
+ {
16
+ "id": "row-tests",
17
+ "label": "Tests",
18
+ "name": "test-writer",
19
+ "description": "Golden capture for the subagent rows",
20
+ "model": "Opus",
21
+ "effort": "medium",
22
+ "contextWindowSize": 180000,
23
+ "tokenCount": 9000,
24
+ "startTime": 1788869875000
25
+ },
26
+ {
27
+ "id": "row-review",
28
+ "label": "Review",
29
+ "name": "reviewer",
30
+ "description": "",
31
+ "model": "Haiku",
32
+ "effort": "low",
33
+ "contextWindowSize": 0,
34
+ "tokenCount": 0,
35
+ "startTime": 1788869990
36
+ },
37
+ {
38
+ "id": "row-fork",
39
+ "label": "",
40
+ "name": "Fork",
41
+ "description": "Name stands in when label is empty",
42
+ "model": "Sonnet",
43
+ "effort": "",
44
+ "contextWindowSize": 1000000,
45
+ "tokenCount": 950000,
46
+ "startTime": 0
47
+ },
48
+ {
49
+ "id": "row-idle",
50
+ "label": "Idle",
51
+ "name": "idle",
52
+ "description": "Idle",
53
+ "model": "",
54
+ "effort": "",
55
+ "contextWindowSize": 0,
56
+ "tokenCount": 0,
57
+ "startTime": 1788870001
58
+ },
59
+ {
60
+ "label": "NoId",
61
+ "name": "ghost",
62
+ "description": "Row without an id renders no line",
63
+ "model": "Opus",
64
+ "effort": "high",
65
+ "contextWindowSize": 200000,
66
+ "tokenCount": 1000,
67
+ "startTime": 1788869950
68
+ }
69
+ ]
70
+ }