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

@robota-sdk/agents

v2.0.9

Published

Complete AI agent implementation with unified core and tools functionality - conversation management, plugin system, and advanced agent features

Downloads

33

Readme

@robota-sdk/agents

The comprehensive AI agent framework with type-safe architecture and advanced plugin system.

Overview

The @robota-sdk/agents package is the unified core of the Robota SDK, providing a complete AI agent system with advanced capabilities for conversation management, tool execution, and extensible plugin architecture.

Installation

npm install @robota-sdk/agents

Quick Start

import { Robota } from '@robota-sdk/agents';
import { OpenAIProvider } from '@robota-sdk/openai';

const openaiProvider = new OpenAIProvider({ apiKey: 'sk-...' });

const agent = new Robota({
  name: 'MyAgent',
  aiProviders: [openaiProvider],
  defaultModel: {
    provider: 'openai',
    model: 'gpt-4',
    systemMessage: 'You are a helpful assistant.'
  }
});

const response = await agent.run('Hello, world!');
console.log(response);

Browser Quick Start

import { Robota, LoggingPlugin, UsagePlugin } from '@robota-sdk/agents';
import { OpenAIProvider } from '@robota-sdk/openai';

const openaiProvider = new OpenAIProvider({ 
  apiKey: process.env.NEXT_PUBLIC_OPENAI_API_KEY // or proxy endpoint
});

// Browser-optimized configuration
const agent = new Robota({
  name: 'BrowserAgent',
  aiProviders: [openaiProvider],
  defaultModel: {
    provider: 'openai',
    model: 'gpt-3.5-turbo'
  },
  plugins: [
    new LoggingPlugin({ strategy: 'console' }),    // Console logging
    new UsagePlugin({ strategy: 'memory' })        // Memory storage
  ]
});

const response = await agent.run('Hello from browser!');
console.log(response);

Key Features

🌐 Cross-Platform Compatibility

  • Universal Runtime Support: Works seamlessly in Node.js, browsers, and WebWorkers
  • Zero Breaking Changes: Existing Node.js code runs unchanged in browsers
  • Pure JavaScript Implementation: No Node.js-specific dependencies in core functionality
  • Browser-Optimized Storage: Memory-based alternatives for file system operations
  • Secure API Patterns: Proxy server support for secure browser deployments

🤖 Agent System

  • Type-Safe Architecture: Full TypeScript support with generic type parameters
  • Robota Class: Complete AI agent implementation with conversation + tool system + plugin integration
  • Stateless Service Layer: ConversationService, ToolExecutionService, ExecutionService for business logic
  • Manager Layer: AIProviders, Tools, AgentFactory, Plugins, ConversationHistory for resource management
  • Parallel Tool Execution: Concurrent multi-tool calling support

🌊 Streaming Response System

  • Real-time Streaming: Full streaming support across all AI providers
  • Modular Architecture: Separate streaming/parsing logic for each provider
  • Provider Support: OpenAI, Anthropic, Google with dedicated stream handlers

🔧 Tool System

  • Type-Safe Tools: BaseTool<TParameters, TResult> with compile-time type checking
  • ToolRegistry: Schema storage and validation system
  • Function Tools: Zod schema-based function tool implementation
  • OpenAPI/MCP Support: Basic structure for extensibility

🔌 Plugin System

Eight core plugins with type-safe configuration and BasePluginOptions integration:

  • ConversationHistoryPlugin: Comprehensive conversation storage with support for memory, file, and database backends. Features auto-save, batch processing, and configurable limits.
  • UsagePlugin: Advanced usage analytics including token counting, cost calculation, aggregated statistics, and multiple storage strategies (memory/file/remote).
  • LoggingPlugin: Multi-level logging system with console, file, and remote endpoints. Supports custom formatters, batch processing, and structured logging.
  • PerformancePlugin: Real-time performance monitoring including execution time tracking, memory usage, CPU metrics, and customizable performance thresholds.
  • ErrorHandlingPlugin: Robust error management with multiple strategies (simple, exponential-backoff, circuit-breaker, silent) and custom error handlers.
  • LimitsPlugin: Advanced rate limiting with token bucket, sliding window, and fixed window strategies. Supports cost tracking and custom calculators.
  • EventEmitterPlugin: Comprehensive event system with async/sync event handling, filtering, buffering, and lifecycle event tracking.
  • WebhookPlugin: HTTP webhook notifications with batch processing, retry logic, custom transformers, and concurrent request management.

Plugin Features

  • Type Safety: All plugins extend BasePluginOptions for consistent configuration
  • Lifecycle Integration: Automatic integration with agent lifecycle events
  • Resource Management: Built-in cleanup and resource optimization
  • Performance Monitoring: All plugins include built-in statistics and monitoring
  • Error Resilience: Graceful error handling across all plugin operations

Plugin Control and Configuration

  • Clear Disable Options: Every plugin provides multiple ways to disable functionality
  • No Arbitrary Decisions: Plugins avoid making policy decisions without explicit configuration
  • Explicit Configuration: All automatic behaviors can be controlled through configuration
  • Silent Modes: Most plugins support 'silent' strategies for performance-critical scenarios
// Complete plugin disable
const agent = new Robota({
  plugins: [] // No plugins
});

// Selective plugin disable
const agent = new Robota({
  plugins: [
    new LoggingPlugin({ strategy: 'silent', enabled: false }),
    new LimitsPlugin({ strategy: 'none' }),
    new UsagePlugin({ strategy: 'silent' })
  ]
});

Plugin Documentation

🔒 Type Safety Features

  • Generic Type Parameters: BaseAgent<TConfig, TContext, TMessage>
  • Provider Agnostic: Dynamic provider registration with type safety
  • Extended RunContext: Provider-specific options with type preservation
  • Plugin Type Parameters: BasePlugin<TOptions, TStats> for specialized configurations

Architecture

Core Abstraction Layers

BaseAgent<TConfig, TContext, TMessage> (Abstract Class)
└── Robota (Implementation - AI conversation + tool system + plugins)

BaseAIProvider<TConfig, TMessage, TResponse>
├── OpenAIProvider (via @robota-sdk/openai)
├── AnthropicProvider (via @robota-sdk/anthropic)
└── GoogleProvider (via @robota-sdk/google)

BaseTool<TParameters, TResult>
├── FunctionTool (Zod schema-based)
├── OpenAPITool (API specification-based)
└── MCPTool (Model Context Protocol)

BasePlugin<TOptions, TStats>
├── Core Plugins (8 essential plugins)
└── Custom Plugins (User-defined extensions)

Module Structure

packages/agents/src/
├── abstracts/           # Abstract base classes with type parameters
├── interfaces/          # Type-safe interface definitions
├── agents/             # Main agent system
│   ├── managers/       # Resource managers
│   ├── services/       # Stateless business logic
│   └── tools/          # Tool system
├── plugins/            # Plugin system with Facade pattern
└── utils/              # Core utilities

Development

See development.md for detailed development guidelines.

API Reference

See api.md for complete API documentation.

Architecture Guide

See architecture.md for detailed architecture information.

Examples

Package Compatibility

Integrated Packages

  • @robota-sdk/openai: Complete agents standard migration
  • @robota-sdk/anthropic: Complete agents standard migration
  • @robota-sdk/google: Complete agents standard migration
  • @robota-sdk/team: Full integration with team collaboration features

Deprecated Packages

  • @robota-sdk/core: Deprecated - functionality moved to agents
  • @robota-sdk/tools: Deprecated - functionality moved to agents

License

MIT