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

gthinking

v2.1.5

Published

Sequential Thinking System v2.1 - Advanced multi-stage thinking engine with AI-powered analysis, reasoning, and planning. Now supports local CLI tools!

Readme

gthinking v2.1.4

Sequential Thinking System - Advanced multi-stage thinking engine with AI-powered analysis, reasoning, and planning.

Overview

gthinking is a comprehensive TypeScript library that implements a sequential thinking system designed to solve complex problems through multiple stages of analysis, reasoning, and synthesis.

Current Status (v2.1.2): The Analysis Engine is fully implemented and operational. The Core Engine architecture, MCP Server, and CLI integration are stable. Other modules (Reasoning, Planning, Creativity, Search, Learning) are currently in active development and operating in placeholder mode for architectural testing.

Features

Core Capabilities

  • Sequential Thinking Pipeline: 8-stage thinking process architecture (Search → Analysis → Reasoning → Learning → Planning → Creativity → Synthesis → Evaluation)
  • Dynamic Pipeline: Automatically selects appropriate stages based on query context
  • Parallel Execution: Supports parallel execution of independent stages
  • Streaming Support: Real-time results as each stage completes
  • Caching Layer: Intelligent caching to reduce redundant processing

🟢 Analysis Engine (Active)

The Analysis Engine is fully implemented and provides deep insights into text content:

  • Sentiment Analysis: Detects overall sentiment (positive, negative, neutral) and specific emotions (joy, anger, fear, etc.).
  • Entity Extraction: Identifies people, organizations, locations, and other key entities.
  • Topic Extraction: Discovers main topics and their relevance.
  • Keyword Extraction: Identifies key terms and phrases using TF-IDF and semantic analysis.
  • Text Summarization: Generates abstractive summaries and key points.
  • Readability Metrics: Calculates Flesch-Kincaid grade levels and other readability statistics.

🟡 Reasoning & Planning (In Development)

These modules are currently in architectural preview.

  • Reasoning: Deductive, Inductive, Abductive, Analogical, Causal, Counterfactual.
  • Planning: Task decomposition, Resource allocation, Critical path analysis.
  • Creativity: Brainstorming, SCAMPER, Six Thinking Hats.
  • Search: Multi-provider web search aggregation.

Installation

npm install gthinking

Quick Start

Basic Usage

import { SequentialThinkingEngine } from 'gthinking';

const engine = new SequentialThinkingEngine();

// The engine will analyze the query and route it through the pipeline
const result = await engine.think({
  query: 'Analyze the sentiment and key topics of the recent product reviews.',
  preferredStages: ['analysis'], // Currently the most active stage
});

console.log(result.summary);
console.log(result.analysis); // Access detailed analysis results

Using the Analysis Engine Directly

import { AnalysisEngine } from 'gthinking';

const analysis = await AnalysisEngine.analyze({
  content: 'The new feature is amazing, but the UI is a bit confusing.',
  types: ['sentiment', 'entity', 'keyword', 'readability'],
});

console.log(analysis.sentiment); 
// { overall: 'mixed', score: 0.2, emotions: { joy: 0.6, confusion: 0.4 } }

console.log(analysis.readability.grade);
// "high_school"

CLI Mode & MCP Server

gthinking v2.1.0+ supports CLI Mode, allowing you to use local CLI tools (like Gemini CLI, Claude CLI, or custom wrappers) as your LLM provider. This eliminates the need for API keys if you are authenticated locally.

MCP Configuration

Add this to your MCP settings file (e.g., in Claude Desktop or other MCP clients):

{
  "mcpServers": {
    "gthinking": {
      "command": "npx",
      "args": ["-y", "gthinking"],
      "env": {
        "GTHINKING_LLM_PROVIDER": "cli",
        "GTHINKING_LLM_CLI_COMMAND": "gemini",
        "GTHINKING_LLM_CLI_ARGS": "-p"
      }
    }
  }
}

Environment Variables

# Provider Selection
GTHINKING_LLM_PROVIDER=cli  # 'cli' or 'gemini' (API)

# CLI Configuration (if provider is 'cli')
GTHINKING_LLM_CLI_COMMAND=gemini
GTHINKING_LLM_CLI_ARGS=""      # Optional args
GTHINKING_LLM_CLI_PROMPT_FLAG=-p # Flag to pass prompt with (e.g. -p "prompt")

# API Configuration (if provider is 'gemini' or others)
GTHINKING_LLM_API_KEY=your-api-key
GTHINKING_LLM_MODEL=gemini-pro

API Reference

SequentialThinkingEngine

The main orchestrator class that coordinates all thinking stages.

  • think(request: ThinkingRequest): Promise<SynthesisResult>
  • quickSearch(query: string): Promise<SynthesisResult> (Uses Search + Analysis)
  • deepAnalysis(query: string): Promise<SynthesisResult> (Full Pipeline)

AnalysisEngine

  • analyze(request: AnalysisRequest): Promise<CompleteAnalysisResult>

Supported Analysis Types:

  • AnalysisType.SENTIMENT
  • AnalysisType.ENTITY
  • AnalysisType.TOPIC
  • AnalysisType.KEYWORD
  • AnalysisType.SUMMARY
  • AnalysisType.READABILITY

Security

  • Input Sanitization: rigorous sanitization of all inputs to prevent injection.
  • Secure Execution: CLI mode uses spawn with non-shell execution.
  • Validation: Zod schemas for runtime type checking.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT License

Changelog

v2.1.2

  • Documentation: Updated README to reflect current module status.
  • Maintenance: Internal package updates and stability improvements.

v2.1.1

  • Feature: Fully implemented AnalysisEngine.
  • Security: Hardened input sanitization (sanitizeForShell).
  • Integration: SequentialThinkingEngine now defaults to AnalysisEngine for analysis tasks.

v2.1.0

  • New Feature: CLI Provider support.
  • Integration: Local LLM tool integration (Gemini, etc.).