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

nimbus-sdk

v1.0.1

Published

Nimbus SDK - AI-powered code orchestration with 3-phase pipeline (Gemini + mgrep → Claude → Claude)

Readme

Nimbus SDK

AI-powered code orchestration with a 3-phase pipeline: Gemini + mgrep → Claude → Claude

Features

  • 3-Phase AI Orchestration: Semantic search → Planning → Execution
  • mgrep Integration: Semantic code search that's 2x faster than grep
  • Streaming Support: Real-time progress updates via Server-Sent Events
  • X402 Micropayments: Built-in payment system for AI operations
  • TypeScript Native: Full type safety and IntelliSense support
  • Flexible Configuration: Customize agents, tools, and workflows

Installation

npm install nimbus-sdk

Quick Start

import { NimbusSDK } from 'nimbus-sdk';

// Initialize the SDK
const sdk = new NimbusSDK({
  sessionId: 'nb_...', // Get from developer dashboard
  walletAddress: '0x...',
  repoUrl: 'https://github.com/user/repo',
  agentConfig: {
    name: 'My AI Agent',
    description: 'AI-powered development assistant'
  }
});

// Initialize (fetches configuration from backend)
await sdk.initialize();

// Execute AI orchestration with streaming
const result = await sdk.orchestrate({
  userGoal: 'Add a dark mode toggle to the settings page',
  context: {
    currentFile: 'src/App.tsx',
    framework: 'React + Tailwind CSS'
  },
  stream: true,
  onStream: (event) => {
    console.log(`Phase: ${event.phase}, Status: ${event.status}`);
    if (event.message) {
      console.log(event.message);
    }
  }
});

// Check results
console.log('Summary:', result.summary);
console.log('Files Changed:', result.filesChanged);
console.log('Actions:', result.actions);

3-Phase Architecture

Phase 1: Data Collection (Gemini + mgrep)

  • mgrep semantic search: Natural language code queries (2x faster than grep)
  • Gemini 2.0 Flash: Fast, efficient data gathering
  • Tools: readFile, runBash, runGrep, runGlob, runGitCommand

Phase 2: Planning (Claude)

  • Claude Sonnet 4.5: Advanced reasoning and architecture design
  • Outputs: Step-by-step implementation plan with best practices

Phase 3: Execution (Claude)

  • Claude Sonnet 4.5: Code generation and file operations
  • Tools: writeFile, editFile, installPackage, runGitCommand

API Reference

NimbusSDK

Constructor

new NimbusSDK(config: NimbusSDKConfig)

Config Options:

  • sessionId (required): Session ID from developer dashboard (format: nb_...)
  • walletAddress (required): User's wallet address
  • repoUrl (required): GitHub repository URL
  • apiUrl (optional): API base URL (defaults to https://sonnetprotocol.com)
  • agentConfig (required): Agent configuration
    • name: Agent name
    • description: Agent description
    • systemPrompt (optional): Custom system prompt
    • tools (optional): Custom tools array
    • brandingConfig (optional): Logo and color customization

Methods

initialize(): Promise<void>

Fetches developer configuration from backend. Call this after construction.

orchestrate(request: OrchestrationRequest): Promise<OrchestrationResult>

Execute 3-phase AI orchestration.

Request:

  • userGoal (required): Natural language description of what to accomplish
  • context (optional): Additional context
    • currentFile: Currently open file
    • selectedCode: Selected code snippet
    • additionalInfo: Any other relevant info
  • stream (optional): Enable streaming (default: false)
  • onStream (optional): Callback for stream events

Result:

  • success: Whether orchestration succeeded
  • summary: Human-readable summary of what was done
  • filesChanged: Array of file paths that were modified
  • actions: Array of actions performed (type, file, details)
  • error (optional): Error message if failed
processIntent(intent: string, walletAddress: string): Promise<ProcessIntentResult>

Legacy method for processing user intents. Use orchestrate() for new implementations.

getPaymentConfig(): PaymentConfig

Get current payment configuration (pricing, revenue split, etc.)

getPricingInfo(): PricingInfo

Get pricing information for display to users.

Examples

With Custom Tools

const sdk = new NimbusSDK({
  sessionId: 'nb_...',
  walletAddress: '0x...',
  repoUrl: 'https://github.com/user/repo',
  agentConfig: {
    name: 'Custom Agent',
    description: 'Agent with custom capabilities',
    tools: [
      {
        name: 'deploy-to-production',
        description: 'Deploy application to production',
        parameters: {
          environment: 'string',
          branch: 'string'
        },
        handler: async (params) => {
          // Custom deployment logic
          return { success: true, url: 'https://app.example.com' };
        }
      }
    ]
  }
});

Non-Streaming Mode

const result = await sdk.orchestrate({
  userGoal: 'Refactor authentication logic to use JWT tokens',
  context: {
    currentFile: 'src/auth/index.ts',
    additionalInfo: 'Use jsonwebtoken library'
  },
  stream: false
});

if (result.success) {
  console.log('Refactoring complete!');
  console.log('Modified files:', result.filesChanged.join(', '));
} else {
  console.error('Error:', result.error);
}

Progress Tracking with Streaming

const result = await sdk.orchestrate({
  userGoal: 'Add user profile page with avatar upload',
  stream: true,
  onStream: (event) => {
    switch (event.phase) {
      case 'data-collection':
        console.log('📚 Gathering context...');
        break;
      case 'planning':
        console.log('🎯 Planning implementation...');
        if (event.message) console.log('  -', event.message);
        break;
      case 'execution':
        console.log('⚡ Executing...');
        if (event.action) {
          console.log(`  - ${event.action}: ${event.file}`);
        }
        break;
      case 'completed':
        console.log('✅ Complete!', event.message);
        break;
    }
  }
});

Pricing

  • Test Mode: $0.05 per prompt (single whitelisted wallet)
  • Production Mode: $0.10 per prompt (unlimited wallets)
  • Revenue Split: 80% developer, 20% protocol

Payment Configuration

The SDK includes built-in X402 micropayments:

const paymentConfig = sdk.getPaymentConfig();
console.log('Price per prompt:', paymentConfig.pricePerPrompt);
console.log('Developer revenue:', paymentConfig.developerFeePercentage + '%');

TypeScript Types

All types are exported for your convenience:

import type {
  NimbusSDK,
  NimbusSDKConfig,
  OrchestrationRequest,
  OrchestrationResult,
  OrchestrationStreamEvent,
  AgentConfig,
  AgentTool,
  PaymentConfig,
  SDKMode
} from 'nimbus-sdk';

Error Handling

try {
  const result = await sdk.orchestrate({
    userGoal: 'Add search functionality'
  });

  if (!result.success) {
    console.error('Orchestration failed:', result.error);
  }
} catch (error) {
  console.error('SDK error:', error);
}

Best Practices

  1. Always call initialize() after constructing the SDK
  2. Use streaming for long-running operations to provide user feedback
  3. Provide context in the context field for better results
  4. Handle errors gracefully with try-catch and result.success checks
  5. Test in test mode before switching to production

Development Dashboard

Get your session ID and manage your SDK settings at: https://sonnetprotocol.com/api-docs

Support

  • Documentation: https://sonnetprotocol.com/api-docs
  • GitHub: https://github.com/dom2icy/claude-on-chain
  • Issues: https://github.com/dom2icy/claude-on-chain/issues

License

MIT