AgentSea.Surf.Sidecar (agentsea_surf v0.1.0)

Copy Markdown

Drives a Node browser-automation subprocess over a Port.

A GenServer owns the subprocess and speaks newline-delimited JSON: each request {"id":N,"command":...,"args":{...}} gets a response {"id":N,"ok":true|false,"result"|"error":...}. Browser/computer-use lives in the Node side (Playwright); only the I/O is bridged — the same "bridge, don't reimplement" pattern as the MCP stdio transport.

Summary

Functions

Send a command to the Node side; returns {:ok, result} or {:error, reason}.

Returns a specification to start this module under a supervisor.

Start a sidecar. Options: :command ([executable | args]), :name.

Functions

call(server, command, args \\ %{})

@spec call(GenServer.server(), String.t(), map()) :: {:ok, term()} | {:error, term()}

Send a command to the Node side; returns {:ok, result} or {:error, reason}.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

Start a sidecar. Options: :command ([executable | args]), :name.