kernl API
    Preparing search index...

    Function createGuardPipeline

    • Compose the guard: ingress flood control, then the visibility gate, then the focus-aware rate limiter, then kehto's bridge.

      What is enforced where (D-020): kehto binds NAP traffic to a MessagePort the bridge owns. Window-level messages, of which only napplet.hello is legitimate, are held or dropped by handleWindowMessage. Port traffic reaches observe through kehto's filterNappletMessage, whose answer kehto follows: dispatch, hold until releaseDeferred, or drop. Hidden windows' envelopes are held and onRelease is called when the window is visible again. Quarantine revokes the window inside the filter, and kehto discards what it held. kehto's runtime then charges what it carries out against the same budgets (createRuntimeRateLimiter), held envelopes included, and puts each request to the firewall.

      Parameters

      Returns GuardPipeline

      The pipeline.

      const pipeline = createGuardPipeline({ config: createGuardConfig('strict'), onEvent: (e) => log.push(e) });
      window.addEventListener('message', (event) => pipeline.handleWindowMessage(event, resolve, bridge.handleMessage));