bootstrap static method
Perform the /v1/sdk/bootstrap handshake against the configured
control-plane. On success, returns the AegisBootstrapResult AND
applies the contained EventGovernanceHint to the NameGovernor.
Parity with libs/web-sdk's bootstrap() export. Wired by Phase 1
per libs/mobile-sdk/PARITY.md.
Implementation
static Future<AegisBootstrapResult> bootstrap() async {
try {
final raw = await _channel.invokeMethod<Map>('bootstrap');
if (raw == null) {
throw Exception('bootstrap returned null');
}
final result = AegisBootstrapResult.fromJson(Map<String, dynamic>.from(raw));
if (result.eventGovernance != null) {
_nameGovernor.ingestHint(result.eventGovernance);
}
_workspaceId = result.workspaceId.isEmpty ? _workspaceId : result.workspaceId;
return result;
} on PlatformException catch (e) {
throw Exception('Bootstrap failed: ${e.message}');
}
}