@vibes.diy/prompts 6.1.3 → 6.2.0
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/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/llms/image-gen.md +17 -2
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export * from "./themes/index.js";
|
|
|
8
8
|
export { parseContent } from "./segment-parser.js";
|
|
9
9
|
export { normalizeComponentExports, transformImports, coreImportMap } from "./component-transforms.js";
|
|
10
10
|
export { buildSchemaSystemMessage } from "./build-schema-prompt.js";
|
|
11
|
+
export { allConfigs } from "./llms/index.js";
|
package/index.js
CHANGED
|
@@ -8,4 +8,5 @@ export * from "./themes/index.js";
|
|
|
8
8
|
export { parseContent } from "./segment-parser.js";
|
|
9
9
|
export { normalizeComponentExports, transformImports, coreImportMap } from "./component-transforms.js";
|
|
10
10
|
export { buildSchemaSystemMessage } from "./build-schema-prompt.js";
|
|
11
|
+
export { allConfigs } from "./llms/index.js";
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../jsr/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../jsr/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAIpE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
package/llms/image-gen.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Generate and edit images from a text prompt. Each generated image lands as a file ref on the doc — display reads the platform-minted URL via `_files`.
|
|
4
4
|
|
|
5
|
+
**When to use it:** reach for `<ImgGen>` when a picture adds real value — items whose identity includes an image (cards, creatures, products, covers), user-personalized art (avatars, portraits from a photo), or apps whose whole point is imagery. Most text/data apps (lists, trackers, notes, forms) need **no** images — leave the import unused rather than decorating with gratuitous pictures.
|
|
6
|
+
|
|
5
7
|
## Basic Usage
|
|
6
8
|
|
|
7
9
|
Start with a minimal image generation component:
|
|
@@ -51,7 +53,20 @@ export default function App() {
|
|
|
51
53
|
>>>>>>> REPLACE
|
|
52
54
|
```
|
|
53
55
|
|
|
54
|
-
The input image is automatically resized (max 1024px) and compressed as JPEG before sending.
|
|
56
|
+
The input image is automatically resized (max 1024px) and compressed as JPEG before sending.
|
|
57
|
+
|
|
58
|
+
`images` accepts **either** a raw `File` (fresh from an `<input type="file">`) **or** a stored Fireproof file ref — anything shaped like `{ file: () => Promise<File> }` passes straight through. So if the app has already saved the upload onto a doc, feed it back directly:
|
|
59
|
+
|
|
60
|
+
```jsx
|
|
61
|
+
// doc was saved earlier with: database.put({ ..., _files: { photo: file } })
|
|
62
|
+
<ImgGen prompt="Turn this pet into a cute cartoon character" images={[doc._files.photo]} _id={doc._id} database={database} />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Do **not** invent wrappers like `images={x?.file ? something : undefined}` — pass the `_files` entry itself. If the stored ref might be absent, gate the whole `<ImgGen>` mount on it instead: `{doc._files?.photo && <ImgGen images={[doc._files.photo]} ... />}`.
|
|
66
|
+
|
|
67
|
+
**Displaying an img2img result later** (gallery, detail view, reload): render by `_id` and do NOT re-pass `images` — `<ImgGen _id={doc._id} database={database} showControls={false} />` shows the stored version. Passing `images` on a doc that already has one forces a fresh generation instead of displaying the saved result. Generate once with `images`, display forever with `_id` alone.
|
|
68
|
+
|
|
69
|
+
Do **not** set `model` for img2img: when an input image is present the platform automatically selects its image-**edit** default, which is tuned to produce edits faithful to the source. An explicit `model` override bypasses that routing — only use one when the app has a specific, stated reason.
|
|
55
70
|
|
|
56
71
|
## Loading a Specific Doc
|
|
57
72
|
|
|
@@ -142,7 +157,7 @@ Model ids follow the `provider/model-name` form from the platform's model catalo
|
|
|
142
157
|
#### Props
|
|
143
158
|
|
|
144
159
|
- `prompt`: text prompt (required unless `_id` is provided)
|
|
145
|
-
- `images`: array of `File` objects for img2img (uses first image)
|
|
160
|
+
- `images`: array of `File` objects **or stored `_files` refs** for img2img (uses first image; only pass while generating — display stored results via `_id`)
|
|
146
161
|
- `_id`: load a specific doc instead of generating
|
|
147
162
|
- `database`: Fireproof db name or instance (default `"ImgGen"`)
|
|
148
163
|
- `className`, `alt`, `style`: standard image styling
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/prompts",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
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": "^6.
|
|
28
|
-
"@vibes.diy/identity": "^6.
|
|
29
|
-
"@vibes.diy/use-vibes-types": "^6.
|
|
27
|
+
"@vibes.diy/call-ai-v2": "^6.2.0",
|
|
28
|
+
"@vibes.diy/identity": "^6.2.0",
|
|
29
|
+
"@vibes.diy/use-vibes-types": "^6.2.0",
|
|
30
30
|
"arktype": "~2.2.3",
|
|
31
31
|
"json-schema-faker": "~0.6.2"
|
|
32
32
|
},
|