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

@aprovan/runtime

v0.1.0

Published

Shared UTDK sandbox runtime: namespace proxies, gateway transport, execution policy, and browser sandbox for scripts and widgets

Downloads

296

Readme

@aprovan/runtime

The shared UTDK sandbox runtime. This package is the single answer to "how does sandboxed code call 3rd-party providers" across Aprovan surfaces, and the formal boundary between the two products:

  • registry owns the execution plane — UTDK provider SDKs, the gateway (credentials, authorization, telemetry), the server-side isolate (@utdk/isolate), and this runtime.
  • patchwork owns the UI plane — generative widgets, the editor, and the compiler. It consumes this runtime for every service call its widgets make.

What it does

Given a dependency manifest (declared, or derived from a script's imports), the runtime produces namespace proxies whose calls flow through a transport:

import {
  createGatewayTransport,
  createRuntimeGlobals,
  instrument,
  parseScriptDependencies,
  withPolicy,
} from "@aprovan/runtime";

const { dependencies, body } = parseScriptDependencies(source);

const transport = instrument(
  withPolicy(
    createGatewayTransport({ baseUrl, getToken, getWorkspaceId }),
    {
      retry: { attempts: 3 },
      providers: { slack: { rateLimit: { rps: 1 } } },
    },
  ),
  (event) => renderLiveView(event), // call spans, retries, logs
);

const globals = createRuntimeGlobals(dependencies, transport);
await (globals.github as any).users.getByUsername({ username: "octocat" });

Layers (composable, each optional):

| Layer | Module | Purpose | | --- | --- | --- | | Proxies | proxy.ts | github.repos.list(args)transport.call("github", "repos.list", args) with zero generated code. Root bindings are callable (ffprobe(args)default operation). | | Imports | imports.ts | import s3 from "aws/s3"{ provider: "aws", path: "s3" }; strips imports so the body can run where bindings are injected. | | Policy | policy.ts | Retries (exponential backoff + jitter, honors Retry-After), per-provider token-bucket rate limits, timeouts. Global / per-provider / per-call resolution. | | Transport | transport.ts | createGatewayTransportPOST /tools/:provider/:operation; credentials are resolved server-side in the gateway and never reach the sandbox. instrument emits the RuntimeEvent feed. | | Browser sandbox | sandbox.ts | runScriptInSandbox runs a script in a sandboxed iframe; the only exit is the service-call/service-result postMessage protocol (the same one patchwork widget iframes speak). | | Pagination | paginate.ts | for await (const item of paginate(github.repos.list, { page: 1 })) with cursor/page heuristics, overridable per provider. |

Sandbox story, in one place

The same script can run in three places with the same semantics:

  1. Browser (registry playground, patchwork widgets) — sandboxed iframe; calls cross to the parent, then to the gateway.
  2. Gateway (server)@utdk/isolate vm sandbox; credentials injected host-side per call.
  3. Any host — bring your own Transport.

In every case, credentials live only in the gateway's credential store; the sandboxed code sees namespaces, never secrets.

Patchwork adoption (gated on publishing this package)

Patchwork consumes published @aprovan/* packages. Once this package is published:

  1. @aprovan/patchwork-compiler deletes createFieldAccessProxy, generateNamespaceGlobals, and createHttpProxy from src/mount/bridge.ts and re-exports createNamespaceProxy / createRuntimeGlobals / createGatewayTransport from @aprovan/runtime. The iframe bridge script already speaks the same message protocol, so generateIframeBridgeScript can be replaced by the sandbox bootstrap here.
  2. Widget manifests' services: string[] map to RuntimeDependency[] (provider = first segment); manifest.policy becomes available to widgets for free.
  3. Patchwork's live "services inspector" can subscribe to the RuntimeEvent feed instead of its own ad-hoc logging.