Skip to main content

Watchpost (watchpost-agent)

CI Release License: Apache-2.0 Python 3.11+ Website

English · 简体中文

Website: watchpost.popcornnn.xyz

Headless local background bridge for your coding agent (Apache-2.0). Watches selected chat channels, runs local triage + your coding agent (Antigravity, Codex, Claude Code, Gemini CLI, with automatic primary→backup failover), and delivers concise diagnoses and 1-tap-copy draft replies strictly to your phone or DM—never auto-sending to external senders.

Watchpost overview

How It Works

flowchart LR
    A["Feishu · Slack · Discord · Telegram · DingTalk · WeCom · SDK Plugins"] --> B["Watchpost Daemon (Debouncer · Cross-Channel Memory · Quiet Hours · Whisper ASR)"]
    B --> C["Primary Agent (e.g. Claude Code / Codex / Gemini / Antigravity)\n↳ Read-Only Until 'go' · Safe Failover"]
    C --> D["Owner Entrance (Telegram · iMessage · Slack/Discord DM · WeCom · ntfy · Bark · Pushover)"]
    D -->|"#N / go / skip / /brief / /mute / /new / voice / image"| B

Key Capabilities

  • Draft-First 4-Mode Triage & Strict "go" Approval Gate: Distinguishes quick Q&A/advice/FYIs from real bugs, diagnoses safely (assistant_only, diagnose_only, auto_fix), and requires explicit approval (go / approve / 执行 / 批准, or skip to dismiss) while holding a pending proposal before touching code.
  • Per-Channel CLI Sandbox Enforcement: Enforces read-only/plan flags during diagnosis and only enables file-editing flags for verified approved_go turns or explicit auto_fix channels:
Backend Read-Only (assistant_only / diagnose_only) Writable (approved_go / auto_fix) Timeout Cleanup
codex --sandbox read-only (start) / -c sandbox_mode="read-only" (resume) --sandbox workspace-write / -c sandbox_mode="workspace-write" kill_process_tree (SIGKILL process group)
claude_code --permission-mode plan --permission-mode acceptEdits kill_process_tree (SIGKILL process group)
gemini_cli --approval-mode plan --approval-mode auto_edit kill_process_tree (SIGKILL process group)
antigravity Local agentapi turn + Stop Hook agentapi turn + Stop Hook kill_process_tree (SIGKILL process group)
  • Quiet Hours + Morning Briefing: Suppress notifications during configured overnight hours (for example 23:00–08:00) while silently diagnosing incoming messages and flushing one clean morning briefing (auto_brief_on_end), plus /brief, /mute 2h, /unmute, and urgent keyword breakthrough.
  • Cross-Channel "Same Incident" Memory & Prompt Fencing: Feeds recent incident digests from sibling channels sharing a workspace while wrapping untrusted external chat inputs, reply previews, and memory entries in randomized per-prompt <untrusted_chat_data_{nonce}> fences.
  • Hardened Control API & Isolated webhook_port: Local control routes on --api-port 8787 enforce a 0o600 Bearer token (~/.local/share/watchpost/api.token), loopback Host allowlist, and browser Origin blocking. Expose an optional separate webhook_port (e.g., 8788) for public reverse tunnels so /api/* control routes stay local-only.
  • 10 Native Integrations + Out-of-Process Plugin SDK: Built-in support for Feishu / Lark, Slack, Discord, Telegram (outbound + shared-hub inbound), DingTalk, WeCom (企业微信), macOS iMessage, ntfy, Bark, and Pushover, plus a clean-room WhatsApp stdio SDK template (examples/whatsapp_plugin_template.py).
  • Background Service & Reliability Controls: Single-instance watchpost.lock, token-scoped Telegram polling with 409/429 backoff, secret redaction across logs/HTTP errors, periodic media pruning, and watchpost service install|status|uninstall (launchd / systemd --user).

Quickstart (5-Minute Onboarding)

Requires Python 3.11+:

# Recommended: install CLI globally from GitHub via uv or pipx
uv tool install git+https://github.com/Popcornnnnnnnn/watchpost.git
# or: pipx install git+https://github.com/Popcornnnnnnnn/watchpost.git

# Or install from source
git clone https://github.com/Popcornnnnnnnn/watchpost.git && cd watchpost
uv sync --all-extras

1. Guided Setup & .env Credentials

# Writes 0600 ~/.config/watchpost/config.json (with optional 0600 ~/.config/watchpost/.env)
watchpost setup

# Pair Telegram bot with nonce-verified private /start link (uploads avatar + / commands)
watchpost telegram-setup --token "$TELEGRAM_BOT_TOKEN" --test-message
# Or inspect recent chat IDs manually:
watchpost telegram-whoami

2. Enroll Channels & Verify

watchpost channels list-remote --adapter feishu
watchpost channels add --adapter feishu --chat-id "oc_..." --name "Support" \
  --chat-type group --trigger mention_owner --autonomy diagnose_only --workspace ~/repo
watchpost channels list
watchpost channels remove --id <channel_id>

watchpost doctor --live
watchpost run --once --seed

3. Run Continuously or Install Background Service

# Foreground daemon
watchpost run --api-port 8787

# Or install launchd (macOS) / systemd --user (Linux) auto-start unit
watchpost service install --print-only   # preview plist/service unit
watchpost service install
watchpost service status
watchpost service uninstall

(Note on WeCom: /api/webhooks/wecom verifies SHA1 msg_signature and expects plaintext XML or JSON payloads, or traffic forwarded behind an upstream AES decryption proxy.)

Guided Agent Skill

watchpost install-skill --target claude   # or codex | antigravity

Control API Authentication

Local /api/* endpoints on api_port require the auto-generated 0o600 token next to your SQLite DB (~/.local/share/watchpost/api.token):

TOKEN="$(cat ~/.local/share/watchpost/api.token)"
curl -s -X POST -H "Authorization: Bearer $TOKEN" http://127.0.0.1:8787/api/reload

Plugin SDK Quickstart (ChannelPlugin & NotifierPlugin)

watchpost plugins scaffold --kind channel --name my_bridge --dest ./plugins/my_bridge
watchpost plugins check --kind channel --test-fetch --cmd python3 ./plugins/my_bridge/plugin.py

# Reference templates (Channel, Notifier, and WhatsApp bridge):
watchpost plugins check --kind channel --test-fetch --cmd python3 examples/channel_plugin_template.py
watchpost plugins check --kind channel --test-fetch --cmd python3 examples/whatsapp_plugin_template.py
watchpost plugins check --kind notifier --cmd python3 examples/notifier_plugin_template.py

Antigravity Stop Hook Integration

uv run --project /path/to/watchpost watchpost hook-stop

Interactive Sandbox, API & Tests

watchpost sandbox-ui --backend mock       # 2-column browser simulator (IME-safe + debounce)
watchpost sandbox-ui --backend codex --cwd /path/to/repo --autonomy diagnose_only
watchpost sandbox --backend mock          # terminal REPL alternative
watchpost demo                            # scripted offline simulation
watchpost serve --host 127.0.0.1 --port 8787 --db ./data/watchpost.db
uv run pytest -q

Use sandbox-ui (http://127.0.0.1:8799) to chat on the left as an outside colleague and reply/approve "go" on the right as your phone.

Architecture, License & Roadmap

  • License boundary: Core is Apache-2.0 (official APIs and OS/CLI protocols only). Copyleft desktop bridges such as wechat-mcp (GPL-3.0) stay separate out-of-process external plugin scripts invoked over JSON stdin/stdout—never imported into Watchpost.
  • Full docs: Architecture · Plugin SDK · Platform Roadmap · Security Policy · Changelog · License

Metadata

Release files for watchpost-agent 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for watchpost-agent 0.4.1
File Size Uploaded Provenance Actions
watchpost_agent-0.4.1.tar.gz 294.5 kB With provenance Details for watchpost_agent-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for watchpost-agent 0.4.1
File Interpreter ABI Platform Actions
watchpost_agent-0.4.1-py3-none-any.whl Python 3 none any Details for watchpost_agent-0.4.1-py3-none-any.whl

Total release size: 539.4 kB

Release files / watchpost_agent-0.4.1.tar.gz

Download URL watchpost_agent-0.4.1.tar.gz
Size 294.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6b377bcb91f4dbed7e7bd5036e7643f103d922b14a1777944a1894c9d2dcb854
BLAKE2b-256 checksum
How to use checksums
8b5a77e661cdedb03f4665f30b529a2d736a1f99f1304906506734ab42acd05b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / watchpost_agent-0.4.1-py3-none-any.whl

Download URL watchpost_agent-0.4.1-py3-none-any.whl
Size 244.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
693feb62f22194a19868def7bb8b10de9433e5d62235b70330a0e5b0363a02b8
BLAKE2b-256 checksum
How to use checksums
4c5fecdd463ed44adc9ed74d7551bf3e234c6ea04600b59fb1da56460e6c5042
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for watchpost-agent 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for watchpost_agent-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page