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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@waylaidwanderer/sumika

v0.1.12

Published

A stateful API server for agents compatible with the Agent Client Protocol (ACP), such as the Gemini CLI.

Readme

Sumika

Sumika (住処), from the Japanese word for "dwelling," is a stateful API server that acts as a bridge for agents compatible with the Agent Client Protocol (ACP), such as the Gemini CLI. It provides a persistent, multi-session chat interface with support for tool calls and streaming events.

Core Concepts

Sumika is built around two primary concepts:

  • Workspaces: A Workspace is the primary data model for isolating an agent's context. It maps a unique ID to a directory on the filesystem, either managed by Sumika (~/.sumika/workspaces/<workspace-id>) or a custom user-provided path. A Workspace is a persistent entity that holds configuration (like environment variables and MCP servers) and contains multiple Sessions.
  • Sessions: A Session represents a single, stateful conversation with an agent. It's a persistent JSON object containing the full message history, including user prompts, agent responses, and tool calls. Each Session is mapped to a live, underlying ACP process. If the agent process terminates, the Session becomes disconnected but retains its history, allowing it to be re-initialized into a new process without data loss.

Getting Started

Prerequisites

  • Node.js
  • pnpm

Installation

  1. Clone the repository.
  2. Navigate to the server directory:
    cd server
  3. Install dependencies:
    pnpm install
  4. Create a .env file from the example:
    cp .env.example .env
  5. Add your GEMINI_API_KEY to the .env file.

Configuration

You can configure the server using the following environment variables in your .env file:

  • GEMINI_API_KEY (Required): Your API key for the Gemini service.
  • GEMINI_MODEL (Optional): The specific Gemini model to use (e.g., gemini-2.5-pro). Defaults to the Gemini CLI's default model if not set.
  • SUMIKA_ROOT_DIR (Optional): By default, Sumika stores all workspaces and session data in ~/.sumika. You can specify a different root directory by setting this variable to an absolute path.

Custom Agent and Environment Variables

For advanced use cases, you can configure Sumika to launch a custom ACP-compliant agent or to inject global environment variables into the agent's process. This is managed via the ~/.sumika/settings.json file.

  • customAcpCommand (string): A shell command used to launch your custom agent. If this is blank or omitted, Sumika defaults to using the built-in @google/gemini-cli.
  • env (object): A key-value map of environment variables to set in the agent's process. These will override any system-level variables with the same name.

Example settings.json:

{
  "customAcpCommand": "/path/to/my-custom-agent --acp --verbose",
  "env": {
    "CUSTOM_AGENT_API_KEY": "your-secret-api-key"
  },
  "mcpServers": {}
}

Note: The Sumika server must be restarted for any changes to settings.json to take effect.

Running the Server

To start the development server, run:

pnpm dev

The API will be available at http://localhost:8787. Interactive OpenAPI documentation is available at http://localhost:8787/docs.

Global MCP Servers

Sumika supports global MCP servers configured at ~/.sumika/settings.json in addition to per-workspace servers. When creating or reinitializing a session, Sumika merges the two sets and sends the merged list to the ACP agent. If both define the same server name, the workspace definition takes precedence.

Example ~/.sumika/settings.json:

{
  "mcpServers": {
    "serverName": {
      "command": "npx",
      "args": ["serverName"],
      "env": { "ENV_VAR": "1" }
    }
  }
}

API

  • GET /api/settings → Returns the global settings.
  • PUT /api/settings → Replaces the global settings (full-replace semantics). Payload shape matches the example above.

Notes:

  • Settings are validated and written atomically. If a corrupt file is detected, the original is backed up to settings.json.bak and reset.
  • Changes take effect for new or reinitialized sessions.