@fungi.computer/oyster 0.29.2 → 0.30.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.
@@ -51,6 +51,7 @@ export declare const mediaFrameMethods: {
51
51
  computerId?: string | undefined;
52
52
  role?: "reference" | "first-frame" | "last-frame" | undefined;
53
53
  }[] | undefined;
54
+ targetMegapixels?: number | undefined;
54
55
  generateAudio?: boolean | undefined;
55
56
  steps?: number | undefined;
56
57
  };
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
- import { MAX_REFERENCE_BYTES, MediaSettingsError, } from "@fungi.computer/darkroom";
3
2
  import { AppInstanceError } from "../index.js";
4
3
  import { readMediaFailure } from "@fungi.computer/darkroom/browser";
5
4
  import { appMediaGenerationResultSchema, mediaModelsSchema, } from "@fungi.computer/darkroom/app-media-contracts";
@@ -8,7 +7,7 @@ import { computer, routes as routeTable } from "../authorization.js";
8
7
  import * as Schema from "effect/Schema";
9
8
  import { pendingSchema } from "@fungi.computer/agar/backend-definition";
10
9
  import { mediaGenerationDescriptionSchema, mediaGenerationJsonRequestSchema, mediaGenerationQuoteRequestSchema, mediaGenerationReferenceSchema, } from "@fungi.computer/agar/media-json";
11
- import { createDailyMediaMetering, createMediaService, estimateMediaModel, mediaPendingSchema, mediaResultSchema, mediaBindingCallSchema, mediaBindingRequest, parseMediaBindingCall, readMediaBindingReply, } from "@fungi.computer/darkroom/server";
10
+ import { createDailyMediaMetering, createMediaService, readHostReference, referenceFilename, estimateMediaModel, mediaPendingSchema, mediaResultSchema, mediaBindingCallSchema, mediaBindingRequest, parseMediaBindingCall, readMediaBindingReply, } from "@fungi.computer/darkroom/server";
12
11
  import { createWorkersAiMediaProvider, createImagesReferenceFitter, } from "@fungi.computer/darkroom/cloudflare";
13
12
  import { oysterPrincipalId, } from "../host.js";
14
13
  import { normalizeFilePath } from "../files.js";
@@ -193,6 +192,17 @@ function standaloneMediaService(env, actorId, workspace, owner = "owner", librar
193
192
  const fit = env.IMAGES === undefined
194
193
  ? undefined
195
194
  : createImagesReferenceFitter(env.IMAGES);
195
+ const readWorkspaceReference = (kind, reference) => readHostReference({
196
+ reference,
197
+ destinationId: computerId,
198
+ kind,
199
+ open: async (path) => {
200
+ const bytes = await files.read(workspacePath(path));
201
+ return bytes === null
202
+ ? null
203
+ : { size: bytes.byteLength, bytes: () => Promise.resolve(bytes) };
204
+ },
205
+ });
196
206
  const destination = {
197
207
  authorize: async (path) => {
198
208
  workspacePath(path);
@@ -200,32 +210,16 @@ function standaloneMediaService(env, actorId, workspace, owner = "owner", librar
200
210
  await files.mkdir(workspacePath(libraryPath));
201
211
  },
202
212
  write: (path, bytes) => files.write(workspacePath(path), bytes),
203
- readAudioReference: async (reference) => {
204
- if (reference.computerId !== computerId)
205
- throw new MediaSettingsError("reference Computer is not selected");
206
- const bytes = await files.read(workspacePath(reference.path));
207
- if (bytes === null)
208
- throw new MediaSettingsError("audio reference is unavailable");
209
- return bytes;
210
- },
213
+ readAudioReference: (reference) => readWorkspaceReference("audio", reference),
211
214
  };
212
215
  const admittedDestination = fit === undefined
213
216
  ? destination
214
217
  : {
215
218
  ...destination,
216
- readReference: async (reference, model) => {
217
- if (reference.computerId !== computerId)
218
- throw new MediaSettingsError("reference Computer is not selected");
219
- const bytes = await files.read(workspacePath(reference.path));
220
- if (bytes === null ||
221
- bytes.byteLength === 0 ||
222
- bytes.byteLength > MAX_REFERENCE_BYTES)
223
- throw new MediaSettingsError("reference image is unavailable or exceeds the byte limit");
224
- return {
225
- ...(await fit(bytes, model)),
226
- filename: reference.path.split("/").at(-1) ?? "reference",
227
- };
228
- },
219
+ readReference: async (reference, model) => ({
220
+ ...(await fit(await readWorkspaceReference("image", reference), model)),
221
+ filename: referenceFilename(reference),
222
+ }),
229
223
  };
230
224
  const provider = createWorkersAiMediaProvider(env.AI, env.AI_GATEWAY_ID === undefined
231
225
  ? undefined
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/oyster",
3
- "version": "0.29.2",
3
+ "version": "0.30.0",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "description": "Oyster by Fungi: open-source Apps for people and AI agents. Try with one command or run on your own Cloudflare account.",
6
6
  "homepage": "https://docs.fungi.computer/oyster",
@@ -346,9 +346,9 @@
346
346
  "dependencies": {
347
347
  "@cfworker/json-schema": "4.1.1",
348
348
  "@earendil-works/pi-ai": "1.3.0",
349
- "@fungi.computer/agar": "0.16.0",
349
+ "@fungi.computer/agar": "0.17.0",
350
350
  "@fungi.computer/bird-dog": "0.3.6",
351
- "@fungi.computer/braid": "0.4.17",
351
+ "@fungi.computer/braid": "0.4.18",
352
352
  "@fungi.computer/burrow": "0.2.1",
353
353
  "@fungi.computer/cairn": "0.1.0",
354
354
  "@fungi.computer/capnweb": "0.12.0-fungi.0",
@@ -356,27 +356,27 @@
356
356
  "@fungi.computer/carrier": "0.2.4",
357
357
  "@fungi.computer/computer": "0.12.2",
358
358
  "@fungi.computer/computer-contract": "0.4.1",
359
- "@fungi.computer/darkroom": "0.9.2",
359
+ "@fungi.computer/darkroom": "0.10.0",
360
360
  "@fungi.computer/ear-tag": "0.1.0",
361
361
  "@fungi.computer/forage": "0.3.9",
362
362
  "@fungi.computer/gills": "0.3.0",
363
363
  "@fungi.computer/knapsack": "0.4.13",
364
364
  "@fungi.computer/lantern": "0.4.2",
365
365
  "@fungi.computer/mycelium": "0.4.0",
366
- "@fungi.computer/nacre": "0.6.4",
367
- "@fungi.computer/parakeet": "0.11.32",
366
+ "@fungi.computer/nacre": "0.6.5",
367
+ "@fungi.computer/parakeet": "0.11.34",
368
368
  "@fungi.computer/puffball": "0.9.0",
369
369
  "@fungi.computer/seam": "0.2.5",
370
- "@fungi.computer/shiitake": "0.18.0",
371
- "@fungi.computer/shiitake-extensions": "0.10.0",
370
+ "@fungi.computer/shiitake": "0.18.1",
371
+ "@fungi.computer/shiitake-extensions": "0.10.1",
372
372
  "@fungi.computer/sigils": "0.3.2",
373
373
  "@fungi.computer/sprite": "0.2.2",
374
374
  "@fungi.computer/sprite-zdog": "0.3.2",
375
375
  "@fungi.computer/veil": "0.7.4",
376
376
  "@fungi.computer/watchdog": "0.1.3",
377
377
  "@fungi.computer/whistle": "0.3.0",
378
- "@fungi.computer/workflows-wire": "0.4.17",
379
- "@fungi.computer/zookeeper": "0.0.30",
378
+ "@fungi.computer/workflows-wire": "0.4.18",
379
+ "@fungi.computer/zookeeper": "0.0.31",
380
380
  "@modelcontextprotocol/server": "2.0.0",
381
381
  "@pnpm/lockfile.fs": "1100.2.13",
382
382
  "@pnpm/lockfile.pruner": "1100.0.27",