@picsart/ai-sdk 6.10.2 → 6.11.1

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.
Files changed (3) hide show
  1. package/index.d.ts +37 -30
  2. package/index.js +785 -757
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1888,6 +1888,33 @@ type ModelInput<M extends TypedModelId> = ModelInputById[M];
1888
1888
  type TextModelId = "claude-fable-5" | "claude-fable-5-1" | "claude-haiku-4-5" | "claude-opus-4-8" | "claude-opus-5" | "claude-sonnet-4-5" | "claude-sonnet-4-6" | "claude-sonnet-5" | "gemini-2.5-flash" | "gemini-3-pro" | "gemini-3.5-flash-lite" | "gemini-3.6-flash" | "gemini-3.7-flash" | "gemini-3.8-flash" | "gpt-4.1-mini" | "gpt-4.1-nano" | "gpt-4o" | "gpt-4o-mini" | "gpt-5" | "gpt-5-mini" | "gpt-5.1" | "gpt-5.2" | "gpt-5.5" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-6-astra";
1889
1889
  type TextModelInputById = Pick<ModelInputById, TextModelId>;
1890
1890
 
1891
+ /**
1892
+ * Per-item vendor metadata promoted from the response. Every key is
1893
+ * best-effort: present when the vendor reports it, absent otherwise.
1894
+ */
1895
+ interface GenerateResultItemMetadata {
1896
+ /** Explore image id (recraft explore models) — pass back as `sourceImageId`
1897
+ * to iterate on this image. */
1898
+ exploreImageId?: string;
1899
+ /** Voice preview id (ElevenLabs voice design/remix) — pass to the vendor's
1900
+ * create-voice-from-preview step to persist the voice. */
1901
+ generatedVoiceId?: string;
1902
+ /** URL of the generated video's last frame, when the model was asked for it
1903
+ * (`returnLastFrame`, seedance) — the seed for frame-chaining flows. */
1904
+ lastFrameUrl?: string;
1905
+ /** The draft a Seedance 2.5 Draft generation produced — pass it back
1906
+ * unchanged as `draftTask` to the matching `-draft-final` model to render
1907
+ * the final 1080p video (valid 7 days). Wire field names on purpose: the
1908
+ * worker signs it, so any change is rejected. */
1909
+ draftTask?: SeedanceDraftTask;
1910
+ }
1911
+ /** A Seedance 2.5 draft reference, as the worker issues it. */
1912
+ interface SeedanceDraftTask {
1913
+ id: string;
1914
+ video_input: boolean;
1915
+ signature: string;
1916
+ }
1917
+
1891
1918
  /**
1892
1919
  * Drive client — manages folders and file saving in Picsart Drive.
1893
1920
  *
@@ -1937,7 +1964,14 @@ interface DriveAttributes {
1937
1964
  appId?: string;
1938
1965
  appType?: AppType;
1939
1966
  }
1940
- interface GenerationFile {
1967
+ /** A saved Seedance 2.5 draft — pass `draftTask` unchanged as the final's
1968
+ * `draftTask` param until `draftExpiresAt`. */
1969
+ interface DriveDraftInfo {
1970
+ draftTask?: SeedanceDraftTask;
1971
+ /** ISO timestamp after which the vendor no longer renders a final from it. */
1972
+ draftExpiresAt?: string;
1973
+ }
1974
+ interface GenerationFile extends DriveDraftInfo {
1941
1975
  appId?: string;
1942
1976
  appType?: AppType;
1943
1977
  model?: string;
@@ -1952,7 +1986,7 @@ interface DriveMediaItem {
1952
1986
  previewUrl?: string;
1953
1987
  timestamp: number;
1954
1988
  }
1955
- interface DriveFileDetails extends DriveMediaItem {
1989
+ interface DriveFileDetails extends DriveMediaItem, DriveDraftInfo {
1956
1990
  createdAt?: string;
1957
1991
  model?: string;
1958
1992
  prompt?: string;
@@ -2709,33 +2743,6 @@ interface CatalogsOptions {
2709
2743
  preload?: boolean;
2710
2744
  }
2711
2745
 
2712
- /**
2713
- * Per-item vendor metadata promoted from the response. Every key is
2714
- * best-effort: present when the vendor reports it, absent otherwise.
2715
- */
2716
- interface GenerateResultItemMetadata {
2717
- /** Explore image id (recraft explore models) — pass back as `sourceImageId`
2718
- * to iterate on this image. */
2719
- exploreImageId?: string;
2720
- /** Voice preview id (ElevenLabs voice design/remix) — pass to the vendor's
2721
- * create-voice-from-preview step to persist the voice. */
2722
- generatedVoiceId?: string;
2723
- /** URL of the generated video's last frame, when the model was asked for it
2724
- * (`returnLastFrame`, seedance) — the seed for frame-chaining flows. */
2725
- lastFrameUrl?: string;
2726
- /** The draft a Seedance 2.5 Draft generation produced — pass it back
2727
- * unchanged as `draftTask` to the matching `-draft-final` model to render
2728
- * the final 1080p video (valid 7 days). Wire field names on purpose: the
2729
- * worker signs it, so any change is rejected. */
2730
- draftTask?: SeedanceDraftTask;
2731
- }
2732
- /** A Seedance 2.5 draft reference, as the worker issues it. */
2733
- interface SeedanceDraftTask {
2734
- id: string;
2735
- video_input: boolean;
2736
- signature: string;
2737
- }
2738
-
2739
2746
  /**
2740
2747
  * Failure codes the SDK synthesizes when the platform supplies no `reason`.
2741
2748
  * An API-supplied `reason` passes through unchanged, so the open `string`
@@ -3443,4 +3450,4 @@ declare const getModel: (id: string) => ModelDefinition | undefined;
3443
3450
  */
3444
3451
  declare const findModel: (ref: string) => ModelDefinition | undefined;
3445
3452
 
3446
- export { ALL_MODELS, type AiClient, ApiError, type ApiErrorCode, type ApiErrorInit, type ApiResponse, type ApiRunOptions, type ApiSchemas, type ApisClient, type AppIdentity, type AppType, type AuthenticatedFetch, type AvatarOption, type BooleanDescriptor, type BooleanEntry, type CatalogDescriptor, type CatalogEntry, type CatalogItem, type CatalogPage, type CatalogPageOptions, type CatalogPreview, type CatalogQuery, type CatalogResult, type CatalogSource, type CatalogsClient, type CatalogsOptions, type ClientConfig, type CreditRange, type CreditRangeContext, type CreditTier, type CreditUsage, DEFAULT_VISIBLE_RELEASES, type DeepLinkResult, type DriveAttributes, type DriveClient, type DriveConfig, type DriveFile, type DriveFileDetails, type DriveFolder, type DriveMediaItem, type DriveSaveResult, type EntryMeta, type EnumDescriptor, type EnumEntry, type EnumOption, type FileDescriptor, type FileEntry, type FlatParamEntry, type GenerateOptions, type GenerateResult, type GenerateResultItem, type GenerateResultItemMetadata, type GenerateTextResult, type GenerationContext, type GenerationEvent, GenerationEventType, type GenerationFile, type GenerationMode, type GenerationOptions, type GenerationProgress, type ListOptions, type MediaModelId, type MediaTypeFilter, Model, type ModelDefinition, type ModelDescriptor, type ModelFilter, type ModelInput, type ModelInputById, type ModelMeta, type ModelParams, type ModelParamsAccessor, Models, type ObjectDescriptor, type ObjectEntry, type ParamDescriptor, type ParamEntry, type ParamOption, type PayloadDriveFolderOptions, type PayloadDriveOptions, type PayloadInputsTransformationOptions, type PricingOptions, type ProviderInfo, type RangeDescriptor, type RangeEntry, type ReleaseTag, type SaveParams, type SdkPayload, type SdkTransport, type SeedanceDraftTask, type TextDescriptor, type TextEntry, type TextModelId, type TextModelInputById, type ToolUsage, type TransportPollOptions, type TransportResult, type TypedModelId, type UserReaction, type ValidationResult, type VoiceOption, type WorkflowJobHandle, type WorkflowSubmitRequest, buildFilename, buildGenerationAttributes, catalog, createClient, decodeDeepLinkPayload, encodeDeepLinkPayload, findModel, getModel, getModelsByMode, getVoiceById, inferResourceType, isVisibleForReleases, parseGeneration, releaseOf, toAvatarOption, toVoiceOption };
3453
+ export { ALL_MODELS, type AiClient, ApiError, type ApiErrorCode, type ApiErrorInit, type ApiResponse, type ApiRunOptions, type ApiSchemas, type ApisClient, type AppIdentity, type AppType, type AuthenticatedFetch, type AvatarOption, type BooleanDescriptor, type BooleanEntry, type CatalogDescriptor, type CatalogEntry, type CatalogItem, type CatalogPage, type CatalogPageOptions, type CatalogPreview, type CatalogQuery, type CatalogResult, type CatalogSource, type CatalogsClient, type CatalogsOptions, type ClientConfig, type CreditRange, type CreditRangeContext, type CreditTier, type CreditUsage, DEFAULT_VISIBLE_RELEASES, type DeepLinkResult, type DriveAttributes, type DriveClient, type DriveConfig, type DriveDraftInfo, type DriveFile, type DriveFileDetails, type DriveFolder, type DriveMediaItem, type DriveSaveResult, type EntryMeta, type EnumDescriptor, type EnumEntry, type EnumOption, type FileDescriptor, type FileEntry, type FlatParamEntry, type GenerateOptions, type GenerateResult, type GenerateResultItem, type GenerateResultItemMetadata, type GenerateTextResult, type GenerationContext, type GenerationEvent, GenerationEventType, type GenerationFile, type GenerationMode, type GenerationOptions, type GenerationProgress, type ListOptions, type MediaModelId, type MediaTypeFilter, Model, type ModelDefinition, type ModelDescriptor, type ModelFilter, type ModelInput, type ModelInputById, type ModelMeta, type ModelParams, type ModelParamsAccessor, Models, type ObjectDescriptor, type ObjectEntry, type ParamDescriptor, type ParamEntry, type ParamOption, type PayloadDriveFolderOptions, type PayloadDriveOptions, type PayloadInputsTransformationOptions, type PricingOptions, type ProviderInfo, type RangeDescriptor, type RangeEntry, type ReleaseTag, type SaveParams, type SdkPayload, type SdkTransport, type SeedanceDraftTask, type TextDescriptor, type TextEntry, type TextModelId, type TextModelInputById, type ToolUsage, type TransportPollOptions, type TransportResult, type TypedModelId, type UserReaction, type ValidationResult, type VoiceOption, type WorkflowJobHandle, type WorkflowSubmitRequest, buildFilename, buildGenerationAttributes, catalog, createClient, decodeDeepLinkPayload, encodeDeepLinkPayload, findModel, getModel, getModelsByMode, getVoiceById, inferResourceType, isVisibleForReleases, parseGeneration, releaseOf, toAvatarOption, toVoiceOption };