Install
Install with PiG
pig install npm:@hk-vk/pi-composer-animationsInstall with Pi
pi install npm:@hk-vk/pi-composer-animationsPackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./index.ts"
]
}README
Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.
Pi Composer Animations
Standalone Pi extension with smooth input frames, a live style picker, and an agent-callable switching tool. Dotted shimmer remains the built-in default. Every style inherits the input box's configured state color—no white/accent override.
Use
Run /reload once after updating. Style changes then apply immediately without another reload.
/composer-animations Open the live preview picker
/composer-animations silk-frame Switch this session immediately
/composer-animations styles List available styles
/composer-animations current Show current style, speed, and saved defaults
/composer-animations speed 2 Set speed to 2× for this session
/composer-animations reset Restore dotted shimmer for this session
/composer-animations save Save the current style and speed for new sessions
/composer-animations save dotted-shimmer Restore the saved default explicitly
The picker opens inline in Pi’s command area: a short single-column style list, current-style marker, and one live preview—no floating overlay or verbose settings instructions. Arrow keys preview, Enter or mouse click confirms, Escape cancels. The Speed row cycles through 0.5×, 1×, 1.5×, 2×, 3×, and 4× with Enter/click; the preview updates immediately. Choose Apply changes to confirm style and speed together. Escape discards both. Previewing does not alter your actual selection or input text. All styles preview their working-state animation even while the agent is idle. The picker opens only when explicitly requested and disposes its timer on close/cancellation.
Styles
| ID | Frame | Effect while working |
|---|---|---|
dotted-shimmer | Rounded corners / centered · dots / vertical : | Current soft clockwise shimmer; default |
silk-frame | Rounded continuous lines | One soft traveling highlight |
twin-glow | Rounded continuous lines | Two highlights half a loop apart |
breathing-frame | Rounded continuous lines | Whole frame gently brightens/fades |
dashed-ribbon | Fixed dashes / ╎ sides | Soft traveling highlight |
static-dots | Rounded corners / centered dots / : sides | No animation; reduced motion |
classic | Original Pi borders | Stock layout, no decoration or animation |
Animated styles share the same 80 ms fractional-position smoothness baseline (12.5 redraws per second) and 64-level state-color fade. The phase step scales with the interval, preserving the prior animation speed while requesting 25% fewer full TUI redraws. Built-in speed is now 1.5× (50% faster than before). Speed applies to every animated style, including breathing, without changing frame rate or colors. Custom speeds from 0.25× to 4× are supported by command/tool; static/classic styles still do not animate. Idle animated borders use the same dim baseline as the non-highlighted working border, derived from the current configured state color. When work starts, the highlight fades in over 400 ms for each animated style. Static and classic borders retain their normal color. No moving letter markers, blinking, or font-weight jumps. : side edges have two readable dots per input row.
Agent tool
composer_animations provides structured results and these actions:
{ "action": "list" }
{ "action": "get" }
{ "action": "set", "style": "silk-frame", "speed": 2 }
{ "action": "speed", "speed": 2.5 }
{ "action": "speed", "speed": 2, "scope": "default" }
{ "action": "set", "style": "twin-glow", "scope": "default" }
{ "action": "reset" }
{ "action": "picker" }
set accepts a known style and/or speed; speed changes only the speed. Scope defaults to session; default explicitly persists the preference and applies it to the current session. reset restores the built-in dotted shimmer and 1.5× speed; add scope: "default" only when also resetting the saved preference. picker is interactive-terminal-only and should be used only when the user requests the visual picker.
List/get/set also work in print/RPC modes, but no terminal animation is started there.
The previous /input-box command and input_box_style tool remain compatibility aliases.
Persistence
- Session changes use non-context session entries and restore from the current branch on reload/navigation.
- New sessions use dotted shimmer unless you explicitly save another default.
- Speed changes restore from the current branch alongside styles. Saving speed alone with the tool does not silently change the saved style. Existing style-only settings are supported without automatic rewrites.
- Saved defaults live in
<agent-dir>/input-box-animations.json(~/.pi/agent/input-box-animations.jsonnormally). - Writes are queued and atomic. Malformed preferences fall back with a warning; they are never silently overwritten.
- No other extension or Pi settings file is changed.
Compatibility
The existing editor, typing, shortcuts, correction feature, Unicode text, cursor/IME markers, labels, and completion menus remain intact. Framed styles reserve one column on each side and translate mouse positions. Classic uses the exact stock layout. Extremely narrow terminals and incompatible editor layouts fall back to stock rendering.
Pi has no public frame-decoration API for an already-installed custom editor. The existing reversible compatibility shim is isolated in src/adapter.ts; it wraps rendering/mouse coordinates but never replaces the editor or touches keyboard handling. Original methods and timers are restored on shutdown/reload. Editors overriding those methods without calling super may not be decorated. See ARCHITECTURE.md for the public-extension-point audit and limitations.
Validation
# With development dependencies/host packages resolvable:
npm run check
npm test
# Or reuse an installed Pi runtime and TypeScript without installing anything:
export PI_RUNTIME_ROOT=/path/to/node_modules/@earendil-works/pi-coding-agent
export PI_TYPESCRIPT_PATH=/path/to/node_modules/typescript/lib/typescript.js
npm run check
npm test
Tests exercise Pi's native TypeScript loader, actual installed editor/theme, live switching, saved preferences, current-branch restoration, preview confirmation/cancellation, state-color inheritance, mouse/cursor/Unicode layout, timers, cleanup, and non-terminal modes. No model/provider calls occur. Visual terminal verification after /reload is still recommended.
Installation
Requires Pi 1.3.0 or newer.
pi install npm:@hk-vk/pi-composer-animations
Run /reload after installing. Remove any older personal copy before loading this package to avoid registering the extension twice. For local development, install the package from its directory instead.