#!/bin/bash
# Exit immediately on error, treat unset variables as errors, propagate pipe failures.
set -euo pipefail
# Load shared log/warn/skip helpers from the installer library.
source "$(dirname "${BASH_SOURCE[0]}")/../../lib/logging.sh"

log "Installing taskwarrior..."
# Taskwarrior (task) is a CLI task manager; it is in the official repos as 'task'.
sudo pacman -S --noconfirm --needed task

log "Installing watson and jrnl (AUR)..."
# watson: time-tracker that logs work sessions to JSON; python-jrnl: encrypted CLI journal.
# Both are Python-based tools only available via the AUR on Arch.
# jrnl is the correct package name (in the official repos); "python-jrnl" exists
# in neither the repos nor the AUR. watson is AUR-only. yay handles both sources.
yay -S --answerdiff None --answerclean All --noconfirm --needed watson jrnl
log "Productivity tools installed."
