A yes/no device endpoint that walks through a daily pipeline of habits, each with a predict → confirm pair integrated with Fatebook for calibration tracking.
Each day the pipeline resets at 2am PST (7am São Paulo) and presents habits sequentially:
| Endpoint | Description |
|---|---|
GET /question | Current question text (plain text, ≤30 chars) |
GET /yes | Answer yes, advance pipeline |
GET /no | Answer no, advance pipeline |
GET /reset | Reset to step 0 |
GET /status | Full pipeline state (JSON) |
GET /responses | All logged answers (JSON) |
habits.ts — Habit definitions (add new habits here)
pipeline.ts — Generic state machine, auto-advance, auto-resolve
fatebook.ts — Fatebook API client (graceful skip if no key)
main.ts — HTTP handler (backward compatible)
cron.ts — 2:15am PST auto-resolve unconfirmed predictions as NO
Add an entry to the HABITS array in habits.ts. Each habit needs:
id, label, forecast, tagsgetPredictText() — predict question (≤30 chars)getConfirmText() — confirm question (≤30 chars)getFatebookTitle() — full Fatebook question titlecheckAutoComplete() — optional auto-detection from external sourceAdd FATEBOOK_API_KEY to this val's environment variables.
Get your key at https://fatebook.io/api-setup