@acpfx/node-sdk
v0.3.1
Published
SDK for authoring acpfx pipeline nodes. Provides the standard primitives for emitting events, logging, and handling the NDJSON stdio protocol.
Downloads
762
Readme
@acpfx/node-sdk
SDK for authoring acpfx pipeline nodes. Provides the standard primitives for emitting events, logging, and handling the NDJSON stdio protocol.
Install
npm install @acpfx/node-sdkAPI
emit(event)-- Send an event to stdout (NDJSON)log.info(msg)/log.warn(msg)/log.error(msg)-- Structured logging vialogeventsonEvent(callback)-- Register a handler for incoming events on stdinhandleManifestFlag()-- Handle--manifestCLI flag (prints manifest JSON and exits)
Usage
import { emit, log, onEvent, handleManifestFlag } from "@acpfx/node-sdk";
handleManifestFlag();
onEvent((event) => {
if (event.type === "audio.chunk") {
// process audio...
}
});
emit({ type: "lifecycle.ready" });License
ISC
