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

tracelattice

v1.4.0

Published

Semantic Sequential Thinking Layer For Agentic Tools

Readme

TraceLattice

npm version

An MCP server that gives AI agents structured sequential thinking. Thoughts live in a DAG, reasoning strategies are pluggable, and confidence scores get calibrated against actual outcomes.

Features

  • 11 thought types: regular, hypothesis, verification, critique, synthesis, meta, tool_call, tool_observation, assumption, decomposition, backtrack
  • DAG-based thought graph with 8 edge kinds (sequence, branch, merge, verifies, critiques, derives_from, tool_invocation, revises) and topological traversal
  • Pluggable reasoning strategies. Sequential by default, or Tree-of-Thought with BFS/beam search and plateau detection
  • Tool interleave: suspend a thinking chain, run a tool call, then resume where you left off
  • Confidence calibration using Beta(2,2) priors, Brier score, and Expected Calibration Error (ECE)
  • Branch compression: cold branches get rolled into summaries automatically, with a sliding-window dehydration policy
  • Outcome recording for tool_call/tool_observation results with metadata
  • Tool and skill recommendations with confidence scores, rationales, and automatic discovery
  • Per-session isolation with TTL eviction and LRU caching
  • Three transports: stdio (default), SSE (legacy), Streamable HTTP (production)
  • Strict TypeScript, Valibot validation, 1913 tests, 18-service DI container

Install

Requires Node.js v22+.

npm install -g tracelattice

Configure your MCP client

The default transport is stdio. Add the server to your client:

Claude Code

User-scoped (~/.claude.json) or project-scoped (.mcp.json in project root):

{
  "mcpServers": {
    "tracelattice": {
      "command": "tracelattice"
    }
  }
}

Or via CLI:

claude mcp add tracelattice -- tracelattice

Codex CLI

User-scoped (~/.codex/config.toml) or project-scoped (.codex/config.toml):

[mcp_servers.tracelattice]
command = "tracelattice"

Or via CLI:

codex mcp add tracelattice -- tracelattice

OpenCode

Global (~/.config/opencode/opencode.json) or project-scoped (.opencode.json):

{
  "mcpServers": {
    "tracelattice": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "tracelattice"
      ],
      "enabled": true,
      "environment": {
        "MAX_HISTORY_SIZE": "10000"
      }
    }
}

Configuration

Server

| Variable | Default | Description | |----------|---------|-------------| | MAX_HISTORY_SIZE | 1000 | Maximum thoughts to keep in history | | MAX_BRANCHES | 50 | Maximum number of branches | | MAX_BRANCH_SIZE | 100 | Maximum size of each branch | | LOG_LEVEL | info | Log level: debug, info, warn, error | | PRETTY_LOG | true | Enable pretty log output |

Feature flags

All flags default to false. Set to true or 1 to enable.

| Variable | Description | |----------|-------------| | TRACELATTICE_FEATURES_DAG_EDGES | Enable DAG edges for thought relationships | | TRACELATTICE_FEATURES_CALIBRATION | Enable confidence calibration with Beta(2,2) priors | | TRACELATTICE_FEATURES_COMPRESSION | Enable branch compression for cold branches | | TRACELATTICE_FEATURES_TOOL_INTERLEAVE | Enable suspend/resume for tool calls | | TRACELATTICE_FEATURES_NEW_THOUGHT_TYPES | Enable tool_call, tool_observation, assumption, decomposition, backtrack | | TRACELATTICE_FEATURES_OUTCOME_RECORDING | Enable outcome recording for tool results | | TRACELATTICE_FEATURES_REASONING_STRATEGY | Strategy: sequential (default) or tot |

Transport

| Variable | Default | Description | |----------|---------|-------------| | TRANSPORT_TYPE | stdio | Transport: stdio, sse, or streamable-http | | STREAMABLE_HTTP_PORT | 3000 | Port for Streamable HTTP server | | STREAMABLE_HTTP_HOST | localhost | Host for Streamable HTTP server | | STREAMABLE_HTTP_STATEFUL | true | Enable stateful session tracking | | SSE_PORT | 3000 | Port for SSE server | | SSE_HOST | localhost | Host for SSE server | | SSE_ENABLE_POOL | true | Enable connection pool for session isolation | | SSE_MAX_SESSIONS | 100 | Maximum concurrent SSE sessions | | SSE_SESSION_TIMEOUT | 300000 | SSE session timeout (ms) | | CORS_ORIGIN | * | CORS origin | | ENABLE_CORS | true | Enable CORS preflight | | ALLOWED_HOSTS | (all) | Comma-separated allowed hosts |

Skill discovery

| Variable | Default | Description | |----------|---------|-------------| | SKILL_DIRS | (none) | Colon-separated skill directories | | DISCOVERY_CACHE_TTL | 300000 | Discovery cache TTL (ms) | | DISCOVERY_CACHE_MAX_SIZE | 100 | Discovery cache max entries |

Transports

Set TRANSPORT_TYPE to pick one:

| Transport | When to use | Command | |-----------|-------------|---------| | stdio (default) | Local MCP clients | tracelattice | | sse (legacy) | Multi-user setups, backwards compatibility | TRANSPORT_TYPE=sse tracelattice | | streamable-http | Production deployments | TRANSPORT_TYPE=streamable-http tracelattice |

Development

npm install
npm run dev          # MCP inspector
npm test             # 1913 tests (vitest)
npm run test:coverage # with coverage report
npm run type-check   # tsc --noEmit
npm run lint         # eslint
npm run build        # rslib + rsbuild

Architecture

src/
├── core/               # Domain logic
│   ├── graph/          # DAG edges: Edge, EdgeStore, GraphView
│   ├── evaluator/      # SignalComputer, Aggregator, PatternDetector, Calibrator
│   ├── compression/    # CompressionService, DehydrationPolicy, SummaryStore
│   ├── reasoning/      # OutcomeRecorder + strategies (Sequential, TreeOfThought)
│   └── tools/          # InMemorySuspensionStore (suspend/resume)
├── contracts/          # Shared interfaces (cross-module coupling point)
├── persistence/        # File, SQLite, Memory backends
├── transport/          # stdio, SSE, Streamable HTTP
├── di/                 # IoC container (18 services)
├── registry/           # Tool/Skill discovery with LRU cache
└── config/             # YAML + env var loading

License

MIT