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

@tuttiai/server

v0.5.0

Published

Tutti HTTP server — runs agents over REST via `tutti-ai serve`

Readme

@tuttiai/server

HTTP server for Tutti — expose your multi-agent score as a REST API with SSE streaming, bearer-token auth, rate limiting, and CORS.

Install

npm install @tuttiai/server

Peer dependencies: @tuttiai/core and @tuttiai/types.

Quick start

import { TuttiRuntime, AnthropicProvider, defineScore } from "@tuttiai/core";
import { createServer } from "@tuttiai/server";

const score = defineScore({
  name: "my-api",
  provider: new AnthropicProvider(),
  agents: {
    assistant: {
      name: "assistant",
      model: "claude-sonnet-4-20250514",
      system_prompt: "You are a helpful assistant.",
      voices: [],
    },
  },
});

const runtime = new TuttiRuntime(score);
const app = await createServer({
  port: 3847,
  host: "0.0.0.0",
  runtime,
  agent_name: "assistant",
});

await app.listen({ port: 3847, host: "0.0.0.0" });

Or use the CLI:

tutti-ai serve --port 3847 --watch

Endpoints

| Method | Path | Description | |--------|------|-------------| | POST | /run | Run agent to completion. Returns { output, session_id, turns, usage, cost_usd, duration_ms }. | | POST | /run/stream | SSE stream: turn_start, tool_call, tool_result, content_delta, turn_end, run_complete. | | GET | /sessions/:id | Retrieve session conversation history. | | GET | /health | { status: "ok", version, uptime_s }. |

Configuration

interface ServerConfig {
  port: number;                          // Default: 3847
  host: string;                          // Default: "127.0.0.1"
  runtime: TuttiRuntime;                 // Pre-built runtime
  agent_name: string;                    // Agent key in the score
  api_key?: string;                      // Falls back to TUTTI_API_KEY env
  rate_limit?: { max: number; timeWindow: string } | false;
  cors_origins?: string | string[];      // Falls back to TUTTI_ALLOWED_ORIGINS env
  timeout_ms?: number;                   // Default: 120_000
}

Middleware

Registered in order: request ID → CORS → rate limit → bearer auth → global error handler → routes.

  • Request ID: x-request-id header on every response (echoes client ID or generates UUID).
  • CORS: @fastify/cors with Authorization + Content-Type allowed headers.
  • Rate limit: @fastify/rate-limit at 60 req/min per API key by default.
  • Auth: constant-time bearer-token comparison; /health is public.
  • Error handler: maps TuttiError subtypes to HTTP status codes; hides stack traces in production.

Docker

docker build -t tutti-server .
docker run -p 3847:3847 -e TUTTI_API_KEY=key -e ANTHROPIC_API_KEY=sk-... tutti-server

See the repo root docker-compose.yml for a full stack with Postgres and Redis.

License

Apache 2.0