@origingame/origin-asset 0.12.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.
@@ -0,0 +1,912 @@
1
+ type JsonPrimitive = string | number | boolean | null;
2
+ type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
3
+ type JsonObject = {
4
+ [key: string]: JsonValue;
5
+ };
6
+ type AssetType = "image" | "ui" | "icon" | "sprite_2d" | "tile" | "background" | "vfx_texture" | "video" | "audio" | "music" | "tts" | "model3d" | "character" | "prop" | "sprite" | "world" | "animation" | "material" | "hdri" | "vfx" | "lut" | "shader" | "font_typeface" | "skybox" | "decal" | "heightmap" | "text";
7
+ type ImageEditMode = "edit" | "inpaint" | "restyle" | "expand";
8
+ type ImageQuality = "low" | "medium" | "high";
9
+ type ImageBackground = "auto" | "opaque" | "transparent";
10
+ type ImageOutputFormat = "png" | "webp" | "jpeg";
11
+ type ImagePreset = "pixel_sprite_sheet" | "isometric_tile_map" | "character_reference_sheet" | "skybox_equirect" | "decal_transparent" | "heightmap_grayscale";
12
+ type WorldQuality = "low" | "high";
13
+ type JobStatus = "pending" | "running" | "completed" | "failed" | "cancelled" | string;
14
+ type VoiceType = "vc" | "vd";
15
+ type CropMode = "tightest" | "power_of2";
16
+ type ComposeDirection = "horizontal" | "vertical" | "grid";
17
+ interface ApiErrorPayload {
18
+ code?: string;
19
+ message?: string;
20
+ suggestion?: string;
21
+ [key: string]: unknown;
22
+ }
23
+ declare class AssetForgeError extends Error {
24
+ readonly code: string;
25
+ readonly status?: number;
26
+ readonly command?: string;
27
+ readonly details?: unknown;
28
+ constructor(message: string, options?: {
29
+ code?: string;
30
+ status?: number;
31
+ command?: string;
32
+ details?: unknown;
33
+ cause?: unknown;
34
+ });
35
+ }
36
+ declare function toAssetForgeError(error: unknown): AssetForgeError;
37
+ interface AssetForgeOptions {
38
+ apiKey: string;
39
+ baseUrl?: string;
40
+ fetch?: typeof fetch;
41
+ headers?: HeadersInit;
42
+ }
43
+ interface RequestOptions {
44
+ signal?: AbortSignal;
45
+ headers?: HeadersInit;
46
+ idempotencyKey?: string;
47
+ async?: boolean;
48
+ }
49
+ interface AsyncSubmitOptions {
50
+ idempotencyKey?: string;
51
+ async?: boolean;
52
+ }
53
+ interface TransportRequestOptions extends RequestOptions {
54
+ body?: unknown;
55
+ form?: FormData;
56
+ query?: Record<string, QueryValue>;
57
+ }
58
+ type QueryValue = string | number | boolean | null | undefined;
59
+ interface ApiSuccessEnvelope<T> {
60
+ ok: true;
61
+ command?: string;
62
+ data: T;
63
+ }
64
+ interface ApiErrorEnvelope {
65
+ ok: false;
66
+ command?: string;
67
+ error: ApiErrorPayload | string;
68
+ }
69
+ type ApiEnvelope<T> = ApiSuccessEnvelope<T> | ApiErrorEnvelope;
70
+ interface GenerateRequest {
71
+ asset_type: AssetType;
72
+ prompt?: string;
73
+ model?: string;
74
+ input_file?: string;
75
+ provider?: string;
76
+ size?: string;
77
+ transparent?: boolean;
78
+ reference_images?: string[];
79
+ edit_mode?: ImageEditMode;
80
+ session_id?: string;
81
+ params?: JsonObject;
82
+ }
83
+ interface OutputFile {
84
+ name: string;
85
+ url: string;
86
+ kind: string;
87
+ size_bytes?: number | null;
88
+ }
89
+ interface GenerateResponse {
90
+ provider_id: string;
91
+ output_path?: string | null;
92
+ output_url?: string | null;
93
+ output_data?: string | null;
94
+ output_files?: OutputFile[];
95
+ metadata: JsonValue;
96
+ cost_usd?: number | null;
97
+ elapsed_ms?: number;
98
+ job_id?: string;
99
+ user_id?: string;
100
+ session_id?: string;
101
+ url?: string | null;
102
+ }
103
+ interface PackOnlyResponse {
104
+ ok: false;
105
+ pack_only: true;
106
+ asset_type: AssetType | string;
107
+ message: string;
108
+ }
109
+ interface SubmitAck {
110
+ job_id: string;
111
+ status: "pending";
112
+ }
113
+ interface BatchSharedRequest {
114
+ transparent?: boolean;
115
+ size?: string;
116
+ model?: string;
117
+ provider?: string;
118
+ reference_images?: string[];
119
+ input_file?: string;
120
+ }
121
+ interface BatchComposeRequest {
122
+ direction?: ComposeDirection;
123
+ columns?: number;
124
+ padding?: number;
125
+ frame_width?: number;
126
+ frame_height?: number;
127
+ }
128
+ interface BatchGenerateRequest {
129
+ asset_type: AssetType;
130
+ prompts: string[];
131
+ shared?: BatchSharedRequest;
132
+ compose?: BatchComposeRequest;
133
+ }
134
+ interface BatchFrameResult {
135
+ index: number;
136
+ provider_id?: string | null;
137
+ output_data?: string | null;
138
+ output_url?: string | null;
139
+ cost_usd?: number | null;
140
+ elapsed_ms?: number | null;
141
+ error?: string | null;
142
+ url?: string | null;
143
+ }
144
+ interface BatchSpritesheetResult {
145
+ output_data: string;
146
+ width: number;
147
+ height: number;
148
+ }
149
+ interface BatchGenerateResponse {
150
+ job_id: string;
151
+ user_id: string;
152
+ frames: BatchFrameResult[];
153
+ total_cost_usd?: number;
154
+ elapsed_ms?: number;
155
+ spritesheet?: BatchSpritesheetResult;
156
+ }
157
+ interface ProviderCapabilities {
158
+ supports_transparency: boolean;
159
+ supports_streaming: boolean;
160
+ max_concurrent: number;
161
+ rate_limit_rpm?: number | null;
162
+ priority: number;
163
+ }
164
+ interface ProviderInfo {
165
+ id: string;
166
+ display_name: string;
167
+ asset_types: AssetType[];
168
+ capabilities: ProviderCapabilities;
169
+ }
170
+ interface ProviderHealth {
171
+ healthy: boolean;
172
+ latency_ms?: number | null;
173
+ message?: string | null;
174
+ }
175
+ interface ProviderListResponse {
176
+ providers: ProviderInfo[];
177
+ }
178
+ interface ProviderHealthEntry {
179
+ id: string;
180
+ health: ProviderHealth;
181
+ }
182
+ interface ProviderHealthListResponse {
183
+ providers: ProviderHealthEntry[];
184
+ }
185
+ interface ProviderHealthResponse {
186
+ id: string;
187
+ health: ProviderHealth;
188
+ }
189
+ interface UploadResult {
190
+ filename: string;
191
+ url: string;
192
+ size: number;
193
+ content_type: string;
194
+ }
195
+ interface AssetFile {
196
+ filename: string;
197
+ url: string;
198
+ size: number;
199
+ }
200
+ interface AssetListResponse {
201
+ files: AssetFile[];
202
+ }
203
+ interface AssetDeleteResponse {
204
+ filename: string;
205
+ }
206
+ interface LibrarySearchQuery {
207
+ query?: string;
208
+ q?: string;
209
+ type?: AssetType | string;
210
+ tags?: string;
211
+ source?: string;
212
+ pack_id?: string;
213
+ mode?: "fts" | "vector" | "hybrid";
214
+ style?: string;
215
+ composition?: string;
216
+ lighting?: string;
217
+ color_tone?: string;
218
+ mood?: string;
219
+ theme?: string;
220
+ era?: string;
221
+ gameplay_role?: string;
222
+ ui_element?: string;
223
+ ui_state?: string;
224
+ ui_theme_pack?: string;
225
+ nine_slice?: boolean;
226
+ size_class?: string;
227
+ rig_name?: string;
228
+ compatible_rig?: string;
229
+ enrichment_status?: string;
230
+ min_long_edge_px?: number;
231
+ min_width_px?: number;
232
+ min_height_px?: number;
233
+ max_file_size_bytes?: number;
234
+ license?: string;
235
+ rerank?: boolean;
236
+ limit?: number;
237
+ offset?: number;
238
+ }
239
+ type IngestSource = "manual" | "generated" | "pack" | "imported";
240
+ type LibraryPackSource = "builtin" | "url" | "upload";
241
+ interface LibraryIngestRequest {
242
+ source: IngestSource;
243
+ asset_type: AssetType | string;
244
+ file_url?: string;
245
+ file_data_b64?: string;
246
+ thumbnail_url?: string;
247
+ name?: string;
248
+ user_tags?: string[];
249
+ user_metadata?: Record<string, unknown>;
250
+ metadata?: Record<string, unknown>;
251
+ pack_id?: string;
252
+ pack_asset_key?: string;
253
+ source_job_id?: string;
254
+ }
255
+ interface LibraryBackfillRequest {
256
+ asset_type?: AssetType | string;
257
+ since?: string;
258
+ limit?: number;
259
+ dry_run?: boolean;
260
+ }
261
+ interface LibraryReenrichRequest {
262
+ ids?: string[];
263
+ asset_type?: AssetType | string;
264
+ taxonomy_version_lt?: number;
265
+ force_visual?: boolean;
266
+ recompute_embedding?: boolean;
267
+ limit?: number;
268
+ }
269
+ interface LibraryAdminBatchResponse {
270
+ job_ids: string[];
271
+ ids?: string[];
272
+ total: number;
273
+ dry_run: boolean;
274
+ }
275
+ interface LibraryIngestResponse {
276
+ ingest_job_id: string;
277
+ estimated_duration_seconds: number;
278
+ }
279
+ interface LibraryIngestResult {
280
+ library_id: string;
281
+ skipped: boolean;
282
+ embedding_dim: number;
283
+ }
284
+ interface LibraryIngestJobInfo {
285
+ id: string;
286
+ job_kind?: string | null;
287
+ status: JobStatus | "queued" | "started";
288
+ progress?: number | null;
289
+ error_message?: string | null;
290
+ response?: LibraryIngestResult | JsonValue | null;
291
+ [key: string]: unknown;
292
+ }
293
+ type JobInfo = LibraryIngestJobInfo;
294
+ interface LibraryPackInfo {
295
+ id: string;
296
+ version: string;
297
+ name: string;
298
+ description: string;
299
+ author: string | null;
300
+ license: string | null;
301
+ source: LibraryPackSource;
302
+ source_url: string | null;
303
+ asset_count: number;
304
+ installed_at: string;
305
+ }
306
+ interface LibraryPackListResponse {
307
+ items: LibraryPackInfo[];
308
+ total: number;
309
+ }
310
+ interface LibraryPackInstallRequest {
311
+ source: LibraryPackSource;
312
+ id?: string;
313
+ version?: string;
314
+ url?: string;
315
+ tarball_b64?: string;
316
+ }
317
+ interface LibraryPackInstallResponse {
318
+ pack_id: string;
319
+ item_count: number;
320
+ ingest_job_ids: string[];
321
+ }
322
+ interface LibraryPackDeleteResponse {
323
+ deleted: number;
324
+ }
325
+ interface LibraryPackRefreshResponse {
326
+ pack_id: string;
327
+ item_count: number;
328
+ }
329
+ interface LibraryItem {
330
+ id: string;
331
+ asset_type: AssetType | string;
332
+ name: string;
333
+ description: string;
334
+ tags: string[];
335
+ file_path: string;
336
+ file_url: string;
337
+ file_size: number;
338
+ duration_seconds?: number | null;
339
+ source: string;
340
+ source_job_id?: string | null;
341
+ metadata: JsonValue;
342
+ created_at: string;
343
+ visual_style: string | null;
344
+ visual_substyle: string | null;
345
+ visual_composition: string | null;
346
+ visual_lighting: string | null;
347
+ visual_color_tone: string | null;
348
+ visual_color_palette: string[];
349
+ visual_mood: string[];
350
+ visual_theme: string[];
351
+ visual_era: string | null;
352
+ visual_detail_level: string | null;
353
+ subjects: string[];
354
+ materials: string[];
355
+ environment: string | null;
356
+ time_of_day: string | null;
357
+ background_type: string | null;
358
+ aesthetic_score: number | null;
359
+ safety_flags: string[];
360
+ width: number | null;
361
+ height: number | null;
362
+ aspect_ratio: string | null;
363
+ thumbnail_url: string | null;
364
+ keyframe_url: string | null;
365
+ catalog_text: string | null;
366
+ pack_id: string | null;
367
+ pack_asset_key: string | null;
368
+ gameplay_role?: string | null;
369
+ ui_element?: string | null;
370
+ ui_state?: string | null;
371
+ ui_theme_pack?: string | null;
372
+ nine_slice?: boolean | null;
373
+ size_class?: string | null;
374
+ variant_group?: string | null;
375
+ rig_name?: string | null;
376
+ compatible_rigs?: string[] | null;
377
+ pack_format?: string | null;
378
+ license?: string | null;
379
+ }
380
+ interface LibrarySearchResponse {
381
+ items: LibraryItem[];
382
+ total: number;
383
+ count?: number;
384
+ limit: number;
385
+ offset: number;
386
+ broadened?: boolean;
387
+ }
388
+ interface LibraryRelatedQuery {
389
+ type?: AssetType | string;
390
+ limit?: number;
391
+ }
392
+ interface LibraryRelatedResponse {
393
+ items: LibraryItem[];
394
+ total: number;
395
+ limit: number;
396
+ }
397
+ interface LibraryBundleRequest {
398
+ asset_ids: string[];
399
+ format?: "zip" | string;
400
+ }
401
+ interface LibraryAddRequest {
402
+ asset_type: AssetType | string;
403
+ name: string;
404
+ description?: string;
405
+ tags?: string[];
406
+ file_url: string;
407
+ file_path?: string;
408
+ file_size?: number;
409
+ duration_seconds?: number;
410
+ source?: string;
411
+ source_job_id?: string;
412
+ gameplay_role?: string;
413
+ metadata?: JsonValue;
414
+ }
415
+ interface LibraryDeleteResponse {
416
+ id: string;
417
+ }
418
+ interface LibraryCatalogJobsRequest {
419
+ asset_type?: AssetType | string;
420
+ after?: string;
421
+ provider_id?: string;
422
+ dry_run?: boolean;
423
+ }
424
+ type LibraryCatalogJobsResponse = {
425
+ dry_run: true;
426
+ would_catalog: number;
427
+ } | {
428
+ cataloged: number;
429
+ errors: number;
430
+ error_details: string[];
431
+ };
432
+ type UploadInput = File | Blob | ArrayBuffer | Uint8Array | {
433
+ data: BlobPart | BlobPart[];
434
+ filename: string;
435
+ type?: string;
436
+ };
437
+ interface UploadOptions extends RequestOptions {
438
+ filename?: string;
439
+ type?: string;
440
+ }
441
+ interface JobListQuery {
442
+ job_kind?: string;
443
+ status?: string;
444
+ asset_type?: AssetType | string;
445
+ provider_id?: string;
446
+ since?: string;
447
+ provider_task_id?: string;
448
+ limit?: number;
449
+ offset?: number;
450
+ }
451
+ interface JobSummary {
452
+ id: string;
453
+ user_id?: string | null;
454
+ job_kind?: string;
455
+ asset_type: AssetType | string;
456
+ provider_id: string;
457
+ provider_task_id?: string | null;
458
+ status: JobStatus;
459
+ error_message?: string | null;
460
+ output_path?: string | null;
461
+ output_url?: string | null;
462
+ cost_usd?: number | null;
463
+ metadata?: JsonValue;
464
+ created_at: string;
465
+ started_at?: string | null;
466
+ completed_at?: string | null;
467
+ duration_ms?: number | null;
468
+ progress?: number | null;
469
+ current_step?: string | null;
470
+ step_index?: number | null;
471
+ step_count?: number | null;
472
+ }
473
+ interface JobListResponse {
474
+ jobs: JobSummary[];
475
+ }
476
+ interface JobStatusResponse extends JobSummary {
477
+ request: JsonValue;
478
+ response?: JsonValue | null;
479
+ }
480
+ interface JobCancelResponse {
481
+ id: string;
482
+ previous_status: JobStatus;
483
+ status: JobStatus;
484
+ }
485
+ interface WaitForJobOptions extends RequestOptions {
486
+ interval_ms?: number;
487
+ intervalMs?: number;
488
+ timeoutMs?: number;
489
+ }
490
+ interface JobProgress {
491
+ progress?: number;
492
+ current_step?: string;
493
+ step_index?: number;
494
+ step_count?: number;
495
+ message?: string;
496
+ details?: unknown;
497
+ }
498
+ interface JobEvent {
499
+ kind: "snapshot" | "update" | "progress";
500
+ job_id: string;
501
+ status: string;
502
+ progress?: JobProgress;
503
+ output_url?: string;
504
+ error_message?: string;
505
+ timestamp: string;
506
+ raw: unknown;
507
+ }
508
+ type ProcessOperation = {
509
+ op: "smart_crop";
510
+ mode?: CropMode;
511
+ } | {
512
+ op: "resize";
513
+ width: number;
514
+ height: number;
515
+ } | {
516
+ op: "compose";
517
+ direction: ComposeDirection;
518
+ columns?: number;
519
+ padding?: number;
520
+ frame_width?: number;
521
+ frame_height?: number;
522
+ } | {
523
+ op: "extract_frames";
524
+ count?: number;
525
+ } | {
526
+ op: "remove_bg";
527
+ bg_color?: string;
528
+ };
529
+ interface ProcessRequest {
530
+ input?: string;
531
+ inputs?: string[];
532
+ operations: ProcessOperation[];
533
+ }
534
+ interface ProcessOutputItem {
535
+ output_data: string;
536
+ width: number;
537
+ height: number;
538
+ }
539
+ interface ProcessResponse {
540
+ output_data: string;
541
+ width: number;
542
+ height: number;
543
+ outputs: ProcessOutputItem[];
544
+ operations_applied: string[];
545
+ elapsed_ms: number;
546
+ }
547
+ interface Process3dRequest {
548
+ task_id: string;
549
+ operation: string;
550
+ params?: JsonObject;
551
+ }
552
+ type Process3dResponse = JsonValue;
553
+ interface VoiceCloneRequest {
554
+ sample_data_url?: string;
555
+ audio_base64?: string;
556
+ audio_mime?: string;
557
+ text?: string;
558
+ preview_text?: string;
559
+ style?: string;
560
+ save_as?: string;
561
+ name?: string;
562
+ target_model?: string;
563
+ }
564
+ interface VoiceDesignRequest {
565
+ voice_prompt: string;
566
+ text?: string;
567
+ preview_text?: string;
568
+ style?: string;
569
+ save_as?: string;
570
+ name?: string;
571
+ target_model?: string;
572
+ language?: string;
573
+ }
574
+ interface VoiceListQuery extends RequestOptions {
575
+ type?: VoiceType;
576
+ page?: number;
577
+ page_size?: number;
578
+ }
579
+ type VoiceListResponse = JsonValue;
580
+ type VoiceCloneResponse = JsonValue;
581
+ type VoiceDesignResponse = JsonValue;
582
+ type VoiceDeleteResponse = JsonValue;
583
+ type LoginResponse = JsonValue;
584
+ interface ShortcutOptions extends RequestOptions {
585
+ provider?: string;
586
+ model?: string;
587
+ params?: JsonObject;
588
+ }
589
+ interface ImageOptions extends ShortcutOptions {
590
+ size?: string;
591
+ quality?: ImageQuality;
592
+ background?: ImageBackground;
593
+ output_format?: ImageOutputFormat;
594
+ n?: number;
595
+ preset?: ImagePreset;
596
+ mask?: string;
597
+ mask_url?: string;
598
+ transparent?: boolean;
599
+ input?: string;
600
+ reference_images?: string[];
601
+ edit_mode?: ImageEditMode;
602
+ session_id?: string;
603
+ }
604
+ interface VideoRequestInput extends ShortcutOptions {
605
+ prompt: string;
606
+ size?: string;
607
+ ratio?: string;
608
+ reference_images?: string[];
609
+ }
610
+ interface AudioOptions extends ShortcutOptions {
611
+ type?: string;
612
+ duration?: number;
613
+ }
614
+ interface MusicOptions extends ShortcutOptions {
615
+ duration?: number;
616
+ force_instrumental?: boolean;
617
+ output_format?: string;
618
+ }
619
+ interface TtsOptions extends ShortcutOptions {
620
+ voice?: string;
621
+ voice_id?: string;
622
+ context?: string;
623
+ style?: string;
624
+ language?: string;
625
+ instructions?: string;
626
+ }
627
+ interface Model3dOptions extends ShortcutOptions {
628
+ input?: string;
629
+ images?: string[];
630
+ ai_model?: string;
631
+ polycount?: number;
632
+ pbr?: boolean;
633
+ hd_texture?: boolean;
634
+ auto_size?: boolean;
635
+ pose_mode?: "a-pose" | "t-pose";
636
+ texture_prompt?: string;
637
+ format?: string;
638
+ }
639
+ interface CharacterOptions extends ShortcutOptions {
640
+ input?: string;
641
+ images?: string[];
642
+ format?: string;
643
+ polycount?: number;
644
+ pbr?: boolean;
645
+ hd_texture?: boolean;
646
+ pose_mode?: "a-pose" | "t-pose";
647
+ ai_model?: string;
648
+ auto_size?: boolean;
649
+ texture_prompt?: string;
650
+ }
651
+ interface PropOptions extends ShortcutOptions {
652
+ input?: string;
653
+ images?: string[];
654
+ format?: string;
655
+ polycount?: number;
656
+ pbr?: boolean;
657
+ hd_texture?: boolean;
658
+ ai_model?: string;
659
+ auto_size?: boolean;
660
+ texture_prompt?: string;
661
+ symmetry_mode?: "off" | "auto" | "on";
662
+ }
663
+ interface SpriteOptions extends ShortcutOptions {
664
+ input?: string;
665
+ animation_type?: string;
666
+ direction?: string;
667
+ duration?: number;
668
+ style?: string;
669
+ output_format?: string;
670
+ fps?: number;
671
+ }
672
+ interface WorldOptions extends ShortcutOptions {
673
+ input?: string;
674
+ image_url?: string;
675
+ panorama_url?: string;
676
+ video_url?: string;
677
+ multi_image_url?: string[];
678
+ quality?: WorldQuality;
679
+ display_name?: string;
680
+ }
681
+ interface TextOptions extends ShortcutOptions {
682
+ max_tokens?: number;
683
+ }
684
+ interface GeneratedAssetOptions extends ShortcutOptions {
685
+ size?: string;
686
+ quality?: ImageQuality;
687
+ background?: ImageBackground;
688
+ output_format?: ImageOutputFormat;
689
+ n?: number;
690
+ preset?: ImagePreset;
691
+ transparent?: boolean;
692
+ input?: string;
693
+ }
694
+ interface StreamProgressEvent {
695
+ job_id?: string;
696
+ status: JobStatus;
697
+ percent: number | null;
698
+ elapsed_ms: number;
699
+ estimate: boolean;
700
+ job?: JobStatusResponse;
701
+ }
702
+ interface StreamCancelledEvent {
703
+ reason?: string;
704
+ }
705
+ interface StreamEventMap<TDone> {
706
+ progress: StreamProgressEvent;
707
+ done: TDone;
708
+ error: AssetForgeError;
709
+ cancelled: StreamCancelledEvent;
710
+ }
711
+
712
+ declare class AssetForgeJobs {
713
+ private readonly transport;
714
+ constructor(transport: AssetForgeTransport);
715
+ list(query?: JobListQuery, options?: RequestOptions): Promise<JobListResponse>;
716
+ status(id: string, options?: RequestOptions): Promise<JobStatusResponse>;
717
+ cancel(id: string, options?: RequestOptions): Promise<JobCancelResponse>;
718
+ wait(id: string, options?: WaitForJobOptions): Promise<JobStatusResponse>;
719
+ private waitWithSse;
720
+ }
721
+
722
+ declare class AssetForgeLibrary {
723
+ private readonly transport;
724
+ constructor(transport: AssetForgeTransport);
725
+ search(query?: LibrarySearchQuery, options?: RequestOptions): Promise<LibrarySearchResponse>;
726
+ related(id: string, query?: LibraryRelatedQuery, options?: RequestOptions): Promise<LibraryRelatedResponse>;
727
+ bundle(request: LibraryBundleRequest, options?: RequestOptions): Promise<Blob>;
728
+ ingest(request: LibraryIngestRequest, options?: RequestOptions): Promise<LibraryIngestResponse>;
729
+ ingestSync(request: LibraryIngestRequest, options?: RequestOptions): Promise<LibraryIngestResult>;
730
+ ingestStatus(jobId: string, options?: RequestOptions): Promise<JobInfo>;
731
+ ingestWait(jobId: string, opts?: {
732
+ intervalMs?: number;
733
+ } & RequestOptions): Promise<LibraryIngestResult>;
734
+ packs(options?: RequestOptions): Promise<LibraryPackListResponse>;
735
+ packsInstall(request: LibraryPackInstallRequest, options?: RequestOptions): Promise<LibraryPackInstallResponse>;
736
+ packsDelete(id: string, options?: RequestOptions): Promise<LibraryPackDeleteResponse>;
737
+ packsRefresh(id: string, options?: RequestOptions): Promise<LibraryPackRefreshResponse>;
738
+ add(request: LibraryAddRequest, options?: RequestOptions): Promise<Pick<LibraryItem, "id" | "asset_type" | "name" | "file_url">>;
739
+ get(id: string, options?: RequestOptions): Promise<LibraryItem>;
740
+ delete(id: string, options?: RequestOptions): Promise<LibraryDeleteResponse>;
741
+ catalogJobs(request?: LibraryCatalogJobsRequest, options?: RequestOptions): Promise<LibraryCatalogJobsResponse>;
742
+ backfill(request?: LibraryBackfillRequest, options?: RequestOptions): Promise<LibraryAdminBatchResponse>;
743
+ reenrich(request?: LibraryReenrichRequest, options?: RequestOptions): Promise<LibraryAdminBatchResponse>;
744
+ }
745
+
746
+ declare class AssetForgeProviders {
747
+ private readonly transport;
748
+ constructor(transport: AssetForgeTransport);
749
+ list(options?: RequestOptions): Promise<ProviderListResponse>;
750
+ health(idOrOptions?: string | RequestOptions, maybeOptions?: RequestOptions): Promise<ProviderHealthListResponse | ProviderHealthResponse>;
751
+ }
752
+
753
+ type JobEventHandler = (event: JobEvent) => void;
754
+ interface SubscribeJobOptions extends RequestOptions {
755
+ baseUrl?: string;
756
+ apiKey?: string;
757
+ fetch?: typeof fetch;
758
+ }
759
+ interface JobSubscription {
760
+ readonly signal: AbortSignal;
761
+ readonly result: Promise<void>;
762
+ close(reason?: string): void;
763
+ }
764
+ declare function subscribeJob(jobId: string, handler: JobEventHandler, options?: SubscribeJobOptions): JobSubscription;
765
+ declare function subscribeAllJobs(handler: JobEventHandler, options?: SubscribeJobOptions): JobSubscription;
766
+ declare class AssetForgeStreamNamespace {
767
+ private readonly forge;
768
+ constructor(forge: AssetForge);
769
+ job(jobId: string, handler: JobEventHandler, options?: RequestOptions): JobSubscription;
770
+ all(handler: JobEventHandler, options?: RequestOptions): JobSubscription;
771
+ private options;
772
+ }
773
+
774
+ declare class AssetForgeAssets {
775
+ private readonly transport;
776
+ constructor(transport: AssetForgeTransport);
777
+ upload(input: UploadInput, options?: UploadOptions): Promise<UploadResult>;
778
+ list(options?: RequestOptions): Promise<AssetListResponse>;
779
+ delete(filename: string, options?: RequestOptions): Promise<AssetDeleteResponse>;
780
+ }
781
+
782
+ interface AssetForgeVoice {
783
+ clone(request: VoiceCloneRequest, options: RequestOptions & {
784
+ async: true;
785
+ }): Promise<SubmitAck>;
786
+ clone(request: VoiceCloneRequest, options?: RequestOptions): Promise<VoiceCloneResponse>;
787
+ design: (request: VoiceDesignRequest, options?: RequestOptions) => Promise<VoiceDesignResponse>;
788
+ list: (query?: VoiceListQuery) => Promise<VoiceListResponse>;
789
+ delete: (voiceId: string, query?: {
790
+ type?: "vc" | "vd";
791
+ } & RequestOptions) => Promise<VoiceDeleteResponse>;
792
+ }
793
+ interface AssetForgeTransport {
794
+ readonly baseUrl: string;
795
+ readonly apiKey?: string;
796
+ request<T>(method: string, path: string, options?: TransportRequestOptions): Promise<T>;
797
+ }
798
+ declare const DEFAULT_BASE_URL = "https://asset.origingame.dev";
799
+ declare class AssetForge implements AssetForgeTransport {
800
+ readonly baseUrl: string;
801
+ readonly job: AssetForgeJobs;
802
+ readonly library: AssetForgeLibrary;
803
+ readonly providers: AssetForgeProviders;
804
+ readonly assets: AssetForgeAssets;
805
+ readonly stream: AssetForgeStreamNamespace;
806
+ readonly voice: AssetForgeVoice;
807
+ readonly apiKey: string;
808
+ private readonly fetchImpl;
809
+ private readonly defaultHeaders;
810
+ constructor(options: AssetForgeOptions);
811
+ login(token?: string, options?: RequestOptions): Promise<LoginResponse>;
812
+ generate(request: GenerateRequest, options: RequestOptions & {
813
+ async: true;
814
+ }): Promise<SubmitAck>;
815
+ generate(request: GenerateRequest, options?: RequestOptions): Promise<GenerateResponse>;
816
+ batch(request: BatchGenerateRequest, options: RequestOptions & {
817
+ async: true;
818
+ }): Promise<SubmitAck>;
819
+ batch(request: BatchGenerateRequest, options?: RequestOptions): Promise<BatchGenerateResponse>;
820
+ process(request: ProcessRequest, options: RequestOptions & {
821
+ async: true;
822
+ }): Promise<SubmitAck>;
823
+ process(request: ProcessRequest, options?: RequestOptions): Promise<ProcessResponse>;
824
+ process3d(request: Process3dRequest, options: RequestOptions & {
825
+ async: true;
826
+ }): Promise<SubmitAck>;
827
+ process3d(request: Process3dRequest, options?: RequestOptions): Promise<Process3dResponse>;
828
+ upload(input: Parameters<AssetForgeAssets["upload"]>[0], options?: Parameters<AssetForgeAssets["upload"]>[1]): Promise<ReturnType<AssetForgeAssets["upload"]> extends Promise<infer T> ? T : never>;
829
+ image(prompt: string, options: ImageOptions & {
830
+ async: true;
831
+ }): Promise<SubmitAck>;
832
+ image(prompt: string, options?: ImageOptions): Promise<GenerateResponse>;
833
+ animation(prompt: string, options: GeneratedAssetOptions & {
834
+ async: true;
835
+ }): Promise<SubmitAck>;
836
+ animation(prompt: string, options?: GeneratedAssetOptions): Promise<GenerateResponse>;
837
+ material(_prompt: string, _options?: GeneratedAssetOptions): Promise<PackOnlyResponse>;
838
+ hdri(_prompt: string, _options?: GeneratedAssetOptions): Promise<PackOnlyResponse>;
839
+ vfx(_prompt: string, _options?: GeneratedAssetOptions): Promise<PackOnlyResponse>;
840
+ lut(_prompt: string, _options?: GeneratedAssetOptions): Promise<PackOnlyResponse>;
841
+ shader(_prompt: string, _options?: GeneratedAssetOptions): Promise<PackOnlyResponse>;
842
+ fontTypeface(_prompt: string, _options?: GeneratedAssetOptions): Promise<PackOnlyResponse>;
843
+ skybox(prompt: string, options: GeneratedAssetOptions & {
844
+ async: true;
845
+ }): Promise<SubmitAck>;
846
+ skybox(prompt: string, options?: GeneratedAssetOptions): Promise<GenerateResponse>;
847
+ decal(prompt: string, options: GeneratedAssetOptions & {
848
+ async: true;
849
+ }): Promise<SubmitAck>;
850
+ decal(prompt: string, options?: GeneratedAssetOptions): Promise<GenerateResponse>;
851
+ heightmap(prompt: string, options: GeneratedAssetOptions & {
852
+ async: true;
853
+ }): Promise<SubmitAck>;
854
+ heightmap(prompt: string, options?: GeneratedAssetOptions): Promise<GenerateResponse>;
855
+ video(promptOrRequest: string | VideoRequestInput, options: Omit<VideoRequestInput, "prompt"> & {
856
+ async: true;
857
+ }): Promise<SubmitAck>;
858
+ video(promptOrRequest: string | VideoRequestInput, options?: Omit<VideoRequestInput, "prompt">): Promise<GenerateResponse>;
859
+ audio(prompt: string, options: AudioOptions & {
860
+ async: true;
861
+ }): Promise<SubmitAck>;
862
+ audio(prompt: string, options?: AudioOptions): Promise<GenerateResponse>;
863
+ music(prompt: string, options: MusicOptions & {
864
+ async: true;
865
+ }): Promise<SubmitAck>;
866
+ music(prompt: string, options?: MusicOptions): Promise<GenerateResponse>;
867
+ tts(prompt: string, options: TtsOptions & {
868
+ async: true;
869
+ }): Promise<SubmitAck>;
870
+ tts(prompt: string, options?: TtsOptions): Promise<GenerateResponse>;
871
+ model3d(prompt: string, options: Model3dOptions & {
872
+ async: true;
873
+ }): Promise<SubmitAck>;
874
+ model3d(prompt: string, options?: Model3dOptions): Promise<GenerateResponse>;
875
+ character(prompt: string, options: CharacterOptions & {
876
+ async: true;
877
+ }): Promise<SubmitAck>;
878
+ character(prompt: string, options?: CharacterOptions): Promise<GenerateResponse>;
879
+ prop(prompt: string, options: PropOptions & {
880
+ async: true;
881
+ }): Promise<SubmitAck>;
882
+ prop(prompt: string, options?: PropOptions): Promise<GenerateResponse>;
883
+ sprite(prompt: string, options: SpriteOptions & {
884
+ async: true;
885
+ }): Promise<SubmitAck>;
886
+ sprite(prompt: string, options?: SpriteOptions): Promise<GenerateResponse>;
887
+ world(prompt: string, options: WorldOptions & {
888
+ async: true;
889
+ }): Promise<SubmitAck>;
890
+ world(prompt: string, options?: WorldOptions): Promise<GenerateResponse>;
891
+ text(prompt: string, options: TextOptions & {
892
+ async: true;
893
+ }): Promise<SubmitAck>;
894
+ text(prompt: string, options?: TextOptions): Promise<GenerateResponse>;
895
+ request<T>(method: string, path: string, options?: TransportRequestOptions): Promise<T>;
896
+ private submitAndMaybeWait;
897
+ }
898
+
899
+ declare function normalizeGenerateResponse(baseUrl: string, response: GenerateResponse): GenerateResponse;
900
+ declare function buildImageRequest(prompt: string, options?: Omit<ImageOptions, "signal" | "headers">): GenerateRequest;
901
+ declare function buildVideoRequest(prompt: string, options?: Omit<VideoRequestInput, "prompt" | "signal" | "headers">): GenerateRequest;
902
+ declare function buildAudioRequest(prompt: string, options?: Omit<AudioOptions, "signal" | "headers">): GenerateRequest;
903
+ declare function buildMusicRequest(prompt: string, options?: Omit<MusicOptions, "signal" | "headers">): GenerateRequest;
904
+ declare function buildTtsRequest(prompt: string, options?: Omit<TtsOptions, "signal" | "headers">): GenerateRequest;
905
+ declare function buildModel3dRequest(prompt: string, options?: Omit<Model3dOptions, "signal" | "headers">): GenerateRequest;
906
+ declare function buildCharacterRequest(prompt: string, options?: Omit<CharacterOptions, "signal" | "headers">): GenerateRequest;
907
+ declare function buildPropRequest(prompt: string, options?: Omit<PropOptions, "signal" | "headers">): GenerateRequest;
908
+ declare function buildSpriteRequest(prompt: string, options?: Omit<SpriteOptions, "signal" | "headers">): GenerateRequest;
909
+ declare function buildWorldRequest(prompt: string, options?: Omit<WorldOptions, "signal" | "headers">): GenerateRequest;
910
+ declare function buildTextRequest(prompt: string, options?: Omit<TextOptions, "signal" | "headers">): GenerateRequest;
911
+
912
+ export { type ApiEnvelope, type ApiErrorEnvelope, type ApiErrorPayload, type ApiSuccessEnvelope, type AssetDeleteResponse, type AssetFile, AssetForge, AssetForgeAssets, AssetForgeError, AssetForgeJobs, AssetForgeLibrary, type AssetForgeOptions, AssetForgeProviders, AssetForgeStreamNamespace, type AssetListResponse, type AssetType, type AsyncSubmitOptions, type AudioOptions, type BatchComposeRequest, type BatchFrameResult, type BatchGenerateRequest, type BatchGenerateResponse, type BatchSharedRequest, type BatchSpritesheetResult, type CharacterOptions, type ComposeDirection, type CropMode, DEFAULT_BASE_URL, type GenerateRequest, type GenerateResponse, type GeneratedAssetOptions, type ImageBackground, type ImageEditMode, type ImageOptions, type ImageOutputFormat, type ImagePreset, type ImageQuality, type IngestSource, type JobCancelResponse, type JobEvent, type JobInfo, type JobListQuery, type JobListResponse, type JobProgress, type JobStatus, type JobStatusResponse, type JobSummary, type JsonObject, type JsonPrimitive, type JsonValue, type LibraryAddRequest, type LibraryAdminBatchResponse, type LibraryBackfillRequest, type LibraryBundleRequest, type LibraryCatalogJobsRequest, type LibraryCatalogJobsResponse, type LibraryDeleteResponse, type LibraryIngestJobInfo, type LibraryIngestRequest, type LibraryIngestResponse, type LibraryIngestResult, type LibraryItem, type LibraryPackDeleteResponse, type LibraryPackInfo, type LibraryPackInstallRequest, type LibraryPackInstallResponse, type LibraryPackListResponse, type LibraryPackRefreshResponse, type LibraryPackSource, type LibraryReenrichRequest, type LibraryRelatedQuery, type LibraryRelatedResponse, type LibrarySearchQuery, type LibrarySearchResponse, type LoginResponse, type Model3dOptions, type MusicOptions, type OutputFile, type PackOnlyResponse, type Process3dRequest, type Process3dResponse, type ProcessOperation, type ProcessOutputItem, type ProcessRequest, type ProcessResponse, type PropOptions, type ProviderCapabilities, type ProviderHealth, type ProviderHealthEntry, type ProviderHealthListResponse, type ProviderHealthResponse, type ProviderInfo, type ProviderListResponse, type QueryValue, type RequestOptions, type ShortcutOptions, type SpriteOptions, type StreamCancelledEvent, type StreamEventMap, type StreamProgressEvent, type SubmitAck, type TextOptions, type TransportRequestOptions, type TtsOptions, type UploadInput, type UploadOptions, type UploadResult, type VideoRequestInput, type VoiceCloneRequest, type VoiceCloneResponse, type VoiceDeleteResponse, type VoiceDesignRequest, type VoiceDesignResponse, type VoiceListQuery, type VoiceListResponse, type VoiceType, type WaitForJobOptions, type WorldOptions, type WorldQuality, buildAudioRequest, buildCharacterRequest, buildImageRequest, buildModel3dRequest, buildMusicRequest, buildPropRequest, buildSpriteRequest, buildTextRequest, buildTtsRequest, buildVideoRequest, buildWorldRequest, normalizeGenerateResponse, subscribeAllJobs, subscribeJob, toAssetForgeError };