pi-sprite-keepalive

A pi extension that keeps a Sprite awake while the agent is working.

Packages

Package details

extension

Install pi-sprite-keepalive from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-sprite-keepalive
Package
pi-sprite-keepalive
Version
0.1.1
Published
Aug 17, 2026
Downloads
204/mo · 17/wk
Author
denniseijpe
License
MIT
Types
extension
Size
8 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-sprite-keepalive

A pi extension that prevents a Sprite from going to sleep while pi is actively working.

The extension creates a short-lived Sprite task when an agent run starts, refreshes it once per minute, and removes it after the agent settles. Each pi process uses a unique task name, so concurrent sessions do not release one another's keepalive tasks.

Outside a Sprite, where /.sprite/api.sock is absent, the extension does nothing.

Install

pi install npm:pi-sprite-keepalive

To try it for one invocation without installing it:

pi -e npm:pi-sprite-keepalive

Behavior

  • Starts a task with a five-minute expiry on agent_start.
  • Refreshes the task every minute while pi is working.
  • Deletes the task on agent_settled or session_shutdown.
  • Shows sprite: awake in pi's status line while active.
  • Warns once if heartbeats fail; failed cleanup is left to expire naturally.

The extension communicates only with the local Sprite Tasks API through /.sprite/api.sock.

Development

npm install
npm run check
npm pack --dry-run

The package ships its TypeScript entry point directly; pi loads TypeScript extensions without a build step.

Publishing

  1. Confirm that the package name and metadata in package.json are correct.
  2. Authenticate with npm using npm login.
  3. Run npm publish.

License

MIT