@tunnlo/core
v0.1.2
Published
Core types, interfaces, and runtime for Tunnlo pipelines
Downloads
501
Maintainers
Readme
@tunnlo/core
Core types, interfaces, and runtime for Tunnlo pipelines.
Part of the Tunnlo project -- a real-time data-to-agent bridge with intelligent filtering.
Installation
npm install @tunnlo/coreUsage
import { Pipeline, InMemoryBus, createEvent } from '@tunnlo/core';
// Create a message bus
const bus = new InMemoryBus();
// Build a pipeline
const pipeline = new Pipeline({ bus });
await pipeline.start();
// Create and publish events
const event = createEvent('network', { src_ip: '10.0.0.1' });
await bus.publish('events', event);API
Pipeline & Bus
Pipeline-- orchestrates adapters, filters, bridges, and actions into a processing pipelineInMemoryBus-- in-process message bus (default)RedisStreamsBus-- Redis Streams-backed distributed message busKafkaBus-- Kafka-backed message busFastBus-- high-throughput in-memory bus
Events & State
createEvent(type, payload)-- creates aTunnloEventwith a unique ID and timestampeventKey(event)-- generates a deduplication key for an eventvalidateEvent(event)-- validates event structureJsonFileStateStore-- file-based cursor/state persistence
Logging
getLogger(name)-- returns a named logger instancesetGlobalLogger(logger)-- sets the global logger
Types
TunnloEvent,Adapter,Filter,AgentBridge,ActionHandler-- core interfacesPipelineConfig,AdapterConfig,FilterConfig,AgentConfig-- configuration types
License
MIT
