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

@mcoda/agent-setup

v0.1.85

Published

Turnkey mcoda/mswarm agent setup SDK for applications.

Downloads

1,078

Readme

@mcoda/agent-setup

Turnkey mcoda/mswarm agent setup SDK for applications.

The package provides:

  • headless catalog and assignment utilities
  • a typed HTTP client
  • framework-agnostic server service helpers
  • a default programmatic mcoda runtime adapter
  • an optional React setup page
  • a trusted backend GPU/generic job client for owner-local mswarm nodes

The default server runtime uses mcoda package APIs directly and does not require a preinstalled or configured mcoda CLI/client tool. When an admin submits a real mswarm API key through configureMswarmApiKey(), subsequent cloud and self-hosted catalog reads use the real mswarm API via MswarmApi. Self-hosted catalog reads include mswarm load-balanced aliases by default in the setup SDK, and those aliases are exposed as Auto load-balanced server options with managedKind: "self_hosted_load_balanced". The synced local agent config keeps only gateway/group metadata and never needs self-hosted node tokens or invocation signing secrets in browser-visible state. Self-hosted entries also expose lifecycle diagnostics through healthReason and selfHostedLifecycle, including relay gateway URL, lifecycle route templates, runtime package version, and missing-route protocol mismatch details.

Self-Hosted Routing Modes

The setup SDK presents two self-hosted routing modes side by side:

  • Direct self-hosted entries keep a fixed server/node target and use managedKind: "self_hosted" with routingMode: "direct".
  • Auto load-balanced entries are synthetic mswarm aliases and use managedKind: "self_hosted_load_balanced" with routingMode: "auto".

Existing saved assignments are not rewritten when auto aliases appear. For a safe migration, let an admin choose the Auto load-balanced option only after the control plane preview shows an eligible upgraded node group. For rollback, save a direct self-hosted slug again or hide auto aliases in the backend catalog sync; direct server entries remain usable.

If the gateway/node lifecycle protocol is incompatible, catalog entries surface healthStatus: "degraded", healthReason: "self_hosted_protocol_mismatch", and selfHostedLifecycle.missingRoute rather than showing the agent as healthy. Host apps should display that reason and avoid selecting degraded self-hosted entries automatically.

For user-scoped mswarm integrations, configureMswarmApiKey() can receive non-secret connection metadata such as tenant ID, product slug, owner user ID, feature key, and installation ID. The default runtime validates tenant, product, and API-key identity against mswarm runtime usage limits when available, then exposes the stored metadata as snapshot.mswarmConnection.

React consumers can use the packaged default stylesheet:

import { McodaAgentSetupPage } from "@mcoda/agent-setup/react";
import "@mcoda/agent-setup/react/styles.css";

Host applications can pass gpuJobOps and GPU job callbacks into McodaAgentSetupPage to show an owner-local queue/usage/audit panel beside the agent setup flow. Keep those callbacks backed by trusted backend routes; do not send self-hosted node signing secrets to browser code.

Trusted backend code can use the GPU job client directly:

import { createMcodaGpuJobClient } from "@mcoda/agent-setup";

const gpuJobs = await createMcodaGpuJobClient({
  nodeBaseUrl: process.env.MCODA_MSWARM_NODE_BASE_URL,
  nodeId: process.env.MCODA_MSWARM_NODE_ID,
  signingSecret: process.env.MCODA_MSWARM_NODE_SIGNING_SECRET,
});

const capabilities = await gpuJobs.listGpus();
const ops = await gpuJobs.ops({ auditLimit: 25 });