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

@lythos/agent-adapter

v0.14.5

Published

Plugin architecture for agent backends. One interface, multiple implementations.

Readme

@lythos/agent-adapter

Plugin architecture for agent backends. One interface, multiple implementations.

This package is the INTERFACE + REGISTRY + lightweight CLI adapters only. Heavy adapters (daemon lifecycle, SSE parsing, PID management) live in independent packages:

| Package | Player | Mechanism | Weight | |---------|--------|-----------|--------| | @lythos/agent-adapter | kimi | kimi --print | Light — pure CLI spawn | | @lythos/agent-adapter | ~~claude~~ | ~~claude -p~~ | Deprecated — deferred tool deadlock | | @lythos/agent-adapter-claude-sdk | claude | Anthropic Agent SDK | Heavy — SDK dep | | @lythos/agent-adapter-deepseek-serve | deepseek | deepseek serve --http thread API | Heavy — daemon, SSE, PID lock |

Rule: if your adapter starts a long-running process, allocates ports, or parses SSE — create a new package. Keep this one thin.

Install

bun add @lythos/agent-adapter

Usage

import { useAgent } from '@lythos/agent-adapter'
import '@lythos/agent-adapter'                  // lightweight adapters (kimi, claude-cli)
import '@lythos/agent-adapter-claude-sdk'       // heavy: claude-sdk
import '@lythos/agent-adapter-deepseek-serve'   // heavy: deepseek serve

const agent = useAgent('deepseek')
const result = await agent.spawn({ cwd: '/tmp', brief: '...', timeoutMs: 60000 })

Custom Adapter

import { registerAgent, type AgentAdapter } from '@lythos/agent-adapter'

const myAdapter: AgentAdapter = {
  name: 'my-agent',
  async spawn(opts) { /* ... */ return { stdout, stderr, code: 0, durationMs, checkpoints: [] } },
}
registerAgent('my-agent', myAdapter)

Authentication & Runtime Setup

"agent-run isn't 'install CLI and it works' — every player needs platform-specific authentication that the adapter does NOT bundle." — OpenClaw test report, 2026-05-08

Each backend has its own credential model. The adapter package only provides the integration glue; you must independently configure the upstream platform's auth.

| Player | Adapter package | Required credential | Setup | |---|---|---|---| | kimi | @lythos/agent-adapter (built-in) | Moonshot login (NOT npm kimi-cli) | uv tool install kimi-cli then kimi login (one-time, persists in ~/.config/kimi) | | claude | @lythos/agent-adapter-claude-sdk | ANTHROPIC_API_KEY | export ANTHROPIC_API_KEY=sk-ant-... in your shell | | claude-cli (deprecated) | @lythos/agent-adapter (built-in) | claude CLI session | n/a — deprecated due to deferred-tool deadlock | | deepseek | @lythos/agent-adapter-deepseek-serve | DeepSeek API key | export DEEPSEEK_API_KEY=sk-... or deepseek auth | | cursor, gemini | (built-in pass-through to useAgent) | Platform-specific | Run that platform's own auth flow first |

Runtime gotchas (learned from OpenClaw integration testing)

These are not bugs — they are inherent to how Bun + npm + workspaces interact with optional adapters. Worth knowing before you debug.

  1. bunx ephemeral env does NOT read workspace node_modules. If you bunx @lythos/skill-arena agent-run --player deepseek and get "adapter not found", it's because bunx pulled a fresh copy that doesn't include the optional @lythos/agent-adapter-deepseek-serve peer. Solutions:
    • Run the local source directly: bun packages/lythoskill-arena/src/cli.ts agent-run ...
    • Or install adapters globally: bun add -g @lythos/agent-adapter-deepseek-serve
  2. Bun.spawn doesn't inherit registry state. If you spawn a child process expecting it to find adapters registered in the parent, it won't — the child has a fresh module graph. The adapter must be import-ed at the top of the spawned script, not registered via side-channel.
  3. Optional adapter imports are conditional — arena's CLI does:
    try { await import('@lythos/agent-adapter-claude-sdk') } catch { /* package not installed */ }
    try { await import('@lythos/agent-adapter-deepseek-serve') } catch { /* package not installed */ }
    This means a missing package is silent at startup; failures show up later as useAgent('claude') returning the built-in fallback (or throwing). Install the heavy adapter package explicitly before running with that player.
  4. Heavy adapter cold start: @lythos/agent-adapter-deepseek-serve starts a deepseek serve --http daemon and waits for health-check. First run takes a few seconds; subsequent runs reuse the running daemon via PID lockfile in ~/.agents/lythoskill/deepseek-serve.json.
  5. kimi (built-in) ≠ kimi-cli on npm. The kimi player invokes Moonshot's official kimi binary installed via uv tool install kimi-cli. The npm package kimi-cli is unrelated and is NOT what this adapter uses.

Quick auth check

Before running agent-run, verify your chosen player can authenticate:

# claude — verify ANTHROPIC_API_KEY is set
echo "${ANTHROPIC_API_KEY:?ANTHROPIC_API_KEY not set}" | head -c 10

# deepseek — verify DEEPSEEK_API_KEY or local auth
echo "${DEEPSEEK_API_KEY:?DEEPSEEK_API_KEY not set}" | head -c 10
# or: deepseek auth status

# kimi — verify Moonshot login persisted
kimi --version && ls ~/.config/kimi/

If any of these fail, fix auth first — agent-run will not surface a clear error message; you'll just get a generic adapter failure at run time.

API

| Export | Description | |--------|------------| | useAgent(name) | Look up registered adapter | | registerAgent(name, adapter) | Register adapter (idempotent) | | listAgents() | List all registered names | | readCheckpoints(cwd) | Read JSONL from _checkpoints/ |

License

MIT