Commit Graph

6 Commits

Author SHA1 Message Date
Taylor Eernisse
90454efe9f fix: install.sh respects CARGO_TARGET_DIR via cargo metadata
The installer hardcoded target/ as the build output directory, but
CARGO_TARGET_DIR (or [build] target-dir in cargo config) can redirect
output anywhere (e.g., /tmp/cargo-target). Now uses cargo metadata
--format-version 1 to get the actual target_directory, falling back
to $SCRIPT_DIR/target if metadata fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 08:45:21 -05:00
Taylor Eernisse
f35d665c19 fix: install.sh adds smoke test, settings verification, and error recovery
The script now: runs the binary with --test after install to verify it
actually works, prints the statusLine JSON that was written to settings,
handles corrupt/invalid settings.json by backing up and writing fresh,
and emphasizes that Claude Code must be restarted to pick up the change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 23:54:09 -05:00
Taylor Eernisse
f94a3170b1 fix: install.sh finds binary under custom target triples
Nightly toolchains with CARGO_BUILD_TARGET set (or .cargo/config.toml
[build] target) put the binary in target/<triple>/release/ instead of
target/release/. The installer now falls back to a find search across
all target subdirectories when the standard path doesn't exist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 23:51:36 -05:00
Taylor Eernisse
23d4d59c71 fix: install.sh shows build errors instead of failing silently
cargo build --quiet swallowed compiler errors, and the subshell (...)
didn't reliably propagate exit codes across bash versions. The script
continued past a failed build, then ls/cp failed on the missing binary.

Now: removed --quiet so errors are visible, explicit exit-code check
with common-cause hints (build-essential, libc6-dev), and a secondary
check that the binary actually exists before attempting to install it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 23:49:45 -05:00
Taylor Eernisse
8853afffa1 feat: update defaults, schema, and installer for new capabilities
Configuration and deployment updates to match the new feature set.

defaults.json:
  - Dark theme palette switched from named ANSI to Dracula-inspired hex:
    success=#50fa7b, warning=#f1fa8c, danger=#ff5555, accent=#8be9fd,
    info=#bd93f9. Light theme unchanged (named ANSI with bold).
  - Glyph characters normalized to Unicode escapes (clean/ahead/behind).
  - Verbose layout (3 lines) reorganized:
    Line 1: model, provider, spacer, lines_changed, project, vcs, beads
    Line 2: context_bar, context_usage, cache_efficiency, spacer, cost,
             cost_velocity, cost_trend, duration
    Line 3: context_trend, tokens_raw, spacer, tools, turns, load,
             cloud_profile, k8s_context, python_env, toolchain
  - context_usage, cost_trend, context_trend now enabled by default.
  - Trend widths increased from 8 to 12 characters.
  - Context bar: bar_style=block, gradient=true.
  - Tools: show_breakdown=true, top_n=7.
  - New sections enabled: cloud_profile (P2), k8s_context (P3, ttl=30),
    python_env (P3), toolchain (P3).

schema.json:
  - Added $schema self-reference field for editor autocomplete.
  - Expanded colorName from fixed enum to freeform string with docs
    covering hex, bg:, modifiers, and palette refs.
  - New section schemas: trendSection, contextTrendSection with width,
    gradient, and threshold properties.
  - context_bar: added bar_style, gradient, fill_char, empty_char.
  - tools: added show_breakdown, top_n, palette array.
  - All section types: added background and placeholder properties.
  - Width description updated to clarify it's a max cap + fallback,
    not an override.
  - colorMatch additionalProperties relaxed from enum to string.

install.sh:
  Complete rewrite for Rust binary workflow:
  - Checks cargo and jq prerequisites.
  - Builds release binary via cargo build --release.
  - Installs to ~/.local/bin/claude-statusline with PATH check.
  - Creates/updates ~/.claude/settings.json with statusLine command
    (type: "command", --color=always, padding: 0).
  - Symlinks statusline.json config if present in project.
  - Removed all bash-script-era logic (symlinks, bash version checks).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 23:42:58 -05:00
Taylor Eernisse
b55d1aefd1 feat: complete Rust port of claude-statusline
Port the entire 2236-line bash statusline script to Rust.
Implements all 25 sections, 3-phase layout engine (render, priority
drop, flex/justify), file-based caching with flock, 9-level terminal
width detection, trend sparklines, and deep-merge JSON config.

Release binary: 864K with LTO. Render time: <1ms warm.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 14:21:57 -05:00