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

@octocodeai/octocode-core

v19.1.5

Published

Canonical Octocode tool schemas, descriptions, instructions, and discovery contracts.

Downloads

7,668

Readme

@octocodeai/octocode-core

Shared, versioned contracts that are independent of Octocode tool execution:

  • public agent-facing tool definitions with names, descriptions, executable input schemas, and schema-owned branch diagnostics;
  • shared research instructions selected for the exposed tools.

Import public tool contracts from @octocodeai/octocode-core/schema. Execution, security, provider access, availability, and response shaping belong to the Rust @octocodeai/octocode-native runtime; core imports no execution or native engine.

Imports

import {
  DIRECT_TOOL_DEFINITIONS,
  TOOL_NAMES,
} from "@octocodeai/octocode-core/schema";
import { buildMcpInstructions } from "@octocodeai/octocode-core/mcp";

const instructions = buildMcpInstructions([
  TOOL_NAMES.GITHUB_SEARCH,
  TOOL_NAMES.GITHUB_FETCH_CONTENT,
]);
const astSearch = DIRECT_TOOL_DEFINITIONS.find(
  tool => tool.name === TOOL_NAMES.AST_SEARCH,
);
const query = astSearch?.schema.parse({ operation: "files", path: "/ABS/repo" });

@octocodeai/octocode-core/mcp also exports SYSTEM_PROMPT for the full catalog. CLI context and MCP servers consume DIRECT_TOOL_DEFINITIONS, the public projection exported from @octocodeai/octocode-core/schema. These definitions intentionally omit output schemas. CLI and MCP discovery therefore advertise only the agent-facing input contract.

TOOL_NAMES, DIRECT_TOOL_DEFINITIONS, and getToolSchemaVariants are the single public sources for identities, contracts, and variants. Each input schema owns its branch relations and diagnostics. Core input schemas preserve accepted caller values; they may add documented defaults or reject invalid input, but never clamp or silently discard it.

The canonical internal specifications retain output schemas for native contract generation, result validation, and contract fingerprinting. They are not part of the public /schema export. Execution packages remain responsible for producing and validating result envelopes. This package contains no tool runners, CLI command registry, or skill bundle.

clasify applies bounded typed questions when a semantic judgment can change the next action. Use one matrix when the same question set applies to every resource; each resource is captured once and every questions[] entry is applied to every resources[] entry. Use {queries:[...]} only to batch independent complete matrices. Do not use it for exact or settled checks, or to reread evidence already in context.

A resource context is either {value: ...} for non-empty supplied state or {tool, query} for one unexecuted read-only Octocode call. Questions are typed as Noul, Choice, or Score. Every matrix requires non-blank reasoning that states why the judgment changes the next action. Every query, resource, and question has a stable ID, and results correlate those IDs with each assessed page:

{
  "id": "store-candidates",
  "reasoning": "Classify every captured page before selecting proof reads.",
  "resources": [
    {
      "id": "local-store",
      "maxChars": 16000,
      "context": {
        "tool": "localFetch",
        "query": {
          "path": "/ABS/repo/src/store.ts",
          "chunkType": "bytes",
          "offset": 0,
          "chunkSize": 16000,
          "reasoning": "Capture one bounded source page."
        }
      }
    },
    {
      "id": "browser-body-2",
      "context": { "value": { "artifact": "bounded saved browser chunk" } }
    }
  ],
  "questions": [
    {
      "id": "relevance",
      "question": {
        "type": "choice",
        "instructions": "Does this resource contribute to the decision?",
        "criteria": {
          "relevant": "Contains evidence that can change the next action.",
          "insufficient": "The bounded view is incomplete or undecidable.",
          "unrelated": "Contains no relevant evidence."
        }
      }
    },
    {
      "id": "risk",
      "question": {
        "type": "score",
        "instructions": "How much direct verification does this resource need?",
        "criteria": ["None", "Targeted read", "Must inspect"]
      }
    }
  ]
}

Run octocode clasify '<json>' or octocode clasify --input request.json. Inspect the live query contract with octocode scheme clasify --view query --compact, and inspect the selected context tool before constructing an ordinary query. Context tools are read-only; recursive assessment, rewrites, and cloning are excluded.

Each matrix is capped at 25 resource-question cells, with at most 25 resources and five questions. A batched call accepts at most five complete matrices and 50 total cells. A resource's maxChars defaults to 80,000; lower it when a smaller assessment bound is sufficient. The runtime follows safe ordinary-tool continuations within that bound and returns next.clasify when more source scope remains.

Results contain typed answers, requested and resolved model identities, usage, coverage, and a body-free context receipt. Retrieved bodies are not returned. Retain partial, uncertain, insufficient, and errored pages; bounded coverage is not exhaustive and cannot prove global absence. Read deciding source and run the appropriate exact checks before making claims or changes. A new assessment reruns inference, so reuse current evidence and prefer direct checks for exact facts.

Native contract generation

Build this package before generating native contracts because the generator loads dist/. The generator rejects package changes that are not committed, so a checked artifact always names a clean source revision:

yarn workspace @octocodeai/octocode-core build
node packages/octocode-core/scripts/generate-native-contracts.ts \
  --out /ABS/octocode/packages/octocode-native/crates/runtime/src/contracts/generated

The build also writes dist/public-catalog.json and one exact agent-facing contract per tool under dist/schema-templates/. Use those generated files for schema review and size measurement; they include the full public input/query contract and intentionally exclude output schemas, matching MCP and CLI discovery.

Use --allow-dirty only for local iteration. Generated output includes contract-provenance.json, which records the core commit, dirty state, and contract fingerprint. Release and verification flows must run without --allow-dirty.

Package discovery and lookup

artifactSearch replaces npmSearch. Use it to find a package for a capability, resolve a known dependency to registry metadata, or locate upstream source. Choose one required type per query: npm, pypi, crates, maven, nuget, go, packagist, or rubygems. Python/pip/uv uses pypi; Rust/Cargo uses crates. Registry metadata does not establish implementation behavior.

import { ArtifactSearchBulkQueryLocalSchema } from "@octocodeai/octocode-core/schema";

const packages = ArtifactSearchBulkQueryLocalSchema.parse({
  queries: [
    { type: "npm", packageName: "@types/node" },
    { type: "pypi", packageName: "requests" },
    { type: "crates", keywords: ["schema", "validation"] },
    { type: "maven", packageName: "org.slf4j:slf4j-api" },
  ],
});

Set exactly one of packageName or keywords (an array even for one term). PyPI supports exact lookup only; keyword queries report unsupported keyword discovery. Keyword pages default to 10 artifacts, with pageSize up to 100. Continue by copying the complete returned next.nextPage query and opaque cursor unchanged. Do not use numbered page fields. Bulk requests contain one to five queries; whole-response pagination retains the shared response snapshot envelope.

Only type: 'npm' accepts registry; existing npm scope mappings and configured credentials remain authoritative. Other ecosystems use official public services. Results expose normalized artifacts[] metadata with source links when supplied by the registry. Use local tools to inspect installed code, or source tools directly when its repository is already known. This tool does not install packages.