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

@gizmo-ai/hitl-plugin

v0.2.1

Published

Human-in-the-Loop approval plugin for Gizmo runtime

Readme

@gizmo-ai/hitl-plugin

Human-in-the-Loop approval plugin for Gizmo. Blocks tool calls pending human approval via HTTP API.

Install

bun add @gizmo-ai/hitl-plugin

Quick Start

import { createRuntime } from "@gizmo-ai/runtime";
import { agentPlugin } from "@gizmo-ai/agent-plugin";
import { createServer, createServerPlugin } from "@gizmo-ai/server";
import { createHITLPlugin } from "@gizmo-ai/hitl-plugin";

// 1. Create HITL plugin
const hitl = createHITLPlugin({
  requiresApproval: ["bash", "write", "edit"],
  defaultTimeoutMs: 60000,
});

// 2. Create runtime with HITL plugin FIRST
const agent = agentPlugin({ model, tools });
const serverPlugin = createServerPlugin();

const runtime = createRuntime({
  plugins: [hitl.plugin, agent, serverPlugin.plugin],
});

// 3. Connect HITL to runtime
hitl.connect(runtime);

// 4. Create server and wire HITL routes
const server = createServer({ runtime, plugin: serverPlugin });
server.app.route("/approvals", hitl.createRoutes());
server.listen(3000);

Configuration

interface HITLPluginConfig {
  // Which tools require approval
  requiresApproval: "all" | string[] | ((toolName: string, args: Record<string, unknown>) => boolean);

  // Timeout for approval requests (0 = no timeout)
  defaultTimeoutMs?: number;  // Default: 60000

  // History ring buffer size
  historySize?: number;       // Default: 100
}

HTTP API

| Method | Path | Description | |--------|------|-------------| | GET | /approvals | List pending approvals | | GET | /approvals/:id | Get approval details | | POST | /approvals/:id | Approve or reject | | GET | /approvals/history | Recent decisions |

Approve/Reject

# Approve
curl -X POST http://localhost:3000/approvals/<id> \
  -H "Content-Type: application/json" \
  -d '{"decision": "approve", "reason": "Looks safe"}'

# Reject
curl -X POST http://localhost:3000/approvals/<id> \
  -H "Content-Type: application/json" \
  -d '{"decision": "reject", "reason": "Dangerous command"}'

Programmatic API

// Get pending approvals
const pending = hitl.getPending();

// Approve programmatically
hitl.approve(approvalId, "Auto-approved by policy");

// Reject programmatically
hitl.reject(approvalId, "Auto-rejected by policy");

Custom Approval Logic

const hitl = createHITLPlugin({
  requiresApproval: (toolName, args) => {
    // Only require approval for destructive bash commands
    if (toolName === "bash") {
      const cmd = args.command as string;
      return cmd.includes("rm") || cmd.includes("delete");
    }
    return false;
  },
});

Actions

| Action | Description | |--------|-------------| | HITL_APPROVAL_REQUESTED | Tool blocked, awaiting decision | | HITL_APPROVAL_GRANTED | Human approved, tool replayed | | HITL_APPROVAL_REJECTED | Human rejected, tool fails | | HITL_APPROVAL_EXPIRED | Timeout reached, tool fails |

State

interface HITLState {
  pending: Record<string, PendingApproval>;  // By approval ID
  history: PendingApproval[];                // Ring buffer
  config: { defaultTimeoutMs: number; historySize: number };
}

interface PendingApproval {
  id: string;
  executionId: string;
  toolCall: { id: string; name: string; args: Record<string, unknown> };
  status: "pending" | "approved" | "rejected" | "expired";
  requestedAt: number;
  expiresAt?: number;
  decidedAt?: number;
  reason?: string;
}

Security

  • Approval IDs are UUIDs (crypto.randomUUID())
  • State validated before approval (must be pending + have blocked action)
  • Expired approvals cannot be approved (410 Gone)
  • Re-approving returns 409 Conflict

License

MIT