@j1nn0/pi-input-lock
Automatically locks Pi's interactive input while an agent is running.
Package details
Install @j1nn0/pi-input-lock from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@j1nn0/pi-input-lock- Package
@j1nn0/pi-input-lock- Version
0.1.4- Published
- Sep 3, 2026
- Downloads
- not available
- Author
- j1nn0
- License
- MIT
- Types
- extension
- Size
- 30.1 KB
- Dependencies
- 0 dependencies · 3 peers
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
@j1nn0/pi-input-lock
A small Pi extension that protects interactive input while an agent is running.
It is opt-in: the parent process is unchanged unless PI_INPUT_LOCK=1 is set.
In WATCH, text, submit keys, paste, and Pi application shortcuts are consumed.
CSI and SSU arrow sequences continue to reach the focused component, and foreign
interactive UIs such as permission dialogs always receive their input. The
original editor and draft text are restored when the lock is released.
Installation
pi install npm:@j1nn0/pi-input-lock
For local development:
PI_INPUT_LOCK=1 pi -ne -e . --tui-mode fullscreen
Usage
Enable the extension explicitly:
export PI_INPUT_LOCK=1
The default toggle is ctrl+alt+i. Configure one shortcut in
.pi/agent/extensions/pi-input-lock/config.json:
{ "toggleKey": "ctrl+alt+i" }
The same action is available as /input-lock or /lock.
States are lifecycle-aware:
IDLE: input is available.WATCH: input is locked and the status bar shows🔒 WATCH.OVERRIDE: input is available after a manual toggle during an active run.
Agent start enters WATCH; agent settled returns from either active state to
IDLE. A manual toggle changes WATCH to OVERRIDE and back. If the runtime
cannot confirm that an agent is active, it fails open to IDLE.
Development
pnpm check
pnpm test
pnpm pack:check
PI_INPUT_LOCK=1 pi -ne -e . --tui-mode fullscreen
License
MIT License.
This project is derived in part from @inobit/pi-reader,
Copyright (c) 2026 inobit, also licensed under the MIT License.