From f3e8539eaf976e224253228650232c1d61ac8bc8 Mon Sep 17 00:00:00 2001 From: Daniel Salazar Date: Sat, 24 Oct 2026 01:26:07 -0700 Subject: [PATCH] docs: easy events recipe (PUT-1961) (#3998) * docs: easy events recipe (PUT-1961) * docs: catch-up-on-notifications events recipe (PUT-1961) * docs: notification examples use notif:app-user, which apps can read * docs: events recipe corrections from a run against a live server (PUT-1961) * refine and update agents md --------- Co-authored-by: Reynaldi Chernando --- AGENTS.md | 3 +- src/docs/src/Events.md | 4 +- src/docs/src/Events/fetch.md | 8 +- .../examples/events-fetch-then-listen.html | 4 +- .../src/playground/examples/events-fetch.html | 2 +- src/docs/src/recipe-tags.js | 1 + .../src/recipes/catch-up-on-notifications.md | 156 +++++++++++ src/docs/src/recipes/watch-for-changes.md | 243 ++++++++++++++++++ 8 files changed, 411 insertions(+), 10 deletions(-) create mode 100644 src/docs/src/recipes/catch-up-on-notifications.md create mode 100644 src/docs/src/recipes/watch-for-changes.md diff --git a/AGENTS.md b/AGENTS.md index 0ea415eb1..e0e297b78 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -185,9 +185,10 @@ Recipes are tested, copy-pasteable patterns for a task, one layer above the per- - **Intro.** Explain the situation and why you'd do this, tied to something the reader already knows ("`puter.kv` is your database in Puter.js"). No "Use this when" bullet list. - **Structure.** Get to the first working call as early as possible, then add validation, rate limits, and sign-in after it. Explain a Puter concept the first time it appears, such as what `me.puter` is or that `puter.workers.exec()` opens the Puter sign-in window. Split recipes by what the reader needs, not by technique, and give a family of recipes a shared tag. - **Link to the reference for full option lists.** Mention only the options the recipe uses, then link to the function page for the rest ("All the sort options are listed on [`puter.fs.readdir()`](/FS/readdir/)."). A copied list of options, rules, or scopes goes stale when the reference changes. +- **Limits.** Mention a limit only when it's the reason for a pattern the recipe uses, such as one wildcard subscription instead of one per key, and link to [rate-limits-and-quotas.md](src/docs/src/rate-limits-and-quotas.md) or the function page for the number. Leave out limits that code following the recipe never reaches. - **Code.** Platform-neutral: just the code, with top-level `await`. No `