readPlan method

Future<PlanReadResult> readPlan()

Reads the current plan.

Returns a PlanReadResult with PlanReadResult.exists indicating whether a plan exists and PlanReadResult.content containing its content.

Implementation

Future<PlanReadResult> readPlan() async {
  _ensureAlive();
  final result = await _connection.sendRequest(
    'session.plan.read',
    {'sessionId': sessionId},
    const Duration(seconds: 5),
  ) as Map<String, dynamic>;
  return PlanReadResult(
    exists: result['exists'] as bool? ?? false,
    content: result['content'] as String?,
  );
}