@leo-alvarenga/pi-ext-core
Shared building blocks for pi extensions: types, utils, headless agent runtime, session store, panel widget, and subagent runtime
Package details
Install @leo-alvarenga/pi-ext-core from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@leo-alvarenga/pi-ext-core- Package
@leo-alvarenga/pi-ext-core- Version
0.6.1- Published
- Sep 25, 2026
- Downloads
- 2,272/mo · 359/wk
- Author
- leo-alvarenga
- License
- MIT
- Types
- extension
- Size
- 53 KB
- Dependencies
- 0 dependencies · 5 peers
Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@leo-alvarenga/pi-ext-core
Shared building blocks for pi extensions: types, utilities, headless agent runtime, session store, TUI panel widget, and subagent runtime factory.
Installation
pnpm add @leo-alvarenga/pi-ext-core
Peer dependencies (all bundled in every pi installation):
pnpm add -D @earendil-works/pi-ai @earendil-works/pi-agent-core @earendil-works/pi-coding-agent @earendil-works/pi-tui typebox
Usage
import {
createSubagentRuntime,
createSessionStore,
createPanelWidget,
} from "@leo-alvarenga/pi-ext-core";
// register the full subagent tool + panel + command in one call
createSubagentRuntime(pi, spec);
// or use individual primitives
const store = createSessionStore<MyState>(pi, "my.entry", defaultState);
const panel = createPanelWidget(pi, store, panelSpec);
Surface note
This lib ships .ts sources and is designed for pi's jiti loader: no compile step required for pi consumers. It is not importable by plain Node without a loader.
Modules
| Export | Description |
|---|---|
types |
StatusUi, PANEL_STATE_ICON, TokenUsage, HeadlessRunResult |
utils/strings |
capitalize, truncateChars, truncateBytes, formatTokens, formatDuration |
utils/concurrency |
mapWithConcurrencyLimit |
headless/* |
getPiInvocation, createEventReducer, runHeadlessAgent, killAllRunning |
session/store |
createSessionStore<T> |
tui/panel |
createPanelWidget<T> |
subagents/runtime |
createSubagentRuntime, buildSystemPrompt, buildAllowlist, parseNeedsInput, classifyResult |
License
MIT