@open-panel/core
v0.1.0
Published
Daemon-internal glue for OpenPanel: a structured Logger with secret redaction, ProfileRuntime (wires button presses to actions and page renders to devices), and the button/page/calibration image generators.
Maintainers
Readme
@open-panel/core
Daemon-internal glue for OpenPanel:
a structured Logger with secret redaction, and ProfileRuntime — the one
place that connects "button N was pressed" to "look up the active
profile/page and run its action," and "render a page" to "push labels/images
to a device."
Scope note. This package is the daemon's own glue code, not a general extension point — most third-party consumers want
@open-panel/plugin-sdk,@open-panel/device-sdkor@open-panel/action-engineinstead. It's published for completeness and for anyone embedding the same daemon-side wiring in their own host, but its API tracks the daemon's needs first.
Install
npm install @open-panel/coreWhat's in here
Logger— structured logging with a bounded in-memory ring buffer (recent(limit)), a pluggablesink(e.g. to forward entries over IPC), and automatic, recursive redaction of any metadata key that looks like a password/token/secret/API key (redact(), exported standalone too).ProfileRuntime— wires aDriverRegistry(@open-panel/device-sdk) to aProfileRepository(@open-panel/profile-engine) and anActionEngine(@open-panel/action-engine): button events resolve to actions, page changes resolve to device renders, and it tracks per-device calibration mode and hotkey-switch on/off state.- Image generators —
createActionIconImage,createPageIndicatorImage,createCalibrationPatternImage, used byProfileRuntimeto render what a device's screen should show without pulling an image library into@open-panel/device-sdkitself.
Usage
import { Logger } from "@open-panel/core";
const logger = new Logger({ sink: (entry) => broadcastOverIpc(entry) });
logger.info("daemon.started", { port: 47912 });import { ProfileRuntime } from "@open-panel/core";
const runtime = new ProfileRuntime(driverRegistry, profileRepository, actionEngine, logger);
runtime.onProfileActivated((profile) => console.log("active profile", profile.name));Related packages
License
MIT © OpenPanel contributors
