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

@hitl-kit/langgraph

v0.6.0

Published

LangGraph adapter for HITL Kit. Emit schema-conformant HITL events from LangGraph interrupt() nodes and resume with typed Command payloads.

Downloads

363

Readme

@hitl-kit/langgraph

LangGraph adapter for HITL Kit. Emit schema-conformant HITL events from LangGraph interrupt() nodes and resume with typed Command payloads.

pnpm add @hitl-kit/core @hitl-kit/langgraph @langchain/langgraph

@langchain/langgraph is a peer dependency; the version you install is up to you.


Why LangGraph first

LangGraph is the only mainstream TS agent framework with a native interrupt() / Command({ resume }) primitive explicitly designed for human checkpoints. That primitive maps 1:1 to the Assist-Not-Complete thesis: pause the graph, wait for structured human input, resume.

The adapter is a thin translation layer:

  • Emit side: helpers like createHitlCardInterrupt({...}) produce a validated HitlInterruptPayload that wraps a Zod-checked HitlEvent from @hitl-kit/core. You pass the payload directly into interrupt().
  • Receive side: isHitlInterrupt(value) is a type guard you use in your UI layer to route to <HitlEventRenderer /> from @hitl-kit/react.

Because the event field is the exact shape <HitlEventRenderer /> expects, no manual mapping is needed.


Usage

Emit a HITL interrupt inside a graph node

import { StateGraph } from "@langchain/langgraph";
import { interrupt } from "@langchain/langgraph";
import { createHitlCardInterrupt } from "@hitl-kit/langgraph";

const graph = new StateGraph(State)
  .addNode("review-citation", async (state) => {
    const approval = interrupt(
      createHitlCardInterrupt({
        variant: "review",
        title: "Citation needs verification",
        subtitle: "IPCC 2023 · p. 12",
        steps: [
          { label: "Flagged by agent", done: true },
          { label: "Confirm", done: false },
        ],
        runLabel: "Confirm & continue",
      }),
    );
    // Graph pauses here.
    // When the UI sends `Command({ resume: { approved: true } })`,
    // `approval` becomes `{ approved: true }` and execution continues.
    return { ...state, approved: approval.approved };
  });

Render the interrupt on the client

import { HitlEventRenderer } from "@hitl-kit/react";
import { isHitlInterrupt } from "@hitl-kit/langgraph";
import { HitlCard } from "@/components/hitl/HitlCard";

function AgentRunner({ interruptValue, onResume }) {
  if (!isHitlInterrupt(interruptValue)) return null;

  return (
    <HitlEventRenderer
      event={interruptValue.event}
      registry={{
        "hitl.card": (ev) => (
          <HitlCard
            config={{
              id: ev.id ?? "default",
              kind: ev.variant,
              title: ev.title,
              subtitle: ev.subtitle,
              steps: ev.steps,
              runLabel: ev.runLabel,
              editPlaceholder: ev.editPlaceholder,
              openTab: "human",
            }}
          />
        ),
      }}
      onAction={(action) => onResume(action)}
    />
  );
}

Resume the graph

On user approval, POST a resume command back to your graph runner:

await graph.invoke(
  new Command({ resume: { approved: true } }),
  { configurable: { thread_id: threadId } },
);

Helpers (one per primitive)

Every HITL Kit primitive has a matching interrupt helper:

| Helper | Event kind | |---|---| | createHitlCardInterrupt | hitl.card | | createSubagentStatusInterrupt | subagent.status | | createMiniTraceInterrupt | trace.mini | | createAiGenerationScaleInterrupt | scale.ai_generation | | createContextChipsInterrupt | chips.context | | createQAFlowInterrupt | qa.flow | | createWritingAgentInterrupt | agent.writing | | createResearchAgentInterrupt | agent.research | | createBatchQueueInterrupt | batch.queue | | createSearchResultInterrupt | result.search | | createApproveRejectInterrupt | approval.binary | | createDiffResultInterrupt (v0.6a) | result.diff | | createCitationResultInterrupt (v0.6a) | result.citation | | createEditablePlanInterrupt (v0.6a) | plan.editable | | createToolCallPreviewInterrupt (v0.6a) | tool.call |

Each helper validates the payload against the corresponding Zod schema from @hitl-kit/core and throws synchronously if the event is malformed. No more shipping a broken event to the UI.

isEditablePlanResume(value) is a runtime type guard for the resume payload an editable-plan interrupt expects ({ steps: PlanStep[]; cancelled?: boolean }).


Part of HITL Kit

MIT © Ieuan King.