@vibes.diy/prompts 14.0.12 → 14.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/llms/backend.md +13 -2
  2. package/package.json +4 -4
package/llms/backend.md CHANGED
@@ -28,6 +28,10 @@ create or mention `backend.js`.
28
28
  - **`scheduled`** — "every N minutes", "poll", "check periodically", "cron",
29
29
  "cleanup", "digest". **Timer-driven**, no user in the loop.
30
30
 
31
+ A reminder that recurs at a wall-clock time — "every morning at 9", "each
32
+ Friday" — is a `scheduled` handler; `onChange` answers a write that just
33
+ happened.
34
+
31
35
  An app can need more than one — a payments app wants `fetch` (webhook receipt)
32
36
  **and** `onChange` (email on the new order). If none of these signal words fit
33
37
  the request, the app needs no `backend.js` — don't emit one.
@@ -511,7 +515,10 @@ a sweep that diffs against its own whole-db read goes blind the moment the
511
515
  database outgrows one page, and then rewrites everything on every tick, forever.
512
516
  Keep a copy of the state in module scope as well, and read a **missing or failed**
513
517
  state read as *"don't know — skip this tick"*, never as *"nothing has been done
514
- yet"*: that second reading is exactly what restarts the endless rewrite.
518
+ yet"*: that second reading is exactly what restarts the endless rewrite. That
519
+ state doc is owner-only in `access.js` — it is what the tick believes about
520
+ itself, so keeping it to the owner is what keeps anyone else from steering the
521
+ tick.
515
522
 
516
523
  ## fetch — the app's HTTP endpoint
517
524
 
@@ -792,7 +799,11 @@ export async function scheduled(event, ctx) {
792
799
  },
793
800
  { db: SHOW_DB }
794
801
  );
795
- await ctx.notify({ toHandle: ctx.appInfo.ownerHandle, body: "Your six jokes are drafted and ready for the show." });
802
+ await ctx.notify({
803
+ toHandle: ctx.appInfo.ownerHandle,
804
+ body: "Your six jokes are drafted and ready for the show.",
805
+ dedupeKey: `draft-${dayKey}`,
806
+ });
796
807
  } catch (err) {
797
808
  // The day stays claimed: the owner sees what went wrong and is not billed twice for it.
798
809
  ctx.log("error", "[digest] draft failed after the day was claimed", { message: err.message });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/prompts",
3
- "version": "14.0.12",
3
+ "version": "14.0.13",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "exports": {
@@ -34,9 +34,9 @@
34
34
  "license": "Apache-2.0",
35
35
  "dependencies": {
36
36
  "@adviser/cement": "~0.5.34",
37
- "@vibes.diy/call-ai-v2": "14.0.12",
38
- "@vibes.diy/identity": "14.0.12",
39
- "@vibes.diy/use-vibes-types": "14.0.12",
37
+ "@vibes.diy/call-ai-v2": "14.0.13",
38
+ "@vibes.diy/identity": "14.0.13",
39
+ "@vibes.diy/use-vibes-types": "14.0.13",
40
40
  "arktype": "~2.2.3",
41
41
  "json-schema-faker": "~0.6.3"
42
42
  },