npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@datspike/pi-runtime-info-extension

v0.1.0

Published

Pi extension exposing verified runtime model, thinking level, and artifact metadata to agents.

Readme

@datspike/pi-runtime-info-extension

npm version License: MIT

Pi package that exposes the current runtime model, thinking level, and session metadata to agents. It is built for workflows that need reproducible artifacts, model-sensitive subagent orchestration, or reviewer-facing metadata such as model_actual and thinking_actual.

Why this exists

Pi already lets the user select a model and a thinking level, but an agent writing a report cannot always prove which runtime settings were actually used. That becomes painful when you need to:

  • write model_actual and thinking_actual into review, research, or handoff artifacts;
  • compare requested subagent routing with the resolved runtime model;
  • debug model picker and profile overrides;
  • keep multi-model review output reproducible.

This extension keeps that check inside Pi, without patching Pi core.

Features

  • runtime_info tool for the current Pi session.
  • subagent_runtime_info tool for checking an active pi-subagents run by agent_id.
  • Tested subagent integration with Tintinweb's pi-subagents: git:github.com/tintinweb/pi-subagents.
  • runtime_artifact_fields tool that returns ready-to-paste YAML/JSON artifact fields.
  • /runtime-info command for a quick human-readable runtime summary.
  • No external service and no network calls.

Quick start

1. Install as a Pi package

pi install npm:@datspike/pi-runtime-info-extension

2. Reload Pi

/reload

3. Ask the agent to verify runtime metadata

Call runtime_info and print the JSON result.

Expected shape:

{
  "scope": "current_session",
  "model": {
    "provider": "openai",
    "id": "gpt-5.5",
    "ref": "openai/gpt-5.5"
  },
  "thinking": {
    "level": "xhigh"
  },
  "session": {
    "id": "...",
    "file": "...",
    "cwd": "/path/to/project"
  },
  "confidence": "selected_model_from_extension_context"
}

Tools

| Tool | Use it when | Output | | --- | --- | --- | | runtime_info | You need the current session runtime. | Model, thinking level, session id/file/cwd, last assistant message metadata. | | subagent_runtime_info | You launched a subagent and need the resolved runtime by agent_id. | Subagent status, model, thinking level, session metadata, output file. | | runtime_artifact_fields | You are about to write a report, review, plan, or handoff artifact. | Ready artifact fields plus a YAML block. |

Example artifact fields:

model_requested: zai/glm-5.1
model_actual: openai/gpt-5.3-codex
thinking_requested: high
thinking_actual: xhigh
runtime_verified_at: 2026-05-04T12:00:00.000Z
runtime_info_source: pi-runtime-info
runtime_info_confidence: subagent_session_model_and_thinking
runtime_scope: subagent
runtime_agent_id: 57444cd3-fb66-4b7

Command

/runtime-info
/runtime-info <agent_id>

Without arguments, the command shows the current session model, thinking level, session id, and cwd. With an agent_id, it shows the same summary for a known subagent record.

Installation options

npm package

pi install npm:@datspike/pi-runtime-info-extension

Git package

pi install git:github.com/datspike/pi-runtime-info-extension

Local development path

{
  "packages": [
    "/absolute/path/to/pi-runtime-info-extension"
  ]
}

The package entrypoint is declared in package.json:

{
  "pi": {
    "extensions": ["./src/index.ts"]
  }
}

Compatibility notes

The current-session tools use documented Pi extension APIs:

  • ctx.model;
  • ctx.sessionManager;
  • pi.getThinkingLevel();
  • session assistant message metadata.

The subagent_runtime_info tool is intentionally narrower. It is tested against Tintinweb's pi-subagents package:

pi install git:github.com/tintinweb/pi-subagents

It reads the active manager from globalThis[Symbol.for("pi-subagents:manager")], which is a package-level integration seam rather than a Pi core API. Put pi-subagents in Pi settings before this package so its manager is available when the tool runs. If pi-subagents is not installed, not loaded, or changes that seam, current-session tools continue to work and the subagent tool reports a clear error.

Verification

npm run check
npm pack --dry-run

For a live Pi smoke test:

pi --mode json -p 'Call runtime_info and print its JSON result.'

Current limitations

  • runtime_info reports the selected/effective session model. After at least one assistant response, last_assistant_message can also confirm provider-reported message metadata.
  • subagent_runtime_info only sees subagents known to the active parent session and the loaded pi-subagents manager.
  • If a subagent is started with extensions disabled, it cannot call runtime_info itself; the parent can still call subagent_runtime_info when the manager seam is available.

License

MIT