@hheei/pi-ext-ui
v0.7.1
Published
Collapsible tool rendering frame and tool renderer pilot for Pi.
Maintainers
Readme
@hheei/pi-ext-ui
Pi UI primitives and a small set of specialized tool renderers.
pi-ext-ui owns the visual result, not tool execution. Its default resolver only handles tools with an explicit specialized renderer (edit, read, write, apply_patch, eval, and codemode). Other tools remain on Pi's native renderer. Extensions can opt into the shared visual API with createToolView, ToolView, and DiffView, or explicitly add a tool through resolver options.
The shared view API owns fold levels, compact sections, status glyphs, copy feedback, and width-safe rendering. It does not read files, execute tools, infer outcomes, or import a concrete extension.
Background Bash and subagent tools own their display formats through ext-core ToolPresentation providers. This resolver consumes those providers automatically, including nested codemode calls, and adds shared folding and copy controls. Without pi-ext-ui, the same tools retain native Pi renderers. No direct dependency on pi-ext-ui is required by the tool extensions.
Activity groups are on by default for Pi >=1.0.1 TUI sessions. Turn them off with the Tool UI setting toolGroups.enabled in ext_settings.json (the ext-core settings page). The change applies to the current session. A heading such as ▸ codemode ×2 · grep ×3 keeps one live summary row per tool beneath a single outer rail. Each thinking round and notification also keeps a summary row; notifications are not counted. A thinking item shows a content preview while Pi hides thinking and opens the full text on demand; while thinking is visible the category prints it flat. Groups form while tools run and can span consecutive tool/thinking rounds. Prose, user messages, unknown components, images, and unknown tool renderers break groups. Any MessageView transcript notice stays inside the group, so bg-bash, subagent, memory, optimizer, and codemode-guard notices do not need their own allowlist. Notification rows show their own text once, indented and width-wrapped; only a MessageView with a real body gets an expand pin. Streaming arguments, partial results, completion, and errors update the existing row.
Fullscreen: click the group heading to restore the original component layouts and interactions beneath the outer rail. Both terminal modes: Ctrl+O forces groups open; closing global expansion restores each group’s local choice. Appending members preserves that choice. Original per-tool fold choices remain intact. Groups are presentation only and are rebuilt on history navigation; session data, model context, and HTML export remain unchanged. Thinking keeps its label; the hidden state shows a preview instead of dropping the text, and the visible state has no per-item arrow. Each ctx.ui.notify keeps its full text inline. Notifications remain session-local, as in Pi.
Grouping uses two centralized, version-checked host prototype hooks: tool lookup and extension notifications. Thinking uses the existing assistant message, with no extra hook. Unsupported hosts or incompatible layouts report a warning and retain normal rendering. Cleanup restores the original methods; if another extension replaces the same methods, restart Pi to unload the conflicting patch. For workspace development use pnpm run pi-dev: running the bundled CLI beside physical host devDependencies can resolve a second host class, unlike the published installation.
