Class ConnectionFactory
java.lang.Object
com.shaft.commandline.runtime.ConnectionFactory
- All Implemented Interfaces:
McpConnector
Chooses the MCP transport for a command per the routing rule: if a daemon session is live, connect
to it over streamable HTTP (so browser/device state persists); otherwise spawn an ephemeral stdio
child. Commands that require live state fail fast when no daemon is running unless
--stdio-ok.-
Constructor Summary
ConstructorsConstructorDescriptionUses the real session manager and launcher locator.ConnectionFactory(SessionManager sessionManager, McpLauncherLocator locator) -
Method Summary
-
Constructor Details
-
ConnectionFactory
public ConnectionFactory()Uses the real session manager and launcher locator. -
ConnectionFactory
- Parameters:
sessionManager- the session managerlocator- the launcher locator
-
-
Method Details
-
connect
- Specified by:
connectin interfaceMcpConnector- Parameters:
requiresSession- whether the command needs persistent live state (browser/element/capture)stdioOk- whether the caller opted in to a throwaway one-shot server- Returns:
- a connected MCP client the caller must close
-