@fungi.computer/darkroom 0.5.12 → 0.7.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/README.md +129 -0
- package/dist/app-media-contracts.d.ts +4 -0
- package/dist/browser-failure.d.ts +2 -0
- package/dist/browser-failure.js +2 -0
- package/dist/cloudflare/provider.js +3 -3
- package/dist/cloudflare/reference-images.d.ts +6 -0
- package/dist/cloudflare/reference-images.js +25 -7
- package/dist/cost-estimate.js +2 -2
- package/dist/daily-media-meter.d.ts +55 -0
- package/dist/daily-media-meter.js +81 -0
- package/dist/execution-error.d.ts +1 -1
- package/dist/gateway-models.d.ts +8 -2
- package/dist/gateway-models.js +35 -10
- package/dist/gateway-wire.d.ts +1 -0
- package/dist/gateway-wire.js +2 -0
- package/dist/index.d.ts +50 -12
- package/dist/index.js +33 -23
- package/dist/media-binding.d.ts +3 -0
- package/dist/media-binding.js +3 -3
- package/dist/media-generation.js +9 -5
- package/dist/media-operation-contract.d.ts +3 -1
- package/dist/media-operation-do.d.ts +13 -2
- package/dist/media-operation-do.js +26 -1
- package/dist/media-operation-owner.d.ts +8 -0
- package/dist/media-operation-owner.js +8 -5
- package/dist/media-operation.js +2 -2
- package/dist/media-quote.d.ts +14 -0
- package/dist/media-quote.js +17 -0
- package/dist/model-catalog.d.ts +438 -5
- package/dist/model-catalog.js +232 -30
- package/dist/reference-image-size.d.ts +4 -3
- package/dist/reference-image-size.js +9 -9
- package/dist/server.d.ts +17 -1
- package/dist/server.js +44 -6
- package/docs/api/app-media-contracts.md +4 -0
- package/docs/api/browser.md +4 -2
- package/docs/api/cloudflare.md +53 -0
- package/docs/api/index.md +464 -55
- package/docs/api/server.md +214 -22
- package/package.json +2 -2
package/dist/model-catalog.d.ts
CHANGED
|
@@ -67,9 +67,11 @@ export declare const mediaModelInputSchema: z.ZodLazy<z.ZodReadonly<z.ZodObject<
|
|
|
67
67
|
* Schema ceiling for reference lists: the largest per-model limit. Each model's
|
|
68
68
|
* own `maxReferences` / `maxReferenceImages` is enforced after parsing.
|
|
69
69
|
*/
|
|
70
|
-
export declare const MAX_REFERENCE_COUNT =
|
|
70
|
+
export declare const MAX_REFERENCE_COUNT = 30;
|
|
71
71
|
/** Verified Unified AI video identifiers; no inferred family aliases. */
|
|
72
72
|
export declare const mediaVideoModelIdSchema: z.ZodEnum<{
|
|
73
|
+
/** Seedance 2.5. */
|
|
74
|
+
readonly seedance25: "bytedance/seedance-2.5";
|
|
73
75
|
/** Seedance 2.0. */
|
|
74
76
|
readonly seedance: "bytedance/seedance-2.0";
|
|
75
77
|
/** Seedance 2.0 Fast. */
|
|
@@ -471,12 +473,443 @@ export declare const mediaModelSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
471
473
|
export type MediaModelInput = z.output<typeof mediaModelInputSchema>;
|
|
472
474
|
/** One immutable provider catalog entry. */
|
|
473
475
|
export type MediaModel = z.output<typeof mediaModelSchema>;
|
|
474
|
-
/** The immutable image and video model catalog. */
|
|
476
|
+
/** The Fungi gateway provider's own immutable image and video model catalog. */
|
|
475
477
|
export declare const mediaModels: readonly MediaModel[];
|
|
476
|
-
/**
|
|
478
|
+
/**
|
|
479
|
+
* One catalogue entry. Same grammar as the gateway's wire entry, except that a
|
|
480
|
+
* video model may name `host` as its provider family: the injected provider
|
|
481
|
+
* owns that model's wire grammar and Darkroom builds no gateway request for it.
|
|
482
|
+
*/
|
|
483
|
+
export declare const mediaCatalogueModelSchema: z.ZodReadonly<z.ZodObject<{
|
|
484
|
+
id: z.ZodString;
|
|
485
|
+
label: z.ZodString;
|
|
486
|
+
kind: z.ZodEnum<{
|
|
487
|
+
/** Still-image generation. */
|
|
488
|
+
readonly image: "image";
|
|
489
|
+
/** Video generation. */
|
|
490
|
+
readonly video: "video";
|
|
491
|
+
}>;
|
|
492
|
+
tier: z.ZodEnum<{
|
|
493
|
+
/** Cheap, fast draft model. */
|
|
494
|
+
readonly draft: "draft";
|
|
495
|
+
/** Balanced model selection. */
|
|
496
|
+
readonly balanced: "balanced";
|
|
497
|
+
/** Premium model selection. */
|
|
498
|
+
readonly premium: "premium";
|
|
499
|
+
/** Most expensive model selection. */
|
|
500
|
+
readonly max: "max";
|
|
501
|
+
}>;
|
|
502
|
+
outputFormats: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
503
|
+
/** PNG image encoding. */
|
|
504
|
+
readonly png: "png";
|
|
505
|
+
/** JPEG image encoding. */
|
|
506
|
+
readonly jpeg: "jpeg";
|
|
507
|
+
/** WebP image encoding. */
|
|
508
|
+
readonly webp: "webp";
|
|
509
|
+
}>>>;
|
|
510
|
+
maxPromptLength: z.ZodNumber;
|
|
511
|
+
input: z.ZodLazy<z.ZodReadonly<z.ZodObject<{
|
|
512
|
+
transport: z.ZodEnum<{
|
|
513
|
+
/** JSON provider input. */
|
|
514
|
+
readonly json: "json";
|
|
515
|
+
/** Multipart provider input. */
|
|
516
|
+
readonly multipart: "multipart";
|
|
517
|
+
}>;
|
|
518
|
+
dimensions: z.ZodEnum<{
|
|
519
|
+
/** Provider chooses its own dimensions. */
|
|
520
|
+
readonly none: "none";
|
|
521
|
+
/** Provider accepts the requested dimensions. */
|
|
522
|
+
readonly own: "own";
|
|
523
|
+
}>;
|
|
524
|
+
maxDimension: z.ZodNullable<z.ZodNumber>;
|
|
525
|
+
maxDimensionDocumented: z.ZodBoolean;
|
|
526
|
+
defaultWidth: z.ZodNumber;
|
|
527
|
+
defaultHeight: z.ZodNumber;
|
|
528
|
+
steps: z.ZodEnum<{
|
|
529
|
+
/** Provider reads the steps field. */
|
|
530
|
+
readonly steps: "steps";
|
|
531
|
+
/** Provider reads the num_steps field. */
|
|
532
|
+
readonly num_steps: "num_steps";
|
|
533
|
+
/** Provider uses fixed inference steps. */
|
|
534
|
+
readonly fixed: "fixed";
|
|
535
|
+
}>;
|
|
536
|
+
maxSteps: z.ZodNullable<z.ZodNumber>;
|
|
537
|
+
defaultSteps: z.ZodNullable<z.ZodNumber>;
|
|
538
|
+
referenceField: z.ZodNullable<z.ZodString>;
|
|
539
|
+
maxReferences: z.ZodNumber;
|
|
540
|
+
referenceDimension: z.ZodNullable<z.ZodNumber>;
|
|
541
|
+
referenceFormat: z.ZodEnum<{
|
|
542
|
+
/** Lossless PNG. */
|
|
543
|
+
readonly png: "png";
|
|
544
|
+
/** Lossy WebP. */
|
|
545
|
+
readonly webp: "webp";
|
|
546
|
+
}>;
|
|
547
|
+
}, z.core.$strict>>>;
|
|
548
|
+
sizes: z.ZodNullable<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
549
|
+
video: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
|
|
550
|
+
minSeconds: z.ZodNumber;
|
|
551
|
+
maxSeconds: z.ZodNumber;
|
|
552
|
+
defaultSeconds: z.ZodNumber;
|
|
553
|
+
durations: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
554
|
+
formats: z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
|
|
555
|
+
resolution: z.ZodEnum<{
|
|
556
|
+
/** 480p. */
|
|
557
|
+
readonly p480: "480p";
|
|
558
|
+
/** 720p. */
|
|
559
|
+
readonly p720: "720p";
|
|
560
|
+
/** 768p, admitted only by MiniMax H3 Max. */
|
|
561
|
+
readonly p768: "768p";
|
|
562
|
+
/** 1080p. */
|
|
563
|
+
readonly p1080: "1080p";
|
|
564
|
+
/** 4k, admitted only by Seedance 2.0. */
|
|
565
|
+
readonly p4k: "4k";
|
|
566
|
+
}>;
|
|
567
|
+
aspectRatio: z.ZodEnum<{
|
|
568
|
+
/** Landscape widescreen. */
|
|
569
|
+
readonly wide: "16:9";
|
|
570
|
+
/** Landscape standard. */
|
|
571
|
+
readonly landscape: "4:3";
|
|
572
|
+
/** Square. */
|
|
573
|
+
readonly square: "1:1";
|
|
574
|
+
/** Portrait standard. */
|
|
575
|
+
readonly portrait: "3:4";
|
|
576
|
+
/** Portrait widescreen. */
|
|
577
|
+
readonly tall: "9:16";
|
|
578
|
+
/** Landscape ultrawide. */
|
|
579
|
+
readonly ultrawide: "21:9";
|
|
580
|
+
/** Portrait ultrawide. */
|
|
581
|
+
readonly ultratall: "9:21";
|
|
582
|
+
}>;
|
|
583
|
+
width: z.ZodNumber;
|
|
584
|
+
height: z.ZodNumber;
|
|
585
|
+
}, z.core.$strict>>>>>;
|
|
586
|
+
defaultResolution: z.ZodEnum<{
|
|
587
|
+
/** 480p. */
|
|
588
|
+
readonly p480: "480p";
|
|
589
|
+
/** 720p. */
|
|
590
|
+
readonly p720: "720p";
|
|
591
|
+
/** 768p, admitted only by MiniMax H3 Max. */
|
|
592
|
+
readonly p768: "768p";
|
|
593
|
+
/** 1080p. */
|
|
594
|
+
readonly p1080: "1080p";
|
|
595
|
+
/** 4k, admitted only by Seedance 2.0. */
|
|
596
|
+
readonly p4k: "4k";
|
|
597
|
+
}>;
|
|
598
|
+
defaultAspectRatio: z.ZodEnum<{
|
|
599
|
+
/** Landscape widescreen. */
|
|
600
|
+
readonly wide: "16:9";
|
|
601
|
+
/** Landscape standard. */
|
|
602
|
+
readonly landscape: "4:3";
|
|
603
|
+
/** Square. */
|
|
604
|
+
readonly square: "1:1";
|
|
605
|
+
/** Portrait standard. */
|
|
606
|
+
readonly portrait: "3:4";
|
|
607
|
+
/** Portrait widescreen. */
|
|
608
|
+
readonly tall: "9:16";
|
|
609
|
+
/** Landscape ultrawide. */
|
|
610
|
+
readonly ultrawide: "21:9";
|
|
611
|
+
/** Portrait ultrawide. */
|
|
612
|
+
readonly ultratall: "9:21";
|
|
613
|
+
}>;
|
|
614
|
+
supportsAudio: z.ZodBoolean;
|
|
615
|
+
defaultGenerateAudio: z.ZodNullable<z.ZodBoolean>;
|
|
616
|
+
referenceRoles: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
617
|
+
/** First frame; required when a last frame is supplied. */
|
|
618
|
+
readonly first: "first-frame";
|
|
619
|
+
/** Last frame, supported by Seedance only (`last_frame_image`). */
|
|
620
|
+
readonly last: "last-frame";
|
|
621
|
+
/** One image in Seedance reference-image mode. */
|
|
622
|
+
readonly reference: "reference";
|
|
623
|
+
}>>>;
|
|
624
|
+
maxReferenceImages: z.ZodNumber;
|
|
625
|
+
referenceResolutions: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
626
|
+
/** 480p. */
|
|
627
|
+
readonly p480: "480p";
|
|
628
|
+
/** 720p. */
|
|
629
|
+
readonly p720: "720p";
|
|
630
|
+
/** 768p, admitted only by MiniMax H3 Max. */
|
|
631
|
+
readonly p768: "768p";
|
|
632
|
+
/** 1080p. */
|
|
633
|
+
readonly p1080: "1080p";
|
|
634
|
+
/** 4k, admitted only by Seedance 2.0. */
|
|
635
|
+
readonly p4k: "4k";
|
|
636
|
+
}>>>;
|
|
637
|
+
prices: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
638
|
+
resolution: z.ZodEnum<{
|
|
639
|
+
/** 480p. */
|
|
640
|
+
readonly p480: "480p";
|
|
641
|
+
/** 720p. */
|
|
642
|
+
readonly p720: "720p";
|
|
643
|
+
/** 768p, admitted only by MiniMax H3 Max. */
|
|
644
|
+
readonly p768: "768p";
|
|
645
|
+
/** 1080p. */
|
|
646
|
+
readonly p1080: "1080p";
|
|
647
|
+
/** 4k, admitted only by Seedance 2.0. */
|
|
648
|
+
readonly p4k: "4k";
|
|
649
|
+
}>;
|
|
650
|
+
silentMilliunitsPerSecond: z.ZodNumber;
|
|
651
|
+
audioMilliunitsPerSecond: z.ZodNumber;
|
|
652
|
+
}, z.core.$strict>>>>;
|
|
653
|
+
provider: z.ZodEnum<{
|
|
654
|
+
/** Seedance integer duration and data-URI image fields. */
|
|
655
|
+
readonly seedance: "seedance";
|
|
656
|
+
/** Veo duration string and base64 image_input. */
|
|
657
|
+
readonly veo: "veo";
|
|
658
|
+
/** MiniMax multimodal `content[]` array and uppercase resolution. */
|
|
659
|
+
readonly minimax: "minimax";
|
|
660
|
+
/** The injected provider owns the wire grammar. */
|
|
661
|
+
readonly host: "host";
|
|
662
|
+
}>;
|
|
663
|
+
}, z.core.$strict>>>;
|
|
664
|
+
}, z.core.$strict>>;
|
|
665
|
+
/** One provider's catalogue entry. */
|
|
666
|
+
export type MediaCatalogueModel = z.output<typeof mediaCatalogueModelSchema>;
|
|
667
|
+
/** One provider's model list: the typed bounds every request is checked against. */
|
|
668
|
+
export type MediaCatalogue = readonly MediaCatalogueModel[];
|
|
669
|
+
/**
|
|
670
|
+
* Decode a host-supplied provider catalogue. Each entry is the same typed wire
|
|
671
|
+
* grammar the built-in catalogue uses; this adds the cross-field facts the
|
|
672
|
+
* validator relies on (unique ids, video metadata iff `kind` is video, defaults
|
|
673
|
+
* inside their own bounds).
|
|
674
|
+
*/
|
|
675
|
+
export declare const mediaCatalogueSchema: z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
676
|
+
id: z.ZodString;
|
|
677
|
+
label: z.ZodString;
|
|
678
|
+
kind: z.ZodEnum<{
|
|
679
|
+
/** Still-image generation. */
|
|
680
|
+
readonly image: "image";
|
|
681
|
+
/** Video generation. */
|
|
682
|
+
readonly video: "video";
|
|
683
|
+
}>;
|
|
684
|
+
tier: z.ZodEnum<{
|
|
685
|
+
/** Cheap, fast draft model. */
|
|
686
|
+
readonly draft: "draft";
|
|
687
|
+
/** Balanced model selection. */
|
|
688
|
+
readonly balanced: "balanced";
|
|
689
|
+
/** Premium model selection. */
|
|
690
|
+
readonly premium: "premium";
|
|
691
|
+
/** Most expensive model selection. */
|
|
692
|
+
readonly max: "max";
|
|
693
|
+
}>;
|
|
694
|
+
outputFormats: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
695
|
+
/** PNG image encoding. */
|
|
696
|
+
readonly png: "png";
|
|
697
|
+
/** JPEG image encoding. */
|
|
698
|
+
readonly jpeg: "jpeg";
|
|
699
|
+
/** WebP image encoding. */
|
|
700
|
+
readonly webp: "webp";
|
|
701
|
+
}>>>;
|
|
702
|
+
maxPromptLength: z.ZodNumber;
|
|
703
|
+
input: z.ZodLazy<z.ZodReadonly<z.ZodObject<{
|
|
704
|
+
transport: z.ZodEnum<{
|
|
705
|
+
/** JSON provider input. */
|
|
706
|
+
readonly json: "json";
|
|
707
|
+
/** Multipart provider input. */
|
|
708
|
+
readonly multipart: "multipart";
|
|
709
|
+
}>;
|
|
710
|
+
dimensions: z.ZodEnum<{
|
|
711
|
+
/** Provider chooses its own dimensions. */
|
|
712
|
+
readonly none: "none";
|
|
713
|
+
/** Provider accepts the requested dimensions. */
|
|
714
|
+
readonly own: "own";
|
|
715
|
+
}>;
|
|
716
|
+
maxDimension: z.ZodNullable<z.ZodNumber>;
|
|
717
|
+
maxDimensionDocumented: z.ZodBoolean;
|
|
718
|
+
defaultWidth: z.ZodNumber;
|
|
719
|
+
defaultHeight: z.ZodNumber;
|
|
720
|
+
steps: z.ZodEnum<{
|
|
721
|
+
/** Provider reads the steps field. */
|
|
722
|
+
readonly steps: "steps";
|
|
723
|
+
/** Provider reads the num_steps field. */
|
|
724
|
+
readonly num_steps: "num_steps";
|
|
725
|
+
/** Provider uses fixed inference steps. */
|
|
726
|
+
readonly fixed: "fixed";
|
|
727
|
+
}>;
|
|
728
|
+
maxSteps: z.ZodNullable<z.ZodNumber>;
|
|
729
|
+
defaultSteps: z.ZodNullable<z.ZodNumber>;
|
|
730
|
+
referenceField: z.ZodNullable<z.ZodString>;
|
|
731
|
+
maxReferences: z.ZodNumber;
|
|
732
|
+
referenceDimension: z.ZodNullable<z.ZodNumber>;
|
|
733
|
+
referenceFormat: z.ZodEnum<{
|
|
734
|
+
/** Lossless PNG. */
|
|
735
|
+
readonly png: "png";
|
|
736
|
+
/** Lossy WebP. */
|
|
737
|
+
readonly webp: "webp";
|
|
738
|
+
}>;
|
|
739
|
+
}, z.core.$strict>>>;
|
|
740
|
+
sizes: z.ZodNullable<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
741
|
+
video: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
|
|
742
|
+
minSeconds: z.ZodNumber;
|
|
743
|
+
maxSeconds: z.ZodNumber;
|
|
744
|
+
defaultSeconds: z.ZodNumber;
|
|
745
|
+
durations: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
746
|
+
formats: z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
|
|
747
|
+
resolution: z.ZodEnum<{
|
|
748
|
+
/** 480p. */
|
|
749
|
+
readonly p480: "480p";
|
|
750
|
+
/** 720p. */
|
|
751
|
+
readonly p720: "720p";
|
|
752
|
+
/** 768p, admitted only by MiniMax H3 Max. */
|
|
753
|
+
readonly p768: "768p";
|
|
754
|
+
/** 1080p. */
|
|
755
|
+
readonly p1080: "1080p";
|
|
756
|
+
/** 4k, admitted only by Seedance 2.0. */
|
|
757
|
+
readonly p4k: "4k";
|
|
758
|
+
}>;
|
|
759
|
+
aspectRatio: z.ZodEnum<{
|
|
760
|
+
/** Landscape widescreen. */
|
|
761
|
+
readonly wide: "16:9";
|
|
762
|
+
/** Landscape standard. */
|
|
763
|
+
readonly landscape: "4:3";
|
|
764
|
+
/** Square. */
|
|
765
|
+
readonly square: "1:1";
|
|
766
|
+
/** Portrait standard. */
|
|
767
|
+
readonly portrait: "3:4";
|
|
768
|
+
/** Portrait widescreen. */
|
|
769
|
+
readonly tall: "9:16";
|
|
770
|
+
/** Landscape ultrawide. */
|
|
771
|
+
readonly ultrawide: "21:9";
|
|
772
|
+
/** Portrait ultrawide. */
|
|
773
|
+
readonly ultratall: "9:21";
|
|
774
|
+
}>;
|
|
775
|
+
width: z.ZodNumber;
|
|
776
|
+
height: z.ZodNumber;
|
|
777
|
+
}, z.core.$strict>>>>>;
|
|
778
|
+
defaultResolution: z.ZodEnum<{
|
|
779
|
+
/** 480p. */
|
|
780
|
+
readonly p480: "480p";
|
|
781
|
+
/** 720p. */
|
|
782
|
+
readonly p720: "720p";
|
|
783
|
+
/** 768p, admitted only by MiniMax H3 Max. */
|
|
784
|
+
readonly p768: "768p";
|
|
785
|
+
/** 1080p. */
|
|
786
|
+
readonly p1080: "1080p";
|
|
787
|
+
/** 4k, admitted only by Seedance 2.0. */
|
|
788
|
+
readonly p4k: "4k";
|
|
789
|
+
}>;
|
|
790
|
+
defaultAspectRatio: z.ZodEnum<{
|
|
791
|
+
/** Landscape widescreen. */
|
|
792
|
+
readonly wide: "16:9";
|
|
793
|
+
/** Landscape standard. */
|
|
794
|
+
readonly landscape: "4:3";
|
|
795
|
+
/** Square. */
|
|
796
|
+
readonly square: "1:1";
|
|
797
|
+
/** Portrait standard. */
|
|
798
|
+
readonly portrait: "3:4";
|
|
799
|
+
/** Portrait widescreen. */
|
|
800
|
+
readonly tall: "9:16";
|
|
801
|
+
/** Landscape ultrawide. */
|
|
802
|
+
readonly ultrawide: "21:9";
|
|
803
|
+
/** Portrait ultrawide. */
|
|
804
|
+
readonly ultratall: "9:21";
|
|
805
|
+
}>;
|
|
806
|
+
supportsAudio: z.ZodBoolean;
|
|
807
|
+
defaultGenerateAudio: z.ZodNullable<z.ZodBoolean>;
|
|
808
|
+
referenceRoles: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
809
|
+
/** First frame; required when a last frame is supplied. */
|
|
810
|
+
readonly first: "first-frame";
|
|
811
|
+
/** Last frame, supported by Seedance only (`last_frame_image`). */
|
|
812
|
+
readonly last: "last-frame";
|
|
813
|
+
/** One image in Seedance reference-image mode. */
|
|
814
|
+
readonly reference: "reference";
|
|
815
|
+
}>>>;
|
|
816
|
+
maxReferenceImages: z.ZodNumber;
|
|
817
|
+
referenceResolutions: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
818
|
+
/** 480p. */
|
|
819
|
+
readonly p480: "480p";
|
|
820
|
+
/** 720p. */
|
|
821
|
+
readonly p720: "720p";
|
|
822
|
+
/** 768p, admitted only by MiniMax H3 Max. */
|
|
823
|
+
readonly p768: "768p";
|
|
824
|
+
/** 1080p. */
|
|
825
|
+
readonly p1080: "1080p";
|
|
826
|
+
/** 4k, admitted only by Seedance 2.0. */
|
|
827
|
+
readonly p4k: "4k";
|
|
828
|
+
}>>>;
|
|
829
|
+
prices: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
830
|
+
resolution: z.ZodEnum<{
|
|
831
|
+
/** 480p. */
|
|
832
|
+
readonly p480: "480p";
|
|
833
|
+
/** 720p. */
|
|
834
|
+
readonly p720: "720p";
|
|
835
|
+
/** 768p, admitted only by MiniMax H3 Max. */
|
|
836
|
+
readonly p768: "768p";
|
|
837
|
+
/** 1080p. */
|
|
838
|
+
readonly p1080: "1080p";
|
|
839
|
+
/** 4k, admitted only by Seedance 2.0. */
|
|
840
|
+
readonly p4k: "4k";
|
|
841
|
+
}>;
|
|
842
|
+
silentMilliunitsPerSecond: z.ZodNumber;
|
|
843
|
+
audioMilliunitsPerSecond: z.ZodNumber;
|
|
844
|
+
}, z.core.$strict>>>>;
|
|
845
|
+
provider: z.ZodEnum<{
|
|
846
|
+
/** Seedance integer duration and data-URI image fields. */
|
|
847
|
+
readonly seedance: "seedance";
|
|
848
|
+
/** Veo duration string and base64 image_input. */
|
|
849
|
+
readonly veo: "veo";
|
|
850
|
+
/** MiniMax multimodal `content[]` array and uppercase resolution. */
|
|
851
|
+
readonly minimax: "minimax";
|
|
852
|
+
/** The injected provider owns the wire grammar. */
|
|
853
|
+
readonly host: "host";
|
|
854
|
+
}>;
|
|
855
|
+
}, z.core.$strict>>>;
|
|
856
|
+
}, z.core.$strict>>>, z.ZodTransform<MediaCatalogue, Readonly<{
|
|
857
|
+
id: string;
|
|
858
|
+
label: string;
|
|
859
|
+
kind: "image" | "video";
|
|
860
|
+
tier: "draft" | "balanced" | "premium" | "max";
|
|
861
|
+
outputFormats: readonly ("png" | "jpeg" | "webp")[];
|
|
862
|
+
maxPromptLength: number;
|
|
863
|
+
input: Readonly<{
|
|
864
|
+
transport: "json" | "multipart";
|
|
865
|
+
dimensions: "none" | "own";
|
|
866
|
+
maxDimension: number | null;
|
|
867
|
+
maxDimensionDocumented: boolean;
|
|
868
|
+
defaultWidth: number;
|
|
869
|
+
defaultHeight: number;
|
|
870
|
+
steps: "steps" | "num_steps" | "fixed";
|
|
871
|
+
maxSteps: number | null;
|
|
872
|
+
defaultSteps: number | null;
|
|
873
|
+
referenceField: string | null;
|
|
874
|
+
maxReferences: number;
|
|
875
|
+
referenceDimension: number | null;
|
|
876
|
+
referenceFormat: "png" | "webp";
|
|
877
|
+
}>;
|
|
878
|
+
sizes: readonly string[] | null;
|
|
879
|
+
video: Readonly<{
|
|
880
|
+
minSeconds: number;
|
|
881
|
+
maxSeconds: number;
|
|
882
|
+
defaultSeconds: number;
|
|
883
|
+
durations: readonly number[];
|
|
884
|
+
formats: readonly Readonly<{
|
|
885
|
+
resolution: "480p" | "720p" | "768p" | "1080p" | "4k";
|
|
886
|
+
aspectRatio: "16:9" | "4:3" | "1:1" | "3:4" | "9:16" | "21:9" | "9:21";
|
|
887
|
+
width: number;
|
|
888
|
+
height: number;
|
|
889
|
+
}>[];
|
|
890
|
+
defaultResolution: "480p" | "720p" | "768p" | "1080p" | "4k";
|
|
891
|
+
defaultAspectRatio: "16:9" | "4:3" | "1:1" | "3:4" | "9:16" | "21:9" | "9:21";
|
|
892
|
+
supportsAudio: boolean;
|
|
893
|
+
defaultGenerateAudio: boolean | null;
|
|
894
|
+
referenceRoles: readonly ("first-frame" | "last-frame" | "reference")[];
|
|
895
|
+
maxReferenceImages: number;
|
|
896
|
+
referenceResolutions: readonly ("480p" | "720p" | "768p" | "1080p" | "4k")[];
|
|
897
|
+
prices: readonly Readonly<{
|
|
898
|
+
resolution: "480p" | "720p" | "768p" | "1080p" | "4k";
|
|
899
|
+
silentMilliunitsPerSecond: number;
|
|
900
|
+
audioMilliunitsPerSecond: number;
|
|
901
|
+
}>[];
|
|
902
|
+
provider: "seedance" | "veo" | "minimax" | "host";
|
|
903
|
+
}> | null;
|
|
904
|
+
}>[]>>;
|
|
905
|
+
/** Decode untrusted catalogue data, throwing a MediaSettingsError that names the first problem. */
|
|
906
|
+
export declare const parseMediaCatalogue: (raw: unknown) => MediaCatalogue;
|
|
907
|
+
/** List the gateway provider's models in catalog order. */
|
|
477
908
|
export declare const listMediaModels: () => readonly MediaModel[];
|
|
478
|
-
/** Find a model
|
|
479
|
-
export declare const
|
|
909
|
+
/** Find a model in the Fungi gateway's own catalogue; gateway-internal code never sees a custom provider's models. */
|
|
910
|
+
export declare const getGatewayModel: (id: string) => MediaModel | undefined;
|
|
911
|
+
/** Find a model in `catalogue` (the gateway's by default), or undefined when absent. */
|
|
912
|
+
export declare const getMediaModel: (id: string, catalogue?: MediaCatalogue) => MediaCatalogueModel | undefined;
|
|
480
913
|
/** Invalid generation settings or unsupported model parameters. */
|
|
481
914
|
export declare class MediaSettingsError extends Error {
|
|
482
915
|
constructor(message: string);
|