@vibes.diy/prompts 2.5.6 → 2.5.7

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/image-gen.md CHANGED
@@ -108,6 +108,15 @@ App.jsx
108
108
  - Prev / next controls navigate between stored versions.
109
109
  - Set `showControls={false}` to hide regenerate and version navigation.
110
110
 
111
+ ## Access Functions and `doc.type`
112
+
113
+ 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`:
114
+
115
+ - **Image attached to a host doc** (`<ImgGen _id={hostDoc._id} database={db} />`): the image inherits the host doc's existing `type` (`story`, `hat`, whatever) and its access/channels. The write passes a type-keyed access function with no extra work.
116
+ - **Standalone image** (no `_id`, or a brand-new doc): the doc is written with `type: "image"`. A type-keyed access function will **reject** this unless it explicitly permits `"image"`. Add an `"image"` branch (with the grant/channel you want image docs to live on) so the write is accepted — otherwise image generation fails silently with `Failed to put document:`.
117
+
118
+ Prefer attaching images to the host doc whose access you already grant; reach for standalone image docs only when you've added an `"image"` branch to the access function.
119
+
111
120
  ## Choosing a Model
112
121
 
113
122
  Override the model per component: `<ImgGen prompt="An astronaut riding a horse" model="openai/gpt-5-image-mini" />`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/prompts",
3
- "version": "2.5.6",
3
+ "version": "2.5.7",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "description": "",
@@ -30,8 +30,8 @@
30
30
  "@fireproof/core-types-base": "~0.24.19",
31
31
  "@fireproof/core-types-protocols-cloud": "~0.24.19",
32
32
  "@fireproof/use-fireproof": "~0.24.19",
33
- "@vibes.diy/call-ai-v2": "^2.5.6",
34
- "@vibes.diy/use-vibes-types": "^2.5.6",
33
+ "@vibes.diy/call-ai-v2": "^2.5.7",
34
+ "@vibes.diy/use-vibes-types": "^2.5.7",
35
35
  "arktype": "~2.2.0",
36
36
  "json-schema-faker": "~0.6.2"
37
37
  },