When Preferences › Integrations › Control Port starts the control server
(no --control) and no token is given, keep the token in the settings
folder as agent-control.token (same as --control-token-file) and publish
agent-connection.json beside it ({version, pid, port, tokenFile, app}),
in the shape #5525 proposes, so a client can find and authenticate to an
app started from the Dock, Start menu or a file manager.
Add integrations.readRoot / integrations.writeRoot, standing in for
--automation-read-root / --automation-write-root; a flag wins over its
preference direction by direction. A preference folder that can't be
opened is left out (fails closed) with a notice instead of stopping the
launch. prefs.set refuses both folders and the whole integrations
section, so automation can't widen its own file access.
A leftover connection file (crash, or any quit on macOS) is removed or
replaced at the next launch.
Co-Authored-By: Claude Opus 5.5 <[email protected]>