omp packages

pi-mini0.1.1

A minimal shell-style terminal chat interface for Pi.

GitHub Actions Published 8 days ago MIT ~289 downloads/mo

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.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-mini

A Pi extension for a minimal terminal chat with an ephemeral session.

Goal

  • Launch Pi with a minimal command-line interface that looks like a terminal chat.
  • Keep conversation history in memory for the running process, without saving a session file.

Status

Partial implementation with opt-in activation through the native boolean flag --tui-mini (default: false). All functionality is restricted to terminal (tui) mode. Without the flag, or in any non-terminal mode such as RPC, JSON, or print, the extension does not change Pi's behavior.

In both regular and fullscreen, mini mode hides the standard footer (including extension statuses displayed there) and replaces the bordered input with a shell-style prompt:

<model name>/<provider>:<thinking level>> 

The model uses its display name and the theme's mdHeading color; /, :, and the final > use muted, the provider uses dim, and the thinking level uses Pi's corresponding theme color. The prompt follows model, thinking-level, and theme changes. Long prompts are shortened with an ellipsis while retaining the final > and room for input. Native editing, multiline input, history, autocomplete, and app shortcuts remain available.

Mini mode suppresses Thinking level: … and Default thinking level: … because the prompt already displays the level. It intercepts only status output: Pi's original shortcut, /thinking command, selectors, level-change events, redraws, and default-setting updates remain in use. Other statuses, unsupported-model notices, and errors are unchanged.

Private API dependency: this suppression wraps InteractiveMode.showStatus() at runtime, without editing installed Pi files. The hook is installed only at opted-in TUI session startup and removed at shutdown/reload. It has been verified on Pi 1.1.0; core updates require compatibility checks. Filtering is text-based and also suppresses matching status text from other sources; the prototype hook is process-wide while mini mode is active.

Known Pi core issue: replacing an editor with a pending large-paste marker can lose the pasted contents on Pi 1.1.0. Per the operator's decision, no extension-side workaround or Pi patch is applied. The enabled integration regression strictly expects this known failure: it passes only when both expanded input and submission contain the original paste marker. Unexpected preservation or a different outcome fails the suite with an instruction to review pi-mini compatibility with the tested Pi core before updating the expectation. This does not fix the data-loss defect. See known issues for the conditions, core root cause, and reproduction, and the review for the finding dispositions.

These changes take effect at session_start, after Pi has started its TUI. The standard footer and editor may briefly appear before the replacements; the extension API cannot guarantee a hidden first frame. Pi 1.1.0's native editor also has a wide-character wrapping defect at input widths below three columns; mini mode reserves at least three columns when possible, but does not patch Pi for smaller terminals. The remaining minimal chat interface is not implemented.

Pass --tui-mini without a value. Pi treats a boolean extension flag as enabled whenever it is present, even if followed by false.

Pi already supports ephemeral sessions through --no-session. Neither loading this extension nor passing --tui-mini currently disables session persistence or selects --tui-mode regular; use those Pi options explicitly.

Versioning

The repository keeps 0.0.0 as the local development version in package.json and the root lockfile entries. Release versions are intended to come from the tag that triggers release CI, for example v1.2.3 → 1.2.3, and be applied only in the CI checkout. Release CI is not configured yet; no automatic version assignment or publishing is implemented.

Development

Requires Node.js 22.19 or newer and npm. Development uses Pi 1.1.0.

npm ci --ignore-scripts
npm run check
npm test
npm run dev

npm run dev loads the local package into Pi with --no-session, leaving mini mode disabled. Use npm run dev -- --tui-mini to hide the standard footer and enable the shell-style input. Model selection and authentication use the usual Pi configuration.

With an existing Pi installation, load the scaffold directly:

pi --extension /path/to/pi-mini --tui-mini --tui-mode regular --no-session

Pi loads TypeScript extensions directly; no build step is required. Pi itself supplies the extension API at runtime.

Structure

  • src/index.ts — extension entry point and the flag/TUI activation boundary.
  • src/editor.ts — shell prompt formatting and a borderless native CustomEditor subclass.
  • src/thinking-status.ts — reversible private-method hook for thinking-level status output.
  • test/extension.test.ts — package loading, native flag handling, opt-in UI installation, and non-interactive mode safeguards using Pi's real runtime services, isolated from user settings and without model requests.
  • test/editor.test.ts — prompt colors, responsive layout, cursor/mouse coordinates, and native editing behavior.
  • test/thinking-status.test.ts — status filtering, cleanup, and native thinking actions, events, defaults, transcript updates, and redraws.
  • docs/development-notes.md — draft documentation of extension functionality.
  • docs/known-issues.md — verified Pi core issues, their effects, and reproductions.
  • package.json — Pi package manifest and development commands.
  • tsconfig.json — strict TypeScript checks for source and tests.

References

License

MIT. See LICENSE.