@vibes.diy/prompts 14.2.3 → 14.2.5

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.
package/llms/access.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This doc is in view because the app is getting its `access.js`: either the prompt names sharing, privacy, teams, members, roles, approval or who-can-see-what, or the platform is running the second pass every app gets — a first build drafts the records with their keys already in place (`creatorHandle` on the object, the parent id on each child, `authorHandle` on every record) and leaves the rules and the invite screen to this pass. Every app gets record rules unless the person asked for none in their own words, and the group shape taught below is the resting default. A person the ask names is let in by a record — see _A person the ask names is let in by a record_ below — so the build states the membership record's shape and the invite handler that writes it.
4
4
 
5
- **On a second pass over an app that already exists, the pass owes only what the rules need.** Read `App.jsx` for the object type, the field that names its creator and the parent id its children carry; name the channels from those records; write the complete `access.js`; then change `App.jsx` only where the rules require it — the invite screen, and any write surface not yet gated on `can` — with SEARCH/REPLACE edits. A file the rules do not touch is not emitted, and stays as it is.
5
+ **On a second pass over an app that already exists, the pass owes only what the rules need.** Read `App.jsx` for the object type, the field that names its creator and the parent id its children carry; name the channels from those records; write the complete `access.js`; then change `App.jsx` only where the rules require it — the invite screen, stable creator membership, typed content queries, and any write surface not yet gated on `can` — with SEARCH/REPLACE edits. A file the rules do not touch is not emitted, and stays as it is.
6
6
 
7
7
  **Honest copy:** until `access.js` says otherwise, all app data is shared and world-readable, and the runtime, not your UI, decides access — `access.js` is where per-document write validation and channel-based read isolation live. Write UI copy that describes what the rules actually do.
8
8
 
@@ -28,7 +28,7 @@ and keep loading and signed-out states distinct from denial.
28
28
 
29
29
  Express every refusal about **who may act** through the supplied validators — `ctx.requireAccess`, `ctx.requireRole`, `ctx.requireBackend` — so that admin mode passes them and the function still runs, applying your own channels and grants to the repaired document; a refusal about the document's own **shape**, like an unknown type or a missing field, stays a plain `throw` and is right to, while a write-once check sits in between and is worth naming in a comment, since a schema repair has to get past it.
30
30
 
31
- The access function's scope is the app's own databases: a platform component's own database (a `media:*` name) carries platform-authored access rules the server evaluates separately, so your access function writes rules only for the databases the app itself creates. Within those, platform-driven writes onto the app's own docs — like an `<ImgGen>` version append (the `ctx.isImgGenVersionAppend` shape) — flow through your function like any other write.
31
+ A component-owned image database (`media:<hostDbName>`) uses platform-authored rules by default. An explicit string-named export such as `export { posterMedia as "media:posters" }` overrides that one media database. Neither `export default` nor a function merely named `media` overrides it. Within those, platform-driven writes onto the app's own docs — like an `<ImgGen>` version append (the `ctx.isImgGenVersionAppend` shape) — flow through your function like any other write.
32
32
 
33
33
  ### AccessDescriptor return type
34
34
 
@@ -115,6 +115,49 @@ if (doc.type === "entry") {
115
115
  throw { forbidden: "unknown document type" }; // every access.js ends by denying what it does not know
116
116
  ```
117
117
 
118
+ ### Private generated images and published snapshots
119
+
120
+ `<ImgGen database="posters" _id={poster._id}>` stores its generated images AND
121
+ prompts in `media:posters`. Making the `posters` records private does not make
122
+ the default media database private. For private drafts, supply an exact media
123
+ override in the same `access.js`; a different host database name alone still
124
+ uses the public-media default.
125
+
126
+ ```js
127
+ function posterMedia(doc, oldDoc, user) {
128
+ if (!user || doc.authorHandle !== user.userHandle) throw { forbidden: "not author" };
129
+ if (doc.type !== "version" && doc.type !== "pointer") throw { forbidden: "unknown media record" };
130
+ if (oldDoc && (doc.authorHandle !== oldDoc.authorHandle || doc.hostDocId !== oldDoc.hostDocId || doc.type !== oldDoc.type)) {
131
+ throw { forbidden: "creator and target cannot change" };
132
+ }
133
+ if (oldDoc && oldDoc.type === "version") throw { forbidden: "versions are append-only" };
134
+ if (doc.type === "version" && (!doc._files || typeof doc._files !== "object" || Array.isArray(doc._files) || Object.keys(doc._files).length === 0)) {
135
+ throw { forbidden: "a version needs its generated file" };
136
+ }
137
+ const channel = `images:${doc.authorHandle}`;
138
+ return { channels: [channel], grant: { users: { [doc.authorHandle]: [channel] } } };
139
+ }
140
+ export { posterMedia as "media:posters" };
141
+ ```
142
+
143
+ Each writer's versions are private even if another writer guesses the same
144
+ `hostDocId`; guessing never grants access to another person's image records.
145
+ For shared media that should instead follow its host's **current** read rules,
146
+ return only `inheritRead: { db: "posters", docId: doc.hostDocId }` (no public
147
+ channel). Bind writes to the intended creator too: assign host IDs such as
148
+ `${me.userHandle}:${crypto.randomUUID()}`, enforce that creator prefix on host
149
+ creation, and require the same prefix on `doc.hostDocId` in the media rule.
150
+ `inheritRead` controls reads; by itself it does not authorize writes to the host.
151
+
152
+ To publish one finished image while keeping drafts private, read the chosen
153
+ version with `useImgGen`, obtain its `_files[version.id].file()`, and save that
154
+ File with the event facts in a separate publication record. Give only that
155
+ record a public grant, and render its `_files.poster.url` with `<img>` for
156
+ visitors. Do not spread the draft or media document into the publication: that
157
+ would copy draft prompts and prior versions. Unpublishing removes that record's
158
+ public grant. Explicit media bindings fail closed on older access outputs until
159
+ the publish-time backfill evaluates them under the new rule.
160
+
118
161
  ### The ImgGen version-append nuance
119
162
 
120
163
  The platform predicate `ctx.isImgGenVersionAppend(doc, oldDoc)` accepts exactly one legitimate ImgGen version append by a non-author — prior versions/files and all other fields must be unchanged, so a field you didn't anticipate stays author-protected by default; deletes stay author-only. Because `versions`/`currentVersion` are among the version fields it allows, a non-author can also advance the DISPLAYED version (the shared-generation feature); guard `currentVersion` specifically for author-only display control. Write-once docs can simply `if (oldDoc === null) {} else throw`.
@@ -142,6 +185,25 @@ A channel is a _reusable_ unit of read access: grant a user into a channel once
142
185
  - **A document goes to a one-off set with no reusable group:** route to several channels at once — `return { channels: [\`user:${aHandle}\`, \`user:${bHandle}\`] }`. Mint a per-document channel (`channels: [doc._id]`) only when each document genuinely has its own disjoint audience.
143
186
  - **Refusing a write:** `throw { forbidden: "reason" }`. Every document you store is routed to at least one channel so it can be read back.
144
187
 
188
+ ### Content queries select a record type and its parent
189
+
190
+ A shared channel contains the group's content and its membership records. An
191
+ invitation may carry the same `boardId` as a gear item, so querying only `boardId`
192
+ returns both. When adding invitations or other supporting record types, update
193
+ the existing content query at the same time. Keep the parent selection and derive
194
+ one content-only list:
195
+
196
+ ```jsx
197
+ const { docs: boardDocs } = useLiveQuery("boardId", { key: boardId });
198
+ const gear = boardDocs.filter((doc) => doc.type === "gear");
199
+ ```
200
+
201
+ Use that typed list for rendered rows, counts, empty states, correction targets,
202
+ and records sent to Ask. Membership views select their own record types from the
203
+ same group. Match the app's actual types and parent field; a compound index that
204
+ selects both is equally suitable. This is a content selection rule: `access.js`
205
+ continues to decide who can read and change each record.
206
+
145
207
  ### Multiple databases in one file
146
208
 
147
209
  Each named export gates its own database. A single `/access.js` can gate all databases the app uses:
@@ -812,11 +874,12 @@ App.jsx — `access.hasChannel()` shows only the lists the viewer belongs to; `u
812
874
 
813
875
  #### The same shape with a default object per person, and a member doc that names the friend
814
876
 
815
- Reach for this variant whenever the app is built around a *thing* people come back to — a board, a trip, a game night's scoreboard, a hiking group's trail list, a habit tracker one person keeps and a coach is invited into next month. Everything above still holds; three additions make it feel finished from the first load:
877
+ Reach for this variant whenever the app is built around a *thing* people come back to — a board, a trip, a game night's scoreboard, a hiking group's trail list, a habit tracker one person keeps and a coach is invited into next month. Everything above still holds; four additions make it feel finished from the first load:
816
878
 
817
- - **Every signed-in person already has one object, with no doc to create.** Their default channel is derived from their own handle — `` `board:default-${user.userHandle}` `` — so a brand-new visitor opens the app, types, and their first item lands. Each write to it re-grants that person their own channel, because there is no object doc carrying the grant. **The child doc stores that board id rather than having each writer derive one**: the create writes `` boardId: pickedBoardId || `default-${me.userHandle}` `` and the rule holds it fixed from then on, so a card stays on the board its creator put it on however many people edit it later.
879
+ - **Every signed-in person gets a default object automatically.** Its stable board record uses `` `default-${me.userHandle}` `` as its id and grants its creator the board channel and admin channel. Establish that record before the first content write or invitation, including when inviting is the first action. The creator remains a member when the board is empty, when a collaborator writes first, and after the last creator-authored item is deleted. Read the board by its fixed id before creating it; an existing board keeps its name and other settings. Child records route to the board channel; the board record carries the lasting creator grant. **The child doc stores that board id rather than having each writer derive one**: the create uses the displayed object’s id, with `` `default-${me.userHandle}` `` for a first action before any object exists and the rule holds it fixed from then on, so a card stays on the board its creator put it on however many people edit it later.
818
880
  - **Membership is a `member` doc, and picking the friend is `HandleInput`** (`useViewer()`, see use-viewer.md — the platform's people-picker, so the handle on the doc is one the platform resolved). The doc grants the named person the object's channel: `` grant: { users: { [doc.userHandle]: [chan] } } ``.
819
881
  - **The object's creator is its admin**, held on a second channel (`` `${chan}/admin` ``) that the creator self-grants at creation. Adding a member is gated on that admin channel, so members collaborate and the creator decides who joins. The app owner holds no place in any of this: every rule reads `user.userHandle` or the object's own `creatorHandle`.
882
+ - **Recipients can select every readable object.** The ordinary object query already applies the access rules, including grants from independent membership records. Its complete result supplies the picker. Prefer the person's own object as the initial selection while keeping invited objects selectable alongside it. Resolve the selected id against the current readable results on each render, so a revoked object leaves both the picker and the content view. Use the selected object's id for child queries, new content, and invitations; `can` continues to gate each write.
820
883
 
821
884
  access.js
822
885
 
@@ -835,8 +898,8 @@ export function boards(doc, oldDoc, user, ctx) {
835
898
  if (oldDoc) {
836
899
  if (doc.creatorHandle !== oldDoc.creatorHandle) throw { forbidden: "creator is fixed" };
837
900
  ctx.requireAccess(ch(doc._id) + "/admin"); // renaming is an admin act — updates only
838
- } else if (doc.creatorHandle !== user.userHandle) {
839
- throw { forbidden: "you must be the creator" };
901
+ } else if (doc.creatorHandle !== user.userHandle || (doc._id.startsWith("default-") && doc._id !== myDefault)) {
902
+ throw { forbidden: "create your own board" };
840
903
  }
841
904
  return { channels: [ch(doc._id)], grant: { users: { [doc.creatorHandle]: [ch(doc._id), ch(doc._id) + "/admin"] } } };
842
905
  }
@@ -852,10 +915,7 @@ export function boards(doc, oldDoc, user, ctx) {
852
915
  if (oldDoc && doc.boardId !== oldDoc.boardId) throw { forbidden: "card stays on its board" };
853
916
  const chan = ch(doc.boardId);
854
917
  if (doc.boardId !== myDefault) ctx.requireAccess(chan); // any member edits any card on it
855
- // The implicit default board has no board doc, so each write re-grants its own person.
856
- if (doc.boardId === myDefault) {
857
- return { channels: [chan], grant: { users: { [user.userHandle]: [chan, chan + "/admin"] } } };
858
- }
918
+ // The stable board record carries its creator's grant, independently of cards.
859
919
  return { channels: [chan] };
860
920
  }
861
921
 
@@ -880,37 +940,86 @@ App.jsx — the invite surface is `HandleInput` plus one `member` write, shown t
880
940
  const { HandleInput } = useViewer();
881
941
  const { me, can } = useVibe("boards");
882
942
  const canInvite = (boardId) => can.create({ type: "member", boardId, userHandle: "x", addedBy: me?.userHandle }).ok;
883
- const addMember = (boardId, handle) =>
884
- handle &&
885
- database.put({
943
+ // This read/create is awaited before either first action. Existing board settings survive.
944
+ const ensureDefaultBoard = async (boardId) => {
945
+ if (boardId !== `default-${me.userHandle}`) return;
946
+ const { docs } = await database.query("_id", { key: boardId });
947
+ if (docs.length === 0) {
948
+ await database.put({ _id: boardId, type: "board", creatorHandle: me.userHandle });
949
+ }
950
+ };
951
+ const addMember = async (boardId, handle) => {
952
+ if (!handle) return;
953
+ await ensureDefaultBoard(boardId);
954
+ await database.put({
886
955
  _id: `member:${boardId}:${handle}`,
887
956
  type: "member",
888
957
  boardId,
889
958
  userHandle: handle,
890
959
  addedBy: me.userHandle,
891
960
  });
892
- // Every card names its board at creation — the person's own default board when they picked none.
893
- const addCard = (text) => database.put({ type: "card", boardId: pickedBoardId || `default-${me.userHandle}`, text });
961
+ };
962
+ // Pass the displayed board's id; a first action before any board exists uses the person's own default.
963
+ const addCard = async (text, boardId = `default-${me.userHandle}`) => {
964
+ await ensureDefaultBoard(boardId);
965
+ return database.put({ type: "card", boardId, text });
966
+ };
894
967
  // …
895
968
  {canInvite(board._id) && <HandleInput onChange={(h) => addMember(board._id, h)} placeholder="Add a friend…" />}
896
969
  ```
897
970
 
971
+ App.jsx — the same board list serves the creator and the invited recipient. `BoardContents` uses `board._id` for its content queries, calls `addCard(text, board._id)` and `addMember(board._id, handle)`, and gates its write controls with `can`. Pass the `ensureDefaultBoard` helper above into `BoardWorkspace`; its creation action stays reachable with an empty readable list and selects the person's new board after saving it.
972
+
973
+ ```jsx file=App.jsx partial
974
+ function BoardWorkspace({ ensureDefaultBoard }) {
975
+ const { useLiveQuery } = useFireproof("boards");
976
+ const { me, can } = useVibe("boards");
977
+ const [pickedBoardId, setPickedBoardId] = React.useState();
978
+ const { docs: boards } = useLiveQuery("type", { key: "board" });
979
+ const ownBoardId = me?.userHandle ? `default-${me.userHandle}` : undefined;
980
+ const ownBoard = { _id: ownBoardId, type: "board", creatorHandle: me?.userHandle };
981
+ const createOwnBoard = async () => {
982
+ await ensureDefaultBoard(ownBoardId);
983
+ setPickedBoardId(ownBoardId);
984
+ };
985
+ const board =
986
+ boards.find((board) => board._id === pickedBoardId) ??
987
+ boards.find((board) => board.creatorHandle === me?.userHandle) ??
988
+ boards[0];
989
+ return (
990
+ <section>
991
+ {ownBoardId && !boards.some((board) => board._id === ownBoardId) && can.create(ownBoard).ok && (
992
+ <button onClick={createOwnBoard}>Create my board</button>
993
+ )}
994
+ <label>
995
+ Board
996
+ <select value={board?._id ?? ""} onChange={(event) => setPickedBoardId(event.target.value)} disabled={boards.length === 0}>
997
+ {boards.map((board) => <option key={board._id} value={board._id}>{board.name ?? board._id}</option>)}
998
+ </select>
999
+ </label>
1000
+ {board && <BoardContents board={board} />}
1001
+ </section>
1002
+ );
1003
+ }
1004
+ ```
1005
+
898
1006
  A new access function has no use for `user.isOwner` at all: a rule about a **person** keys on `user.userHandle` or the object's own creator field, and a rule about the app's **own automation** keys on `user.backend`.
899
1007
 
900
1008
  #### A person the ask names is let in by a record
901
1009
 
902
1010
  When the instruction names somebody by their handle — "let my friend priya-k see and add to my chores list", "an expedition notebook for me and theo" — **the build's part is the rule that admits a membership and the screen that writes one; the membership itself is a record.** It is the same `member` doc the invite surface above writes, saved for that handle on the asker's own default object once the rules are live, by whoever is driving the build acting as the maker, read back, and only then spoken of as in.
903
1011
 
904
- So the record's shape is a contract the files state plainly. The `_id` is fixed by the object and the handle — `` `member:${boardId}:${userHandle}` `` — so a second attempt is the same record rather than a twin, and a read by that id answers "is this person already in?" on its own. The fields are the ones the rule reads: `type`, `boardId`, `userHandle`, and `addedBy` set to the writer's own handle. The `member` rule above admits the board's creator writing on their own default board with nothing to bootstrap, and admits an identical re-put, so a replay lands quietly. One invite handler in `App.jsx` writes exactly that shape, which is what makes the app's own screen and any later save agree on one record.
1012
+ So the record's shape is a contract the files state plainly. The `_id` is fixed by the object and the handle — `` `member:${boardId}:${userHandle}` `` — so a second attempt is the same record rather than a twin, and a read by that id answers "is this person already in?" on its own. The fields are the ones the rule reads: `type`, `boardId`, `userHandle`, and `addedBy` set to the writer's own handle. The invite handler first ensures the stable board record, then writes the membership. The `member` rule admits an identical re-put, so a replay lands quietly. The board record keeps the creator in the collaboration independently of every content and invitation record. One invite handler in `App.jsx` writes exactly that shape, which is what makes the app's own screen and any later save agree on one record.
905
1013
 
906
1014
  ```jsx
907
1015
  const { HandleInput } = useViewer();
908
1016
  const { database } = useFireproof("boards");
909
1017
  const { me, can } = useVibe("boards");
910
- const addMember = (boardId, handle) => {
1018
+ const addMember = async (boardId, handle) => {
1019
+ await ensureDefaultBoard(boardId); // the read/create helper above
911
1020
  // One fixed id per (board, handle): the same person added twice is the same record.
912
1021
  const member = { _id: `member:${boardId}:${handle}`, type: "member", boardId, userHandle: handle, addedBy: me.userHandle };
913
- if (can.create(member).ok) database.put(member);
1022
+ if (can.create(member).ok) await database.put(member);
914
1023
  };
915
1024
  // …
916
1025
  <HandleInput onChange={(h) => h && addMember(board._id, h)} placeholder="Add a friend…" />;
@@ -2,15 +2,21 @@
2
2
 
3
3
  The `callAI` function asks an AI model and returns a string. Every call carries a `schema`, and the string that comes back is JSON you `JSON.parse()`. When the app needs prose — a chat reply, a caption, a paragraph — the schema is a single string field and that field holds the prose: `schema: { properties: { reply: { type: "string" } } }`, read back as `JSON.parse(response).reply`.
4
4
 
5
+ The browser runtime validates each answer against your schema. A schema mismatch uses the existing fallback attempt; an exhausted fallback rejects the call. Keep the person's input available when showing a retry action. App normalization still owns trusted ids, sharing fields, and meaningful values such as a nonempty title.
6
+
7
+ Use this capability when an app turns words into structured records or provides requested model-generated text. Direct controls handle known values, and a simple message saves directly when its text is the whole record.
8
+
5
9
  ## Text to records
6
10
 
7
- Wire these visible actions in the first working app, using its own record names. One composer has Add and Ask actions. Add extracts and normalizes facts, saves each record immediately, and shows saved records with edit actions; one item and a pasted batch share this action. Each saved row has Change by sentence: selecting it changes Add to Apply correction, which saves onto that same record id. Ask sends the typed question with the relevant saved records and displays a read-only answer beside the composer. Edit opens the selected row’s populated fields. One parent-owned Undo restores the latest successful creation batch or the previous document from either a sentence correction or a field edit.
11
+ An ordinary tracker with several facts per entry uses sentence creation even when the person never asks for AI, pasting, or a chat interface. A packing board with item, quantity, and who is bringing it, or a potluck board with dish, servings, and contributor, starts with this composer. Keep quantity steppers, claim buttons, and toggles on existing records as direct controls; they complement sentence creation. A name-only list, a simple message, and a timer stay direct because their input already is the whole record or an explicit setting.
12
+
13
+ For an app that keeps structured records, wire these visible actions in the first working app, using its own record names. One composer has Add and Ask actions. Add extracts and normalizes facts, saves each record immediately, and shows saved records with edit actions; one item and a pasted batch share this action. Each saved row has Change by sentence: selecting it changes Add to Apply correction, which saves onto that same record id. Ask sends the typed question with the relevant saved records and displays a read-only answer beside the composer. Edit opens the selected row’s populated fields. One parent-owned Undo restores the latest successful creation batch or the previous document from either a sentence correction or a field edit.
8
14
 
9
15
  A record starts as a sentence. For structured intake, use one text box or the app's chat composer, extract the person's facts into the document's fields, normalize them, and save immediately in that same submit action. Show the saved record with editing controls. A pasted list becomes individual records through an array schema. Field-by-field controls belong to the edit view of a saved record. One new record and a pasted batch use the same composer. Opening a saved row’s Edit action reveals its populated field controls. A message whose text IS the record can save directly; extraction is useful when the person would otherwise fill several fields. Requested AI generation remains available for creative work.
10
16
 
11
17
  The extraction schema names the same editable fields the app writes to its documents. Normalize the parsed output into that shape before saving or rendering: check strings, finite numbers, enum values and arrays (including their members), and project only the fields the app owns. Keep `_id`, authorship, parent ids and sharing fields under app control. Submitting the sentence commits the normalized records automatically. The saved card shows the understood facts and is the confirmation; editing follows persistence. For an edit by sentence, pass the current editable fields plus the correction through the same single-record schema, then write the normalized fields onto that saved record's trusted identity.
12
18
 
13
- After each successful creation, sentence correction or field edit, the parent owns one Undo action. Keep the created ids or the previous document until the next successful write replaces them; a detail editor reports its previous document to that parent after its save succeeds. Undo deletes the created records or puts the previous document back. A value the person already knows — a number, a date, a time, a choice, an on/off state — is a control, never a schema field a sentence is asked to fill; the schema extracts what the person described and leaves what they can set.
19
+ After each successful creation, sentence correction or field edit, the parent owns one Undo action. Keep the created ids or the previous document until the next successful write replaces them; a detail editor reports its previous document to that parent after its save succeeds. Undo deletes the created records or puts the previous document back. An explicit setting — a number, a date, a time, a choice, an on/off state — stays a direct control. The schema can extract ordinary quantities the person describes, such as two tents or six servings, while a saved row keeps its quantity control. Critical values (a dose, a price, a deadline, a timer, a recipient) are set directly. A multi-field record still starts with the composer.
14
20
 
15
21
  This complete example covers **one sentence → one task**, **pasted list → many tasks**, **a selected task + correction → the same task**, **questions from the same box**, and **Undo after a save**. Every new submission uses the array schema, whether it names one task or several. The person sets a due date in the saved task’s date control. A malformed response leaves the typed sentence and saved records available; the waiting state ends when the request settles.
16
22
 
@@ -175,7 +181,7 @@ For nested document shapes, normalize every collection at its boundary: `Array.i
175
181
 
176
182
  ## Ask about your records
177
183
 
178
- The same box answers a question about the records the app holds: send the records the answer could need with the question, and ask for the answer in a schema with one string field. Bound what you send (the visible list, or the records a query selected), name today's date when the question could involve time, and render the answer as text beside the box, never as a saved record.
184
+ In a sentence-intake app, the same box answers a question about the records the app holds: send the records the answer could need with the question, and ask for the answer in a schema with one string field. Bound what you send (the visible list, or the records a query selected), name today's date when the question could involve time, and render the answer as text beside the box, never as a saved record.
179
185
 
180
186
  ```jsx
181
187
  const { docs } = useLiveQuery("type", { key: "task" });
package/llms/callai.md CHANGED
@@ -2,15 +2,21 @@
2
2
 
3
3
  The `callAI` function asks an AI model and returns a string. Every call carries a `schema`, and the string that comes back is JSON you `JSON.parse()`. When the app needs prose — a chat reply, a caption, a paragraph — the schema is a single string field and that field holds the prose: `schema: { properties: { reply: { type: "string" } } }`, read back as `JSON.parse(response).reply`.
4
4
 
5
+ The browser runtime validates each answer against your schema. A schema mismatch uses the existing fallback attempt; an exhausted fallback rejects the call. Keep the person's input available when showing a retry action. App normalization still owns trusted ids, sharing fields, and meaningful values such as a nonempty title.
6
+
7
+ Use this capability when an app turns words into structured records or provides requested model-generated text. Direct controls handle known values, and a simple message saves directly when its text is the whole record.
8
+
5
9
  ## Text to records
6
10
 
7
- Wire these visible actions in the first working app, using its own record names. One composer has Add and Ask actions. Add extracts and normalizes facts, saves each record immediately, and shows saved records with edit actions; one item and a pasted batch share this action. Each saved row has Change by sentence: selecting it changes Add to Apply correction, which saves onto that same record id. Ask sends the typed question with the relevant saved records and displays a read-only answer beside the composer. Edit opens the selected row’s populated fields. One parent-owned Undo restores the latest successful creation batch or the previous document from either a sentence correction or a field edit.
11
+ An ordinary tracker with several facts per entry uses sentence creation even when the person never asks for AI, pasting, or a chat interface. A packing board with item, quantity, and who is bringing it, or a potluck board with dish, servings, and contributor, starts with this composer. Keep quantity steppers, claim buttons, and toggles on existing records as direct controls; they complement sentence creation. A name-only list, a simple message, and a timer stay direct because their input already is the whole record or an explicit setting.
12
+
13
+ For an app that keeps structured records, wire these visible actions in the first working app, using its own record names. One composer has Add and Ask actions. Add extracts and normalizes facts, saves each record immediately, and shows saved records with edit actions; one item and a pasted batch share this action. Each saved row has Change by sentence: selecting it changes Add to Apply correction, which saves onto that same record id. Ask sends the typed question with the relevant saved records and displays a read-only answer beside the composer. Edit opens the selected row’s populated fields. One parent-owned Undo restores the latest successful creation batch or the previous document from either a sentence correction or a field edit.
8
14
 
9
15
  A record starts as a sentence. For structured intake, use one text box or the app's chat composer, extract the person's facts into the document's fields, normalize them, and save immediately in that same submit action. Show the saved record with editing controls. A pasted list becomes individual records through an array schema. Field-by-field controls belong to the edit view of a saved record. One new record and a pasted batch use the same composer. Opening a saved row’s Edit action reveals its populated field controls. A message whose text IS the record can save directly; extraction is useful when the person would otherwise fill several fields. Requested AI generation remains available for creative work.
10
16
 
11
17
  The extraction schema names the same editable fields the app writes to its documents. Normalize the parsed output into that shape before saving or rendering: check strings, finite numbers, enum values and arrays (including their members), and project only the fields the app owns. Keep `_id`, authorship, parent ids and sharing fields under app control. Submitting the sentence commits the normalized records automatically. The saved card shows the understood facts and is the confirmation; editing follows persistence. For an edit by sentence, pass the current editable fields plus the correction through the same single-record schema, then write the normalized fields onto that saved record's trusted identity.
12
18
 
13
- After each successful creation, sentence correction or field edit, the parent owns one Undo action. Keep the created ids or the previous document until the next successful write replaces them; a detail editor reports its previous document to that parent after its save succeeds. Undo deletes the created records or puts the previous document back. A value the person already knows — a number, a date, a time, a choice, an on/off state — is a control, never a schema field a sentence is asked to fill; the schema extracts what the person described and leaves what they can set.
19
+ After each successful creation, sentence correction or field edit, the parent owns one Undo action. Keep the created ids or the previous document until the next successful write replaces them; a detail editor reports its previous document to that parent after its save succeeds. Undo deletes the created records or puts the previous document back. An explicit setting — a number, a date, a time, a choice, an on/off state — stays a direct control. The schema can extract ordinary quantities the person describes, such as two tents or six servings, while a saved row keeps its quantity control. Critical values (a dose, a price, a deadline, a timer, a recipient) are set directly. A multi-field record still starts with the composer.
14
20
 
15
21
  This complete example covers **one sentence → one task**, **pasted list → many tasks**, **a selected task + correction → the same task**, **questions from the same box**, and **Undo after a save**. Every new submission uses the array schema, whether it names one task or several. The person sets a due date in the saved task’s date control. A malformed response leaves the typed sentence and saved records available; the waiting state ends when the request settles.
16
22
 
@@ -175,7 +181,7 @@ For nested document shapes, normalize every collection at its boundary: `Array.i
175
181
 
176
182
  ## Ask about your records
177
183
 
178
- The same box answers a question about the records the app holds: send the records the answer could need with the question, and ask for the answer in a schema with one string field. Bound what you send (the visible list, or the records a query selected), name today's date when the question could involve time, and render the answer as text beside the box, never as a saved record.
184
+ In a sentence-intake app, the same box answers a question about the records the app holds: send the records the answer could need with the question, and ask for the answer in a schema with one string field. Bound what you send (the visible list, or the records a query selected), name today's date when the question could involve time, and render the answer as text beside the box, never as a saved record.
179
185
 
180
186
  ```jsx
181
187
  const { docs } = useLiveQuery("type", { key: "task" });
@@ -197,8 +197,12 @@ studio, a template's starter rows, the rooms in a planner — those records are
197
197
  created by the app's own first render through the ordinary write path. That is
198
198
  the mechanism, and it is the same one described below for starter content.
199
199
  `seed.json` is a separate thing: an optional import a person runs by hand from
200
- the Data tab, applied by no deploy path, so a record that exists only there does
201
- not exist for anyone who opens the app.
200
+ the Data tab. Its sample records also populate the temporary, view-only preview
201
+ while saving is being prepared; they become real saved records only through an
202
+ explicit import. In that file, give each item a stable `key`; its derived identity
203
+ is `seed:<key>`. References to another item use that derived identity. An `_id`
204
+ that repeats the item's own derived identity is equivalent to leaving it out.
205
+ Explicit singleton identities such as `config:board` remain available.
202
206
 
203
207
  Four rules make it hold:
204
208
 
@@ -250,6 +254,36 @@ function Board({ pickedBoardId }) {
250
254
 
251
255
  Queries read off those same ids — `useLiveQuery("boardId", { key: boardId })` above — so the fields earn their place immediately rather than being bookkeeping for later.
252
256
 
257
+ ### Match sample records to the maker's opening query
258
+
259
+ The initial build's preview-maker context supplies the actual maker handle.
260
+ Use it to evaluate the opening query's group ID when writing `seed.json`.
261
+ For a maker named `mira`, the runtime expression below selects `default-mira`,
262
+ so every sample card in this opening board carries that exact `boardId`:
263
+
264
+ ```jsx
265
+ const boardId = pickedBoardId ?? `default-${me?.userHandle}`;
266
+ const { docs: cards } = useLiveQuery("boardId", { key: boardId });
267
+ ```
268
+
269
+ ```json
270
+ {
271
+ "boards": [
272
+ { "key": "tent", "type": "card", "boardId": "default-mira", "text": "Blue tent, sleeps four" },
273
+ { "key": "stove", "type": "card", "boardId": "default-mira", "text": "Two-burner camp stove" },
274
+ { "key": "lantern", "type": "card", "boardId": "default-mira", "text": "Two rechargeable lanterns" },
275
+ { "key": "cooler", "type": "card", "boardId": "default-mira", "text": "Wheeled cooler" }
276
+ ]
277
+ }
278
+ ```
279
+
280
+ Substitute the supplied maker handle in the sample values; keep the app's query
281
+ and real writes driven by the current viewer and selected object. The database
282
+ name, record type, parent references and query filters agree across the sample
283
+ file and opening view. Later edits preserve those parent references.
284
+ The platform labels the temporary preview as sample data; those records reach
285
+ persistent storage only through the person's explicit import.
286
+
253
287
  ### Seeding starter data — give each seed a deterministic `_id`
254
288
 
255
289
  When an app ships with default content — starter slides, template rows, example cards — and writes it into the database on first load, give **each seed document a deterministic `_id`** (`"seed:intro"`, `"seed:" + key`). This makes the seeding write **idempotent**: if it ever runs again, it overwrites the same documents instead of creating fresh copies.
package/llms/fireproof.md CHANGED
@@ -197,8 +197,12 @@ studio, a template's starter rows, the rooms in a planner — those records are
197
197
  created by the app's own first render through the ordinary write path. That is
198
198
  the mechanism, and it is the same one described below for starter content.
199
199
  `seed.json` is a separate thing: an optional import a person runs by hand from
200
- the Data tab, applied by no deploy path, so a record that exists only there does
201
- not exist for anyone who opens the app.
200
+ the Data tab. Its sample records also populate the temporary, view-only preview
201
+ while saving is being prepared; they become real saved records only through an
202
+ explicit import. In that file, give each item a stable `key`; its derived identity
203
+ is `seed:<key>`. References to another item use that derived identity. An `_id`
204
+ that repeats the item's own derived identity is equivalent to leaving it out.
205
+ Explicit singleton identities such as `config:board` remain available.
202
206
 
203
207
  Four rules make it hold:
204
208
 
@@ -219,6 +223,36 @@ ids those are two writes of the same document, and last-writer-wins converges on
219
223
  one copy. Reading the query first and then deciding whether to write is the shape
220
224
  that races — the read is empty in both tabs before either write lands.
221
225
 
226
+ ### Match sample records to the maker's opening query
227
+
228
+ The initial build's preview-maker context supplies the actual maker handle.
229
+ Use it to evaluate the opening query's group ID when writing `seed.json`.
230
+ For a maker named `mira`, the runtime expression below selects `default-mira`,
231
+ so every sample card in this opening board carries that exact `boardId`:
232
+
233
+ ```jsx
234
+ const boardId = pickedBoardId ?? `default-${me?.userHandle}`;
235
+ const { docs: cards } = useLiveQuery("boardId", { key: boardId });
236
+ ```
237
+
238
+ ```json
239
+ {
240
+ "boards": [
241
+ { "key": "tent", "type": "card", "boardId": "default-mira", "text": "Blue tent, sleeps four" },
242
+ { "key": "stove", "type": "card", "boardId": "default-mira", "text": "Two-burner camp stove" },
243
+ { "key": "lantern", "type": "card", "boardId": "default-mira", "text": "Two rechargeable lanterns" },
244
+ { "key": "cooler", "type": "card", "boardId": "default-mira", "text": "Wheeled cooler" }
245
+ ]
246
+ }
247
+ ```
248
+
249
+ Substitute the supplied maker handle in the sample values; keep the app's query
250
+ and real writes driven by the current viewer and selected object. The database
251
+ name, record type, parent references and query filters agree across the sample
252
+ file and opening view. Later access rules preserve those parent references.
253
+ The platform labels the temporary preview as sample data; those records reach
254
+ persistent storage only through the person's explicit import.
255
+
222
256
  ### Seeding starter data — give each seed a deterministic `_id`
223
257
 
224
258
  When an app ships with default content — starter slides, template rows, example cards — and writes it into the database on first load, give **each seed document a deterministic `_id`** (`"seed:intro"`, `"seed:" + key`). This makes the seeding write **idempotent**: if it ever runs again, it overwrites the same documents instead of creating fresh copies.
@@ -153,3 +153,15 @@ Model ids follow the `provider/model-name` form from the platform's model catalo
153
153
  - `className`, `alt`, `style`: standard image styling
154
154
  - `showControls`: toggle regenerate + version nav (default `true`)
155
155
  - `model`: override the image-gen model for this component
156
+
157
+ ## Generated-image privacy
158
+
159
+ Generated images and prompts use a component-owned media database whose default
160
+ read policy is app-public. A private host record or a different database name
161
+ does not change that policy. Do not describe generated image history as private
162
+ until the app's subsequent access pass establishes its media permissions.
163
+
164
+ Publish a separate record containing only the chosen image File and the intended
165
+ public facts. Public viewers render its `_files` URL with `<img>`; keep generation
166
+ and revision controls on the creator's draft. Share the same `useImgGen` hook
167
+ result between preview, download and publication so they select the same version.
package/llms/image-gen.md CHANGED
@@ -138,6 +138,21 @@ function Gallery() {
138
138
  - Prev / next controls navigate between stored versions.
139
139
  - Set `showControls={false}` to hide regenerate and version navigation.
140
140
 
141
+ ## Private drafts and public images
142
+
143
+ Generated images and prompts live in `media:<database>`, whose default read
144
+ policy is app-public. A private host record or a different database name does
145
+ not change that policy. For private drafts, add an explicit
146
+ `export { privateMedia as "media:yourDatabase" }` in `access.js`, with
147
+ creator-owned version/pointer rules and private read grants. An app-wide
148
+ default export does not override media. See the access skill's "Private
149
+ generated images and published snapshots" recipe.
150
+
151
+ Publish a separate record containing only the chosen image File and the intended
152
+ public facts. Public viewers render its `_files` URL with `<img>`; keep generation
153
+ and revision controls on the creator's draft. Share the same `useImgGen` hook
154
+ result between preview, download and publication so they select the same version.
155
+
141
156
  ## Access Functions and `doc.type`
142
157
 
143
158
  If your app defines an access function that keys on `doc.type` (the common pattern — e.g. it throws `{ forbidden: "unknown document type" }` for any unenumerated type), be aware of how ImgGen sets `type`:
@@ -287,7 +287,7 @@ And never disable the app's real controls on `!viewer`. If favoriting works sign
287
287
 
288
288
  ## ViewerTag
289
289
 
290
- `ViewerTag` is a ready-made inline user pill returned alongside `viewer` from `useViewer()`. It is not a separate import — you get it from the hook. **Use it to render _other_ people** — comment authors, roster rows, "added by" labels — by passing `userHandle`:
290
+ `ViewerTag` is a ready-made inline user pill. Import it directly with `import { ViewerTag } from "use-vibes";`, or get it alongside `viewer` from `useViewer()`. Both forms use the current viewer context and the same identity, pending, and avatar-edit behavior. **Use it to render _other_ people** — comment authors, roster rows, "added by" labels — by passing `userHandle`:
291
291
 
292
292
  ```jsx
293
293
  {/* Show another user read-only: */}
@@ -278,7 +278,7 @@ And never disable the app's real controls on `!viewer`. If favoriting works sign
278
278
 
279
279
  ## ViewerTag
280
280
 
281
- `ViewerTag` is a ready-made inline user pill returned alongside `viewer` from `useViewer()`. It is not a separate import — you get it from the hook. **Use it to render _other_ people** — comment authors, roster rows, "added by" labels — by passing `userHandle`:
281
+ `ViewerTag` is a ready-made inline user pill. Import it directly with `import { ViewerTag } from "use-vibes";`, or get it alongside `viewer` from `useViewer()`. Both forms use the current viewer context and the same identity, pending, and avatar-edit behavior. **Use it to render _other_ people** — comment authors, roster rows, "added by" labels — by passing `userHandle`:
282
282
 
283
283
  ```jsx
284
284
  {/* Show another user read-only: */}
@@ -301,7 +301,7 @@ Pass `<ViewerTag userHandle={...} />` to render other people. Reach for the no-p
301
301
 
302
302
  ## HandleInput
303
303
 
304
- `HandleInput` is a ready-made **find-a-person input**, returned from `useViewer()` alongside `ViewerTag`. Use it whenever your app needs the viewer to pick another user — assigning a task, adding someone to a roster, sharing with a friend. Never build your own handle autocomplete or ask users to type handles into a bare `<input>`.
304
+ `HandleInput` is a ready-made **find-a-person input**. Import it directly with `import { HandleInput } from "use-vibes"`, or take it from `useViewer()` alongside `ViewerTag`; both expose the same component and props. Use it whenever your app needs the viewer to pick another user — assigning a task, adding someone to a roster, sharing with a friend. Never build your own handle autocomplete or ask users to type handles into a bare `<input>`.
305
305
 
306
306
  ```jsx
307
307
  const { HandleInput } = useViewer();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/prompts",
3
- "version": "14.2.3",
3
+ "version": "14.2.5",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "exports": {
@@ -37,9 +37,9 @@
37
37
  "license": "Apache-2.0",
38
38
  "dependencies": {
39
39
  "@adviser/cement": "~0.5.34",
40
- "@vibes.diy/call-ai-v2": "14.2.3",
41
- "@vibes.diy/identity": "14.2.3",
42
- "@vibes.diy/use-vibes-types": "14.2.3",
40
+ "@vibes.diy/call-ai-v2": "14.2.5",
41
+ "@vibes.diy/identity": "14.2.5",
42
+ "@vibes.diy/use-vibes-types": "14.2.5",
43
43
  "arktype": "~2.2.3",
44
44
  "json-schema-faker": "~0.6.3"
45
45
  },
package/prompts.js CHANGED
@@ -179,7 +179,7 @@ export async function makeBaseSystemPrompt(model, sessionDoc) {
179
179
  selectedNames.push(required);
180
180
  }
181
181
  }
182
- for (const capability of ["image-gen"]) {
182
+ for (const capability of ["image-gen", "callai"]) {
183
183
  if (llmsCatalogNames.has(capability) && !selectedNames.includes(capability)) {
184
184
  selectedNames.push(capability);
185
185
  }
package/prompts.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../jsr/prompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAmB,MAAM,gBAAgB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACjI,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,EAEL,wBAAwB,EACxB,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;AAC1D,CAAC;AAWD,MAAM,4BAA4B,GAChC,4wCAA4wC,CAAC;AAS/wC,MAAM,kBAAkB,GACtB,+PAA+P,CAAC;AAUlQ,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,UAAkB,EAAE,OAAoC;IACpG,MAAM,OAAO,GAAG,MAAM,aAAa,EAAE,CAAC;IACtC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAKnF,MAAM,SAAS,GAAG,aAAa;SAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,KA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,CAAC;IACL,CAAC,CAAC,CAAC;IACH,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;QAClB,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,KAAK,CAAC,EAAE,EAAE,CAAC;AACpB,CAAC"}
@@ -42,11 +42,13 @@ You are an AI assistant tasked with creating React components. You should create
42
42
  - Never use emojis in the UI. Use inline SVG icons instead — simple, single-color, stroke-based SVGs (24x24 viewBox, strokeWidth 2, strokeLinecap round, strokeLinejoin round). Build icons directly in JSX, do not import icon libraries.
43
43
  ### A record starts as a sentence
44
44
 
45
+ An ordinary tracker with several facts per entry uses sentence creation even when the person never asks for AI, pasting, or a chat interface. A packing board with item, quantity, and who is bringing it, or a potluck board with dish, servings, and contributor, starts with this composer. Keep quantity steppers, claim buttons, and toggles on existing records as direct controls; they complement sentence creation. A name-only list, a simple message, and a timer stay direct because their input already is the whole record or an explicit setting.
46
+
45
47
  Wire these visible actions in the first working app, using its own record names. One composer has Add and Ask actions. Add extracts and normalizes facts, saves each record immediately, and shows saved records with edit actions; one item and a pasted batch share this action. Each saved row has Change by sentence: selecting it changes Add to Apply correction, which saves onto that same record id. Ask sends the typed question with the relevant saved records and displays a read-only answer beside the composer. Edit opens the selected row’s populated fields. One parent-owned Undo restores the latest successful creation batch or the previous document from either a sentence correction or a field edit.
46
48
 
47
49
  An app is the person's own records and the rules they set for them; the page is one way in. When the callai skill is available and the app keeps structured records, the front door is one text box or the app's own chat composer, never a field-by-field form: the person types or pastes what happened, one schema call extracts their facts into the document's editable fields, and submitting saves the normalized records in that same action. The saved record is the confirmation: show what was understood as cards or rows the person can edit directly, and keep Undo one tap away after every save. A pasted list becomes many records through an array schema, one document each. Use that array for every new submission: a single item yields one record and several items yield several records from the same box. The same box takes a correction to a selected record and answers a question about the records the app holds. Field-by-field controls are the edit view of a record that already exists. One new record and a pasted batch use the same composer. Opening a saved row’s Edit action reveals its populated field controls.
48
50
 
49
- A value the person already has in mind stays a direct control: a known number, date, time, choice or on/off state is set with a picker, stepper, slider or toggle, and a critical value (a dose, a price, a deadline, a timer, a recipient) is never inferred from a sentence. Keep a simple message or a name direct when its text already is the whole record; use extraction where the person would otherwise fill several fields. Never render the raw parse: normalize it into the shape the app renders first (project known fields, check primitive types and enum values, check arrays and each member before mapping) and let the app supply identity, author, parent and sharing fields. Keep the typed words available through loading, refusal and correction. When the app acts on its own later, it leaves a visible record of what it did. The callai skill's Text to records example teaches the single-record, batch, correction and undo paths, and its Ask about your records section teaches the question path.
51
+ A value the person already has in mind stays a direct control when setting or adjusting that value: use a picker, stepper, slider or toggle, and a critical value (a dose, a price, a deadline, a timer, a recipient) is never inferred from a sentence. Ordinary quantities described in a new record, such as two tents or six servings, can be extracted; the saved row retains its quantity control. Keep a simple message or a name direct when its text already is the whole record; use extraction where the person would otherwise fill several fields. Never render the raw parse: normalize it into the shape the app renders first (project known fields, check primitive types and enum values, check arrays and each member before mapping) and let the app supply identity, author, parent and sharing fields. Keep the typed words available through loading, refusal and correction. When the app acts on its own later, it leaves a visible record of what it did. The callai skill's Text to records example teaches the single-record, batch, correction and undo paths, and its Ask about your records section teaches the question path.
50
52
  - List data items on the main page of your app so people can browse and open each saved record.
51
53
  - Keep saved records visible as cards or rows with direct editing. For structured intake with the callai skill, add a sentence-based correction action.
52
54
  - For an app with the callai skill, let an example chip put an example sentence into the same intake box. Submitting it runs the same parser and automatic save path as the person's own words. Extraction of the person's facts into structured records is a default use of callAI, including when the request describes an ordinary useful app. Reserve additional analysis (such as sentiment scoring or inferred tags) for a feature the person requests. A message board can save the person's message directly when its text already is the record.{{DEMO_DATA}}
@@ -42,11 +42,13 @@ You are an AI assistant tasked with creating React components. You should create
42
42
  - Never use emojis in the UI. Use inline SVG icons instead — simple, single-color, stroke-based SVGs (24x24 viewBox, strokeWidth 2, strokeLinecap round, strokeLinejoin round). Build icons directly in JSX, do not import icon libraries.
43
43
  ### A record starts as a sentence
44
44
 
45
+ An ordinary tracker with several facts per entry uses sentence creation even when the person never asks for AI, pasting, or a chat interface. A packing board with item, quantity, and who is bringing it, or a potluck board with dish, servings, and contributor, starts with this composer. Keep quantity steppers, claim buttons, and toggles on existing records as direct controls; they complement sentence creation. A name-only list, a simple message, and a timer stay direct because their input already is the whole record or an explicit setting.
46
+
45
47
  Wire these visible actions in the first working app, using its own record names. One composer has Add and Ask actions. Add extracts and normalizes facts, saves each record immediately, and shows saved records with edit actions; one item and a pasted batch share this action. Each saved row has Change by sentence: selecting it changes Add to Apply correction, which saves onto that same record id. Ask sends the typed question with the relevant saved records and displays a read-only answer beside the composer. Edit opens the selected row’s populated fields. One parent-owned Undo restores the latest successful creation batch or the previous document from either a sentence correction or a field edit.
46
48
 
47
49
  An app is the person's own records and the rules they set for them; the page is one way in. When the callai skill is available and the app keeps structured records, the front door is one text box or the app's own chat composer, never a field-by-field form: the person types or pastes what happened, one schema call extracts their facts into the document's editable fields, and submitting saves the normalized records in that same action. The saved record is the confirmation: show what was understood as cards or rows the person can edit directly, and keep Undo one tap away after every save. A pasted list becomes many records through an array schema, one document each. Use that array for every new submission: a single item yields one record and several items yield several records from the same box. The same box takes a correction to a selected record and answers a question about the records the app holds. Field-by-field controls are the edit view of a record that already exists. One new record and a pasted batch use the same composer. Opening a saved row’s Edit action reveals its populated field controls.
48
50
 
49
- A value the person already has in mind stays a direct control: a known number, date, time, choice or on/off state is set with a picker, stepper, slider or toggle, and a critical value (a dose, a price, a deadline, a timer, a recipient) is never inferred from a sentence. Keep a simple message or a name direct when its text already is the whole record; use extraction where the person would otherwise fill several fields. Never render the raw parse: normalize it into the shape the app renders first (project known fields, check primitive types and enum values, check arrays and each member before mapping) and let the app supply identity, author, parent and sharing fields. Keep the typed words available through loading, refusal and correction. When the app acts on its own later, it leaves a visible record of what it did. The callai skill's Text to records example teaches the single-record, batch, correction and undo paths, and its Ask about your records section teaches the question path.
51
+ A value the person already has in mind stays a direct control when setting or adjusting that value: use a picker, stepper, slider or toggle, and a critical value (a dose, a price, a deadline, a timer, a recipient) is never inferred from a sentence. Ordinary quantities described in a new record, such as two tents or six servings, can be extracted; the saved row retains its quantity control. Keep a simple message or a name direct when its text already is the whole record; use extraction where the person would otherwise fill several fields. Never render the raw parse: normalize it into the shape the app renders first (project known fields, check primitive types and enum values, check arrays and each member before mapping) and let the app supply identity, author, parent and sharing fields. Keep the typed words available through loading, refusal and correction. When the app acts on its own later, it leaves a visible record of what it did. The callai skill's Text to records example teaches the single-record, batch, correction and undo paths, and its Ask about your records section teaches the question path.
50
52
  - List data items on the main page of your app so people can browse and open each saved record.
51
53
  - Keep saved records visible as cards or rows with direct editing. For structured intake with the callai skill, add a sentence-based correction action.
52
54
  - For an app with the callai skill, let an example chip put an example sentence into the same intake box. Submitting it runs the same parser and automatic save path as the person's own words. Extraction of the person's facts into structured records is a default use of callAI, including when the request describes an ordinary useful app. Reserve additional analysis (such as sentiment scoring or inferred tags) for a feature the person requests. A message board can save the person's message directly when its text already is the record.{{DEMO_DATA}}
package/system-prompt.md CHANGED
@@ -48,11 +48,13 @@ You are an AI assistant tasked with creating React components. You should create
48
48
  - The system can send you crash reports, fix them by simplifying the affected code
49
49
  ### A record starts as a sentence
50
50
 
51
+ An ordinary tracker with several facts per entry uses sentence creation even when the person never asks for AI, pasting, or a chat interface. A packing board with item, quantity, and who is bringing it, or a potluck board with dish, servings, and contributor, starts with this composer. Keep quantity steppers, claim buttons, and toggles on existing records as direct controls; they complement sentence creation. A name-only list, a simple message, and a timer stay direct because their input already is the whole record or an explicit setting.
52
+
51
53
  Wire these visible actions in the first working app, using its own record names. One composer has Add and Ask actions. Add extracts and normalizes facts, saves each record immediately, and shows saved records with edit actions; one item and a pasted batch share this action. Each saved row has Change by sentence: selecting it changes Add to Apply correction, which saves onto that same record id. Ask sends the typed question with the relevant saved records and displays a read-only answer beside the composer. Edit opens the selected row’s populated fields. One parent-owned Undo restores the latest successful creation batch or the previous document from either a sentence correction or a field edit.
52
54
 
53
55
  An app is the person's own records and the rules they set for them; the page is one way in. When the callai skill is available and the app keeps structured records, the front door is one text box or the app's own chat composer, never a field-by-field form: the person types or pastes what happened, one schema call extracts their facts into the document's editable fields, and submitting saves the normalized records in that same action. The saved record is the confirmation: show what was understood as cards or rows the person can edit directly, and keep Undo one tap away after every save. A pasted list becomes many records through an array schema, one document each. Use that array for every new submission: a single item yields one record and several items yield several records from the same box. The same box takes a correction to a selected record and answers a question about the records the app holds. Field-by-field controls are the edit view of a record that already exists. One new record and a pasted batch use the same composer. Opening a saved row’s Edit action reveals its populated field controls.
54
56
 
55
- A value the person already has in mind stays a direct control: a known number, date, time, choice or on/off state is set with a picker, stepper, slider or toggle, and a critical value (a dose, a price, a deadline, a timer, a recipient) is never inferred from a sentence. Keep a simple message or a name direct when its text already is the whole record; use extraction where the person would otherwise fill several fields. Never render the raw parse: normalize it into the shape the app renders first (project known fields, check primitive types and enum values, check arrays and each member before mapping) and let the app supply identity, author, parent and sharing fields. Keep the typed words available through loading, refusal and correction. When the app acts on its own later, it leaves a visible record of what it did. The callai skill's Text to records example teaches the single-record, batch, correction and undo paths, and its Ask about your records section teaches the question path.
57
+ A value the person already has in mind stays a direct control when setting or adjusting that value: use a picker, stepper, slider or toggle, and a critical value (a dose, a price, a deadline, a timer, a recipient) is never inferred from a sentence. Ordinary quantities described in a new record, such as two tents or six servings, can be extracted; the saved row retains its quantity control. Keep a simple message or a name direct when its text already is the whole record; use extraction where the person would otherwise fill several fields. Never render the raw parse: normalize it into the shape the app renders first (project known fields, check primitive types and enum values, check arrays and each member before mapping) and let the app supply identity, author, parent and sharing fields. Keep the typed words available through loading, refusal and correction. When the app acts on its own later, it leaves a visible record of what it did. The callai skill's Text to records example teaches the single-record, batch, correction and undo paths, and its Ask about your records section teaches the question path.
56
58
  - List data items on the main page of your app so people can browse and open each saved record.
57
59
  - Keep saved records visible as cards or rows with direct editing. For structured intake with the callai skill, add a sentence-based correction action.
58
60
  - For an app with the callai skill, let an example chip put an example sentence into the same intake box. Submitting it runs the same parser and automatic save path as the person's own words. Extraction of the person's facts into structured records is a default use of callAI, including when the request describes an ordinary useful app. Reserve additional analysis (such as sentiment scoring or inferred tags) for a feature the person requests. A message board can save the person's message directly when its text already is the record.{{DEMO_DATA}}