@vibes.diy/prompts 4.0.7 → 4.0.9

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 +7 -0
  2. package/package.json +4 -4
package/llms/backend.md CHANGED
@@ -53,6 +53,7 @@ ctx.appInfo; // { ownerHandle, appSlug } — this app's identity
53
53
  ctx.userInfo; // { userHandle } or null — who the handler is acting as
54
54
  await ctx.db.put(doc, { db: "notes", id: "optional-id" }); // resolves to the doc id AFTER commit
55
55
  await ctx.db.delete(docId, { db: "notes" });
56
+ const docs = await ctx.db.query({ db: "notes" }); // latest non-deleted docs (each with _id)
56
57
  ```
57
58
 
58
59
  - `{ db }` names the Fireproof database (same names `App.jsx` uses with
@@ -60,6 +61,12 @@ await ctx.db.delete(docId, { db: "notes" });
60
61
  database that triggered the event is the default.
61
62
  - Always `await` db calls; they resolve only after the write commits (or throw
62
63
  when the access function denies it).
64
+ - `ctx.db.query({ db })` returns the whole database's latest docs (capped at
65
+ 2000) — filter and sort in the handler. It is read-ACL-gated as the acting
66
+ identity, anonymous `fetch` callers are denied, and databases bound to an
67
+ access function cannot be queried from the backend (keep backend-read
68
+ databases on plain ACLs). Made for `scheduled` sweeps: read, decide, then
69
+ `put`/`delete`.
63
70
  - **No outside network access**: `fetch()` to external URLs is refused inside
64
71
  `backend.js`, and there are no secrets/API keys yet. Don't call third-party
65
72
  APIs from the backend; AI calls stay in `App.jsx` via `callAI`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/prompts",
3
- "version": "4.0.7",
3
+ "version": "4.0.9",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "description": "",
@@ -24,9 +24,9 @@
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
26
  "@adviser/cement": "~0.5.34",
27
- "@vibes.diy/call-ai-v2": "^4.0.7",
28
- "@vibes.diy/identity": "^4.0.7",
29
- "@vibes.diy/use-vibes-types": "^4.0.7",
27
+ "@vibes.diy/call-ai-v2": "^4.0.9",
28
+ "@vibes.diy/identity": "^4.0.9",
29
+ "@vibes.diy/use-vibes-types": "^4.0.9",
30
30
  "arktype": "~2.2.1",
31
31
  "json-schema-faker": "~0.6.2"
32
32
  },