omp packages

pi-context-view0.9.0

Pi extension to visualize context usage and inspect the hidden parts: base prompt, tools defs, and extension injections

dimk90 Published 6 days ago MIT ~28.3K downloads/mo

Reported broken on omp

1 of 1 report says this package does not work on omp. Read the notes before you install it.

0 works1 broken

Did it work for you?

Result

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

Reports 1

  • brokenTested by omp packagesv0.9.0 · 1 day ago

    Tested on omp 19.4.1: `omp plugin install` fails. Error: pi-context-view/src/ui/usage-view.ts imports "@earendil-works/pi-tui", which omp no longer provides: its component API was replaced by the reactive @oh-my-pi/pi-tui. Return pi-tui nodes (JSX from "@oh-my-pi/pi-tui") or a { render(width): string[] } rows object from renderers, ctx.ui.custom and ctx.ui.setWidget; replace ctx.ui.setEditorComponent with the ctx.ui.composer hooks; import Theme types from "@oh-my-pi/pi-coding-agent". See docs/ex

Readme

pi-context-view


License: MIT npm version Pi Package npm downloads Discord


Pi extension that visualizes context usage and lets you inspect the parts you normally can't see: the system prompt, tool definitions, and instructions injected by other extensions.

Features

  • Context usage map - visualize used and free context space, grouped by category (tools, skills, messages, and more).

  • Context injections - explore the hidden parts of the context: the system prompt, tool definitions, and extension injections.

Commands

  • /context - shorthand for /context usage.
  • /context usage - open the context usage visualization.
  • /context injections - explore the latest request's injections: its system prompt, tool definitions, and extension contributions.
  • /context config - create the global configuration file populated with defaults, useful for customization.

Demo: /context

See what fills your context, for example, what survives compaction:

Context usage view showing estimated context composition
➥ Pi theme in this demo: dark-legacy.

Demo: injections

Inspect hidden parts of the context, such as tool definitions:

Context injections view and item preview

Demo: zoom

Zoom in for a more detailed breakdown of large context windows, such as 1M-token windows:

Zoom feature
➥ Pi theme in this demo: dark-legacy.

Install

pi install npm:pi-context-view

Customization

You can customize the colors, dimensions and icons of the Context Usage map.

To get started, create a configuration file populated with the current defaults:

/context config

➥ This creates ~/.pi/agent/extensions/pi-context-view.json.

See the configuration reference for each parameter's meaning and default value.

Icon Styles

Press i in Context Usage to switch between the pre-defined icon styles. You can also add your own icons with iconStyles in the config.

Icon styles demo

Category Colors

You can use theme color names to match your current theme or hex values for colors that stay the same across themes. Here are examples of custom terrain and rainbow palettes:

Terrain and rainbow palettes
➥ Pi theme in this demo: dark-legacy.

See the theme color reference for color names that follow the current theme.

Map Size

You can configure the number of rows and columns in the Context Usage map:

Map size demo

Context Footprint

pi-context-view adds nothing to the model context. Opening a view before the first turn may run one silent probe that sends no request and leaves only blank entries, omitted from future context. Set "autoProbing": false in the config to disable it.

My Other Stuff

📌 S-VHS - terminal recorder used to create the demo GIFs.

📌 pi-tui-prompt-box - Pi extension with an alternative style for the prompt input.

License

MIT