Install
Install with PiG
pig install npm:@saifymatteo/pi-decisionsInstall with Pi
pi install npm:@saifymatteo/pi-decisionsPackages 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.
{
"image": "https://raw.githubusercontent.com/saifymatteo/pi-extensions/main/packages/pi-decisions/screenshot.png",
"extensions": [
"./src/index.ts"
]
}README
Written by the package's publisher, shown as published in version 0.3.0 (README.md). PiG does not review it.
@saifymatteo/pi-decisions

The agent calls classify against a configured Decisions endpoint and gets structured answers with per-label probabilities.
Purpose and registrations
When configured, registers classifier providers and the classify tool (choice/bool/score; JSON state and optional PNG/JPEG/WebP images). No slash commands. Requires Pi's classifier model registry APIs (findOfType, classify, provider classifiers); older hosts may not implement them.
Configuration and service
Reads the shared <agent-dir>/extensions/service-models.json registry and registers every model with type: "classifier". A missing registry is created once as $schema plus empty providers; with no classifier model nothing registers. Add providers from examples/service-models.example.json. An optional one-line description per model is shown to the agent as a strength hint in the model parameter. Classifier models require type: "classifier", api: "openai-decisions", positive contextWindow and input capabilities.
Editor validation: set "$schema": "https://raw.githubusercontent.com/saifymatteo/pi-extensions/main/packages/pi-decisions/schemas/service-models.schema.json" at the top of the registry. pi-decisions and pi-tts ship identical copies of schemas/service-models.schema.json, so either installed package's URL works. The loader ignores $schema; the schema is editor help, not a runtime gate.
Use an actual OpenAI Decisions-compatible service at your chosen base URL (POST decisions under the versioned base). Generic examples use localhost, not a configured personal server. API keys accept $ENV or ${ENV}; if omitted, credentials fall back to agent auth.json. Prefer explicit environment references. No external CLI required.
Security and limits
Supplied state, questions, and image pixels are transmitted to the selected model service. Never send secrets or treat confidence as a security decision. 30s timeout, no retries/provider fallback; at most four images, 10 MiB each/20 MiB total. Large results use private temp files. Service responses become model-visible. Source caveat: the classifier rejects an empty API key despite helper support for keyless access; use a nonempty configured key. The adapter also uses default fetch redirect behavior; use trusted endpoints.
Tests
From the monorepo root with its existing test dependencies available:
node --test packages/pi-decisions/test/*.test.mjs
Tests use the shared test-only TypeScript/VM loader, fixtures, and host/service stubs. They do not prove compatibility with a live host, CLI, or model service.
Running locally
From the monorepo root:
pi -e ./packages/pi-decisions
Node >=24; host imports are peers, not bundled dependencies. Load only one copy: for an isolated session use --no-extensions with explicit -e paths so the original live extension is not also discovered. Set PI_CODING_AGENT_DIR to a disposable agent directory before launch; unset means the normal ~/.pi/agent fallback. Extension config continues to resolve there, never relative to this package.
Examples are manually authored, sanitized reference documents, not runtime defaults. Review and manually create only the needed files in the isolated agent directory; do not copy live credentials or endpoints. No example is automatically loaded or copied. Loading an extension grants Pi-process OS permissions. Licensed AGPL-3.0-only; see NOTICE.md.