stop method

Future<void> stop(
  1. String taskId,
  2. String sessionId
)

Stop a running ultraplan.

Archives the remote session (halts it but keeps the URL viewable), kills the local task entry (clears the pill), and clears sessionUrl (re-arms the keyword trigger).

Implementation

Future<void> stop(String taskId, String sessionId) async {
  // Kill the task.
  taskState.value = taskState.value?.copyWith(
    status: 'killed',
    endTime: DateTime.now().millisecondsSinceEpoch,
  );

  // Clear state.
  sessionUrl.value = null;
  pendingChoice.value = null;
  launchPending.value = null;

  final url = getRemoteSessionUrl(sessionId);

  // In production, this also:
  // 1. Archives the remote session via API
  // 2. Enqueues notification: "Ultraplan stopped.\n\nSession: $url"
  // 3. Enqueues meta notification to suppress auto-response
}