@shop-os/modelkit 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.
@@ -69,6 +69,10 @@ type ModelType = "text" | "image" | "video" | "audio"
69
69
  | "lipsync"
70
70
  /** Speech to text (`transcribe`). */
71
71
  | "transcription"
72
+ /** A reusable voice cloned from recordings (`createVoice`); its id feeds `SpeechRequest.customVoice`. */
73
+ | "voice-clone"
74
+ /** Candidate voices from a description (`designVoice`); keep one with `createVoice`. */
75
+ | "voice-design"
72
76
  /** A prompt and/or photos of an object in, a GLB 3D model out. */
73
77
  | "model3d";
74
78
  /**
@@ -133,7 +137,7 @@ type Lifecycle = "active" | "deprecated" | "retired";
133
137
  type Surface = "cowork" | "space_builder";
134
138
  /** @deprecated use Surface[] */
135
139
  type Exposure = Surface[];
136
- type AdapterId = "ai-sdk-text" | "google-image" | "openai-image" | "google-genai" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "xai-video" | "luma";
140
+ type AdapterId = "ai-sdk-text" | "google-image" | "openai-image" | "google-genai" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "xai-video" | "luma" | "fish";
137
141
  /** Gemini image safety threshold, per category, sent only when the caller opts in. */
138
142
  type ImageSafetySetting = {
139
143
  category: string;
@@ -427,6 +431,12 @@ interface SpeechRequest {
427
431
  text: string;
428
432
  /** One of `constraints.voices[].id`; the row default when unset. */
429
433
  voice?: string;
434
+ /**
435
+ * Rows with `capabilities.customVoices`: a voice id `createVoice` returned, used instead of
436
+ * `voice`. It belongs to the provider account of the key set that created it, so call with
437
+ * the same `tier`.
438
+ */
439
+ customVoice?: string;
430
440
  /** One of `constraints.languages[].code`; the provider detects it when unset. */
431
441
  language?: string;
432
442
  /** Rows with `supports: style`: how to speak it ("warm and slow"), kept out of the script. */
@@ -435,6 +445,65 @@ interface SpeechRequest {
435
445
  outputFormat?: string;
436
446
  abortSignal?: AbortSignal;
437
447
  }
448
+ /** One recording a voice is cloned from. */
449
+ interface VoiceSample {
450
+ /** Clean, single-speaker speech. Set `durationSeconds` so `constraints.references.audioSeconds` can be checked. */
451
+ audio: MediaRef;
452
+ /** The words spoken in `audio`; the provider transcribes the clip when unset. */
453
+ transcript?: string;
454
+ /** `VoiceCandidate.signature` when `audio` is a `designVoice` candidate. */
455
+ designSignature?: string;
456
+ }
457
+ /** `createVoice` on a `voice-clone` row: a private, reusable voice. */
458
+ interface VoiceCloneRequest {
459
+ model: string;
460
+ /** The voice's name in the provider console. */
461
+ title: string;
462
+ samples: VoiceSample[];
463
+ description?: string;
464
+ /** Provider noise removal and level normalisation before cloning; the provider default (on) when unset. */
465
+ enhance?: boolean;
466
+ abortSignal?: AbortSignal;
467
+ }
468
+ type VoiceCloneState = "created" | "training" | "trained" | "failed";
469
+ interface VoiceCloneResult {
470
+ /** Pass as `SpeechRequest.customVoice` on a row with `capabilities.customVoices`. */
471
+ voiceId: string;
472
+ /** `trained` means usable now; unset when the provider reports a state the kit does not know. */
473
+ state?: VoiceCloneState;
474
+ usage: UsageEvent;
475
+ raw?: JsonValue;
476
+ }
477
+ /** `designVoice` on a `voice-design` row: short candidate voices from a description. */
478
+ interface VoiceDesignRequest {
479
+ model: string;
480
+ /** The voice: age, tone, accent, pacing, context. */
481
+ prompt: string;
482
+ /** A short line every candidate reads, so they can be compared. */
483
+ previewText?: string;
484
+ /** A language hint such as `en`. */
485
+ language?: string;
486
+ /** Candidates to return, within `constraints.voiceDesign.maxCandidates`; the row default when unset. */
487
+ count?: number;
488
+ seed?: number;
489
+ abortSignal?: AbortSignal;
490
+ }
491
+ interface VoiceCandidate {
492
+ audio: MediaOutput;
493
+ durationSeconds: number;
494
+ /** Send with this audio in `VoiceSample.designSignature` to keep the voice. */
495
+ signature: string;
496
+ }
497
+ interface VoiceDesignResult {
498
+ candidates: VoiceCandidate[];
499
+ usage: UsageEvent;
500
+ }
501
+ /** `deleteVoice` on the `voice-clone` row that created the voice, with the same `tier`. */
502
+ interface VoiceDeleteRequest {
503
+ model: string;
504
+ voiceId: string;
505
+ abortSignal?: AbortSignal;
506
+ }
438
507
  /** `changeVoice` on a `voice-change` row: the recording re-spoken in another voice. */
439
508
  interface VoiceChangeRequest {
440
509
  model: string;
@@ -670,6 +739,11 @@ interface ModelConstraints {
670
739
  ratioIgnoredWith?: ("firstFrame" | "sourceVideo")[];
671
740
  /** Speech and voice-change rows: the voices offered; `defaults.voice` is one of their ids. */
672
741
  voices?: VoiceOption[];
742
+ /** `voice-design` rows: how many candidates one call returns at most, and the preview line's length cap. */
743
+ voiceDesign?: {
744
+ maxCandidates: number;
745
+ previewMaxChars: number;
746
+ };
673
747
  /** Speech, transcription and dubbing (target) rows: the languages taken. */
674
748
  languages?: LanguageOption[];
675
749
  /** Audio-output rows whose provider lets the caller pick a file format; `defaults.outputFormat` is one. */
@@ -753,6 +827,8 @@ interface CatalogDisplay {
753
827
  interface CatalogCapabilities {
754
828
  /** Video rows: takes an existing video as the thing to edit or extend. */
755
829
  acceptsSourceVideo?: boolean;
830
+ /** Speech rows: take `SpeechRequest.customVoice`, a voice the same provider cloned. */
831
+ customVoices?: boolean;
756
832
  /**
757
833
  * Video rows: offered for prompt-driven edits of a source clip (`taskType: "edit"`). Absent
758
834
  * means the caller falls back to `acceptsSourceVideo`; `false` opts a row out.
@@ -901,7 +977,7 @@ interface UsageEvent {
901
977
  latencyMs?: number;
902
978
  raw?: unknown;
903
979
  }
904
- type ProviderKeyName = "openai" | "anthropic" | "google" | "xai" | "perplexity" | "deepseek" | "moonshot" | "minimax" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "luma" | "cloudflare";
980
+ type ProviderKeyName = "openai" | "anthropic" | "google" | "xai" | "perplexity" | "deepseek" | "moonshot" | "minimax" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "luma" | "fish" | "cloudflare";
905
981
  type ProviderKeys = Partial<Record<ProviderKeyName, string>> & {
906
982
  /** Higgsfield needs the pair; both switch together. */
907
983
  higgsfieldSecret?: string;
@@ -952,6 +1028,8 @@ interface AdapterEndpoints {
952
1028
  ark?: string;
953
1029
  /** Luma Agents API. Defaults to https://agents.lumalabs.ai. */
954
1030
  luma?: string;
1031
+ /** Fish Audio API. Defaults to https://api.fish.audio. */
1032
+ fish?: string;
955
1033
  }
956
1034
  interface ModelKitConfig {
957
1035
  keys: {
@@ -1026,7 +1104,7 @@ declare function isListed(row: CatalogModel): boolean;
1026
1104
  */
1027
1105
  declare const MODELS: CatalogModel[];
1028
1106
 
1029
- declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video", "luma"];
1107
+ declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video", "luma", "fish"];
1030
1108
  declare const SurfaceSchema: z.ZodEnum<{
1031
1109
  cowork: "cowork";
1032
1110
  space_builder: "space_builder";
@@ -1061,6 +1139,8 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1061
1139
  dubbing: "dubbing";
1062
1140
  lipsync: "lipsync";
1063
1141
  transcription: "transcription";
1142
+ "voice-clone": "voice-clone";
1143
+ "voice-design": "voice-design";
1064
1144
  model3d: "model3d";
1065
1145
  }>;
1066
1146
  adapter: z.ZodEnum<{
@@ -1075,6 +1155,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1075
1155
  higgsfield: "higgsfield";
1076
1156
  "xai-video": "xai-video";
1077
1157
  luma: "luma";
1158
+ fish: "fish";
1078
1159
  }>;
1079
1160
  providerModelId: z.ZodString;
1080
1161
  lifecycle: z.ZodEnum<{
@@ -1208,6 +1289,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1208
1289
  description: z.ZodOptional<z.ZodString>;
1209
1290
  previewUrl: z.ZodOptional<z.ZodURL>;
1210
1291
  }, z.core.$loose>>>;
1292
+ voiceDesign: z.ZodOptional<z.ZodObject<{
1293
+ maxCandidates: z.ZodNumber;
1294
+ previewMaxChars: z.ZodNumber;
1295
+ }, z.core.$strip>>;
1211
1296
  languages: z.ZodOptional<z.ZodArray<z.ZodObject<{
1212
1297
  code: z.ZodString;
1213
1298
  name: z.ZodString;
@@ -1512,6 +1597,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1512
1597
  }, z.core.$loose>>;
1513
1598
  capabilities: z.ZodOptional<z.ZodObject<{
1514
1599
  acceptsSourceVideo: z.ZodOptional<z.ZodBoolean>;
1600
+ customVoices: z.ZodOptional<z.ZodBoolean>;
1515
1601
  videoEdit: z.ZodOptional<z.ZodBoolean>;
1516
1602
  framesExcludeReferences: z.ZodOptional<z.ZodBoolean>;
1517
1603
  sourceVideoExcludesFrames: z.ZodOptional<z.ZodBoolean>;
@@ -1733,8 +1819,13 @@ declare function resolveDubbingOptions(model: CatalogModel, request: DubbingRequ
1733
1819
  /** `transcribe` on a `transcription` row. */
1734
1820
  declare function resolveTranscriptionOptions(model: CatalogModel, request: TranscriptionRequest, onUnsupported?: OnUnsupported): ResolveResult<TranscriptionRequest>;
1735
1821
 
1822
+ /** `createVoice` on a `voice-clone` row. */
1823
+ declare function resolveVoiceCloneOptions(model: CatalogModel, request: VoiceCloneRequest): ResolveResult<VoiceCloneRequest>;
1824
+ /** `designVoice` on a `voice-design` row; a count over the row cap is clamped when coercing. */
1825
+ declare function resolveVoiceDesignOptions(model: CatalogModel, request: VoiceDesignRequest, onUnsupported?: OnUnsupported): ResolveResult<VoiceDesignRequest>;
1826
+
1736
1827
  /** The client methods that execute a catalog row (text rows run through the text helpers). */
1737
- type MediaMethod = "generateImage" | "generateVideo" | "generateAudio" | "generateSpeech" | "changeVoice" | "lipsync" | "dub" | "transcribe" | "submitVideoTool";
1828
+ type MediaMethod = "generateImage" | "generateVideo" | "generateAudio" | "generateSpeech" | "changeVoice" | "lipsync" | "dub" | "transcribe" | "createVoice" | "designVoice" | "submitVideoTool";
1738
1829
  /** Typed as a full `Record` so a new `ModelType` does not compile until it is routed here. */
1739
1830
  declare const MEDIA_METHODS: Record<ModelType, readonly MediaMethod[]>;
1740
1831
  /** A request tagged with the client method it is meant for. */
@@ -1762,6 +1853,12 @@ type ResolveCall = {
1762
1853
  } | {
1763
1854
  method: "transcribe";
1764
1855
  request: TranscriptionRequest;
1856
+ } | {
1857
+ method: "createVoice";
1858
+ request: VoiceCloneRequest;
1859
+ } | {
1860
+ method: "designVoice";
1861
+ request: VoiceDesignRequest;
1765
1862
  } | {
1766
1863
  method: "submitVideoTool";
1767
1864
  request: VideoToolRequest;
@@ -1798,6 +1895,14 @@ type ResolvedCall = {
1798
1895
  method: "transcribe";
1799
1896
  request: TranscriptionRequest;
1800
1897
  warnings: Warning[];
1898
+ } | {
1899
+ method: "createVoice";
1900
+ request: VoiceCloneRequest;
1901
+ warnings: Warning[];
1902
+ } | {
1903
+ method: "designVoice";
1904
+ request: VoiceDesignRequest;
1905
+ warnings: Warning[];
1801
1906
  } | {
1802
1907
  method: "submitVideoTool";
1803
1908
  request: VideoToolRequest;
@@ -1829,4 +1934,4 @@ declare function promptConventions(row: {
1829
1934
  constraints: unknown;
1830
1935
  }): PromptConventions;
1831
1936
 
1832
- export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, 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 DubbingRequest, type DubbingResult, 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 KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoToolConstraints };
1937
+ export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, 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 DubbingRequest, type DubbingResult, 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 KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoToolConstraints };
package/dist/catalog.d.ts CHANGED
@@ -69,6 +69,10 @@ type ModelType = "text" | "image" | "video" | "audio"
69
69
  | "lipsync"
70
70
  /** Speech to text (`transcribe`). */
71
71
  | "transcription"
72
+ /** A reusable voice cloned from recordings (`createVoice`); its id feeds `SpeechRequest.customVoice`. */
73
+ | "voice-clone"
74
+ /** Candidate voices from a description (`designVoice`); keep one with `createVoice`. */
75
+ | "voice-design"
72
76
  /** A prompt and/or photos of an object in, a GLB 3D model out. */
73
77
  | "model3d";
74
78
  /**
@@ -133,7 +137,7 @@ type Lifecycle = "active" | "deprecated" | "retired";
133
137
  type Surface = "cowork" | "space_builder";
134
138
  /** @deprecated use Surface[] */
135
139
  type Exposure = Surface[];
136
- type AdapterId = "ai-sdk-text" | "google-image" | "openai-image" | "google-genai" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "xai-video" | "luma";
140
+ type AdapterId = "ai-sdk-text" | "google-image" | "openai-image" | "google-genai" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "xai-video" | "luma" | "fish";
137
141
  /** Gemini image safety threshold, per category, sent only when the caller opts in. */
138
142
  type ImageSafetySetting = {
139
143
  category: string;
@@ -427,6 +431,12 @@ interface SpeechRequest {
427
431
  text: string;
428
432
  /** One of `constraints.voices[].id`; the row default when unset. */
429
433
  voice?: string;
434
+ /**
435
+ * Rows with `capabilities.customVoices`: a voice id `createVoice` returned, used instead of
436
+ * `voice`. It belongs to the provider account of the key set that created it, so call with
437
+ * the same `tier`.
438
+ */
439
+ customVoice?: string;
430
440
  /** One of `constraints.languages[].code`; the provider detects it when unset. */
431
441
  language?: string;
432
442
  /** Rows with `supports: style`: how to speak it ("warm and slow"), kept out of the script. */
@@ -435,6 +445,65 @@ interface SpeechRequest {
435
445
  outputFormat?: string;
436
446
  abortSignal?: AbortSignal;
437
447
  }
448
+ /** One recording a voice is cloned from. */
449
+ interface VoiceSample {
450
+ /** Clean, single-speaker speech. Set `durationSeconds` so `constraints.references.audioSeconds` can be checked. */
451
+ audio: MediaRef;
452
+ /** The words spoken in `audio`; the provider transcribes the clip when unset. */
453
+ transcript?: string;
454
+ /** `VoiceCandidate.signature` when `audio` is a `designVoice` candidate. */
455
+ designSignature?: string;
456
+ }
457
+ /** `createVoice` on a `voice-clone` row: a private, reusable voice. */
458
+ interface VoiceCloneRequest {
459
+ model: string;
460
+ /** The voice's name in the provider console. */
461
+ title: string;
462
+ samples: VoiceSample[];
463
+ description?: string;
464
+ /** Provider noise removal and level normalisation before cloning; the provider default (on) when unset. */
465
+ enhance?: boolean;
466
+ abortSignal?: AbortSignal;
467
+ }
468
+ type VoiceCloneState = "created" | "training" | "trained" | "failed";
469
+ interface VoiceCloneResult {
470
+ /** Pass as `SpeechRequest.customVoice` on a row with `capabilities.customVoices`. */
471
+ voiceId: string;
472
+ /** `trained` means usable now; unset when the provider reports a state the kit does not know. */
473
+ state?: VoiceCloneState;
474
+ usage: UsageEvent;
475
+ raw?: JsonValue;
476
+ }
477
+ /** `designVoice` on a `voice-design` row: short candidate voices from a description. */
478
+ interface VoiceDesignRequest {
479
+ model: string;
480
+ /** The voice: age, tone, accent, pacing, context. */
481
+ prompt: string;
482
+ /** A short line every candidate reads, so they can be compared. */
483
+ previewText?: string;
484
+ /** A language hint such as `en`. */
485
+ language?: string;
486
+ /** Candidates to return, within `constraints.voiceDesign.maxCandidates`; the row default when unset. */
487
+ count?: number;
488
+ seed?: number;
489
+ abortSignal?: AbortSignal;
490
+ }
491
+ interface VoiceCandidate {
492
+ audio: MediaOutput;
493
+ durationSeconds: number;
494
+ /** Send with this audio in `VoiceSample.designSignature` to keep the voice. */
495
+ signature: string;
496
+ }
497
+ interface VoiceDesignResult {
498
+ candidates: VoiceCandidate[];
499
+ usage: UsageEvent;
500
+ }
501
+ /** `deleteVoice` on the `voice-clone` row that created the voice, with the same `tier`. */
502
+ interface VoiceDeleteRequest {
503
+ model: string;
504
+ voiceId: string;
505
+ abortSignal?: AbortSignal;
506
+ }
438
507
  /** `changeVoice` on a `voice-change` row: the recording re-spoken in another voice. */
439
508
  interface VoiceChangeRequest {
440
509
  model: string;
@@ -670,6 +739,11 @@ interface ModelConstraints {
670
739
  ratioIgnoredWith?: ("firstFrame" | "sourceVideo")[];
671
740
  /** Speech and voice-change rows: the voices offered; `defaults.voice` is one of their ids. */
672
741
  voices?: VoiceOption[];
742
+ /** `voice-design` rows: how many candidates one call returns at most, and the preview line's length cap. */
743
+ voiceDesign?: {
744
+ maxCandidates: number;
745
+ previewMaxChars: number;
746
+ };
673
747
  /** Speech, transcription and dubbing (target) rows: the languages taken. */
674
748
  languages?: LanguageOption[];
675
749
  /** Audio-output rows whose provider lets the caller pick a file format; `defaults.outputFormat` is one. */
@@ -753,6 +827,8 @@ interface CatalogDisplay {
753
827
  interface CatalogCapabilities {
754
828
  /** Video rows: takes an existing video as the thing to edit or extend. */
755
829
  acceptsSourceVideo?: boolean;
830
+ /** Speech rows: take `SpeechRequest.customVoice`, a voice the same provider cloned. */
831
+ customVoices?: boolean;
756
832
  /**
757
833
  * Video rows: offered for prompt-driven edits of a source clip (`taskType: "edit"`). Absent
758
834
  * means the caller falls back to `acceptsSourceVideo`; `false` opts a row out.
@@ -901,7 +977,7 @@ interface UsageEvent {
901
977
  latencyMs?: number;
902
978
  raw?: unknown;
903
979
  }
904
- type ProviderKeyName = "openai" | "anthropic" | "google" | "xai" | "perplexity" | "deepseek" | "moonshot" | "minimax" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "luma" | "cloudflare";
980
+ type ProviderKeyName = "openai" | "anthropic" | "google" | "xai" | "perplexity" | "deepseek" | "moonshot" | "minimax" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "luma" | "fish" | "cloudflare";
905
981
  type ProviderKeys = Partial<Record<ProviderKeyName, string>> & {
906
982
  /** Higgsfield needs the pair; both switch together. */
907
983
  higgsfieldSecret?: string;
@@ -952,6 +1028,8 @@ interface AdapterEndpoints {
952
1028
  ark?: string;
953
1029
  /** Luma Agents API. Defaults to https://agents.lumalabs.ai. */
954
1030
  luma?: string;
1031
+ /** Fish Audio API. Defaults to https://api.fish.audio. */
1032
+ fish?: string;
955
1033
  }
956
1034
  interface ModelKitConfig {
957
1035
  keys: {
@@ -1026,7 +1104,7 @@ declare function isListed(row: CatalogModel): boolean;
1026
1104
  */
1027
1105
  declare const MODELS: CatalogModel[];
1028
1106
 
1029
- declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video", "luma"];
1107
+ declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video", "luma", "fish"];
1030
1108
  declare const SurfaceSchema: z.ZodEnum<{
1031
1109
  cowork: "cowork";
1032
1110
  space_builder: "space_builder";
@@ -1061,6 +1139,8 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1061
1139
  dubbing: "dubbing";
1062
1140
  lipsync: "lipsync";
1063
1141
  transcription: "transcription";
1142
+ "voice-clone": "voice-clone";
1143
+ "voice-design": "voice-design";
1064
1144
  model3d: "model3d";
1065
1145
  }>;
1066
1146
  adapter: z.ZodEnum<{
@@ -1075,6 +1155,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1075
1155
  higgsfield: "higgsfield";
1076
1156
  "xai-video": "xai-video";
1077
1157
  luma: "luma";
1158
+ fish: "fish";
1078
1159
  }>;
1079
1160
  providerModelId: z.ZodString;
1080
1161
  lifecycle: z.ZodEnum<{
@@ -1208,6 +1289,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1208
1289
  description: z.ZodOptional<z.ZodString>;
1209
1290
  previewUrl: z.ZodOptional<z.ZodURL>;
1210
1291
  }, z.core.$loose>>>;
1292
+ voiceDesign: z.ZodOptional<z.ZodObject<{
1293
+ maxCandidates: z.ZodNumber;
1294
+ previewMaxChars: z.ZodNumber;
1295
+ }, z.core.$strip>>;
1211
1296
  languages: z.ZodOptional<z.ZodArray<z.ZodObject<{
1212
1297
  code: z.ZodString;
1213
1298
  name: z.ZodString;
@@ -1512,6 +1597,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1512
1597
  }, z.core.$loose>>;
1513
1598
  capabilities: z.ZodOptional<z.ZodObject<{
1514
1599
  acceptsSourceVideo: z.ZodOptional<z.ZodBoolean>;
1600
+ customVoices: z.ZodOptional<z.ZodBoolean>;
1515
1601
  videoEdit: z.ZodOptional<z.ZodBoolean>;
1516
1602
  framesExcludeReferences: z.ZodOptional<z.ZodBoolean>;
1517
1603
  sourceVideoExcludesFrames: z.ZodOptional<z.ZodBoolean>;
@@ -1733,8 +1819,13 @@ declare function resolveDubbingOptions(model: CatalogModel, request: DubbingRequ
1733
1819
  /** `transcribe` on a `transcription` row. */
1734
1820
  declare function resolveTranscriptionOptions(model: CatalogModel, request: TranscriptionRequest, onUnsupported?: OnUnsupported): ResolveResult<TranscriptionRequest>;
1735
1821
 
1822
+ /** `createVoice` on a `voice-clone` row. */
1823
+ declare function resolveVoiceCloneOptions(model: CatalogModel, request: VoiceCloneRequest): ResolveResult<VoiceCloneRequest>;
1824
+ /** `designVoice` on a `voice-design` row; a count over the row cap is clamped when coercing. */
1825
+ declare function resolveVoiceDesignOptions(model: CatalogModel, request: VoiceDesignRequest, onUnsupported?: OnUnsupported): ResolveResult<VoiceDesignRequest>;
1826
+
1736
1827
  /** The client methods that execute a catalog row (text rows run through the text helpers). */
1737
- type MediaMethod = "generateImage" | "generateVideo" | "generateAudio" | "generateSpeech" | "changeVoice" | "lipsync" | "dub" | "transcribe" | "submitVideoTool";
1828
+ type MediaMethod = "generateImage" | "generateVideo" | "generateAudio" | "generateSpeech" | "changeVoice" | "lipsync" | "dub" | "transcribe" | "createVoice" | "designVoice" | "submitVideoTool";
1738
1829
  /** Typed as a full `Record` so a new `ModelType` does not compile until it is routed here. */
1739
1830
  declare const MEDIA_METHODS: Record<ModelType, readonly MediaMethod[]>;
1740
1831
  /** A request tagged with the client method it is meant for. */
@@ -1762,6 +1853,12 @@ type ResolveCall = {
1762
1853
  } | {
1763
1854
  method: "transcribe";
1764
1855
  request: TranscriptionRequest;
1856
+ } | {
1857
+ method: "createVoice";
1858
+ request: VoiceCloneRequest;
1859
+ } | {
1860
+ method: "designVoice";
1861
+ request: VoiceDesignRequest;
1765
1862
  } | {
1766
1863
  method: "submitVideoTool";
1767
1864
  request: VideoToolRequest;
@@ -1798,6 +1895,14 @@ type ResolvedCall = {
1798
1895
  method: "transcribe";
1799
1896
  request: TranscriptionRequest;
1800
1897
  warnings: Warning[];
1898
+ } | {
1899
+ method: "createVoice";
1900
+ request: VoiceCloneRequest;
1901
+ warnings: Warning[];
1902
+ } | {
1903
+ method: "designVoice";
1904
+ request: VoiceDesignRequest;
1905
+ warnings: Warning[];
1801
1906
  } | {
1802
1907
  method: "submitVideoTool";
1803
1908
  request: VideoToolRequest;
@@ -1829,4 +1934,4 @@ declare function promptConventions(row: {
1829
1934
  constraints: unknown;
1830
1935
  }): PromptConventions;
1831
1936
 
1832
- export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, 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 DubbingRequest, type DubbingResult, 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 KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoToolConstraints };
1937
+ export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, 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 DubbingRequest, type DubbingResult, 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 KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoToolConstraints };