'use strict';

// Worker-thread wrapper around the shared headless terminal service. The same
// service also runs inside per-session PTY host processes so snapshot,
// approval, and row-extraction behavior stays identical across both paths.

const { parentPort } = require('node:worker_threads');
const { bindHeadlessTerminalService } = require('../lib/headless-term-service');

bindHeadlessTerminalService({
  postMessage: (msg) => parentPort.postMessage(msg),
  onMessage: (handler) => parentPort.on('message', handler),
});
