@arhen/pi-senja1.5.8
Senja Gruvbox Material theme with Haiku's structured header, footer, and live timer for Pi.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@arhen/pi-senja
Senja theme and Haiku's tidier header and footer for Pi.
Forked from pi-haiku 0.2.0 by nocte, under MIT. The header/footer layout and behavior are preserved; branding, palette, and Pi 1.0 compatibility/safety fixes are the changes. Palette from Gruvbox Material by sainnhe, also MIT.
What's in it
- Gruvbox Material dark/medium/material — exact colors captured from Neovim, matching the Ghostty Senja theme. Background
#282828, foreground#d4be98, orange accent#e78a4e. All 56 Pi roles and HTML export backgrounds use palette variables. - A header with shortcuts grouped by control, models, view, and input.
- A footer with location, Git branch, session name, provider, model, thinking effort (including
max), context bar, token usage, latest cache-hit rate, cost, OAuth subscription marker, and extension statuses. - Flat tool output — image captions, command results, and errors sit on the terminal background. Only source and diff lines get a quiet editor surface (Senja warm grey
#32302f). Status dots and failure labels carry the state; user messages retain their own background. - Grouped tool calls — a single call stays on one line, e.g.
• Write example.ts ▸. Titled codemode summaries can use the full pane width. Untitled script previews and other tool summaries use at most 60%. Long titles truncate on one line, leaving room for the status and arrow. For runs longer than ten, the heading counts every call and failure, but only the latest ten calls are listed. Click Show all to reveal earlier calls above those ten, or Show less to fold history again. The control briefly brightens without scrolling through intermediate layouts (REDUCE_MOTION=1disables the feedback). Image reads keep Pi’s native inline image or text fallback, without a code gutter. Two or more consecutive calls to the same tool share a fixed heading, e.g.• Ran codemode ×4 · 1 failed. Each call occupies one tree line:├─ script ▸or└─ script ▸. A failed call is lightly muted red while collapsed and returns to normal colors when opened. WithNO_COLOR=1, the row keeps itsfailedlabel instead. Click the line to open its indented native panel. The muted trailing icon changes to▾. Calls start collapsed by default. While running, the label has a subtle moving highlight without changing the row height (REDUCE_MOTION=1orNO_COLOR=1disables it). Click a call to open or close it at any time; partial output, success, and failure update its status without changing your choice. Expanded panels omit repeated titles and number script or file source lines (read offsets and native diff numbering are preserved). A text read opens to five wrapped lines; click its “more lines” hint to see the full read result. Image reads are not clipped. Opening a codemode row shows Pi’s native preview: at most five wrapped output lines. Click the result to see it in full; click it again to return to the preview. The row arrow closes the panel. Numbered source has a shaded row of padding above and below. Nested calls, output, and timing align with the script text, without an inner border. Pi’s tool expansion shortcut (defaultCtrl+O) toggles all calls.Thinking…andThoughtshare the same single-cell outline bulb: yellow while streaming, muted when finished. Inside a tool group, the bulb sits after the tree guide. Click the label to replace it with Pi’s thinking text without an icon, or the text to fold it back. A thinking-only turn between matching tools stays above the next call’s tree branch; elsewhere it stays in transcript order. Final replies have no marker. Parallel calls share the row once. Thinking follows its call through Show all / Show less and does not count toward the ten calls. A different tool or assistant prose starts a new group. - Shared transcript renderer — compatible subagent views use the same renderer as the leader when Senja is enabled. Other Pi extensions can synchronously discover it via
pi.events.emit("pi:transcript-renderer", provider => { … }). Mount withprovider.mount(chatContainer, tui, theme, starts?, cancelled?), render and send clicks to itsroot, and calldispose()when the view closes. The optional maps use tool call IDs and monotonic milliseconds (starts or frozen durations). With no provider, render the native container. This is opt-in for custom views; non-transcript panels are unchanged. - Tool activity — A call shows
preparing…without a timer while Pi receives its arguments. Pi’s execution-start event switches the row torunning 0s; writing the script does not count. Expanded results keep Pi’s own reported duration. Confirmed interruptions showcancelledbefore execution, orcancelled · 8safter it starts, without counting as failures. - Codemode intent titles — With Senja enabled, new codemode scripts require a nonblank
// @title: Find the goal notice rendererline before the JavaScript (after an optional first// @options:line). The tool declaration includes the requirement; Senja rejects missing titles before execution even if the provider ignores it. Compatible child sessions use the same rule. Disabling Senja restores plain scripts. Old untitled calls still show their 60%-width preview. - Goal notices — a
goal-uistatus starts as one clickable row. Open it for the original notice, including its objective, usage and commands. - Quiet tool text — action labels such as
Ranuse muted teal (#7daea3) to distinguish tools from assistant prose. Tool names following a verb and tool output use the foreground beige (fg0) rather than loud accents, keeping panels calm against their tint. - Editor-style code colors — pink keywords, olive strings, aqua function names, amber types, warm beige identifiers and punctuation, readable muted comments. Applies to code in tool calls/results and Markdown code blocks through Pi's syntax roles.
- A live timer while Pi works, plus elapsed-time completion message and notification. Preserves the active mode label and colour from
@arhen/pi-add-mode(review is working... 8s). - Fast / Ultrafast mode —
/fast on|offand/ultrafast on|offset a paid speed preference per OpenAI provider and model. Withopenai-codexand ChatGPT sign-in, Senja checks the account catalog and retries a saved tier after a temporary lookup failure on the next turn or model selection. With the publicopenaiResponses provider, Senja checks known model support and OpenAI handles account eligibility. The footer shows the selected preference asfastorultrafast. Preferences persist under<agent-dir>/fast-mode/. An explicitsamplingParams.service_tiertakes precedence. - A fresh start — clear the visible screen on initial terminal startup without clearing scrollback.
Enabled by default in terminal UI mode. Print, JSON, SDK, and RPC modes do not install terminal components, switch themes, clear the screen, or start UI timers. /senja in RPC mode reports that terminal UI is required.
Install
pi install npm:@arhen/pi-senja
Disable/remove pi-haiku or other header/footer replacements to avoid competing UI ownership.
Toggle
Type /senja to turn the header, footer, and tool grouping on or off. The theme stays selected. Terminal session startup selects senja; selecting another theme afterward still works.
Development
From the monorepo root, with development dependencies available:
bun test packages/add/pi-senja/test
bunx tsc -p packages/add/pi-senja/tsconfig.json --noEmit
npm pack --dry-run --workspace @arhen/pi-senja
Tests use fake UI/session/timer handles, real Pi width utilities, and the current host theme loader when available. They do not open terminals or write user settings. Set SENJA_PI_HOST to an installed Pi coding-agent package directory to validate its theme schema and loader (for example, a Pi 1.0 installation).
License
MIT. Original 2026 nocte and Gruvbox Material 2020 sainnhe notices retained in LICENSE.