@shop-os/modelkit 0.2.12 → 0.2.14

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.
@@ -429,6 +429,11 @@ interface CallContext {
429
429
  /** "enterprise" picks keys.enterprise when every key for the provider is set, else falls back to pro. */
430
430
  tier?: "pro" | "enterprise";
431
431
  signal?: AbortSignal;
432
+ /** Media retries after the initial request. Set 0 when a durable host owns recovery.
433
+ * Unset preserves adapter defaults. Successful pending-job polls are not retries.
434
+ * Text methods use the AI SDK options.maxRetries instead.
435
+ */
436
+ maxRetries?: number;
432
437
  onUnsupported?: "error" | "coerce";
433
438
  }
434
439
 
@@ -480,6 +485,289 @@ declare const SurfaceSchema: z.ZodEnum<{
480
485
  }>;
481
486
  declare const SURFACES: ("cowork" | "space_builder")[];
482
487
  declare const ExposureSchema: z.ZodType<Surface[], unknown>;
488
+ declare const CatalogModelSchemaBase: z.ZodObject<{
489
+ id: z.ZodString;
490
+ aliases: z.ZodDefault<z.ZodArray<z.ZodString>>;
491
+ label: z.ZodString;
492
+ type: z.ZodEnum<{
493
+ text: "text";
494
+ image: "image";
495
+ video: "video";
496
+ audio: "audio";
497
+ upscale: "upscale";
498
+ "bg-remove": "bg-remove";
499
+ }>;
500
+ adapter: z.ZodEnum<{
501
+ "ai-sdk-text": "ai-sdk-text";
502
+ "google-image": "google-image";
503
+ "openai-image": "openai-image";
504
+ "google-genai": "google-genai";
505
+ ark: "ark";
506
+ fal: "fal";
507
+ replicate: "replicate";
508
+ prodia: "prodia";
509
+ higgsfield: "higgsfield";
510
+ "xai-video": "xai-video";
511
+ }>;
512
+ providerModelId: z.ZodString;
513
+ lifecycle: z.ZodEnum<{
514
+ active: "active";
515
+ deprecated: "deprecated";
516
+ retired: "retired";
517
+ }>;
518
+ replacedBy: z.ZodOptional<z.ZodString>;
519
+ exposure: z.ZodType<Surface[], unknown, z.core.$ZodTypeInternals<Surface[], unknown>>;
520
+ constraints: z.ZodObject<{
521
+ aspectRatios: z.ZodOptional<z.ZodArray<z.ZodEnum<{
522
+ "1:1": "1:1";
523
+ "16:9": "16:9";
524
+ "9:16": "9:16";
525
+ "4:3": "4:3";
526
+ "3:4": "3:4";
527
+ "3:2": "3:2";
528
+ "2:3": "2:3";
529
+ "4:5": "4:5";
530
+ "5:4": "5:4";
531
+ "21:9": "21:9";
532
+ "9:21": "9:21";
533
+ "97:30": "97:30";
534
+ adaptive: "adaptive";
535
+ }>>>;
536
+ sizes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
537
+ 512: "512";
538
+ "1K": "1K";
539
+ "2K": "2K";
540
+ "4K": "4K";
541
+ }>>>;
542
+ resolutions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
543
+ "360p": "360p";
544
+ "480p": "480p";
545
+ "720p": "720p";
546
+ "768p": "768p";
547
+ "1080p": "1080p";
548
+ "2k": "2k";
549
+ "4k": "4k";
550
+ }>>>;
551
+ durations: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
552
+ min: z.ZodNumber;
553
+ max: z.ZodNumber;
554
+ }, z.core.$loose>, z.ZodArray<z.ZodNumber>]>>;
555
+ durationPresets: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
556
+ qualityOptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
557
+ exactSizes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
558
+ references: z.ZodOptional<z.ZodObject<{
559
+ images: z.ZodOptional<z.ZodNumber>;
560
+ imagesWithVideo: z.ZodOptional<z.ZodNumber>;
561
+ videos: z.ZodOptional<z.ZodNumber>;
562
+ audios: z.ZodOptional<z.ZodNumber>;
563
+ total: z.ZodOptional<z.ZodNumber>;
564
+ audioOnly: z.ZodOptional<z.ZodBoolean>;
565
+ }, z.core.$loose>>;
566
+ requires: z.ZodOptional<z.ZodArray<z.ZodEnum<{
567
+ references: "references";
568
+ firstFrame: "firstFrame";
569
+ sourceVideo: "sourceVideo";
570
+ }>>>;
571
+ supports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
572
+ upscale: "upscale";
573
+ quality: "quality";
574
+ seed: "seed";
575
+ count: "count";
576
+ outputFormat: "outputFormat";
577
+ scaleFactor: "scaleFactor";
578
+ safetySettings: "safetySettings";
579
+ temperature: "temperature";
580
+ lastFrame: "lastFrame";
581
+ generateAudio: "generateAudio";
582
+ negativePrompt: "negativePrompt";
583
+ cfgScale: "cfgScale";
584
+ promptExpansion: "promptExpansion";
585
+ watermark: "watermark";
586
+ safetyChecker: "safetyChecker";
587
+ taskType: "taskType";
588
+ instrumental: "instrumental";
589
+ }>>>;
590
+ ratioIgnoredWith: z.ZodOptional<z.ZodArray<z.ZodEnum<{
591
+ firstFrame: "firstFrame";
592
+ sourceVideo: "sourceVideo";
593
+ }>>>;
594
+ }, z.core.$loose>;
595
+ defaults: z.ZodObject<{
596
+ references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
597
+ url: z.ZodString;
598
+ label: z.ZodOptional<z.ZodString>;
599
+ }, z.core.$loose>, z.ZodObject<{
600
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
601
+ mime: z.ZodString;
602
+ label: z.ZodOptional<z.ZodString>;
603
+ }, z.core.$loose>]>>>;
604
+ aspectRatio: z.ZodOptional<z.ZodEnum<{
605
+ "1:1": "1:1";
606
+ "16:9": "16:9";
607
+ "9:16": "9:16";
608
+ "4:3": "4:3";
609
+ "3:4": "3:4";
610
+ "3:2": "3:2";
611
+ "2:3": "2:3";
612
+ "4:5": "4:5";
613
+ "5:4": "5:4";
614
+ "21:9": "21:9";
615
+ "9:21": "9:21";
616
+ "97:30": "97:30";
617
+ adaptive: "adaptive";
618
+ }>>;
619
+ size: z.ZodOptional<z.ZodEnum<{
620
+ 512: "512";
621
+ "1K": "1K";
622
+ "2K": "2K";
623
+ "4K": "4K";
624
+ }>>;
625
+ exactSize: z.ZodOptional<z.ZodString>;
626
+ quality: z.ZodOptional<z.ZodEnum<{
627
+ auto: "auto";
628
+ low: "low";
629
+ medium: "medium";
630
+ high: "high";
631
+ xhigh: "xhigh";
632
+ max: "max";
633
+ }>>;
634
+ seed: z.ZodOptional<z.ZodNumber>;
635
+ count: z.ZodOptional<z.ZodNumber>;
636
+ outputFormat: z.ZodOptional<z.ZodEnum<{
637
+ png: "png";
638
+ jpeg: "jpeg";
639
+ webp: "webp";
640
+ }>>;
641
+ scaleFactor: z.ZodOptional<z.ZodNumber>;
642
+ safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
643
+ category: z.ZodString;
644
+ threshold: z.ZodString;
645
+ }, z.core.$loose>>>;
646
+ temperature: z.ZodOptional<z.ZodNumber>;
647
+ upscale: z.ZodOptional<z.ZodObject<{
648
+ enhanceModel: z.ZodOptional<z.ZodString>;
649
+ subjectDetection: z.ZodOptional<z.ZodString>;
650
+ faceEnhancement: z.ZodOptional<z.ZodBoolean>;
651
+ faceEnhancementCreativity: z.ZodOptional<z.ZodNumber>;
652
+ faceEnhancementStrength: z.ZodOptional<z.ZodNumber>;
653
+ }, z.core.$loose>>;
654
+ firstFrame: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
655
+ url: z.ZodString;
656
+ label: z.ZodOptional<z.ZodString>;
657
+ }, z.core.$loose>, z.ZodObject<{
658
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
659
+ mime: z.ZodString;
660
+ label: z.ZodOptional<z.ZodString>;
661
+ }, z.core.$loose>]>>;
662
+ lastFrame: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
663
+ url: z.ZodString;
664
+ label: z.ZodOptional<z.ZodString>;
665
+ }, z.core.$loose>, z.ZodObject<{
666
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
667
+ mime: z.ZodString;
668
+ label: z.ZodOptional<z.ZodString>;
669
+ }, z.core.$loose>]>>;
670
+ sourceVideo: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
671
+ url: z.ZodString;
672
+ label: z.ZodOptional<z.ZodString>;
673
+ }, z.core.$loose>, z.ZodObject<{
674
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
675
+ mime: z.ZodString;
676
+ label: z.ZodOptional<z.ZodString>;
677
+ }, z.core.$loose>]>>;
678
+ referenceImages: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
679
+ url: z.ZodString;
680
+ label: z.ZodOptional<z.ZodString>;
681
+ }, z.core.$loose>, z.ZodObject<{
682
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
683
+ mime: z.ZodString;
684
+ label: z.ZodOptional<z.ZodString>;
685
+ }, z.core.$loose>]>>>;
686
+ referenceVideos: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
687
+ url: z.ZodString;
688
+ label: z.ZodOptional<z.ZodString>;
689
+ }, z.core.$loose>, z.ZodObject<{
690
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
691
+ mime: z.ZodString;
692
+ label: z.ZodOptional<z.ZodString>;
693
+ }, z.core.$loose>]>>>;
694
+ referenceAudios: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
695
+ url: z.ZodString;
696
+ label: z.ZodOptional<z.ZodString>;
697
+ }, z.core.$loose>, z.ZodObject<{
698
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
699
+ mime: z.ZodString;
700
+ label: z.ZodOptional<z.ZodString>;
701
+ }, z.core.$loose>]>>>;
702
+ resolution: z.ZodOptional<z.ZodEnum<{
703
+ "360p": "360p";
704
+ "480p": "480p";
705
+ "720p": "720p";
706
+ "768p": "768p";
707
+ "1080p": "1080p";
708
+ "2k": "2k";
709
+ "4k": "4k";
710
+ }>>;
711
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
712
+ generateAudio: z.ZodOptional<z.ZodBoolean>;
713
+ negativePrompt: z.ZodOptional<z.ZodString>;
714
+ cfgScale: z.ZodOptional<z.ZodNumber>;
715
+ promptExpansion: z.ZodOptional<z.ZodEnum<{
716
+ quality: "quality";
717
+ fast: "fast";
718
+ balanced: "balanced";
719
+ }>>;
720
+ watermark: z.ZodOptional<z.ZodBoolean>;
721
+ safetyChecker: z.ZodOptional<z.ZodBoolean>;
722
+ taskType: z.ZodOptional<z.ZodEnum<{
723
+ reference: "reference";
724
+ edit: "edit";
725
+ extend: "extend";
726
+ }>>;
727
+ mode: z.ZodOptional<z.ZodEnum<{
728
+ standard: "standard";
729
+ pro: "pro";
730
+ }>>;
731
+ instrumental: z.ZodOptional<z.ZodBoolean>;
732
+ }, z.core.$loose>;
733
+ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<ProviderOptionValue, unknown, z.core.$ZodTypeInternals<ProviderOptionValue, unknown>>>>>;
734
+ usage: z.ZodObject<{
735
+ unit: z.ZodEnum<{
736
+ tokens: "tokens";
737
+ images: "images";
738
+ seconds: "seconds";
739
+ reported_cost_usd: "reported_cost_usd";
740
+ compute_seconds: "compute_seconds";
741
+ }>;
742
+ slug: z.ZodOptional<z.ZodString>;
743
+ providerLabel: z.ZodOptional<z.ZodString>;
744
+ }, z.core.$loose>;
745
+ pricingKind: z.ZodEnum<{
746
+ token: "token";
747
+ image_size: "image_size";
748
+ video_per_second: "video_per_second";
749
+ flat: "flat";
750
+ }>;
751
+ display: z.ZodOptional<z.ZodObject<{
752
+ provider: z.ZodString;
753
+ description: z.ZodString;
754
+ logo: z.ZodOptional<z.ZodString>;
755
+ costTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
756
+ recommended: z.ZodOptional<z.ZodBoolean>;
757
+ sortOrder: z.ZodOptional<z.ZodNumber>;
758
+ chat: z.ZodOptional<z.ZodObject<{
759
+ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<ProviderOptionValue, unknown, z.core.$ZodTypeInternals<ProviderOptionValue, unknown>>>>>;
760
+ temperature: z.ZodOptional<z.ZodNumber>;
761
+ }, z.core.$loose>>;
762
+ }, z.core.$loose>>;
763
+ capabilities: z.ZodOptional<z.ZodObject<{
764
+ acceptsSourceVideo: z.ZodOptional<z.ZodBoolean>;
765
+ framesExcludeReferences: z.ZodOptional<z.ZodBoolean>;
766
+ reasoning: z.ZodOptional<z.ZodBoolean>;
767
+ vision: z.ZodOptional<z.ZodBoolean>;
768
+ contextWindow: z.ZodOptional<z.ZodNumber>;
769
+ }, z.core.$loose>>;
770
+ }, z.core.$loose>;
483
771
  declare const CatalogModelSchema: z.ZodType<CatalogModel>;
484
772
  declare const CatalogSchema: z.ZodType<CatalogModel[]>;
485
773
 
@@ -489,6 +777,7 @@ interface PrimeCatalogResult {
489
777
  rowCount: number;
490
778
  revision?: string;
491
779
  error?: string;
780
+ droppedRows?: number;
492
781
  }
493
782
  interface LiveCatalogState {
494
783
  catalog: Catalog;
@@ -526,6 +815,10 @@ interface CatalogEnvelope {
526
815
  rows: CatalogModel[];
527
816
  revision?: string;
528
817
  }
818
+ interface QuarantineResult {
819
+ rows: CatalogModel[];
820
+ dropped: number;
821
+ }
529
822
  /** Fetch, validate, swap into liveCatalog. Never throws. Second call returns the same promise. */
530
823
  declare function primeCatalog(source: CatalogSource): Promise<PrimeCatalogResult>;
531
824
  /** Test seam: stop the refresh timer, reset liveCatalog to MODELS and clear the memo. */
@@ -585,4 +878,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
585
878
  /** Resolve caller options against a catalog row, dispatching on `model.type`. */
586
879
  declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
587
880
 
588
- export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, type CatalogOrigin, CatalogSchema, type CatalogSource, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type ReferenceLimits, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows };
881
+ export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows };
package/dist/catalog.d.ts CHANGED
@@ -429,6 +429,11 @@ interface CallContext {
429
429
  /** "enterprise" picks keys.enterprise when every key for the provider is set, else falls back to pro. */
430
430
  tier?: "pro" | "enterprise";
431
431
  signal?: AbortSignal;
432
+ /** Media retries after the initial request. Set 0 when a durable host owns recovery.
433
+ * Unset preserves adapter defaults. Successful pending-job polls are not retries.
434
+ * Text methods use the AI SDK options.maxRetries instead.
435
+ */
436
+ maxRetries?: number;
432
437
  onUnsupported?: "error" | "coerce";
433
438
  }
434
439
 
@@ -480,6 +485,289 @@ declare const SurfaceSchema: z.ZodEnum<{
480
485
  }>;
481
486
  declare const SURFACES: ("cowork" | "space_builder")[];
482
487
  declare const ExposureSchema: z.ZodType<Surface[], unknown>;
488
+ declare const CatalogModelSchemaBase: z.ZodObject<{
489
+ id: z.ZodString;
490
+ aliases: z.ZodDefault<z.ZodArray<z.ZodString>>;
491
+ label: z.ZodString;
492
+ type: z.ZodEnum<{
493
+ text: "text";
494
+ image: "image";
495
+ video: "video";
496
+ audio: "audio";
497
+ upscale: "upscale";
498
+ "bg-remove": "bg-remove";
499
+ }>;
500
+ adapter: z.ZodEnum<{
501
+ "ai-sdk-text": "ai-sdk-text";
502
+ "google-image": "google-image";
503
+ "openai-image": "openai-image";
504
+ "google-genai": "google-genai";
505
+ ark: "ark";
506
+ fal: "fal";
507
+ replicate: "replicate";
508
+ prodia: "prodia";
509
+ higgsfield: "higgsfield";
510
+ "xai-video": "xai-video";
511
+ }>;
512
+ providerModelId: z.ZodString;
513
+ lifecycle: z.ZodEnum<{
514
+ active: "active";
515
+ deprecated: "deprecated";
516
+ retired: "retired";
517
+ }>;
518
+ replacedBy: z.ZodOptional<z.ZodString>;
519
+ exposure: z.ZodType<Surface[], unknown, z.core.$ZodTypeInternals<Surface[], unknown>>;
520
+ constraints: z.ZodObject<{
521
+ aspectRatios: z.ZodOptional<z.ZodArray<z.ZodEnum<{
522
+ "1:1": "1:1";
523
+ "16:9": "16:9";
524
+ "9:16": "9:16";
525
+ "4:3": "4:3";
526
+ "3:4": "3:4";
527
+ "3:2": "3:2";
528
+ "2:3": "2:3";
529
+ "4:5": "4:5";
530
+ "5:4": "5:4";
531
+ "21:9": "21:9";
532
+ "9:21": "9:21";
533
+ "97:30": "97:30";
534
+ adaptive: "adaptive";
535
+ }>>>;
536
+ sizes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
537
+ 512: "512";
538
+ "1K": "1K";
539
+ "2K": "2K";
540
+ "4K": "4K";
541
+ }>>>;
542
+ resolutions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
543
+ "360p": "360p";
544
+ "480p": "480p";
545
+ "720p": "720p";
546
+ "768p": "768p";
547
+ "1080p": "1080p";
548
+ "2k": "2k";
549
+ "4k": "4k";
550
+ }>>>;
551
+ durations: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
552
+ min: z.ZodNumber;
553
+ max: z.ZodNumber;
554
+ }, z.core.$loose>, z.ZodArray<z.ZodNumber>]>>;
555
+ durationPresets: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
556
+ qualityOptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
557
+ exactSizes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
558
+ references: z.ZodOptional<z.ZodObject<{
559
+ images: z.ZodOptional<z.ZodNumber>;
560
+ imagesWithVideo: z.ZodOptional<z.ZodNumber>;
561
+ videos: z.ZodOptional<z.ZodNumber>;
562
+ audios: z.ZodOptional<z.ZodNumber>;
563
+ total: z.ZodOptional<z.ZodNumber>;
564
+ audioOnly: z.ZodOptional<z.ZodBoolean>;
565
+ }, z.core.$loose>>;
566
+ requires: z.ZodOptional<z.ZodArray<z.ZodEnum<{
567
+ references: "references";
568
+ firstFrame: "firstFrame";
569
+ sourceVideo: "sourceVideo";
570
+ }>>>;
571
+ supports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
572
+ upscale: "upscale";
573
+ quality: "quality";
574
+ seed: "seed";
575
+ count: "count";
576
+ outputFormat: "outputFormat";
577
+ scaleFactor: "scaleFactor";
578
+ safetySettings: "safetySettings";
579
+ temperature: "temperature";
580
+ lastFrame: "lastFrame";
581
+ generateAudio: "generateAudio";
582
+ negativePrompt: "negativePrompt";
583
+ cfgScale: "cfgScale";
584
+ promptExpansion: "promptExpansion";
585
+ watermark: "watermark";
586
+ safetyChecker: "safetyChecker";
587
+ taskType: "taskType";
588
+ instrumental: "instrumental";
589
+ }>>>;
590
+ ratioIgnoredWith: z.ZodOptional<z.ZodArray<z.ZodEnum<{
591
+ firstFrame: "firstFrame";
592
+ sourceVideo: "sourceVideo";
593
+ }>>>;
594
+ }, z.core.$loose>;
595
+ defaults: z.ZodObject<{
596
+ references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
597
+ url: z.ZodString;
598
+ label: z.ZodOptional<z.ZodString>;
599
+ }, z.core.$loose>, z.ZodObject<{
600
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
601
+ mime: z.ZodString;
602
+ label: z.ZodOptional<z.ZodString>;
603
+ }, z.core.$loose>]>>>;
604
+ aspectRatio: z.ZodOptional<z.ZodEnum<{
605
+ "1:1": "1:1";
606
+ "16:9": "16:9";
607
+ "9:16": "9:16";
608
+ "4:3": "4:3";
609
+ "3:4": "3:4";
610
+ "3:2": "3:2";
611
+ "2:3": "2:3";
612
+ "4:5": "4:5";
613
+ "5:4": "5:4";
614
+ "21:9": "21:9";
615
+ "9:21": "9:21";
616
+ "97:30": "97:30";
617
+ adaptive: "adaptive";
618
+ }>>;
619
+ size: z.ZodOptional<z.ZodEnum<{
620
+ 512: "512";
621
+ "1K": "1K";
622
+ "2K": "2K";
623
+ "4K": "4K";
624
+ }>>;
625
+ exactSize: z.ZodOptional<z.ZodString>;
626
+ quality: z.ZodOptional<z.ZodEnum<{
627
+ auto: "auto";
628
+ low: "low";
629
+ medium: "medium";
630
+ high: "high";
631
+ xhigh: "xhigh";
632
+ max: "max";
633
+ }>>;
634
+ seed: z.ZodOptional<z.ZodNumber>;
635
+ count: z.ZodOptional<z.ZodNumber>;
636
+ outputFormat: z.ZodOptional<z.ZodEnum<{
637
+ png: "png";
638
+ jpeg: "jpeg";
639
+ webp: "webp";
640
+ }>>;
641
+ scaleFactor: z.ZodOptional<z.ZodNumber>;
642
+ safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
643
+ category: z.ZodString;
644
+ threshold: z.ZodString;
645
+ }, z.core.$loose>>>;
646
+ temperature: z.ZodOptional<z.ZodNumber>;
647
+ upscale: z.ZodOptional<z.ZodObject<{
648
+ enhanceModel: z.ZodOptional<z.ZodString>;
649
+ subjectDetection: z.ZodOptional<z.ZodString>;
650
+ faceEnhancement: z.ZodOptional<z.ZodBoolean>;
651
+ faceEnhancementCreativity: z.ZodOptional<z.ZodNumber>;
652
+ faceEnhancementStrength: z.ZodOptional<z.ZodNumber>;
653
+ }, z.core.$loose>>;
654
+ firstFrame: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
655
+ url: z.ZodString;
656
+ label: z.ZodOptional<z.ZodString>;
657
+ }, z.core.$loose>, z.ZodObject<{
658
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
659
+ mime: z.ZodString;
660
+ label: z.ZodOptional<z.ZodString>;
661
+ }, z.core.$loose>]>>;
662
+ lastFrame: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
663
+ url: z.ZodString;
664
+ label: z.ZodOptional<z.ZodString>;
665
+ }, z.core.$loose>, z.ZodObject<{
666
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
667
+ mime: z.ZodString;
668
+ label: z.ZodOptional<z.ZodString>;
669
+ }, z.core.$loose>]>>;
670
+ sourceVideo: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
671
+ url: z.ZodString;
672
+ label: z.ZodOptional<z.ZodString>;
673
+ }, z.core.$loose>, z.ZodObject<{
674
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
675
+ mime: z.ZodString;
676
+ label: z.ZodOptional<z.ZodString>;
677
+ }, z.core.$loose>]>>;
678
+ referenceImages: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
679
+ url: z.ZodString;
680
+ label: z.ZodOptional<z.ZodString>;
681
+ }, z.core.$loose>, z.ZodObject<{
682
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
683
+ mime: z.ZodString;
684
+ label: z.ZodOptional<z.ZodString>;
685
+ }, z.core.$loose>]>>>;
686
+ referenceVideos: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
687
+ url: z.ZodString;
688
+ label: z.ZodOptional<z.ZodString>;
689
+ }, z.core.$loose>, z.ZodObject<{
690
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
691
+ mime: z.ZodString;
692
+ label: z.ZodOptional<z.ZodString>;
693
+ }, z.core.$loose>]>>>;
694
+ referenceAudios: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
695
+ url: z.ZodString;
696
+ label: z.ZodOptional<z.ZodString>;
697
+ }, z.core.$loose>, z.ZodObject<{
698
+ bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
699
+ mime: z.ZodString;
700
+ label: z.ZodOptional<z.ZodString>;
701
+ }, z.core.$loose>]>>>;
702
+ resolution: z.ZodOptional<z.ZodEnum<{
703
+ "360p": "360p";
704
+ "480p": "480p";
705
+ "720p": "720p";
706
+ "768p": "768p";
707
+ "1080p": "1080p";
708
+ "2k": "2k";
709
+ "4k": "4k";
710
+ }>>;
711
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
712
+ generateAudio: z.ZodOptional<z.ZodBoolean>;
713
+ negativePrompt: z.ZodOptional<z.ZodString>;
714
+ cfgScale: z.ZodOptional<z.ZodNumber>;
715
+ promptExpansion: z.ZodOptional<z.ZodEnum<{
716
+ quality: "quality";
717
+ fast: "fast";
718
+ balanced: "balanced";
719
+ }>>;
720
+ watermark: z.ZodOptional<z.ZodBoolean>;
721
+ safetyChecker: z.ZodOptional<z.ZodBoolean>;
722
+ taskType: z.ZodOptional<z.ZodEnum<{
723
+ reference: "reference";
724
+ edit: "edit";
725
+ extend: "extend";
726
+ }>>;
727
+ mode: z.ZodOptional<z.ZodEnum<{
728
+ standard: "standard";
729
+ pro: "pro";
730
+ }>>;
731
+ instrumental: z.ZodOptional<z.ZodBoolean>;
732
+ }, z.core.$loose>;
733
+ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<ProviderOptionValue, unknown, z.core.$ZodTypeInternals<ProviderOptionValue, unknown>>>>>;
734
+ usage: z.ZodObject<{
735
+ unit: z.ZodEnum<{
736
+ tokens: "tokens";
737
+ images: "images";
738
+ seconds: "seconds";
739
+ reported_cost_usd: "reported_cost_usd";
740
+ compute_seconds: "compute_seconds";
741
+ }>;
742
+ slug: z.ZodOptional<z.ZodString>;
743
+ providerLabel: z.ZodOptional<z.ZodString>;
744
+ }, z.core.$loose>;
745
+ pricingKind: z.ZodEnum<{
746
+ token: "token";
747
+ image_size: "image_size";
748
+ video_per_second: "video_per_second";
749
+ flat: "flat";
750
+ }>;
751
+ display: z.ZodOptional<z.ZodObject<{
752
+ provider: z.ZodString;
753
+ description: z.ZodString;
754
+ logo: z.ZodOptional<z.ZodString>;
755
+ costTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
756
+ recommended: z.ZodOptional<z.ZodBoolean>;
757
+ sortOrder: z.ZodOptional<z.ZodNumber>;
758
+ chat: z.ZodOptional<z.ZodObject<{
759
+ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<ProviderOptionValue, unknown, z.core.$ZodTypeInternals<ProviderOptionValue, unknown>>>>>;
760
+ temperature: z.ZodOptional<z.ZodNumber>;
761
+ }, z.core.$loose>>;
762
+ }, z.core.$loose>>;
763
+ capabilities: z.ZodOptional<z.ZodObject<{
764
+ acceptsSourceVideo: z.ZodOptional<z.ZodBoolean>;
765
+ framesExcludeReferences: z.ZodOptional<z.ZodBoolean>;
766
+ reasoning: z.ZodOptional<z.ZodBoolean>;
767
+ vision: z.ZodOptional<z.ZodBoolean>;
768
+ contextWindow: z.ZodOptional<z.ZodNumber>;
769
+ }, z.core.$loose>>;
770
+ }, z.core.$loose>;
483
771
  declare const CatalogModelSchema: z.ZodType<CatalogModel>;
484
772
  declare const CatalogSchema: z.ZodType<CatalogModel[]>;
485
773
 
@@ -489,6 +777,7 @@ interface PrimeCatalogResult {
489
777
  rowCount: number;
490
778
  revision?: string;
491
779
  error?: string;
780
+ droppedRows?: number;
492
781
  }
493
782
  interface LiveCatalogState {
494
783
  catalog: Catalog;
@@ -526,6 +815,10 @@ interface CatalogEnvelope {
526
815
  rows: CatalogModel[];
527
816
  revision?: string;
528
817
  }
818
+ interface QuarantineResult {
819
+ rows: CatalogModel[];
820
+ dropped: number;
821
+ }
529
822
  /** Fetch, validate, swap into liveCatalog. Never throws. Second call returns the same promise. */
530
823
  declare function primeCatalog(source: CatalogSource): Promise<PrimeCatalogResult>;
531
824
  /** Test seam: stop the refresh timer, reset liveCatalog to MODELS and clear the memo. */
@@ -585,4 +878,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
585
878
  /** Resolve caller options against a catalog row, dispatching on `model.type`. */
586
879
  declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
587
880
 
588
- export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, type CatalogOrigin, CatalogSchema, type CatalogSource, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type ReferenceLimits, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows };
881
+ export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows };