Skip to content

Repository files navigation

@es6kr/agent-events

Unified vendor-agnostic Agent Lifecycle Event Schema and NDJSON stream writer for Claude Code, Antigravity (Gemini Agent), OpenClaw (acpx), and claw-orchestrator.

Installation

npm install @es6kr/agent-events

Quick Start

1. Emit Lifecycle Events

import { UnifiedEventWriter, UnifiedEvent } from "@es6kr/agent-events";

const writer = new UnifiedEventWriter();

const event: UnifiedEvent = {
  v: 1,
  ts: new Date().toISOString(),
  tool: "claw-orchestrator",
  sessionId: "session-abc-123",
  event: "tool.before",
  share_eligibility: "public",
  data: {
    toolName: "run_command",
    command: "git status"
  }
};

// Emits event line atomically to ~/.local/state/agent-events/session-abc-123.ndjson
writer.emit(event);

2. Read Session Telemetry Stream

import { UnifiedEventWriter } from "@es6kr/agent-events";

const writer = new UnifiedEventWriter();
const events = writer.readEvents("session-abc-123");

console.log(`Read ${events.length} events in chronological order`);

Build & Test Commands

npm run build    # Compile TypeScript to ./dist
npm test         # Run Jest unit test suite

Supported Agent Runtimes (tool)

  • claude-code: Native hook events (SessionStart, PreToolUse, PostToolUse, Stop)
  • antigravity: Gemini pair-programming subagents and background tasks
  • openclaw: OpenClaw headless CLI sessions (acpx)
  • claw-orchestrator: Enderfga/openclaw-claude-code orchestrator stdio ACP streams

Architecture & Governance

  • Core Event Standard: @es6kr/agent-events serves as the canonical vendor-agnostic event schema and telemetry layer. All documentation, commits, and API contracts within this repository are written in English.
  • Extensibility: Custom enterprise adapters, private authentication wrappers, or internal pipeline bindings can extend or consume this package as a standard npm dependency in external repositories.

About

Unified vendor-agnostic Agent Lifecycle Event Schema and NDJSON stream writer for Claude Code, Antigravity, OpenClaw, and claw-orchestrator

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages