@vibes.diy/prompts 14.3.186 → 14.3.188

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 +18 -2
  2. package/package.json +5 -5
package/llms/backend.md CHANGED
@@ -893,6 +893,15 @@ recipe has three parts:
893
893
  document is cleared and the rest go through. `access.js` keeps every
894
894
  arrival at an `arrival:` id, so none can occupy a lead's id.
895
895
 
896
+ **A lead list belongs to the owner and the teammates they add.** Records
897
+ that carry people's names and contact details — leads, sign-ups, form
898
+ responses, inquiries — land on one members channel. The owner reads it from
899
+ the very first lead through the reserved `owner` role, and a `member` record
900
+ the owner writes lets a teammate in (`grant.users` names that teammate's
901
+ handle). The page gates its add-a-teammate control on
902
+ `useVibe("leads").can`, says who sees the list beside it ("Just you and the
903
+ teammates you add see these leads"), and your reply says the same.
904
+
896
905
  Gate both handlers on the secret, so the app works fully before any Zap
897
906
  exists, and say in your reply what the owner sets up: the secret, the Zap's
898
907
  POST address and header, and anonymous writes for the app (publishing from
@@ -998,14 +1007,21 @@ export function leads(doc, oldDoc, user, ctx) {
998
1007
  }
999
1008
  if (doc.type === "lead") {
1000
1009
  ctx.requireBackend("scheduled"); // a lead is written only after its seal matched
1001
- return { channels: ["leads"], grant: { users: { [user.userHandle]: ["leads"] } } };
1010
+ return { channels: ["leads"], grant: { roles: { owner: ["leads"] } } }; // the owner reads every lead
1011
+ }
1012
+ if (doc.type === "member") {
1013
+ ctx.requireRole("owner"); // the owner adds and removes teammates
1014
+ if (typeof doc.userHandle !== "string" || doc.userHandle === "") throw { forbidden: "a member names a handle" };
1015
+ if (oldDoc && oldDoc.userHandle !== doc.userHandle) throw { forbidden: "a member keeps its handle" };
1016
+ return { channels: ["leads"], grant: { users: { [doc.userHandle]: ["leads"] }, roles: { owner: ["leads"] } } };
1002
1017
  }
1003
1018
  throw { forbidden: "unknown type" };
1004
1019
  }
1005
1020
  ```
1006
1021
 
1007
1022
  The page lists `lead` records with `useLiveQuery("type", { key: "lead" })`,
1008
- and the owner sees each one within a minute of the Zap firing.
1023
+ and the owner and their teammates see each one within a minute of the Zap
1024
+ firing.
1009
1025
 
1010
1026
  ### Bulk transformations run as a route
1011
1027
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/prompts",
3
- "version": "14.3.186",
3
+ "version": "14.3.188",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "exports": {
@@ -39,10 +39,10 @@
39
39
  "license": "Apache-2.0",
40
40
  "dependencies": {
41
41
  "@adviser/cement": "~0.5.34",
42
- "@vibes.diy/api-types": "14.3.186",
43
- "@vibes.diy/call-ai-v2": "14.3.186",
44
- "@vibes.diy/identity": "14.3.186",
45
- "@vibes.diy/use-vibes-types": "14.3.186",
42
+ "@vibes.diy/api-types": "14.3.188",
43
+ "@vibes.diy/call-ai-v2": "14.3.188",
44
+ "@vibes.diy/identity": "14.3.188",
45
+ "@vibes.diy/use-vibes-types": "14.3.188",
46
46
  "arktype": "~2.2.8",
47
47
  "json-schema-faker": "~0.6.3"
48
48
  },