feat(pi): add standalone Calm presentation mode - #29
Merged
Conversation
Aviator-Coding
pushed a commit
to Aviator-Coding/dotfiles
that referenced
this pull request
Aug 1, 2026
* feat(pi): add standalone Calm extension * no-mistakes(review): Preserve Pi tool semantics in Calm rendering * no-mistakes(review): Preserve built-in-named custom tool rendering * no-mistakes(review): Preserve SDK base-tool override rendering * no-mistakes(document): Document Pi Calm autoload and runtime boundaries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Build the captain-authorized standalone Pi Calm extension in the public kunchenguid/dotfiles repository. It must auto-load from the repository-managed global Pi extensions directory, register /calm, default off, and persist only a local untracked preference at ~/.pi/agent/calm. While active it must preserve genuine user and assistant text, hide only collapsed thinking and Pi's seven known built-in tool call/result shells gaplessly, replace the stock working row with a resize-safe animated blue-water/yellow-boat widget, preserve Ctrl+O expansion state, and restore stock rendering when off. It must leave custom tools and unsupported transcript rows visible, keep session/model/tool semantics and /share and /export content unchanged, have zero Firstmate runtime coupling, retain the required MIT attribution for adapted code, document all boundaries, and include deterministic plus isolated credential-free real Pi 0.82 TUI coverage. Do not activate or rebuild a live system.
What Changed
/calmtoggle, off-by-default behavior, and local untracked preference persistence.Risk Assessment
✅ Low: The change is now presentation-only and well-bounded: stock built-ins are identified without replacing execution definitions, while extension collisions, SDK custom tools, and SDK base-tool overrides retain their rendering.
Testing
Confirmed the baseline environment uses real Pi 0.82.0, then passed the focused deterministic contracts and isolated credential-free real Pi TUI flow twice; visual terminal captures confirmed auto-loading, genuine transcript visibility, and resize-safe Calm boat rendering, with the worktree left clean.
Evidence: Real Pi 0.82 Calm TUI at 100 columns
Evidence: Real Pi 0.82 Calm TUI resized to 40 columns
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed (3) ✅
home/.pi/agent/extensions/calm/index.ts:181- Intent requires Calm to keep "tool semantics ... unchanged," but these registrations replace Pi's built-in definitions by name and line 185 executes fresh factory-created tools even while Calm is off. This bypasses supported base behavior such as read auto-resize settings, bash shell path/command prefix, SDK base-tool overrides, and competing same-name extension definitions. Confirm whether semantic replacement is authorized; otherwise preserve the active tool definitions and apply Calm at a shared renderer-only boundary.🔧 Fix: Preserve Pi tool semantics in Calm rendering
1 error still open:
home/.pi/agent/extensions/calm/lib/built-in-tool-shells.ts:62- Intent requires Calm to "leave custom tools ... visible," butbuiltInToolDefinitionis populated by Pi solely fromtoolName. Therefore, an extension or SDK override namedread,bash, etc. satisfies this condition and its custom row is hidden while Calm is active. Identify the active definition's source at the earliest boundary that retains source metadata, rather than treating every row with a built-in name as a built-in tool.🔧 Fix: Preserve built-in-named custom tool rendering
1 error still open:
home/.pi/agent/extensions/calm/lib/built-in-tool-shells.ts:76- The durable fix still misses Pi's supported SDK base-tool override path. WhenbaseToolsOverridesupplies a customread/bashdefinition, Pi places it in_baseToolDefinitionsand labels it withsource: "builtin"; this lookup therefore adds that custom definition tobuiltInDefinitions, and Calm hides its custom renderer. This contradicts "leave custom tools ... visible" and the file's claim that SDK overrides render unchanged. At this AgentSession boundary, also exclude names present in the session's base-tools override before marking a definition as stock.🔧 Fix: Preserve SDK base-tool override rendering
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
Preflight:pi --version,command -v tmux, and installed Pi package inspectionbash tests/pi-calm.test.shTMPDIR=/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KYXRWDVAN3WZ65M1PCVTVHWT KEEP_TMP=1 bash tests/pi-calm.test.shManual review ofworking-wide.current.ansi.txtandworking-narrow.current.ansi.txtgit status --shortafter testing✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.