@fungi.computer/darkroom 0.8.0 → 0.9.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/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/model-catalog.d.ts +0 -14
- package/dist/model-catalog.js +2 -9
- package/dist/server.js +2 -2
- package/docs/api/index.md +0 -34
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { type MediaVideoReferenceRole, type MediaCatalogue, type MediaVideoResol
|
|
|
4
4
|
export { mediaFailureStageSchema } from "./execution-error.js";
|
|
5
5
|
export { MAX_AUDIO_REFERENCE_BODY_BYTES, MAX_AUDIO_REFERENCE_BYTES, } from "./audio-reference-types.js";
|
|
6
6
|
export type { AudioReferenceMimeType, MediaAudioReferenceBytes, } from "./audio-reference-types.js";
|
|
7
|
-
export { MAX_MEDIA_PROMPT_LENGTH, getMediaModel, getGatewayModel, MAX_REFERENCE_COUNT, listMediaModels,
|
|
8
|
-
export type { MediaCatalogue, MediaCatalogueModel, MediaModel,
|
|
7
|
+
export { MAX_MEDIA_PROMPT_LENGTH, getMediaModel, getGatewayModel, MAX_REFERENCE_COUNT, listMediaModels, mediaCatalogueSchema, mediaCatalogueModelSchema, parseMediaCatalogue, mediaModelInputSchema, mediaModelSchema, mediaRequestedImageFormatSchema, mediaModels, mediaModelTierSchema, MediaSettingsError, mediaVideoModelIdSchema, mediaVideoResolutionSchema, mediaVideoAspectRatioSchema, mediaVideoReferenceRoleSchema, mediaVideoFormatSchema, mediaVideoSchema, mediaAudioModelIdSchema, mediaAudioSchema, mediaAudioVoiceSchema, AUDIO_CHARACTER_BLOCK, } from "./model-catalog.js";
|
|
8
|
+
export type { MediaCatalogue, MediaCatalogueModel, MediaModel, MediaModelInput, MediaModelTier, MediaVideoModelId, MediaVideoResolution, MediaVideoAspectRatio, MediaVideoReferenceRole, MediaVideoModel, MediaVideoFormat, MediaAudioModelId, MediaAudioModel, MediaAudioVoice, } from "./model-catalog.js";
|
|
9
9
|
/** A reference file selected by the host, with its destination identity and path. */
|
|
10
10
|
export type MediaReference = Readonly<{
|
|
11
11
|
/** Host-admitted destination or reference identity. */
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { referenceImageSizeIsValid } from "./reference-image-size.js";
|
|
|
4
4
|
import { getGatewayModel, getMediaModel, mediaAudioModelIdSchema, MAX_REFERENCE_COUNT, MediaSettingsError, mediaModels, mediaVideoModelIdSchema, mediaVideoResolutionSchema, mediaVideoAspectRatioSchema, mediaVideoReferenceRoleSchema, MAX_MEDIA_PROMPT_LENGTH, } from "./model-catalog.js";
|
|
5
5
|
export { mediaFailureStageSchema } from "./execution-error.js";
|
|
6
6
|
export { MAX_AUDIO_REFERENCE_BODY_BYTES, MAX_AUDIO_REFERENCE_BYTES, } from "./audio-reference-types.js";
|
|
7
|
-
export { MAX_MEDIA_PROMPT_LENGTH, getMediaModel, getGatewayModel, MAX_REFERENCE_COUNT, listMediaModels,
|
|
7
|
+
export { MAX_MEDIA_PROMPT_LENGTH, getMediaModel, getGatewayModel, MAX_REFERENCE_COUNT, listMediaModels, mediaCatalogueSchema, mediaCatalogueModelSchema, parseMediaCatalogue, mediaModelInputSchema, mediaModelSchema, mediaRequestedImageFormatSchema, mediaModels, mediaModelTierSchema, MediaSettingsError, mediaVideoModelIdSchema, mediaVideoResolutionSchema, mediaVideoAspectRatioSchema, mediaVideoReferenceRoleSchema, mediaVideoFormatSchema, mediaVideoSchema, mediaAudioModelIdSchema, mediaAudioSchema, mediaAudioVoiceSchema, AUDIO_CHARACTER_BLOCK, } from "./model-catalog.js";
|
|
8
8
|
/** The long-edge bounds a viewer may ask for when fitting an image to look at. */
|
|
9
9
|
export const MIN_VIEW_DIMENSION = 256;
|
|
10
10
|
/** Maximum long-edge size accepted by an image viewer, in pixels. */
|
package/dist/model-catalog.d.ts
CHANGED
|
@@ -1057,20 +1057,6 @@ export declare const mediaCatalogueSchema: z.ZodPipe<z.ZodArray<z.ZodReadonly<z.
|
|
|
1057
1057
|
export declare const parseMediaCatalogue: (raw: unknown) => MediaCatalogue;
|
|
1058
1058
|
/** List the gateway provider's models in catalog order. */
|
|
1059
1059
|
export declare const listMediaModels: () => readonly MediaModel[];
|
|
1060
|
-
/** A catalog entry that is a picture or video model. */
|
|
1061
|
-
export type MediaPictureModel = Omit<MediaModel, "kind" | "audio"> & {
|
|
1062
|
-
/** Still-image or video generation; never audio. */
|
|
1063
|
-
readonly kind: "image" | "video";
|
|
1064
|
-
/** Always null for a picture or video model. */
|
|
1065
|
-
readonly audio: null;
|
|
1066
|
-
};
|
|
1067
|
-
/**
|
|
1068
|
-
* The gateway models Apps and browsers list and pick from: pictures and video.
|
|
1069
|
-
* The Agar and Prints catalog decoders know no `audio` kind yet, and one unknown
|
|
1070
|
-
* row fails the whole list, so audio models are generated by id until the
|
|
1071
|
-
* Prints audio UI lands and lists them.
|
|
1072
|
-
*/
|
|
1073
|
-
export declare const listPictureMediaModels: () => readonly MediaPictureModel[];
|
|
1074
1060
|
/** Find a model in the Fungi gateway's own catalogue; gateway-internal code never sees a custom provider's models. */
|
|
1075
1061
|
export declare const getGatewayModel: (id: string) => MediaModel | undefined;
|
|
1076
1062
|
/** Find a model in `catalogue` (the gateway's by default), or undefined when absent. */
|
package/dist/model-catalog.js
CHANGED
|
@@ -941,8 +941,8 @@ const models = Object.freeze([
|
|
|
941
941
|
]),
|
|
942
942
|
minimaxVideoModel(),
|
|
943
943
|
// ElevenLabs on Unified Billing: URL results, like the video models.
|
|
944
|
-
speechModel(mediaAudioModelIdSchema.enum.multilingual, "Eleven Multilingual v2
|
|
945
|
-
speechModel(mediaAudioModelIdSchema.enum.v3, "Eleven v3
|
|
944
|
+
speechModel(mediaAudioModelIdSchema.enum.multilingual, "Eleven Multilingual v2 — natural speech", "balanced", 10),
|
|
945
|
+
speechModel(mediaAudioModelIdSchema.enum.v3, "Eleven v3 — expressive speech", "premium", 10),
|
|
946
946
|
musicModel(),
|
|
947
947
|
]);
|
|
948
948
|
/** The Fungi gateway provider's own immutable image, video and audio model catalog. */
|
|
@@ -1030,13 +1030,6 @@ export const parseMediaCatalogue = (raw) => {
|
|
|
1030
1030
|
};
|
|
1031
1031
|
/** List the gateway provider's models in catalog order. */
|
|
1032
1032
|
export const listMediaModels = () => mediaModels;
|
|
1033
|
-
/**
|
|
1034
|
-
* The gateway models Apps and browsers list and pick from: pictures and video.
|
|
1035
|
-
* The Agar and Prints catalog decoders know no `audio` kind yet, and one unknown
|
|
1036
|
-
* row fails the whole list, so audio models are generated by id until the
|
|
1037
|
-
* Prints audio UI lands and lists them.
|
|
1038
|
-
*/
|
|
1039
|
-
export const listPictureMediaModels = () => mediaModels.filter((model) => model.kind !== "audio");
|
|
1040
1033
|
/** Find a model in the Fungi gateway's own catalogue; gateway-internal code never sees a custom provider's models. */
|
|
1041
1034
|
export const getGatewayModel = (id) => mediaModels.find((model) => model.id === id);
|
|
1042
1035
|
/** Find a model in `catalogue` (the gateway's by default), or undefined when absent. */
|
package/dist/server.js
CHANGED
|
@@ -8,7 +8,7 @@ import * as Effect from "effect/Effect";
|
|
|
8
8
|
import * as Result from "effect/Result";
|
|
9
9
|
import { runMediaGeneration } from "./media-generation.js";
|
|
10
10
|
import { quoteMediaGeneration } from "./media-quote.js";
|
|
11
|
-
import { validateMediaGenerationSettings,
|
|
11
|
+
import { validateMediaGenerationSettings, listMediaModels, mediaGenerationSettingsSchema, mediaRequestedImageFormatSchema, MediaSettingsError, } from "./index.js";
|
|
12
12
|
import { mediaResultSchema, } from "./media-operation-contract.js";
|
|
13
13
|
import { MediaOutputFormatMismatch, MediaBillingRefusal, MediaExecutionError, MediaSafetyFilterRefusal, } from "./execution-error.js";
|
|
14
14
|
export { createDailyMediaMetering, DailyMediaMeter, } from "./daily-media-meter.js";
|
|
@@ -202,7 +202,7 @@ function outcomeResponse(outcome) {
|
|
|
202
202
|
/** Relative HTTP routes; the caller admits identity and supplies destination access. */
|
|
203
203
|
export function createMediaService(host) {
|
|
204
204
|
const app = new Hono();
|
|
205
|
-
app.get("/models", () => Response.json((host.catalogue ??
|
|
205
|
+
app.get("/models", () => Response.json((host.catalogue ?? listMediaModels())
|
|
206
206
|
.map((model) => host.destination.readReference !== undefined ||
|
|
207
207
|
model.input.maxReferences === 0
|
|
208
208
|
? model
|
package/docs/api/index.md
CHANGED
|
@@ -692,23 +692,6 @@ type MediaCatalogue = readonly MediaCatalogueModel[];
|
|
|
692
692
|
|
|
693
693
|
One provider's model list: the typed bounds every request is checked against.
|
|
694
694
|
|
|
695
|
-
---
|
|
696
|
-
|
|
697
|
-
### MediaPictureModel
|
|
698
|
-
|
|
699
|
-
```ts
|
|
700
|
-
type MediaPictureModel = Omit<MediaModel, "kind" | "audio"> & object;
|
|
701
|
-
```
|
|
702
|
-
|
|
703
|
-
A catalog entry that is a picture or video model.
|
|
704
|
-
|
|
705
|
-
#### Type Declaration
|
|
706
|
-
|
|
707
|
-
| Name | Type | Description |
|
|
708
|
-
| ------- | ---------------------- | --------------------------------------------- |
|
|
709
|
-
| `kind` | `"image"` \| `"video"` | Still-image or video generation; never audio. |
|
|
710
|
-
| `audio` | `null` | Always null for a picture or video model. |
|
|
711
|
-
|
|
712
695
|
## Variables
|
|
713
696
|
|
|
714
697
|
### MAX\_AUDIO\_REFERENCE\_BYTES
|
|
@@ -2393,23 +2376,6 @@ readonly (`"first-frame"` \| `"last-frame"` \| `"reference"`)[];
|
|
|
2393
2376
|
|
|
2394
2377
|
---
|
|
2395
2378
|
|
|
2396
|
-
### listPictureMediaModels()
|
|
2397
|
-
|
|
2398
|
-
```ts
|
|
2399
|
-
function listPictureMediaModels(): readonly MediaPictureModel[];
|
|
2400
|
-
```
|
|
2401
|
-
|
|
2402
|
-
The gateway models Apps and browsers list and pick from: pictures and video. The
|
|
2403
|
-
Agar and Prints catalog decoders know no `audio` kind yet, and one unknown row
|
|
2404
|
-
fails the whole list, so audio models are generated by id until the Prints audio
|
|
2405
|
-
UI lands and lists them.
|
|
2406
|
-
|
|
2407
|
-
#### Returns
|
|
2408
|
-
|
|
2409
|
-
readonly [`MediaPictureModel`](#mediapicturemodel)[]
|
|
2410
|
-
|
|
2411
|
-
---
|
|
2412
|
-
|
|
2413
2379
|
### getGatewayModel()
|
|
2414
2380
|
|
|
2415
2381
|
```ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/darkroom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"description": "Media generation, durable output retention and provenance with host-owned authority and billing",
|
|
6
6
|
"type": "module",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"exifreader": "4.46.0",
|
|
61
61
|
"@fungi.computer/ts-webp": "0.1.6",
|
|
62
62
|
"@xmldom/xmldom": "0.9.12",
|
|
63
|
-
"@fungi.computer/agar": "0.
|
|
63
|
+
"@fungi.computer/agar": "0.15.0",
|
|
64
64
|
"@fungi.computer/capnweb": "0.12.0-fungi.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|