launch static method

Future<AcpAgent> launch(
  1. AgentLaunchCommand command, {
  2. required ProcessExecutor executor,
  3. AgentClientServices client = const AgentClientServices(),
  4. AgentInfo clientInfo = const semantic.AgentInfo(name: 'agent_harness', version: agentHarnessVersion),
})

Implementation

static Future<AcpAgent> launch(
  AgentLaunchCommand command, {
  required ProcessExecutor executor,
  AgentClientServices client = const AgentClientServices(),
  semantic.AgentInfo clientInfo = const semantic.AgentInfo(
    name: 'agent_harness',
    version: agentHarnessVersion,
  ),
}) async {
  try {
    final stdioTransport = await StdioAcpTransport.launch(
      command: command,
      executor: executor,
    );
    final transport = executor is AcpTransportDecorator
        ? (executor as AcpTransportDecorator).decorateAcpTransport(
            stdioTransport,
          )
        : stdioTransport;
    return await connect(transport, client: client, clientInfo: clientInfo);
  } catch (error, stackTrace) {
    throwWrappedAcpConnection(error, stackTrace);
  }
}