Optional warning sink.
A function to call for every dropped message.
import { createUnrecognizedTypeDiagnostic } from '@kehto/runtime';
const ignoreUnrecognized = createUnrecognizedTypeDiagnostic();
function handleMessage(windowId: string, message: NappletMessage, send: Send): void {
if (message.type === 'serial.open') return open(windowId, message, send);
ignoreUnrecognized('serial', message.type); // no reply
}
Create the host-side diagnostic for unrecognized message types.
NIP-5D (nostr-protocol/nips#2303 at dskvr/nips@f60550c3) says "Messages with an unrecognized
typeMUST be silently ignored" and that this prevents capability probing, so a service drops such a message and calls the returned function instead of answering. The host still hears about it once:domain.actionstring of at most 64 characters. Anything else is reported as<unprintable>. Payloads, ids and window ids are never logged.Create one per service or runtime instance, not per message.