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

@tenkicloud/composio-tools

v0.1.0

Published

Tenki sandbox tools for Composio agents — boot disposable Linux microVMs, run commands, snapshot, and terminate them through Composio custom toolkits.

Readme

@tenkicloud/composio-tools

Tenki sandbox tools for Composio agents. Gives any Composio agent disposable Linux microVMs from Tenki — boot in ~2–4 seconds, run shell commands, snapshot state, and terminate — via Composio's custom toolkits.

The tools run in-process in your app and call the Tenki SDK directly. No extra backend, no Composio approval needed.

Install

npm install @tenkicloud/composio-tools @composio/core

@composio/core is a peer dependency (>= 0.13.0). Requires Node >= 18.

Quickstart

import { Composio } from '@composio/core';
import { tenkiToolkit } from '@tenkicloud/composio-tools';

const composio = new Composio({ apiKey: process.env.COMPOSIO_API_KEY });

const session = await composio.create('user_1', {
  experimental: { customToolkits: [tenkiToolkit()] },
});

// The agent can now call:
//   LOCAL_TENKI_CREATE_SANDBOX
//   LOCAL_TENKI_EXEC_COMMAND
//   LOCAL_TENKI_LIST_SANDBOXES
//   LOCAL_TENKI_GET_SANDBOX
//   LOCAL_TENKI_CREATE_SNAPSHOT
//   LOCAL_TENKI_TERMINATE_SANDBOX

Note: toolkits bind via experimental.customToolkits (standalone tools use experimental.customTools).

Authentication: set TENKI_API_KEY in your environment (get one at app.tenki.cloud), or pass authToken explicitly. The workspace/project for new sandboxes is resolved automatically from the key's identity; override with TENKI_WORKSPACE_ID / TENKI_PROJECT_ID env vars or factory options.

Configuration

tenkiToolkit({
  authToken: 'tk_…',            // default: TENKI_API_KEY env var
  workspaceId: '…',             // default: TENKI_WORKSPACE_ID env var, else first visible workspace
  projectId: '…',               // default: TENKI_PROJECT_ID env var, else first project in workspace
  preload: true,                // expose tools in session.tools() without searching first
  bootTimeoutMs: 120_000,       // creation + readiness budget; failed boots are terminated, not leaked
  defaults: {                   // applied to CREATE_SANDBOX when the agent omits them
    cpuCores: 4,
    memoryMb: 8192,
    allowOutbound: true,
    maxDurationMs: 30 * 60_000, // hard backstop: VM self-terminates even if the host crashes
  },
});

Tools

| Tool | Input | Returns | |------|-------|---------| | LOCAL_TENKI_CREATE_SANDBOX | name?, cpuCores?, memoryMb?, allowOutbound?, image?, snapshotId?, env? (array of {name, value}), maxDurationMinutes? (default 30) | sessionId, specs, state, bootTimeMs | | LOCAL_TENKI_EXEC_COMMAND | sessionId, command, timeoutSeconds? (default 30, max 600) | exitCode, stdout, stderr, durationMs (output truncated ~12KB/4KB for LLM context) | | LOCAL_TENKI_LIST_SANDBOXES | state? (filter) | count, sandboxes[] with id/name/state/specs | | LOCAL_TENKI_GET_SANDBOX | sessionId | full detail incl. state, networking, expiry | | LOCAL_TENKI_CREATE_SNAPSHOT | sessionId, name? | snapshotId (usable in CREATE_SANDBOX.snapshotId) | | LOCAL_TENKI_TERMINATE_SANDBOX | sessionId | idempotent; alreadyTerminated flag |

Behavior notes: every tool returns structured JSON and never throws — SDK errors come back as { success: false, error: { type, message } } so the agent can react. EXEC_COMMAND requires an existing sessionId (no implicit sandbox creation). Outbound internet is controlled by allowOutbound; when omitted, your Tenki workspace defaults apply — check outboundNetworking in the CREATE_SANDBOX response.

Lifecycle guarantees: CREATE_SANDBOX is failure-atomic — the session handle is held before waiting for readiness, so a boot that fails or exceeds bootTimeoutMs is terminated, never leaked. Every sandbox gets a max-duration backstop (default 30 min, override via maxDurationMinutes or defaults.maxDurationMs) so microVMs self-terminate even if the host process crashes before calling TERMINATE_SANDBOX. Readiness is detected by polling unary refresh() rather than the streaming waitReady() RPC, which some runtimes (e.g. Bun's node:http2) close prematurely.

Security

  • TENKI_API_KEY grants control over your Tenki workspace — keep it in the host environment, never inside sandboxes.
  • Tools run in-process in your application (the host you run the Composio session from), not on Composio's servers.
  • The agent decides what commands to run; the sandbox is your isolation boundary. Set allowOutbound: false explicitly (per call or via defaults) if your workspace default is open and the task doesn't need network.

How it works

Custom tools are session-scoped: tenkiToolkit() returns a CustomToolkit whose execute functions run in your process and call the Tenki SDK. Composio prefixes the slugs (CREATE_SANDBOXLOCAL_TENKI_CREATE_SANDBOX) and routes agent tool calls back to your process via session.execute(). Because execution is session-bound, drive these tools through the session object — provider.handleToolCalls() (global execute path) cannot reach them; see scripts/agent-test.ts for a working agentic loop.

Development

pnpm install
pnpm test          # vitest unit tests (Tenki SDK mocked — no network, no keys needed)
pnpm build         # tsup → dist/ (ESM + CJS + d.ts)
pnpm typecheck
pnpm format:check

Live verification (needs a .env with real keys — see the script headers):

pnpm smoke   # drives all six tools through a real Composio session: create → exec → snapshot → terminate
pnpm agent   # Claude autonomously boots, inspects, and terminates a sandbox (needs ANTHROPIC_API_KEY)

Both scripts terminate every microVM they create (even on failure) and smoke deletes its test snapshot.

License

MIT