@vibes.diy/prompts 9.4.0 → 9.4.2

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/web-audio.md CHANGED
@@ -272,7 +272,18 @@ External sync and drift
272
272
  - Latency budget: device `baseLatency` + your lookahead + any Worklet buffering.
273
273
  - Headphones recommended for monitoring to avoid acoustic feedback.
274
274
 
275
- ## 6) Restraintsound belongs on the core actions
275
+ ## 6) File layout audio apps split, proactively
276
+
277
+ Audio apps run long: an engine (context/graph/scheduler), a playable surface (keyboard, pads, step grid), transport/parameter controls, and a preset list each carry real code. A single-file synth blows past the ~500-line `App.jsx` split threshold almost immediately — so split from the start rather than after the fact. The sandbox serves raw ES modules: relative imports work, local `.css` imports do not (style stays in `App.jsx`).
278
+
279
+ The shape that works (filenames illustrative — split by responsibility, matched to the app's actual surfaces, not by count):
280
+
281
+ - `lib/audio-engine.js` — everything that touches `AudioContext`: the `unlockAudio()` gate, node graph construction, voice management, the lookahead scheduler. Plain module, no React; export functions/objects the UI calls. Keeping the engine React-free is what makes gesture-synchronous unlock (§1) and clean scheduling (§4) easy — no re-render can rebuild the graph.
282
+ - `components/Keyboard.jsx` (or `StepGrid.jsx`, `Pads.jsx`) — the playable surface; calls engine functions from `pointerdown`-family handlers.
283
+ - `components/TransportControls.jsx`, `components/PresetList.jsx` — parameter knobs/sliders and preset browsing; presets live in the database, the engine consumes plain parameter objects.
284
+ - `App.jsx` — layout, styling, database wiring; imports the above (`import { createEngine } from "./lib/audio-engine.js"`).
285
+
286
+ ## 7) Restraint — sound belongs on the core actions
276
287
 
277
288
  - No sound on every keystroke, hover, or list render — that reads as noise, not life.
278
289
  - Never autoplay audio on load; playback must follow a user gesture (the `unlockAudio()` gate in §1).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/prompts",
3
- "version": "9.4.0",
3
+ "version": "9.4.2",
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": "^9.4.0",
28
- "@vibes.diy/identity": "^9.4.0",
29
- "@vibes.diy/use-vibes-types": "^9.4.0",
27
+ "@vibes.diy/call-ai-v2": "^9.4.2",
28
+ "@vibes.diy/identity": "^9.4.2",
29
+ "@vibes.diy/use-vibes-types": "^9.4.2",
30
30
  "arktype": "~2.2.3",
31
31
  "json-schema-faker": "~0.6.2"
32
32
  },
@@ -132,7 +132,8 @@ seed.json
132
132
  Rules for the items:
133
133
 
134
134
  - Every item carries a short immutable **`key`** slug (`"alert"`, `"setname"`), **unique within its database's array**. The key is the item's identity across codegen turns — the platform derives the document id and idempotency from it, so **do NOT invent `_id`s or write any dedupe logic**. Re-emitting an unchanged `seed.json` on a later turn is a no-op; changing an item's content updates that one document.
135
- - Set `_id` explicitly **only** for a well-known singleton (a `config:setname` settings doc); the `key` is still required.
135
+ - Set `_id` explicitly in exactly two cases — a well-known singleton (a `config:setname` settings doc), or an item that other seed items reference by id (next rule); every other item gets no `_id`. The `key` is still required either way.
136
+ - **Cross-references need an explicit `_id`.** Any seed item that OTHER seed items point at by id must carry an explicit `_id`, and the referencing items must use that exact `_id` value — never the bare `key`. The platform derives the id as `seed:<key>`, so a field holding the raw key (`"listId": "list-pancakes"`) will never match the referenced doc's id (`seed:list-pancakes`) and the join comes up empty. Give the parent an `_id` (`"_id": "list-pancakes"`) and have children reference that same string.
136
137
  - Multi-db apps get one array per db; use the exact db names from `App.jsx`.
137
138
  - **Seed every app-written document type.** For every string-literal `type` that `App.jsx` writes, include at least one exemplar row of that type — even ephemeral types get one humble example. Types originated by the platform at runtime (for example ImgGen's `"image"`) cannot be seeded — omit them.
138
139
  - **JSON only — no images or binary.** For items whose identity includes an illustration, rely on `<ImgGen>` rendering it on first view (the default); do not put `_files` or image bytes in `seed.json`.
@@ -134,7 +134,8 @@ seed.json
134
134
  Rules for the items:
135
135
 
136
136
  - Every item carries a short immutable **`key`** slug (`"alert"`, `"setname"`), **unique within its database's array**. The key is the item's identity across codegen turns — the platform derives the document id and idempotency from it, so **do NOT invent `_id`s or write any dedupe logic**. Re-emitting an unchanged `seed.json` on a later turn is a no-op; changing an item's content updates that one document.
137
- - Set `_id` explicitly **only** for a well-known singleton (a `config:setname` settings doc); the `key` is still required.
137
+ - Set `_id` explicitly in exactly two cases — a well-known singleton (a `config:setname` settings doc), or an item that other seed items reference by id (next rule); every other item gets no `_id`. The `key` is still required either way.
138
+ - **Cross-references need an explicit `_id`.** Any seed item that OTHER seed items point at by id must carry an explicit `_id`, and the referencing items must use that exact `_id` value — never the bare `key`. The platform derives the id as `seed:<key>`, so a field holding the raw key (`"listId": "list-pancakes"`) will never match the referenced doc's id (`seed:list-pancakes`) and the join comes up empty. Give the parent an `_id` (`"_id": "list-pancakes"`) and have children reference that same string.
138
139
  - Multi-db apps get one array per db; use the exact db names from `App.jsx`.
139
140
  - **Seed every app-written document type.** For every string-literal `type` that `App.jsx` writes, include at least one exemplar row of that type — even ephemeral types get one humble example. Types originated by the platform at runtime (for example ImgGen's `"image"`) cannot be seeded — omit them.
140
141
  - **JSON only — no images or binary.** For items whose identity includes an illustration, rely on `<ImgGen>` rendering it on first view (the default); do not put `_files` or image bytes in `seed.json`.
package/system-prompt.md CHANGED
@@ -436,15 +436,24 @@ docs in your database, and never build follow UI state machines.
436
436
  `requestFollowersAccess(): Promise<void>` (the preflight consent path). For a normal app,
437
437
  `followersEnabled` is ON by default — sharing with followers just works, so DON'T gate your
438
438
  audience UI on it or make users flip a switch first. It is `false` only for the minority:
439
- the viewer explicitly turned this app off, chose a never-share standing policy, or the app is
440
- marked privacy-sensitive (a diary, a personal tracker), where sharing stays off until a
441
- deliberate opt-in. Show a small "open to followers so friends can see your picks" callout
439
+ the viewer explicitly turned this app off, chose a never-share standing preference, or the app
440
+ is marked privacy-sensitive (a diary, a personal tracker), where sharing stays off until a
441
+ deliberate opt-in. Show a small "open to followers so followers can see your picks" callout
442
442
  wired to `requestFollowersAccess()` ONLY when `!followersEnabled` (that minority), for an app
443
443
  whose whole point is sharing; for a privacy-sensitive app this is the deliberate-consent
444
444
  prompt. `requestFollowersAccess()` resolves quietly with no state change (including when the
445
445
  app is already enabled, or the viewer already declined/opted out) — never call it in a loop,
446
446
  on every render, or more than once per explicit user action. Don't invent a callout an app's
447
447
  own privacy doesn't call for.
448
+ - For an explicit visibility control (a settings toggle inside your app), `useSocial()` returns
449
+ `visibility: "followers" | "private"` (read-only: the effective level for THIS viewer/app —
450
+ `followersEnabled` is just `visibility !== "private"`) and
451
+ `setVisibility(level): Promise<void>` to change it. `"followers"` means followers can see;
452
+ `"private"` turns this app's sharing off for the viewer. Call `setVisibility` only from an
453
+ explicit user action (a toggle), then re-render from `visibility` — it resolves after the
454
+ change lands. (`"public"`/world-readable is not settable yet; don't offer it.) Most apps don't
455
+ need this — the default already shares with followers; reach for it only when the app's own UX
456
+ wants an in-app privacy switch.
448
457
  - To grow the graph, `useSocial()` returns
449
458
  `invite(email: string): Promise<"ok" | "rate-limited" | "cancelled">` — asks the PLATFORM to
450
459
  email a non-user an invitation to connect with the viewer. The platform shows a consent prompt,
@@ -634,7 +643,8 @@ seed.json
634
643
  Rules for the items:
635
644
 
636
645
  - Every item carries a short immutable **`key`** slug (`"alert"`, `"setname"`), **unique within its database's array**. The key is the item's identity across codegen turns — the platform derives the document id and idempotency from it, so **do NOT invent `_id`s or write any dedupe logic**. Re-emitting an unchanged `seed.json` on a later turn is a no-op; changing an item's content updates that one document.
637
- - Set `_id` explicitly **only** for a well-known singleton (a `config:setname` settings doc); the `key` is still required.
646
+ - Set `_id` explicitly in exactly two cases — a well-known singleton (a `config:setname` settings doc), or an item that other seed items reference by id (next rule); every other item gets no `_id`. The `key` is still required either way.
647
+ - **Cross-references need an explicit `_id`.** Any seed item that OTHER seed items point at by id must carry an explicit `_id`, and the referencing items must use that exact `_id` value — never the bare `key`. The platform derives the id as `seed:<key>`, so a field holding the raw key (`"listId": "list-pancakes"`) will never match the referenced doc's id (`seed:list-pancakes`) and the join comes up empty. Give the parent an `_id` (`"_id": "list-pancakes"`) and have children reference that same string.
638
648
  - Multi-db apps get one array per db; use the exact db names from `App.jsx`.
639
649
  - **Seed every app-written document type.** For every string-literal `type` that `App.jsx` writes, include at least one exemplar row of that type — even ephemeral types get one humble example. Types originated by the platform at runtime (for example ImgGen's `"image"`) cannot be seeded — omit them.
640
650
  - **JSON only — no images or binary.** For items whose identity includes an illustration, rely on `<ImgGen>` rendering it on first view (the default); do not put `_files` or image bytes in `seed.json`.