New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@lucianfialho/hooklaw-core

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lucianfialho/hooklaw-core

Core engine for HookLaw — webhook orchestrator with AI agents and MCP tools

latest
npmnpm
Version
3.0.1
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

@lucianfialho/hooklaw-core

Core engine for HookLaw — event-driven AI agents with native MCP tools.

What's inside

  • Config loader — YAML config with ${ENV_VAR} substitution and Zod validation
  • HTTP server — webhook receiver (POST /h/:slug), REST API, and dashboard hosting
  • Router — recipe matcher with conditional routing via lightweight LLM evaluation
  • Agent — agentic tool loop (max 10 iterations) with observability traces
  • MCP Pool — persistent MCP client connections (stdio + SSE transports)
  • SQLite DB — executions, traces, agent memory, approvals (WAL mode)
  • Feed poller — RSS/Atom/JSON feed watcher with content-hash deduplication
  • Queue — per-recipe async queue with concurrency control
  • Provider registry — pluggable LLM providers (OpenAI, Anthropic, Ollama, OpenRouter)

Key Features

  • Multi-agent chains — recipes trigger other recipes on success/error with depth tracking
  • Human-in-the-loop — executions pause at pending_approval status for review
  • Agent memory — conversation context persists across executions per recipe
  • Conditional routing — LLM evaluates conditions to decide which recipe handles an event
  • Agent observability — traces capture every LLM call, tool call, tool result, and error

Install

npm install @lucianfialho/hooklaw-core

Usage

import { bootstrap } from '@lucianfialho/hooklaw-core';

const { server, config } = await bootstrap({
  configPath: './hooklaw.config.yaml',
  dashboardDir: './dashboard/dist',
});

API Endpoints

MethodPathDescription
POST/h/:slugReceive webhook
GET/api/recipesList recipes
GET/api/executionsList executions (filterable)
GET/api/executions/:id/tracesAgent reasoning traces
GET/api/executions/:id/chainChild executions in a chain
GET/api/recipes/:id/memoryAgent memory for a recipe
DELETE/api/recipes/:id/memoryClear agent memory
GET/api/approvalsPending approval queue
POST/api/executions/:id/approveApprove/reject execution
GET/api/mcp-serversList MCP servers
GET/api/mcp-servers/healthHealth check all MCP servers
GET/api/statsExecution statistics
GET/api/feedsActive feed pollers
GET/api/configRedacted config

Architecture

hooklaw.config.yaml
        |
        v
┌──────────────┐     ┌──────────┐     ┌───────────┐     ┌──────────┐
│  HTTP Server │────>│  Router  │────>│   Agent   │────>│ MCP Pool │
│  /h/:slug    │     │  Routing │     │  Tool Loop│     │  stdio   │
│  /api/*      │     │  Chains  │     │  Traces   │     │  sse     │
│  /dashboard  │     │  Memory  │     │  Memory   │     │          │
└──────────────┘     └──────────┘     └───────────┘     └──────────┘
        ^                  |                                   |
        |                  v                                   v
┌──────────────┐     ┌──────────┐                        ┌──────────┐
│  RSS/Atom    │     │  SQLite  │                        │ External │
│  Feed Poller │     │  (WAL)   │                        │ MCP Svrs │
└──────────────┘     └──────────┘                        └──────────┘

License

MIT

FAQs

Package last updated on 10 Mar 2026

Related posts