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-sdk/resolver-temporal

v1.0.0

Published

Temporal binding for hitl.

Readme

@hitl-sdk/resolver-temporal

Temporal binding for hitl.

Install

npm add @hitl-sdk/resolver-temporal @hitl-sdk/hitl @temporalio/client @temporalio/workflow

@hitl-sdk/hitl, @temporalio/client, and @temporalio/workflow are peer dependencies.

Workflow side

Temporal splits activity code (I/O) from workflow code (orchestration). Keep them in separate files:

// activities/hitl.ts — register with your Worker
import type { HitlRequest, HitlResponse } from "@hitl-sdk/hitl/core";

export async function hitlRequestActivity(req: HitlRequest): Promise<HitlResponse> {
  const res = await fetch(req.url, {
    method: req.method,
    headers: req.headers,
    body: req.body,
  });
  return { status: res.status, ok: res.ok, body: await res.text() };
}
// lib/hitl-client.ts — import in workflows
import { proxyActivities } from "@temporalio/workflow";
import { createTemporalHitlClient } from "@hitl-sdk/resolver-temporal";
import type * as activities from "../activities/hitl";

const { hitlRequestActivity } = proxyActivities<typeof activities>({
  startToCloseTimeout: "1m",
});

export const { waitForHuman, requestHuman, notify } = createTemporalHitlClient({
  request: hitlRequestActivity,
});
// workflows/inbound-lead.ts
import { actions, isResolved } from "@hitl-sdk/hitl";
import { waitForHuman } from "../lib/hitl-client";

export async function inboundLead(input: { email: string; draft: { subject: string; body: string } }) {
  const approval = await waitForHuman({
    message: `Inbound lead: ${input.email}`,
    actions: actions().approve().deny().build(),
    timeout: "72h",
  });

  if (!isResolved(approval, "approve")) return;
  // ...
}

Server side

// lib/hitl.ts
import { Connection, Client } from "@temporalio/client";
import { Hitl } from "@hitl-sdk/hitl";
import { InMemoryState } from "@hitl-sdk/hitl/state";
import { temporalResolver } from "@hitl-sdk/resolver-temporal";

const connection = await Connection.connect({ address: process.env.TEMPORAL_ADDRESS });
const temporalClient = new Client({ connection, namespace: process.env.TEMPORAL_NAMESPACE });

export const hitl = new Hitl({
  state: new InMemoryState(),
  resolver: temporalResolver({ client: temporalClient }),
});
// app/api/hitl/[...path]/route.ts  (Next.js example)
import { hitl } from "@/lib/hitl";

export const GET = hitl.handler;
export const POST = hitl.handler;

Environment

| Variable | Where | Purpose | |---|---|---| | HITL_URL | Worker | Base URL the activity uses to reach the hitl server | | HITL_SECRET | Worker | Bearer token for the internal API (if configured) | | TEMPORAL_ADDRESS | Server | Temporal frontend for temporalResolver | | TEMPORAL_NAMESPACE | Server | Namespace for workflow handles |

Implementation details: ARCHITECTURE.md.