Skip to content

feat: add native Windows statusline renderer#11

Merged
nanami-he merged 1 commit into
nanami-he:mainfrom
MestreY0d4-Uninter:feat/native-windows-statusline
Apr 29, 2026
Merged

feat: add native Windows statusline renderer#11
nanami-he merged 1 commit into
nanami-he:mainfrom
MestreY0d4-Uninter:feat/native-windows-statusline

Conversation

@MestreY0d4-Uninter
Copy link
Copy Markdown
Contributor

Summary

  • add a native PowerShell statusline renderer for Windows so installs no longer skip the pet statusline
  • generate shared pet-art.json data from the existing art source for the PowerShell renderer
  • centralize platform-specific statusline command generation and copy the new runtime files during install
  • document Windows statusline behavior and the Claude Code trust-dialog workaround

Fixes #4.

Validation

  • bun test cli/statusline-config.test.ts cli/statusline-art.test.ts
  • bun test
  • bun run build
  • npm pack --dry-run
  • git diff --check HEAD --
  • PowerShell smoke test with official PowerShell 7.6.1 linux-arm64: pwsh -NoProfile -ExecutionPolicy Bypass -File statusline/pet-status.ps1 rendered the pet from a real status.json schema

Note: I do not have a native Windows host in this environment. Windows PowerShell 5.1 compatibility is based on Microsoft docs for ConvertFrom-Json and powershell.exe -File; the native Windows path is implemented with powershell.exe -NoProfile -ExecutionPolicy Bypass -File "..." and should exit quietly if runtime files are missing.

@nanami-he nanami-he merged commit 5113bba into nanami-he:main Apr 29, 2026
1 check passed
nanami-he added a commit that referenced this pull request Apr 29, 2026
…ateus #11

Closes #8.

Before: cli/install.ts shelled out to `bun run build:reactions` at
install time. Neither scripts/ nor server/ was in package.json#files,
so the build always failed silently for npx users — every install
fell back to the degraded reactions pool instead of the advertised
638-per-language set.

After:
- scripts/build-reactions.ts now writes the JSON to BOTH
  ~/.petsonality/reactions-pool.json (existing dev path, unchanged)
  AND dist/reactions-pool.json (new artifact, ships via package.json
  files = ["dist/", ...] which was already there)
- cli/install.ts copies the prebuilt JSON from dist/ into
  ~/.petsonality/ instead of running the build. No bun runtime
  dependency at install time. Silent fallback only triggers if the
  artifact is genuinely missing (i.e. local dev without a fresh build).
- npm pack --dry-run confirmed dist/reactions-pool.json (58KB)
  lands in the tarball.
- Smoke-tested install: "Reactions pool installed (638/lang)" instead
  of the previous warn fallback.

Also: credit @MestreY0d4-Uninter in CONTRIBUTORS.md for #11 (native
PowerShell statusline, closed #4) — second contribution from him,
much bigger scope than #5.
nanami-he added a commit that referenced this pull request Apr 29, 2026
PR #11 (Mateus PowerShell) shipped pet-art.json with the OLD golden
retriever frames because his branch baseline pre-dated PR #12
(Lwhieldon's redesign). Now that both are in main, regenerating
build-art.ts brings pet-art.json in sync with the new front-facing
Bonnie design — without this commit the PowerShell statusline would
render dinosaur-era Golden while bash renders the new one.
@nanami-he
Copy link
Copy Markdown
Owner

merged into v0.4.4 — thank you. this is a substantively bigger PR than #5 and the architecture choices land well: the cli/statusline-config.ts extraction with platform-aware command building reads as the "right" way to do it (much cleaner than the IS_WIN early-return that was there before), and the shared pet-art.json source means bash and PowerShell can never drift.

defensive PowerShell touches i specifically appreciated: Test-Path -LiteralPath for path-with-brackets, the multi-fallback HomeDir chain, $ErrorActionPreference = SilentlyContinue so failures don't bother the user, the trust-dialog hint in install output. those are details that come from someone who's actually thought about the user's first 30 seconds.

shipped today. Lwhieldon (the original Windows bug reporter) and i will be the first to dogfood it on real Win11 — if anything surfaces we'll open follow-up issues, but the architecture you chose makes those easy to land incrementally.

your second contribution = added you to CONTRIBUTORS.md with the full story. seriously, thank you.

nanami-he added a commit that referenced this pull request Apr 29, 2026
PRD lagged 1 patch version. Today's reality:

- Header: 0.4.3 -> 0.4.4
- Phase 1 items 21-22 added: second external PR + Lwhieldon upgraded to
  contributor (PR #11 + #12); Issue #8 packaging fix (the silent fallback
  bug that affected every npx user since launch)
- NEW G0 (high priority, top of "宣传 + 推广" section): multi-channel
  distribution architecture. Triggered by the npm registry outage we
  hit during v0.4.4 publish. Sets out the 3-channel target (npm +
  Claude Code Plugin + MCP Server Registry), the dist/-in-git decision,
  and the task list to land it before the next release cycle.
- 教训 +3: install path can't depend on build tools (Issue #8); npm is
  a single point of failure for distribution; merge != regenerated, must
  rebuild after PR merge to keep generated files in sync
- 决策记录: new 2026-04-29 second entry covering the multi-channel
  awakening + npm-as-SPOF realization
- Footer: v3.8 -> v3.9
@MestreY0d4-Uninter
Copy link
Copy Markdown
Contributor Author

Thanks again for the thoughtful review and for shipping it so quickly.

I’m glad the architecture landed well. If any Windows/statusline follow-up comes out of the Win11 dogfooding, feel free to tag me — I’d be happy to help with another narrow, incremental fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(Windows) Native status line (PowerShell or .cmd) — pet-status.sh requires bash + jq

2 participants