@fungi.computer/prints 0.0.0-stage → 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jamstack Consulting LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,117 @@
1
- # Temporary Holding Version
1
+ # Prints (`@fungi.computer/prints`)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Prints generates images and video from a prompt and keeps them in a gallery on
4
+ your Computer.
5
+
6
+ ![Prints: a gallery of five generated images, two koi ponds, a knight dunking a basketball, an elf holding a basketball and a sunrise over water, above the prompt bar with the Flux 2 Klein 4b model and a 1024 × 768 size](docs/media/gallery.png)
7
+
8
+ Prints is one of the starter Apps of
9
+ [Oyster](https://github.com/fungi-computer/oyster), the open App host that runs
10
+ on your own Cloudflare account. On Oyster, Prints generates with Workers AI and
11
+ saves every file to a folder on the Computer, a Linux workspace in a Cloudflare
12
+ Container.
13
+
14
+ ## What you can do
15
+
16
+ - Type a prompt, pick a model and a size, and generate an image or a video. Each
17
+ file keeps its model's native format: PNG where the model supports it, JPEG
18
+ otherwise, MP4 for video.
19
+ - Add your own images as style references, on models that accept them.
20
+ - Upload files into the same folder, or choose another folder for the gallery.
21
+ - Browse the gallery newest first, open a picture in
22
+ [Inkcap](https://github.com/fungi-computer/inkcap), or open its **Image info**
23
+ panel (press **I**).
24
+ - **Download** an image from Image info. The download drops the prompt and
25
+ lineage and keeps the AI marker and the print's id; the file on the Computer
26
+ stays as it is.
27
+ - Retry a failed attempt from its tile or from **Activity**. A retry resumes the
28
+ same attempt instead of generating again, and **Resume** picks up an
29
+ unfinished image after a reload.
30
+
31
+ <img alt="Prints on a phone in the light theme: a two-column gallery above the prompt bar" src="docs/media/gallery-phone.png" width="300">
32
+
33
+ ## Get it
34
+
35
+ Prints installs with the other starter Apps. On a deployed Oyster (see the
36
+ [Oyster quick start](https://github.com/fungi-computer/oyster#quick-start-deploy-your-own-oyster)),
37
+ run:
38
+
39
+ ```sh
40
+ export OYSTER_URL=https://oyster.<your-subdomain>.workers.dev
41
+ export OYSTER_OWNER_KEY=<your owner key>
42
+ npx oyster install-apps
43
+ ```
44
+
45
+ The installer clones this repository and the six others, seeds each on your
46
+ Oyster with `git push`, builds them on your Computer and installs them. Sign in
47
+ at `$OYSTER_URL/login` with the owner key and open Prints from the Tourtois
48
+ desktop. Run `install-apps` again to update; each App keeps its data. Generation
49
+ uses Workers AI on your Cloudflare account.
50
+
51
+ ## Change it
52
+
53
+ Every installed App is also a template you can fork on your own Oyster. Fork
54
+ Prints into a Bonsai repository and clone it with ordinary `git`:
55
+
56
+ ```sh
57
+ curl -X POST -H "Authorization: Bearer $OYSTER_OWNER_KEY" -H 'content-type: application/json' \
58
+ -d '{"appId":"app_prints","name":"my-prints"}' \
59
+ $OYSTER_URL/apps/bonsai/methods/apps.fork
60
+ git -c http.extraHeader="Authorization: Bearer $OYSTER_OWNER_KEY" \
61
+ clone $OYSTER_URL/git/bonsai/my-prints.git
62
+ ```
63
+
64
+ The reply names your fork's App id and repository. Push your edits, open the
65
+ repository in Bonsai and choose **Settings**, then **Build & install** with that
66
+ App id and your commit as `git:<sha>`. Install the Release at `prints` to
67
+ replace the running Prints, or at a new id to keep both.
68
+
69
+ To work from GitHub instead, fork this repository and point the installer at
70
+ your forks with `--repositories <base URL>` and `--ref <branch or tag>`. The
71
+ installer reads all seven starter Apps from that base, so fork them under one
72
+ account.
73
+
74
+ ## Agent tools
75
+
76
+ Agents call Prints through Oyster's MCP endpoint, or at
77
+ `POST $OYSTER_URL/apps/prints/methods/<name>` with a key; see
78
+ [Git, keys and MCP](https://github.com/fungi-computer/oyster#git-keys-and-mcp).
79
+
80
+ | Method | What it does |
81
+ | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
82
+ | `listModels` | Lists the image and video models, with their sizes, settings and how many references each takes. |
83
+ | `generateImage` | Generates one image from a prompt and saves it to the gallery folder. |
84
+ | `generateVideo` | Generates one video. While it works, the method returns `{kind: "pending", retryAfterMs}`; call again with the same inputs after that delay. |
85
+ | `listOutputs` | Lists the prints this App made, newest first. |
86
+ | `openOutput` | Reads up to 128 KiB of one print per call. |
87
+
88
+ Each generation carries a request id (`media_request_` and 21 lowercase letters
89
+ or digits). Retrying with the same id and inputs recovers the same generation
90
+ instead of paying for another. References are paths on the Computer, such as
91
+ `[{ path: "/canon/style.png" }]`; callers never pass image bytes, URLs or a
92
+ Computer id.
93
+
94
+ ## Build and check
95
+
96
+ Prints is a React App built with Vite, with controls from
97
+ [Caps](https://github.com/fungi-computer/caps). Its backend keeps folder
98
+ choices, recovery records and the index of finished prints in the App's own
99
+ SQLite database.
100
+
101
+ ```sh
102
+ pnpm install
103
+ pnpm build
104
+ pnpm typecheck
105
+ pnpm test
106
+ ```
107
+
108
+ [src/MediaPane.tsx](src/MediaPane.tsx) puts the composer, gallery and Activity
109
+ together. [src/media-generation.ts](src/media-generation.ts) owns attempts and
110
+ retries, [src/media-gallery.ts](src/media-gallery.ts) the gallery and uploads,
111
+ and [backend/prints-index.ts](backend/prints-index.ts) records each finished
112
+ print. The agent tools are in [backend/methods.ts](backend/methods.ts), and
113
+ [package.json](package.json) declares the permissions the App asks for.
114
+
115
+ ## License
116
+
117
+ MIT. See [LICENSE](LICENSE).