{"version":"2.1.336","anchor":"dark-process-rpc-wrapper","canonical_anchor":"dark-process-rpc-wrapper","heading":"New process API lets hooks modules start and drive child processes","tier":"internal","area":"Remote Control","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336\/e\/dark-process-rpc-wrapper","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336","markdown":"### New process API lets hooks modules start and drive child processes\n\nA new `process.open`, `send`, `end`, `read`, `signal` and `close` API lets hooks modules run child processes, refused in at least one setting\n\n**What**\n\nHooks are scripts that run automatically at set points in a session, and plugins can supply them as modules. Those modules get a new set of process operations for starting and controlling another program (a child process):\n\n- `process.open`, `process.send`, `process.end`, `process.read`, `process.signal` and `process.close` are added to the hooks module runtime. Each one works through a token, and each token holds at most one child process.\n\n- Input sent to the process is capped, and on Windows or inside the sandbox (a walled-off area limiting what commands can touch) only `SIGTERM` and `SIGKILL` signals are accepted.\n\n- The same six operations are also exposed as remote calls through a separate wrapper. No caller of it was looked for.\n\n- A table of allowed operations marks all six as \"refused\". Before, the table had no entries.\n\n- The workflow tool now treats `process.open` like `process.run` and `process.spawn`, so a script using it gets the \"may use ... on $.process\" note.\n\nThe same release adds a `harness_file_send` message type and three new file-send query events.\n\n**Why**\n\nPlugin authors can start a program from a hooks module, write to it, read from it and stop it, though some setups refuse these operations entirely.\n\n- Area: Remote Control\n- Tier: Under the hood\n- Useful: 3\/5\n- Signal: 4\/5\n- Scope: individual\n- Heads-up: no"}