Socket
Book a DemoSign in
Socket

hzl-core

Package Overview
Dependencies
Maintainers
1
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hzl-core

Core library for HZL - External task ledger for coding agents and OpenClaw.

latest
Source
npmnpm
Version
3.2.0
Version published
Maintainers
1
Created
Source

hzl-core

Core library for HZL - task tracking for coding agents and multi-agent workflows.

This package provides the business logic for programmatic use. For the CLI, install hzl-cli instead.

Installation

npm install hzl-core

Usage

import {
  createConnection,
  runMigrations,
  EventStore,
  ProjectionEngine,
  TaskService,
  ProjectService,
} from 'hzl-core';

// Initialize database
const db = createConnection('/path/to/data.db');
runMigrations(db);

// Set up event sourcing
const eventStore = new EventStore(db);
const projectionEngine = new ProjectionEngine(db, eventStore);

// Create services
const taskService = new TaskService(db, eventStore, projectionEngine);
const projectService = new ProjectService(db, eventStore, projectionEngine);

// Create a project and task
projectService.createProject({ name: 'my-project' });
const task = taskService.createTask({
  title: 'Implement feature',
  project: 'my-project',
});

// Claim and complete
taskService.claimTask(task.id, { owner: 'agent-1' });
taskService.completeTask(task.id);

Key Concepts

Event Sourcing: All state changes are recorded as immutable events. The EventStore handles persistence, and projections derive current state.

Atomic Claiming: claimTask() and claimNext() use database transactions to prevent race conditions when multiple agents claim work concurrently.

Projections: Current state is rebuilt from events. The ProjectionEngine coordinates projectors that maintain specific views (tasks, dependencies, tags, etc.).

Exports

  • Database: createConnection, runMigrations, withWriteTransaction
  • Events: EventStore, EventType, TaskStatus
  • Projections: ProjectionEngine, individual projectors
  • Services: TaskService, ProjectService, SearchService, ValidationService, BackupService

License

MIT

Keywords

hzl

FAQs

Package last updated on 11 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts