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

@contractspec/integration.workflow-devkit

v0.1.3

Published

Workflow DevKit compiler and runtime bridges for ContractSpec workflows

Downloads

1,651

Readme

@contractspec/integration.workflow-devkit

Workflow DevKit compiler and runtime bridges for ContractSpec WorkflowSpec.

What it provides

  • Compile a WorkflowSpec into a deterministic Workflow DevKit manifest.
  • Generate Workflow, Next.js, and generic-host scaffolding.
  • Run a WorkflowSpec through injected Workflow DevKit primitives such as sleep, hooks, and webhooks.
  • Create a Workflow-backed AgentRuntimeAdapterBundle for @contractspec/lib.ai-agent.
  • Expose chat route helpers and re-export WorkflowChatTransport for reconnectable chat UIs.

Entry points

  • @contractspec/integration.workflow-devkit
  • @contractspec/integration.workflow-devkit/compiler
  • @contractspec/integration.workflow-devkit/runtime
  • @contractspec/integration.workflow-devkit/chat-routes
  • @contractspec/integration.workflow-devkit/agent-adapter
  • @contractspec/integration.workflow-devkit/next

Workflow vs step boundary

Workflow DevKit code runs across two different execution contexts:

  • Workflow functions ("use workflow") orchestrate control flow and must stay deterministic.
  • Step functions ("use step") perform the actual Node.js work.

This matches the Workflow docs: workflow functions do not have full Node.js access, while step functions do. Keep Node.js core modules, SDK clients, database access, and other side effects inside use step helpers. The workflow function itself should only compose Workflow primitives and call step helpers.

For WorkflowSpec authoring in Workflow-hosted apps, import the safe authoring API from @contractspec/lib.contracts-spec/workflow/spec, not the broad @contractspec/lib.contracts-spec/workflow barrel.

Next.js example

import { withContractSpecWorkflow } from "@contractspec/integration.workflow-devkit/next";
import { createWorkflowChatRoutes } from "@contractspec/module.ai-chat/core/workflow";

export default withContractSpecWorkflow({
  experimental: {},
});

const routes = createWorkflowChatRoutes({
  workflow: async (payload) => payload,
  getFollowUpToken({ runId }) {
    return `chat:${runId}`;
  },
});

export const POST = routes.start;

Generic host example

import { createHook, createWebhook, sleep } from "workflow";
import {
  runWorkflowSpecWithWorkflowDevkit,
  type WorkflowDevkitRuntimeBridge,
} from "@contractspec/integration.workflow-devkit";
import { onboardingWorkflow } from "./onboarding.workflow";

export async function runOnboarding(input: Record<string, unknown>, bridge: WorkflowDevkitRuntimeBridge) {
  "use workflow";

  // Keep this function deterministic. Node.js work belongs in `use step`
  // helpers that your bridge dispatches to.
  return runWorkflowSpecWithWorkflowDevkit({
    spec: onboardingWorkflow,
    initialData: input,
    bridge,
    primitives: {
      sleep,
      createHook,
      createWebhook,
    },
  });
}