Files
Timmy-time-dashboard/deploy/install-mac-timer.sh

33 lines
981 B
Bash
Raw Normal View History

Claude/fix tick engine v16wt (#165) * fix: wire up tick engine scheduler + add journal + systemd timer The ThinkingEngine was fully implemented but never called — the background scheduler was lost during the Celery removal in #133. This commit: - Add _thinking_scheduler() to dashboard lifespan (5-min cycle) - Add _write_journal() that appends thoughts to data/journal/YYYY-MM-DD.md - Add `timmy tick` CLI command for one-shot thinking (systemd-friendly) - Add deploy/timmy-tick.{service,timer} systemd units https://claude.ai/code/session_013e7upfJ6negFzu5YNJikge * Add macOS launchd plist for Timmy tick timer Equivalent of the existing systemd service/timer for Linux. Runs `timmy tick` every 5 minutes via launchd on macOS. https://claude.ai/code/session_013e7upfJ6negFzu5YNJikge * fix: make macOS launchd timer work with user-local paths The plist had hardcoded /opt/timmy paths that don't exist on Mac. Now uses a template with __PROJECT_DIR__ placeholders, a wrapper script for PATH setup, and an install script that wires it all up. Usage: ./deploy/install-mac-timer.sh https://claude.ai/code/session_013e7upfJ6negFzu5YNJikge * fix: add missing tox pre-commit env + pre-push hook to prevent broken builds RCA: the pre-commit hook referenced `tox -e pre-commit` which didn't exist in tox.ini, so commits went unchecked. There was also no pre-push hook, so broken code could reach GitHub without running the CI-mirror suite. - Add [testenv:pre-commit] to tox.ini (format check + unit tests) - Add .githooks/pre-push that runs `tox -e pre-push` (full CI mirror) https://claude.ai/code/session_013e7upfJ6negFzu5YNJikge --------- Co-authored-by: Claude <noreply@anthropic.com>
2026-03-11 10:19:46 -04:00
#!/bin/sh
# Install the Timmy tick timer on macOS via launchd.
# Usage: ./deploy/install-mac-timer.sh
set -e
PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
PLIST_SRC="$PROJECT_DIR/deploy/com.timmy.tick.plist"
PLIST_DST="$HOME/Library/LaunchAgents/com.timmy.tick.plist"
LABEL="com.timmy.tick"
# Ensure data dir exists for logs
mkdir -p "$PROJECT_DIR/data"
# Make wrapper executable
chmod +x "$PROJECT_DIR/deploy/timmy-tick-mac.sh"
# Unload if already installed
if launchctl list "$LABEL" >/dev/null 2>&1; then
echo "Unloading existing $LABEL..."
launchctl bootout "gui/$(id -u)/$LABEL" 2>/dev/null || true
fi
# Fill in project path and install
sed "s|__PROJECT_DIR__|$PROJECT_DIR|g" "$PLIST_SRC" > "$PLIST_DST"
# Load
launchctl bootstrap "gui/$(id -u)" "$PLIST_DST"
echo "Installed! Timmy will tick every 5 minutes."
echo " Logs: $PROJECT_DIR/data/tick.log"
echo " Check: launchctl list | grep timmy"
echo " Stop: launchctl bootout gui/\$(id -u)/com.timmy.tick"