prjct-cli 3.83.0 → 3.84.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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [3.84.0] - 2026-08-11
6
+
7
+ ### Added
8
+ - efficiency
9
+
5
10
  ## [3.83.0] - 2026-08-10
6
11
 
7
12
  ### Added
@@ -4,6 +4,34 @@
4
4
  # Modular component system with graceful degradation
5
5
  # ============================================================================
6
6
 
7
+ # Render cache: Claude Code re-renders constantly, so cache the full rendered
8
+ # line for 2s keyed by project (PWD hash). This fast path runs BEFORE the
9
+ # bash 4 re-exec, so it must stay bash 3.2 / POSIX compatible (no assoc
10
+ # arrays, no mapfile). The epoch is stored inside the cache file (line 1) to
11
+ # avoid stat differences between macOS and Linux.
12
+ PRJCT_RENDER_TTL=2
13
+ _prjct_hash=$(printf '%s' "$PWD" | cksum 2>/dev/null)
14
+ _prjct_hash=${_prjct_hash%% *}
15
+ [[ -z "$_prjct_hash" ]] && _prjct_hash="default"
16
+ PRJCT_RENDER_CACHE="${TMPDIR:-/tmp}/prjct-statusline-cache.${_prjct_hash}"
17
+ _prjct_now=$(date +%s)
18
+
19
+ if [[ -z "$PRJCT_STATUSLINE_NO_CACHE" && -f "$PRJCT_RENDER_CACHE" ]]; then
20
+ {
21
+ IFS= read -r _prjct_epoch
22
+ IFS= read -r _prjct_cached_render
23
+ } < "$PRJCT_RENDER_CACHE"
24
+ case $_prjct_epoch in
25
+ ''|*[!0-9]*) _prjct_epoch=0 ;;
26
+ esac
27
+ if (( _prjct_now - _prjct_epoch < PRJCT_RENDER_TTL )); then
28
+ # Drain stdin with shell builtins so Claude Code isn't left hanging on the pipe.
29
+ while IFS= read -r _prjct_discard || [[ -n "$_prjct_discard" ]]; do :; done
30
+ printf '%s\n' "$_prjct_cached_render"
31
+ exit 0
32
+ fi
33
+ fi
34
+
7
35
  # Require bash 4.0+ for associative arrays
8
36
  if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then
9
37
  # Try to find a modern bash and re-exec
@@ -99,5 +127,11 @@ build_statusline() {
99
127
  echo -e "$line"
100
128
  }
101
129
 
102
- # Output the statusline
103
- build_statusline
130
+ # Output the statusline (and refresh the render cache)
131
+ rendered=$(build_statusline)
132
+ if [[ -z "$PRJCT_STATUSLINE_NO_CACHE" ]]; then
133
+ PRJCT_RENDER_CACHE_TMP="${PRJCT_RENDER_CACHE}.$$"
134
+ { printf '%s\n' "$_prjct_now"; printf '%s\n' "$rendered"; } > "$PRJCT_RENDER_CACHE_TMP" 2>/dev/null
135
+ mv -f "$PRJCT_RENDER_CACHE_TMP" "$PRJCT_RENDER_CACHE" 2>/dev/null || true
136
+ fi
137
+ printf '%s\n' "$rendered"
package/bin/prjct.cjs CHANGED
@@ -362,6 +362,7 @@ async function main() {
362
362
  'hook',
363
363
  '__internal-auto-update',
364
364
  '__post-upgrade',
365
+ '__internal-ensure-daemon',
365
366
  ])
366
367
  const version = packageVersion()
367
368
  if (!setupSkipCommands.has(args[0]) && shouldRunSetup(version)) {