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

@alfe.ai/integrations

v0.0.2

Published

Integration lifecycle management for Alfe — registry, resolution, installation, and state

Downloads

252

Readme

@alfe.ai/integrations

Integration lifecycle management for Alfe — registry, resolution, installation, state, and hook execution.

What It Does

Provides the complete integration lifecycle:

  • Registry — fetches the integration index from GET /integrations/registry on the integrations service, with search and lookup
  • Resolver — maps an integration name + optional version to a git clone target (repo URL, tag, or pinned commit SHA)
  • Installer — git clones integration repos to ~/.alfe/integrations/{name}/, with install/update/remove/list operations
  • IntegrationManager — full lifecycle orchestration: install → configure → activate → deactivate → uninstall
  • StateManager — persistent state at ~/.alfe/integrations.json with in-memory secret storage
  • Hooks — runs integration lifecycle scripts (pre_install, post_install, health_check, etc.) as child processes with env var injection
  • AdapterIntegrationManagerAdapter bridges IntegrationManager to the IIntegrationManager interface used by the gateway's ReconciliationEngine

Used by packages/gateway (daemon owns integration lifecycle directly) and packages/cli for the integration commands.

Key Files

src/
├── index.ts                    # Public re-exports
├── registry.ts                 # Registry client (fetches from integrations service API)
├── resolver.ts                 # Version resolution (name + version → git target)
├── installer.ts                # Git clone/update/remove to ~/.alfe/integrations/
├── integration-manager.ts      # Full lifecycle manager (install/configure/activate/health/uninstall)
├── state.ts                    # State file manager (~/.alfe/integrations.json)
├── hooks.ts                    # Hook script runner with env var injection
├── adapter.ts                  # IIntegrationManager adapter for ReconciliationEngine
├── types.ts                    # Integration command param types
├── resolver.test.ts            # Registry + resolver tests
├── installer.test.ts           # Installer tests
├── integration-manager.test.ts # Lifecycle tests
└── state.test.ts               # State manager tests

Usage

import {
  Registry, Resolver, Installer,
  IntegrationManager,
  IntegrationManagerAdapter,
} from '@alfe.ai/integrations';

// ── Registry + Resolution ──────────────────────────────────
const registry = new Registry();
const results = await registry.search('discord');

const resolver = new Resolver(registry);
const resolved = await resolver.resolve('discord', '1.0.0');

const installer = new Installer();
const installPath = await installer.install(resolved);

// ── Lifecycle Management ───────────────────────────────────
const manager = new IntegrationManager({
  logger,
  skillsDir: '~/.alfe/skills/',  // default
});

await manager.install({ name: 'discord', version: '1.0.0' });
await manager.configure({ name: 'discord', config: { guild_id: '123' } });
await manager.activate('discord');
await manager.health({ name: 'discord' });

// ── Gateway Adapter ────────────────────────────────────────
// Bridges IntegrationManager to ReconciliationEngine's interface
const adapter = new IntegrationManagerAdapter(manager);
cloudClient.setIntegrationManager(adapter);

Configuration

The Registry class resolves the API URL in this order:

  1. Explicit apiUrl constructor argument
  2. ALFE_API_URL environment variable
  3. https://api.alfe.ai (production default)

The IntegrationManager accepts an options object:

interface IntegrationManagerOptions {
  logger?: Logger;
  statePath?: string;       // default: ~/.alfe/integrations.json
  integrationsDir?: string;  // default: ~/.alfe/integrations/
  skillsDir?: string;        // default: ~/.alfe/skills/
}

Development

pnpm install
pnpm --filter @alfe.ai/integrations build
pnpm --filter @alfe.ai/integrations test

Dependencies

  • @alfe.ai/integration-manifest — manifest parsing, config validation, state types