@leo-alvarenga/pi-ext-core

extensionmaintained

Shared building blocks for pi extensions: types, utils, headless agent runtime, session store, panel widget, and subagent runtime

by — · v0.6.1 · published 1d ago

$ pi install npm:@leo-alvarenga/pi-ext-core
downloads/mo
0
stars
0
last push
1d ago
open issues
1

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

1.9K downloads · last 12 weeks (weekly)

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

ExportDescription
typesStatusUi, PANEL_STATE_ICON, TokenUsage, HeadlessRunResult
utils/stringscapitalize, truncateChars, truncateBytes, formatTokens, formatDuration
utils/concurrencymapWithConcurrencyLimit
headless/*getPiInvocation, createEventReducer, runHeadlessAgent, killAllRunning
session/storecreateSessionStore<T>
tui/panelcreatePanelWidget<T>
subagents/runtimecreateSubagentRuntime, buildSystemPrompt, buildAllowlist, parseNeedsInput, classifyResult

License

MIT