createCustomReporter
Purpose and behavior
Section titled “Purpose and behavior”Create an observe callback that routes each agent observation to the handler for its kind. Handlers run one at a time on a bounded queue without blocking the dispatch; flush() waits for them and rejects with the first handler failure. The caller owns any files or loggers the handlers use.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”handlersRequiredReporterHandlersHandlers keyed by agent event kind, run one at a time in arrival order; kinds without a handler are ignored.optionsOptionalCustomReporterOptions | undefinedError diagnostics for the custom reporter; no terminal output or resource ownership is added.options.capacityOptionalnumber | undefinedMaximum waiting events in the reporter queue, default 1024; overflow drops newest deliveries and makes flush reject.options.deliveryTimeoutMsOptionalnumber | undefinedMaximum asynchronous handler wait in milliseconds, default 5000; timeout disables further deliveries and makes flush reject.options.onErrorOptional((error: unknown, event: AgentObservation) => void | Promise<void>) | undefinedCalled for each failed handler with its error and event; diagnostic failures are isolated and the first handler failure remains observable through flush().