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

@mrclrchtr/supi-tree-sitter

v4.7.0

Published

Structural AST analysis for SuPi code intelligence

Readme

@mrclrchtr/supi-tree-sitter

Tree-sitter structural code analysis library for the pi coding agent.

This is a library-only package — it has no pi extension surface. Use @mrclrchtr/supi-code-intelligence to access structural code-understanding workflows in pi.

Install

npm install @mrclrchtr/supi-tree-sitter

Tree-sitter outline in action

What you get

This package provides the parser-backed structural substrate consumed by @mrclrchtr/supi-code-intelligence:

  • a shared session-scoped Tree-sitter service for structural analysis
  • an owned parsing session API for direct library consumers
  • a StructuralProvider adapter published through ./provider/tree-sitter-provider
  • structural extraction helpers for outline/import/export/node/callee/call-site analysis inside the library surface
  • operation-specific extension discovery through getStructuralSearchSupportedExtensions()

It does not register pi tools or commands on its own.

Coordinates in the library APIs use 1-based line and character columns. Character positions use UTF-16 code units. Relative paths resolve from the session cwd, and a leading @ on file paths is stripped.

Supported file families

  • JavaScript / TypeScript (.js, .jsx, .ts, .tsx, .mjs, .cjs, .mts, .cts)
  • Python (.py, .pyi)
  • Rust (.rs)
  • Go (.go)
  • C / C++ (.c, .h, .cpp, .hpp, .cc, .cxx, .hxx, .c++, .h++)
  • Java (.java)
  • Kotlin (.kt, .kts)
  • Ruby (.rb, .gemspec)
  • Bash / shell (.sh, .bash, .zsh, .ksh)
  • HTML (.html, .htm, .xhtml)
  • R (.r)
  • SQL (.sql)

Outline collection supports every listed family. HTML outlines contain elements with non-empty id attributes; SQL outlines contain CREATE declarations and shallow table/type members. Import and export collection remains JavaScript/TypeScript-only, and call-site collection supports every listed family except HTML and SQL. Go module manifests and ERB templates are intentionally excluded because the Go and Ruby grammars do not parse those mixed or separate syntaxes; supi-lsp still handles them semantically. Consumers performing a bulk structural scan should use getStructuralSearchSupportedExtensions(operation) rather than treating parser support as operation support.

Architecture

@mrclrchtr/supi-tree-sitter is the structural substrate in SuPi's code-understanding stack. It depends on @mrclrchtr/supi-core and @mrclrchtr/supi-code-runtime for shared contracts, and provides structural analysis via a session-scoped Tree-sitter service that publishes its capabilities into the shared workspace runtime.

supi-code-runtime  ← shared contracts + workspace runtime
    ↑
supi-tree-sitter  ← Tree-sitter WASM + session-scoped service + runtime capabilities

Package surfaces

  • @mrclrchtr/supi-tree-sitter/api — reusable parsing session factory, shared session-scoped structural service access, and shared result types
  • @mrclrchtr/supi-tree-sitter/provider/tree-sitter-provider — shared StructuralProvider adapter

This is a library-only package. Public tool registration and pi event handlers belong to @mrclrchtr/supi-code-intelligence.

Owned session example:

import { createTreeSitterSession } from "@mrclrchtr/supi-tree-sitter/api";

const session = createTreeSitterSession("/project");

const parseable = await session.canParse("src/index.ts");
const outline = await session.outline("src/index.ts");
const callees = await session.calleesAt("src/index.ts", 42, 10);

session.dispose();

Shared session-scoped service example:

import { getSessionTreeSitterService } from "@mrclrchtr/supi-tree-sitter/api";

const state = getSessionTreeSitterService("/project");
if (state.kind === "ready") {
  const outline = await state.service.outline("src/index.ts");
}

Source

  • src/api.ts — public library entrypoint
  • src/index.ts — re-export surface
  • src/session/runtime.ts — parser and query runtime
  • src/session/session.ts — runtime-backed service helpers and owned session API
  • src/operation-support.ts — authoritative operation-specific extension support
  • src/session/service-registry.ts — shared session-scoped structural service registry
  • src/provider/tree-sitter-provider.tsStructuralProvider adapter consumed by @mrclrchtr/supi-code-intelligence
  • src/tool/outline.ts, src/tool/outline-*.ts, src/tool/imports.ts, src/tool/exports.ts, src/tool/node-at.ts, src/tool/callees.ts, src/tool/call-sites.ts — structural analyses exposed through the library surface