start method

Future<void> start(
  1. String goal,
  2. LeonardConfig config
)

Perform the binding handshake and capture contract version + extension manifest. Emits SessionStarted exactly once on success.

Throws StateError if called twice. Propagates BindingNotInitializedError from the underlying client when the target app's binding extension is absent.

Implementation

Future<void> start(String goal, LeonardConfig config) async {
  if (_started) {
    throw StateError('Session already started');
  }
  _storeCoreBudget(config);
  _config = config;
  final result = await _client.handshake();
  _handshake = result;
  _started = true;
  _emit(SessionStarted(goal));
}