← Catalog

@vtstech/pi-shared

Shared utilities for Pi Coding Agent extensions

Package

Install

Install with PiG

pig install npm:@vtstech/pi-shared

Install with Pi

pi install npm:@vtstech/pi-shared
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.

README

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

@vtstech/pi-shared

Shared utilities for Pi Coding Agent extensions by VTSTech.

This is an internal dependency — you don't need to install it directly. It's pulled in automatically when you install any @vtstech/pi-* extension package.

Modules

ModuleDescription
debugConditional debug logging via PI_EXTENSIONS_DEBUG=1 env var — debugLog(module, message, ...args)
formatSection headers, indicators (ok/fail/warn/info), numeric formatters (bytes, ms, percentages), string utilities
model-test-utilsShared test utilities — ChatFn abstraction, unified test functions, scoring helpers, tool support cache, user config (~/.pi/agent/model-test-config.json), test history with regression detection (~/.pi/agent/cache/model-test-history.json)
ollamaOllama base URL resolution, models.json I/O with TTL cache, async write mutex (acquireModelsJsonLock, readModifyWriteModelsJson), exponential backoff retry (withRetry), model family detection, provider detection, Ollama API helpers
react-parserMulti-dialect ReAct text parser — 4 dialects (react, function, tool, call), parseReact(), detectReactDialect(), fuzzyMatchToolName()
securitySecurity mode toggle (basic/max), partitioned command blocklist (41 CRITICAL + 25 EXTENDED) with full-word scanning, mode-aware SSRF (22 + 7 patterns), path validation with symlink dereference, URL validation, command sanitization, DNS rebinding protection (resolveAndCheckHostname), buffered audit logging with mode tracking (AUDIT_LOG_PATH exported)
typesType definitions (ToolSupportLevel, AuditEntry, etc.)

Usage

import { section, ok, fail, info } from "@vtstech/pi-shared/format";
import { readModelsJson, getOllamaBaseUrl } from "@vtstech/pi-shared/ollama";

License

MIT — VTSTech