Metadata-Version: 2.5
Name: nightsitter
Version: 0.1.0
Summary: Stop babysitting your AI agents — a night-shift watchdog for unattended agents (Claude Code, cron jobs, anything).
Project-URL: Homepage, https://github.com/minjong212121/nightsitter
Project-URL: Repository, https://github.com/minjong212121/nightsitter
Project-URL: Issues, https://github.com/minjong212121/nightsitter/issues
Author: minjong212121
License: MIT
License-File: LICENSE
Keywords: ai-agents,claude-code,dead-man-switch,monitoring,watchdog
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.12
Requires-Dist: httpx>=0.27
Requires-Dist: psutil>=5.9
Provides-Extra: dev
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Requires-Dist: types-psutil; extra == 'dev'
Description-Content-Type: text/markdown

# nightsitter

**Stop babysitting your AI agents.**

You kicked off a Claude Code session (or a cron'd agent job) and walked away.
Six hours later you discover it's been sitting on a permission prompt since
minute nine — or looping, or dead. `nightsitter` is the night-shift watchdog:
it tells the difference between *working*, *stuck*, *waiting for you*, and
*dead*, and pings your phone only when it matters.

```bash
pipx install nightsitter

nightsitter watch                      # watch all local Claude Code sessions
nightsitter status                     # one-shot fleet snapshot
nightsitter run -- python nightly.py   # dead-man wrapper for any command
nightsitter daemon install             # run the watcher as a service (launchd/systemd)
```

## What it detects

| State | Meaning |
|---|---|
| 🟢 active | transcript activity within the stall window |
| 🟡 stalled | process alive, mid-task, no activity — alive but stuck |
| 🟠 waiting | process alive, turn closed — waiting on your approval/input |
| 🔴 dead | process gone mid-task |
| ⚪ done | finished cleanly (silent by default) |

## Notifications

Zero-signup default: [ntfy.sh](https://ntfy.sh). Set a topic and install the ntfy app:

```bash
export NIGHTSITTER_NTFY_TOPIC="your-secret-topic"
nightsitter test-notify
```

Telegram and desktop notifications are also supported — see `~/.nightsitter/config.toml`:

```toml
[notify]
ntfy_topic = "your-secret-topic"
# telegram_token = "..."
# telegram_chat_id = "..."
# desktop = "on"
```

## Run it as a service

The watcher only helps if it outlives your terminal:

```bash
nightsitter daemon install    # macOS launchd (KeepAlive) / Linux systemd --user
nightsitter daemon status
nightsitter daemon uninstall
```

Re-run `install` with different flags (`--stall-after 20`) to update in place.

## Dead-man wrapper for cron agents

```bash
nightsitter run --label nightly-report --max-minutes 45 \
  --heartbeat-url https://hc-ping.com/<uuid> -- python nightly.py
```

- alerts on failure or when the kill switch fires (SIGTERM → SIGKILL)
- pings your healthchecks.io check on success, `/fail` on failure
- passes stdio through untouched

## Status

v0.1 — local CLI, free forever (MIT). A hosted version (alert history,
multi-machine fleet view, mobile) is planned — founding-user preorders coming
with the launch.
