#!/usr/bin/env bash
# Background sync entry point for agent memory files.
#
#   ./poll-cron
#
# Wraps `fleet.memsync.poll` in the fleet uv environment. This is what a
# systemd user timer (see settings/systemd/user/fleet-memsync.*.example) calls
# every 10 seconds. It detects
# new/modified/deleted files under agent-memory/ and commits them to main, so
# agent memories are persisted to git as soon as they appear.
#
# No secrets needed — this is pure git plumbing. No credential loading, no
# secrets-manager wrapper.
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
FLEET="$(cd "$HERE/../.." && pwd)"

exec uv run --project "$FLEET" python -m fleet.memsync.poll "$@"
