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

@jgalego/teamapi-core

v0.10.0

Published

Team API as Code resolution, graph building, cognitive load, context mapping, and diagram generation

Downloads

150

Readme

@jgalego/teamapi-core

npm CI Node License: MIT

$ref resolution, org graph building, cognitive load scoring, DDD context-map derivation, and Mermaid/DOT diagram generation for the Team API as Code extended spec.

This is the shared engine behind the teamapi CLI, the REST API, the MCP server, and the chat tool-use loop — you normally don't depend on it directly unless you're building another adapter on top of the same org graph.

Install

npm install @jgalego/teamapi-core @jgalego/teamapi-schema

Usage

import { buildOrgGraph, buildTopologyDiagram, toMermaid } from "@jgalego/teamapi-core";

// seedUris are resolved file paths (expand any globs yourself, e.g. with `fast-glob`)
const graph = await buildOrgGraph({ seedUris: ["./examples/acme-org/stream-checkout/teamapi.yml"] });
console.log(toMermaid(buildTopologyDiagram(graph)));

Exports

  • Resolution: buildOrgGraph, OrgGraphStore (a live, reloadable wrapper around buildOrgGraph), LoaderRegistry/FileLoader/HttpLoader (resolve/loaders), formatZodError (turns a Zod validation failure into a readable message).
  • Model: OrgGraph, GraphEdge, RoleGraphEdge, ResolvedTeam types (model/org-graph); listTeams, getTeam, getInteractions, getDependencies, listServices, findServiceOwner, listRoles, listMembers, searchOrg (model/queries).
  • Cognitive load: scoreCognitiveLoad, orgWideCognitiveLoadReport (cognitive-load/score).
  • Gaps: planGaps, formatGaps (gaps/plan) — the accountability holes between teams, which are invisible from any single teamapi.yml and only appear once the graph is resolved. Pure: no I/O, no network.
  • Shadow AI: scanForAiArtifacts (shadow-ai/scan) reads repository checkouts already on disk for MCP configs, agent instruction files, LLM SDKs in manifests and workflow steps that call a model; planShadowAi/formatShadowAi/repoNameFromUrl (shadow-ai/plan) reconcile what it found against what teams declare in agents[].
  • DDD context mapping: deriveContextMap, MODE_TO_PATTERN_HEURISTIC (context-map/derive, context-map/patterns).
  • Diagrams: buildTopologyDiagram, buildHierarchyDiagram, buildOrgHierarchyDiagram, buildContextMapDiagram (one per --scope), plus toMermaid/toDot renderers and the DiagramModel type they share.
  • Serialization: toTeamSummaryDto, toTeamDetailDto, listTeamSummaries, toOrgGraphDto (serialize/team-dto) — the single source of truth both the REST API and the MCP server use to turn a ResolvedTeam/OrgGraph into a wire-format object, so their responses are identical by construction.
  • Generators: buildCrewAiCrewConfig/buildCrewAiOrgConfig plus the toCrewAiCrewYaml/toCrewAiOrgYaml serializers (generators/crewai) — turn a team's (or the whole org's) roles into CrewAI agents.yaml/tasks.yaml. buildBackstageCatalog/ buildBackstageOrgCatalog plus toBackstageYaml (generators/backstage) — turn a team's (or the whole org's) services[]/members[] into a Backstage catalog-info.yaml (Group/User/System/Component entities).
  • Diffing: diffOrgGraphs, isEmptyDiff, formatOrgGraphDiff (diff/diff-graph) — diff two resolved OrgGraphs (teams added/removed, per-team role/member/service/cognitive-load changes, edge changes) and render the result as a human-readable report. Git-agnostic — teamapi diff is what supplies "the org as of a git revision" as one side of the comparison.
  • History: listRevisions, sampleRevisions, snapshotOrg, withChurn, formatHistory, historyToCsv (history/trends, git/ref-loader) — the org resolved at a series of past git revisions, as a trend rather than a pair of snapshots.
  • Digest: buildOrgDigest, formatDigestText, digestToSlackMessage, digestToHtml (digest/build) — gaps + policy + topology merged with what moved since a previous snapshot.
  • Metrics: collectOrgMetrics, renderPrometheus (metrics/*) — the org graph in the Prometheus exposition format, reused by serve-api --metrics.
  • Semantic search: semanticSearchOrg, buildSearchDocuments, OpenAiEmbeddingProvider, EmbeddingCache, createEmbeddingScorer (search/*) — embedding-backed search and context-bundle scoring over any OpenAI-compatible /embeddings endpoint.
  • Importers: importBackstageCatalog, importDirectoryGroups (Okta/Entra), importSlackChannels, importCsvRoster (import/*) — bootstrap documents from the systems an org already has.
  • Write-back planners: planSlackUsergroups, planOktaGroups, planPagerDutyTeams (apply/*) — plan/execute reconciliation of memberships in external systems, same plan-then-confirm shape as the GitHub apply.
  • Proposals: buildTeamProposal, openTeamProposal (propose/*) — a small, closed patch to one team document becomes a pull request, re-validated and re-formatted first.

Full docs: https://github.com/JGalego/TeamAPI

The TeamAPI toolchain

One org graph, seven doors into it — install only the ones you need:

| Package | What it does | | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | | @jgalego/teamapi | The CLI — validate, diagram, check, import, reconcile, serve and chat with your org | | @jgalego/teamapi-core (this package) | The engine: $ref resolution, the org graph, scoring, checks, diagrams, generators | | @jgalego/teamapi-schema | Zod schemas and TypeScript types for the extended spec | | @jgalego/teamapi-rest-api | REST API, live dashboard, Swagger UI, Prometheus metrics | | @jgalego/teamapi-mcp-server | The org graph as MCP tools for LLM assistants | | @jgalego/teamapi-chat | Chat as a team or member — Anthropic or any OpenAI-compatible endpoint | | @jgalego/teamapi-backstage | Live Backstage catalog entity provider |

Docs, examples and the extended spec: teamapi.dev · github.com/JGalego/TeamAPI

License

MIT