← Catalog

@adeildo/pi-diagrams

Mermaid blocks drawn as real diagrams in the terminal, in the colors of your theme, while the model is still writing them.

Extension

Install

Install with PiG

pig install npm:@adeildo/pi-diagrams

Install with Pi

pi install npm:@adeildo/pi-diagrams
Review before installing

Packages 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": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 7.2.0 (README.md). PiG does not review it.

@adeildo/pi-diagrams

npm pi SDK

Pi draws a ```mermaid block as Unicode art, and only the kinds of diagram that fit in text. With this package, the block becomes a picture in the terminal, in the colors of your pi theme, and it grows while the model writes it.

pi install npm:@adeildo/pi-diagrams

What changes

Pele lays the diagram out, and resvg turns it into a picture the size of your terminal's cells, so its labels read at the size of the text around them. Every type of Mermaid 12.1 is drawn, and Pele's own on top: file trees, swimlanes, Ishikawa, Cynefin, event models, agent flows and railroad grammars.

  • While it is written. Each line the model finishes is drawn as soon as it parses, so the diagram fills in during the answer instead of showing up at the end.
  • In your theme. Text, lines, borders and accents come from the pi theme, and nodes keep the terminal's own background, as the rest of the harness does.
  • When it cannot be drawn. A block that does not parse keeps its source, with the reason under it.
  • Without images. In a terminal that shows no images, or inside tmux, the block is the same Unicode art pi draws.

The model is also told that it can draw, with the list of types and where the syntax of each one is (pele.run/examples.md), so it reaches for a diagram when one says more than prose.

Setting it up

Pi's own Mermaid art runs before every extension, so it would take the blocks first. Turn it off once, in /settings (Mermaid rendering: off), or in ~/.pi/agent/settings.json:

{ "markdown": { "mermaid": "off" } }

Until then, the package says so when a session starts. Pictures need a terminal that shows images (Kitty, Ghostty, WezTerm or iTerm2). The labels use your system's monospace font, found with fc-match on Linux, Menlo on macOS and Consolas on Windows.

adeildo.dev
pi-harness is made by adeildo.dev