diff --git a/AGENTS.md b/AGENTS.md index 6e791b76..c8c593f9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,263 +1,66 @@ -# Bitvid — AI Agent Guide (AGENTS.md) +# Bitvid — AI Agent Guide -This document tells AI agents how Bitvid works **now** and how to extend it going forward. It focuses on the newly adopted **URL‑first playback with WebTorrent fallback** strategy, minimal code touchpoints, and reliable interop with the Nostr ecosystem. - -As you work in the repo, please add detailed comments to help others understand what and why your code is doing. +This guide tells AI agents how to keep Bitvid aligned with the current product direction. Follow it whenever you touch code, content, or documentation inside this repository. --- -## 1) Mission & Product Direction +## 1. Mission: URL‑First Playback with WebTorrent Fallback -**Goal:** Stream videos reliably and cheaply. - -* **Primary transport:** a **hosted video URL** (MP4/WebM/HLS/DASH) that plays directly in the browser. -* **Secondary transport (fallback & cost control):** a **WebTorrent magnet** enhanced with **`ws=` (web seed)** and **`xs=` (.torrent URL)**. -* **Behavior:** Try `url` first. If it’s missing or unreachable, **fallback to WebTorrent** using the same post’s magnet. If the magnet includes `ws`/`xs`, WebTorrent can bootstrap via HTTP and/or peers. -* **Nostr interop:** Keep existing kind `30078` events for Bitvid’s app data; optionally **mirror a NIP‑94 kind `1063`** event so other clients can discover the same hosted video URL. -* **Resilience:** Light link‑health probing to hide/flag dead URLs and avoid broken playback. +* **Goal:** Always deliver smooth playback while keeping hosting costs low. +* **Primary transport:** A hosted video URL (MP4/WebM/HLS/DASH) that the `