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

@contextsdk/adapter-modal

v0.4.0

Published

Modal Sandbox and Volume runtime adapter for contextSDK

Readme

@contextsdk/adapter-modal

Modal Sandbox and Volume runtime adapter for contextSDK.

Use this when you want a Modal sandbox with a context directory backed by a Modal Volume, while still exporting the encrypted portable context bundle to your storage backend so the context can move to another provider.

@contextsdk/core is a peer dependency (npm 7+ installs it automatically):

npm install @contextsdk/core @contextsdk/adapter-modal
import { runWithContext } from "@contextsdk/core";
import { ModalProvisioner } from "@contextsdk/adapter-modal";

await runWithContext({
  id: "agent-context",
  storage,
  encryption,
  provisioner: new ModalProvisioner({
    volumeName: "contextsdk-contexts",
  }),
  createIfMissing: true,
}, async session => {
  await session.files.write("workspace/result.txt", "ok\n");
});

Credentials

The Modal client reads ~/.modal.toml (created by modal token new) or the MODAL_TOKEN_ID + MODAL_TOKEN_SECRET environment variables.

Runtime behavior

  • The context directory is backed by a Modal Volume mounted at /contextsdk (override with volumeMountPath), one subdirectory per context. The volume accelerates re-attach; the encrypted tree bundle remains the portable source of truth and is still exported on save.
  • Sandboxes default to a 60-minute lifetime (timeoutMs), since Modal otherwise terminates them 5 minutes after creation. Modal's JS SDK has no extend-at-runtime API, so size timeoutMs to the workload up front (Modal caps it at 24 hours). Pass idleTimeoutMs to terminate the sandbox after a period of exec inactivity, independent of timeoutMs.
  • dispose() only terminates sandboxes the adapter created. A sandbox you supply via sandbox or reattach to via sandboxId belongs to your lifecycle and is left running.

Full docs: https://github.com/robzilla1738/ContextSDK