ShareControls
agent-integrationsStart/stop relay sessions.
Why
Collaborative agents and humans need to inhabit the same surface without polling or Playwright scraping. ShareControls solves the bootstrap problem: how does a host safely hand off session credentials to external agents (Claude Desktop, Cline, curl clients) so they can join the same shared session via MCP? Without it, agents either have no way to discover the session or credentials leak through logs and transcripts.
What
ShareControls is a unidirectional host UI that displays connection details in three formats (URL, JSON config, cURL recipe) when a session descriptor is passed. The component is controlled via session (a SessionDescriptor with id, token, and display fields, or null when sharing is inactive), onStart and onStop callbacks to toggle the session, and optional status text for connection state. The three tabs (URL, JSON, cURL) render copy-paste–able credentials tailored to each client type: humans join via a querystring URL, agents configure an MCP server with JSON, terminal users execute cURL recipes to verify reachability.How
Import from
@particle-academy/agent-integrations, create a session with createSessionDescriptor(), and pass it to <ShareControls session={descriptor} onStart={handleStart} onStop={handleStop} />. When the user clicks “Start”, invoke onStart to generate and store the session; when they click “Stop”, invoke onStop to clear it. The component handles tab switching, copy-to-clipboard, and rendering the three credential forms automatically.