Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 2.66 KB

README.md

File metadata and controls

40 lines (30 loc) · 2.66 KB

Yakit Browser Agent Native Host

The Native Host is a small stdio-to-loopback-WebSocket transport. It does not store pairing credentials and does not execute browser commands itself. It forwards the normal Bridge v3 server challenge and extension authentication messages; Yak validates the origin-bound paired device signature and returns the engine identity, engine instance, connection, session, task, grant, protocol, and capability identity.

The WebSocket connection mode automatically discovers running engines. Yak tries the preferred port and the following 15 ports, then separate fallback windows starting at 64333, 14333, 24333 and 34333. Both occupied ports and permission-denied binds are skipped. The extension rediscovers a paired engine after its port changes and verifies its pinned signing key before saving the new address. Initial pairing also discovers fallback ports, including browsers bootstrapped by YTray. Discovery does not replace the pairing confirmation or signature verification.

For Windows Chrome with a WSL engine, keep the loopback address in WebSocket mode; the WSL listener must be reachable from Windows through localhost forwarding or mirrored networking. The settings page shows the endpoint on connection failures. This Native Host still relays to WebSocket, so it is not a port-free named-pipe or Unix-socket transport. When using Native Host mode, set its -Endpoint / --endpoint to the engine's actual Bridge URL; automatic port discovery applies to WebSocket mode.

Build from the Yak repository:

go build -o yakit-browser-agent-host ./common/browser/nativehostcmd

Install for Linux or macOS, using the ID shown by chrome://extensions for an unpacked build:

./native-host/install.sh \
  --host-binary /absolute/path/to/yakit-browser-agent-host \
  --extension-id YOUR_CHROME_EXTENSION_ID

On Windows, run PowerShell without administrator privileges:

.\native-host\install.ps1 -HostBinary C:\path\yakit-browser-agent-host.exe -ExtensionId YOUR_CHROME_EXTENSION_ID

The installer registers Chrome, Chromium, Edge, Brave, and Firefox per-user locations. Chrome supplies its extension origin to the host. Firefox supplies the Native Host manifest path and add-on ID; the host verifies that ID against allowed_extensions before deriving its Bridge origin. It writes only the loopback endpoint to the user configuration directory. Run with --uninstall on POSIX or -Uninstall on Windows to remove the registrations; uninstall does not require an extension ID. When Chrome runs on Windows and development runs in WSL, build/install the Windows host with install.ps1; a Linux Native Host cannot be launched by Windows Chrome.