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

@slop-lab/dim-core

v0.8.0

Published

Project, managed Git, and persistent workspace lifecycle APIs for DIM

Readme

@slop-lab/dim-core

Core TypeScript APIs behind the dim command-line interface. This package implements:

  • Project and project-scoped repository state;
  • managed Gitea reconciliation and clone URLs;
  • provider-neutral Project CI runner lifecycle with an initial managed-Gitea coordinator adapter and isolated container executor;
  • persistent workspace create/start/restart/update/discard lifecycle;
  • Sysbox, gVisor, rootless Podman, and runc runtime plans;
  • host-readiness checks;
  • plugin manifest loading and version validation.

Most users should install @slop-lab/dim-cli instead. The core package is for embedding DIM lifecycle operations in TypeScript tools or contributing to DIM itself.

Installation

Pin the same reviewed release used by the CLI:

npm install --save-exact "@slop-lab/[email protected]"

The package is ESM-only, supports Node.js 24 and 26, and includes TypeScript declarations. It supports Linux hosts only.

Basic use

import {
  ProcessRunner,
  createProject,
  importProjectRepository,
  createWorkspace,
  lifecycleOptions
} from "@slop-lab/dim-core";

const runner = new ProcessRunner();
const options = lifecycleOptions(process.env);

await createProject(runner, options, "acme");
await importProjectRepository(runner, options, {
  project: "acme",
  alias: "root",
  source: "/path/to/acme",
  root: true,
  rootRef: "main",
  protectedPatterns: ["main", "development"]
});
await createWorkspace(runner, options, {
  project: "acme",
  name: "feature-123",
  runtimeBackend: "sysbox",
  profiles: [],
  cpuCount: "4",
  memory: "8g",
  pidsLimit: "4096"
});

Lifecycle methods reconcile Docker containers, volumes, networks, and a local managed Gitea service. They are not pure data helpers. Callers must provide a usable host environment and surface UserError messages to users without discarding the underlying operation result.

importProjectRepository is a low-level mirror import and copies every source ref. Applications that want the CLI's branches-and-tags-only default should use the prepare/transfer/complete API and perform that explicit Git transfer with host credentials.

Configuration

lifecycleOptions() reads the same environment used by the CLI:

  • DIM_STATE_ROOT
  • DIM_GITEA_IMAGE, DIM_GITEA_PORT, and DIM_GITEA_ADMIN_USERNAME
  • DIM_GIT_USERNAME
  • the installed workspaceBackend, DIM_WORKSPACE_IMAGE, and DIM_WORKSPACE_RUNTIME
  • DIM_WORKSPACE_CPUS, DIM_WORKSPACE_MEMORY, and DIM_WORKSPACE_PIDS
  • DIM_CI_RUNNER_IMAGE, DIM_CI_RUNNER_RUNTIME, DIM_CI_RUNNER_CPUS, DIM_CI_RUNNER_MEMORY, and DIM_CI_RUNNER_PIDS

The resource environment variables provide defaults. createWorkspace accepts persistent per-workspace overrides. A Project root ref may be omitted; workspace creation then resolves the root repository's symbolic HEAD and fails if no HEAD exists.

The default state root is ~/.local/state/dim; the default managed Gitea port is 3300. DIM does not migrate incompatible pre-stable state.

API scope

The package exports its core modules from the root entry point, including lifecycle records and low-level managed-Gitea helpers. APIs are versioned with DIM but are not promised to remain source-compatible across minor 0.x releases. Prefer high-level functions from projectRegistry, workspaceLifecycle, and ciRunner over direct state or Gitea mutation.

The plugin loader validates explicitly installed plugins and gives each controller an instance-scoped plugin route registry. GET /api discovers those authenticated routes. Core does not define product-specific external URL routes or a generic repository-provider extension point.

DIM executes Project-controlled lifecycle scripts and manages container runtimes. Consumers must follow the mandatory adoption and trust requirements, including full human review and exact version pinning.

See the architecture, lifecycle documentation, and source repository.