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

@ddse/acm-adapters

v0.5.2

Published

Framework adapters for ACM (LangGraph, Microsoft Agent Framework)

Readme

@ddse/acm-adapters

Framework adapters for ACM, providing integration with LangGraph and Microsoft Agent Framework.

Overview

This package provides adapters that allow ACM plans to be executed using popular agent frameworks. The adapters handle the conversion of ACM tasks, guards, and edges into framework-specific constructs while preserving ACM's policy, verification, and streaming capabilities.

Features

  • LangGraph Adapter: Convert ACM plans into LangGraph state graphs
  • MS Agent Framework Adapter: Execute ACM plans as MS Agent activities
  • Full support for ACM policy hooks and verification
  • Streaming progress updates
  • Memory ledger integration

Installation

pnpm add @ddse/acm-adapters

For LangGraph support, also install:

pnpm add @langchain/langgraph

Usage

LangGraph Adapter

import { asLangGraph } from '@ddse/acm-adapters';
import { executePlan } from '@ddse/acm-runtime';

// Create adapter
const adapter = asLangGraph({
  goal,
  context,
  plan,
  capabilityRegistry,
  toolRegistry,
  policy,
  stream,
  ledger,
});

// Get graph structure for use with LangGraph
const { nodes, edges, entryPoint } = adapter.buildGraph();

// Or execute directly (simplified execution)
const result = await adapter.execute();

Microsoft Agent Framework Adapter

import { wrapAgentNodes } from '@ddse/acm-adapters';

// Create adapter
const adapter = wrapAgentNodes({
  goal,
  context,
  plan,
  capabilityRegistry,
  toolRegistry,
  policy,
  stream,
  ledger,
});

// Get activities for MS Agent Framework
const activities = adapter.getAllActivities();

// Or execute directly
const result = await adapter.execute();

Full Example with CLI

import { asLangGraph, wrapAgentNodes } from '@ddse/acm-adapters';

// ... setup goal, context, plan, registries ...

let result;

if (engine === 'langgraph') {
  const adapter = asLangGraph({
    goal,
    context,
    plan,
    capabilityRegistry,
    toolRegistry,
    policy,
    stream,
    ledger,
  });
  result = await adapter.execute();
} else if (engine === 'msaf') {
  const adapter = wrapAgentNodes({
    goal,
    context,
    plan,
    capabilityRegistry,
    toolRegistry,
    policy,
    stream,
    ledger,
  });
  result = await adapter.execute();
} else {
  // Use standard ACM runtime
  result = await executePlan({
    goal,
    context,
    plan,
    capabilityRegistry,
    toolRegistry,
    policy,
    stream,
    ledger,
  });
}

Features by Adapter

LangGraph Adapter

The LangGraph adapter converts ACM plans into LangGraph state graphs:

  • Nodes: Each ACM task becomes a LangGraph node
  • Edges: ACM edges with guards become conditional edges
  • State: Graph state includes task outputs and context
  • Execution: Supports LangGraph's execution engine

Key Methods:

  • buildGraph(): Get nodes, edges, and entry point
  • execute(): Run simplified execution

MS Agent Framework Adapter

The MS Agent Framework adapter wraps ACM tasks as activities:

  • Activities: Each ACM task becomes an activity handler
  • Workflow: Respects task dependencies via topological sort
  • Hooks: Full policy and verification support
  • Events: Streaming events for progress tracking

Key Methods:

  • getActivity(taskId): Get activity handler for a task
  • getAllActivities(): Get all activity handlers
  • execute(): Run workflow execution

Policy and Verification

Both adapters fully support ACM's policy and verification features:

// Policy checks happen before task execution
const policy = {
  async evaluate({ action, input, context }) {
    // Return true to allow, false to deny
    return input.riskLevel !== 'HIGH';
  },
};

// Verification happens after task execution
class MyTask extends Task {
  verification() {
    return ['output.result !== null', 'output.status === "success"'];
  }
}

Streaming

Both adapters emit progress events that can be consumed:

const stream = new DefaultStreamSink();
stream.attach('task', (update) => {
  console.log(`Task ${update.taskId}: ${update.status}`);
});

// Use with adapter
const adapter = asLangGraph({
  // ...
  stream,
});

API Reference

LangGraphAdapter

Constructor:

new LangGraphAdapter(options: LangGraphAdapterOptions)

Methods:

  • buildGraph(): Returns { nodes, edges, entryPoint }
  • execute(): Returns { outputs, ledger }

MSAgentFrameworkAdapter

Constructor:

new MSAgentFrameworkAdapter(options: MSAgentFrameworkAdapterOptions)

Methods:

  • getActivity(taskId: string): Get activity handler
  • getAllActivities(): Get all activities as Map
  • execute(): Returns { outputs, ledger }

Notes

  • The adapters provide simplified execution modes suitable for ACM use cases
  • For advanced LangGraph features (checkpointing, parallel execution), use the graph structure directly
  • MS Agent Framework adapter uses topological sorting for task ordering
  • Both adapters respect guard expressions for conditional branching

License

Apache-2.0