@byte_fluffy/nexra-sdk 0.1.0-alpha.27 → 0.1.0-alpha.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,6 +37,71 @@ available from `@byte_fluffy/nexra-sdk/media`.
37
37
  The default API base URL is `https://api.nexra-ai.com/v1`. When overriding
38
38
  `baseUrl`, include the `/v1` API prefix.
39
39
 
40
+ ## Model display names
41
+
42
+ `getModelSpec`, `listModelSpecs`, `nexra.models.search`, `nexra.models.get`, and
43
+ `nexra.catalog.model` return display names with spaces between words and
44
+ capitalized initials, such as
45
+ `Grok Imagine Image`, `GPT 5.4`, and `Wan 2.7 Image Pro`. Brand spelling, acronyms,
46
+ and decimal versions are preserved. Model detail family versions follow the same
47
+ format.
48
+
49
+ Use `formatModelDisplayName(name)` to apply this format to other display labels.
50
+ It is available from the package root and `/catalog`. Formatting affects only
51
+ `displayName`: use the static catalog's `id`, model discovery's `slug`, or the
52
+ live catalog's `modelId` for requests, never the formatted display name.
53
+
54
+ ## Live model catalog
55
+
56
+ `getModelSpec` and `listModelSpecs` read the catalog bundled with this SDK release.
57
+ Use `catalog.model(publicId, operation)` to read the currently published database
58
+ input schema, display name, sale prices and actual model revision. A successful
59
+ `available: false` response authoritatively confirms an unavailable or retired
60
+ public identity; HTTP failures throw and must preserve the last successful value.
61
+ An unknown identity returns 404. Model IDs are URL-encoded by the SDK.
62
+
63
+ `catalog.changes` lists lightweight public model/operation identities and their
64
+ latest revisions. Start with `after: "0"` for initial alignment. Keep the first
65
+ page's `revision` as `upper` for every remaining page and pass its opaque
66
+ `nextCursor`. The cursor is bound to that `after`/`upper` window. Revisions are
67
+ 64-bit decimal strings; compare them with `BigInt`, not JavaScript numbers.
68
+
69
+ ```ts
70
+ let after = "0";
71
+ let cursor: string | undefined;
72
+ let upper: string | undefined;
73
+ do {
74
+ const page = await nexra.catalog.changes({ after, upper, cursor });
75
+ upper ??= page.revision;
76
+ // Record changed identities for independent background model reads.
77
+ enqueueChanges(page.data);
78
+ cursor = page.nextCursor;
79
+ } while (cursor);
80
+ after = upper!;
81
+
82
+ for await (const event of nexra.catalog.events({ after, signal })) {
83
+ enqueueChanges(event.data);
84
+ after = event.revision;
85
+ }
86
+ ```
87
+
88
+ `enqueueChanges` is application code that records the affected identities before
89
+ advancing the receiving cursor; it does not block on all model reads. Each model
90
+ response carries its own actual revision. Do not label an older response with the
91
+ requested target revision or let it overwrite newer state. An identity updated
92
+ beyond a page window's fixed upper bound appears in the next window, including
93
+ when its index row was replaced during pagination.
94
+
95
+ `catalog.events` opens one authenticated SSE stream, ignores heartbeats, and
96
+ emits complete `catalog.quote-context.changed` windows with `{ revision,
97
+ changedAt, data }`. Notifications wake the API instance immediately; a per-instance
98
+ 60-second revision check recovers silent notification loss. When a stream ends or
99
+ throws, the application reconnects using its retained `after` cursor; the SDK
100
+ does not reconnect automatically. Abort the supplied signal to stop an active
101
+ read. Leaving the iterator cancels and releases the response stream. Keep cached
102
+ values and cursors separate for different API sources and authorization identities.
103
+ No credentials, channel costs or user discounts are included in the public events.
104
+
40
105
  ## Private ElevenLabs voices
41
106
 
42
107
  Voice design uses `elevenlabs/eleven_multilingual_ttv_v2`, with exactly one prompt
package/dist/catalog.d.ts CHANGED
@@ -1,10 +1,18 @@
1
- import { H as HttpTransport, N as NexraSalePriceList, C as CreateNexraQuoteRequest, a as NexraQuote, b as CreateNexraDisplayQuoteBatchRequest, c as NexraDisplayQuoteBatch, d as NexraCatalogRevision, e as NexraModelSpec, f as NexraModelSpecFilter } from './media-geometry-B7ip-nrA.js';
2
- export { M as MediaGeometryField, g as MediaGeometryProjection, h as NexraBillingCurrency, i as NexraModelEndpointSpec, j as NexraModelOperation, k as NexraSalePrice, l as NexraSettlement, U as UnifiedMediaGeometry, m as applyMediaGeometry, n as decodeMediaGeometry, o as encodeMediaGeometry, p as projectMediaGeometry } from './media-geometry-B7ip-nrA.js';
1
+ import { H as HttpTransport, N as NexraCatalogChangeParams, a as NexraCatalogChangePage, b as NexraCatalogModelState, c as NexraSalePriceList, C as CreateNexraQuoteRequest, d as NexraQuote, e as CreateNexraDisplayQuoteBatchRequest, f as NexraDisplayQuoteBatch, g as NexraCatalogRevision, h as NexraModelSpec, i as NexraModelSpecFilter } from './media-geometry-BoxkWQlj.js';
2
+ export { M as MediaGeometryField, j as MediaGeometryProjection, k as NexraBillingCurrency, l as NexraCatalogModelIdentity, m as NexraModelEndpointSpec, n as NexraModelOperation, o as NexraSalePrice, p as NexraSettlement, U as UnifiedMediaGeometry, q as applyMediaGeometry, r as decodeMediaGeometry, s as encodeMediaGeometry, t as projectMediaGeometry } from './media-geometry-BoxkWQlj.js';
3
3
  import './json-Drjj1OKl.js';
4
4
 
5
+ declare function formatModelDisplayName(displayName: string): string;
6
+
5
7
  declare class CatalogClient {
6
8
  private readonly transport;
7
9
  constructor(transport: HttpTransport);
10
+ changes(params?: NexraCatalogChangeParams, signal?: AbortSignal): Promise<NexraCatalogChangePage>;
11
+ model(modelId: string, operation: string, signal?: AbortSignal): Promise<NexraCatalogModelState>;
12
+ events(options?: {
13
+ after?: string;
14
+ signal?: AbortSignal;
15
+ }): AsyncGenerator<NexraCatalogChangePage>;
8
16
  listPrices(signal?: AbortSignal): Promise<NexraSalePriceList>;
9
17
  quote(request: CreateNexraQuoteRequest, signal?: AbortSignal): Promise<NexraQuote>;
10
18
  quoteBatch(request: CreateNexraDisplayQuoteBatchRequest, signal?: AbortSignal): Promise<NexraDisplayQuoteBatch>;
@@ -13,4 +21,4 @@ declare class CatalogClient {
13
21
  declare function getModelSpec(modelId: string): NexraModelSpec | undefined;
14
22
  declare function listModelSpecs(filter?: NexraModelSpecFilter): readonly NexraModelSpec[];
15
23
 
16
- export { CatalogClient, CreateNexraDisplayQuoteBatchRequest, CreateNexraQuoteRequest, NexraCatalogRevision, NexraDisplayQuoteBatch, NexraModelSpec, NexraModelSpecFilter, NexraQuote, NexraSalePriceList, getModelSpec, listModelSpecs };
24
+ export { CatalogClient, CreateNexraDisplayQuoteBatchRequest, CreateNexraQuoteRequest, NexraCatalogChangePage, NexraCatalogChangeParams, NexraCatalogModelState, NexraCatalogRevision, NexraDisplayQuoteBatch, NexraModelSpec, NexraModelSpecFilter, NexraQuote, NexraSalePriceList, formatModelDisplayName, getModelSpec, listModelSpecs };
package/dist/catalog.js CHANGED
@@ -3,16 +3,18 @@ import {
3
3
  applyMediaGeometry,
4
4
  decodeMediaGeometry,
5
5
  encodeMediaGeometry,
6
+ formatModelDisplayName,
6
7
  getModelSpec,
7
8
  listModelSpecs,
8
9
  projectMediaGeometry
9
- } from "./chunk-N622DGTD.js";
10
- import "./chunk-YQXMWTSV.js";
10
+ } from "./chunk-ECF5MLSM.js";
11
+ import "./chunk-IEBCNRT4.js";
11
12
  export {
12
13
  CatalogClient,
13
14
  applyMediaGeometry,
14
15
  decodeMediaGeometry,
15
16
  encodeMediaGeometry,
17
+ formatModelDisplayName,
16
18
  getModelSpec,
17
19
  listModelSpecs,
18
20
  projectMediaGeometry
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sortRatioDisplayOrder
3
- } from "./chunk-YQXMWTSV.js";
3
+ } from "./chunk-IEBCNRT4.js";
4
4
 
5
5
  // src/catalog/generated/audio.generated.json
6
6
  var audio_generated_default = [
@@ -8,7 +8,7 @@ var audio_generated_default = [
8
8
  id: "elevenlabs/eleven_multilingual_ttv_v2",
9
9
  contractVersion: 1,
10
10
  developer: "elevenlabs",
11
- displayName: "ElevenLabs Voice Design v2",
11
+ displayName: "ElevenLabs Voice Design V2",
12
12
  summary: "Design three voice previews from a voice description and preview script. Save a selected preview as a private voice for speech and voice conversion.",
13
13
  kind: "audio",
14
14
  family: "ElevenLabs Voice Design",
@@ -369,7 +369,7 @@ var audio_generated_default = [
369
369
  id: "bytedance/doubao-tts-v1",
370
370
  contractVersion: 1,
371
371
  developer: "bytedance",
372
- displayName: "Doubao TTS v1",
372
+ displayName: "Doubao TTS V1",
373
373
  summary: "Synthesize expressive Chinese speech from text with a Volcengine TTS v1 preset voice.",
374
374
  kind: "audio",
375
375
  family: "Doubao TTS",
@@ -506,7 +506,7 @@ var audio_generated_default = [
506
506
  id: "bytedance/doubao-tts-v2",
507
507
  contractVersion: 1,
508
508
  developer: "bytedance",
509
- displayName: "Doubao TTS v2",
509
+ displayName: "Doubao TTS V2",
510
510
  summary: "Synthesize natural, expressive speech from text with a Volcengine TTS v2 preset voice.",
511
511
  kind: "audio",
512
512
  family: "Doubao TTS",
@@ -643,7 +643,7 @@ var audio_generated_default = [
643
643
  id: "elevenlabs/eleven_flash_v2_5",
644
644
  contractVersion: 1,
645
645
  developer: "elevenlabs",
646
- displayName: "Eleven Flash v2.5",
646
+ displayName: "Eleven Flash V2.5",
647
647
  summary: "Synthesize low-latency speech in 32 languages from up to 40,000 characters using an ElevenLabs preset or cloned voice.",
648
648
  kind: "audio",
649
649
  family: "ElevenLabs Flash",
@@ -848,7 +848,7 @@ var audio_generated_default = [
848
848
  id: "elevenlabs/eleven_multilingual_v2",
849
849
  contractVersion: 1,
850
850
  developer: "elevenlabs",
851
- displayName: "Eleven Multilingual v2",
851
+ displayName: "Eleven Multilingual V2",
852
852
  summary: "Synthesize stable, natural long-form speech in 29 languages from up to 10,000 characters using an ElevenLabs preset or cloned voice.",
853
853
  kind: "audio",
854
854
  family: "ElevenLabs Multilingual",
@@ -1054,7 +1054,7 @@ var audio_generated_default = [
1054
1054
  id: "elevenlabs/eleven_text_to_sound_v2",
1055
1055
  contractVersion: 1,
1056
1056
  developer: "elevenlabs",
1057
- displayName: "Eleven Text to Sound v2",
1057
+ displayName: "Eleven Text To Sound V2",
1058
1058
  summary: "Generate sound effects up to 30 seconds from a text prompt with duration, loop, and prompt-influence controls.",
1059
1059
  kind: "audio",
1060
1060
  family: "ElevenLabs Text to Sound",
@@ -1279,7 +1279,7 @@ var audio_generated_default = [
1279
1279
  id: "elevenlabs/eleven_v3",
1280
1280
  contractVersion: 1,
1281
1281
  developer: "elevenlabs",
1282
- displayName: "Eleven v3",
1282
+ displayName: "Eleven V3",
1283
1283
  summary: "Generate expressive multilingual speech from up to 5,000 characters using an ElevenLabs preset or cloned voice.",
1284
1284
  kind: "audio",
1285
1285
  family: "ElevenLabs Eleven",
@@ -1482,7 +1482,7 @@ var audio_generated_default = [
1482
1482
  id: "elevenlabs/music_v2",
1483
1483
  contractVersion: 1,
1484
1484
  developer: "elevenlabs",
1485
- displayName: "Eleven Music v2",
1485
+ displayName: "Eleven Music V2",
1486
1486
  summary: "Generate instrumental or vocal music from a text prompt with an optional duration from 3 seconds to 10 minutes.",
1487
1487
  kind: "audio",
1488
1488
  family: "ElevenLabs Music",
@@ -1895,7 +1895,7 @@ var audio_generated_default = [
1895
1895
  endpoints: []
1896
1896
  },
1897
1897
  {
1898
- id: "fish-audio/s2pro",
1898
+ id: "fish-audio/s2-pro",
1899
1899
  contractVersion: 1,
1900
1900
  developer: "fish-audio",
1901
1901
  displayName: "Fish Audio S2 Pro",
@@ -1903,10 +1903,7 @@ var audio_generated_default = [
1903
1903
  kind: "audio",
1904
1904
  family: "Fish Audio S Pro",
1905
1905
  versionLabel: "2",
1906
- aliases: [
1907
- "fish-audio-s2-pro",
1908
- "fish_audio/s2pro"
1909
- ],
1906
+ aliases: [],
1910
1907
  capabilities: {
1911
1908
  inputModalities: [
1912
1909
  "text"
@@ -4115,7 +4112,7 @@ var image_generated_default = [
4115
4112
  id: "alibaba/qwen-image-edit-plus",
4116
4113
  contractVersion: 2,
4117
4114
  developer: "alibaba",
4118
- displayName: "qwen-image-edit-plus",
4115
+ displayName: "Qwen Image Edit Plus",
4119
4116
  summary: "Qwen Image Edit Plus \u56FE\u7247\u7F16\u8F91\uFF0C\u652F\u6301 1\uFF5E3 \u5F20\u8F93\u5165\u56FE\u7247\u3002",
4120
4117
  kind: "image",
4121
4118
  family: "Qwen Image Edit Plus",
@@ -4372,18 +4369,15 @@ var image_generated_default = [
4372
4369
  endpoints: []
4373
4370
  },
4374
4371
  {
4375
- id: "alibaba/wan-2-7-image-pro",
4372
+ id: "alibaba/wan2.7-image-pro",
4376
4373
  contractVersion: 2,
4377
4374
  developer: "alibaba",
4378
- displayName: "wan-2-7-image-pro",
4375
+ displayName: "Wan 2.7 Image Pro",
4379
4376
  summary: "Wan 2.7 Image Pro \u56FE\u7247\u751F\u6210\u4E0E\u7F16\u8F91\uFF0C\u652F\u6301\u6700\u591A 9 \u5F20\u53C2\u8003\u56FE\u548C\u6700\u9AD8 4K \u6587\u751F\u56FE\u3002",
4380
4377
  kind: "image",
4381
4378
  family: "Wan Image Pro",
4382
4379
  versionLabel: "2.7",
4383
- aliases: [
4384
- "aliyun/wan-2-7-image-pro",
4385
- "wan2.7-image-pro"
4386
- ],
4380
+ aliases: [],
4387
4381
  capabilities: {
4388
4382
  inputModalities: [
4389
4383
  "text",
@@ -4642,7 +4636,7 @@ var image_generated_default = [
4642
4636
  id: "alibaba/z-image-turbo",
4643
4637
  contractVersion: 2,
4644
4638
  developer: "alibaba",
4645
- displayName: "z-image-turbo",
4639
+ displayName: "Z Image Turbo",
4646
4640
  summary: "Z-Image Turbo \u6587\u751F\u56FE\uFF0C\u652F\u6301\u81EA\u5B9A\u4E49\u5C3A\u5BF8\u4E0E\u63D0\u793A\u8BCD\u6269\u5199\u3002",
4647
4641
  kind: "image",
4648
4642
  family: "Z-Image Turbo",
@@ -5249,7 +5243,7 @@ var image_generated_default = [
5249
5243
  endpoints: []
5250
5244
  },
5251
5245
  {
5252
- id: "google/gemini-2-5-flash-image",
5246
+ id: "google/gemini-2.5-flash-image",
5253
5247
  contractVersion: 1,
5254
5248
  developer: "google",
5255
5249
  displayName: "Gemini 2.5 Flash Image",
@@ -5257,9 +5251,7 @@ var image_generated_default = [
5257
5251
  kind: "image",
5258
5252
  family: "Gemini Flash Image",
5259
5253
  versionLabel: "2.5",
5260
- aliases: [
5261
- "banana"
5262
- ],
5254
+ aliases: [],
5263
5255
  capabilities: {
5264
5256
  inputModalities: [
5265
5257
  "text",
@@ -5472,7 +5464,7 @@ var image_generated_default = [
5472
5464
  endpoints: []
5473
5465
  },
5474
5466
  {
5475
- id: "google/gemini-3-1-flash-image",
5467
+ id: "google/gemini-3.1-flash-image",
5476
5468
  contractVersion: 1,
5477
5469
  developer: "google",
5478
5470
  displayName: "Gemini 3.1 Flash Image",
@@ -5480,10 +5472,7 @@ var image_generated_default = [
5480
5472
  kind: "image",
5481
5473
  family: "Gemini Flash Image",
5482
5474
  versionLabel: "3.1",
5483
- aliases: [
5484
- "banana2",
5485
- "google/gemini-3.1-flash-image"
5486
- ],
5475
+ aliases: [],
5487
5476
  capabilities: {
5488
5477
  inputModalities: [
5489
5478
  "text",
@@ -5704,19 +5693,15 @@ var image_generated_default = [
5704
5693
  endpoints: []
5705
5694
  },
5706
5695
  {
5707
- id: "google/gemini-3-1-flash-lite-image",
5696
+ id: "google/gemini-3.1-flash-lite-image",
5708
5697
  contractVersion: 1,
5709
5698
  developer: "google",
5710
- displayName: "Gemini 3.1 Flash-Lite Image",
5699
+ displayName: "Gemini 3.1 Flash Lite Image",
5711
5700
  summary: "Generate or edit 1K images from text and up to fourteen reference images with expanded aspect-ratio support.",
5712
5701
  kind: "image",
5713
5702
  family: "Gemini Flash-Lite Image",
5714
5703
  versionLabel: "3.1",
5715
- aliases: [
5716
- "banana-2-lite",
5717
- "banana2-lite",
5718
- "google/gemini-3.1-flash-lite-image"
5719
- ],
5704
+ aliases: [],
5720
5705
  capabilities: {
5721
5706
  inputModalities: [
5722
5707
  "text",
@@ -5934,7 +5919,7 @@ var image_generated_default = [
5934
5919
  endpoints: []
5935
5920
  },
5936
5921
  {
5937
- id: "google/gemini-3-pro-image-preview",
5922
+ id: "google/gemini-3-pro-image",
5938
5923
  contractVersion: 1,
5939
5924
  developer: "google",
5940
5925
  displayName: "Gemini 3 Pro Image",
@@ -5942,9 +5927,7 @@ var image_generated_default = [
5942
5927
  kind: "image",
5943
5928
  family: "Gemini Pro Image",
5944
5929
  versionLabel: "3 Pro",
5945
- aliases: [
5946
- "banana-pro"
5947
- ],
5930
+ aliases: [],
5948
5931
  capabilities: {
5949
5932
  inputModalities: [
5950
5933
  "text",
@@ -7252,7 +7235,7 @@ var image_generated_default = [
7252
7235
  id: "xai/grok-imagine-image",
7253
7236
  contractVersion: 2,
7254
7237
  developer: "xai",
7255
- displayName: "grok-imagine-image",
7238
+ displayName: "Grok Imagine Image",
7256
7239
  summary: "Grok \u56FE\u7247\u751F\u6210\u4E0E\u7F16\u8F91\uFF0C\u652F\u6301\u591A\u56FE\u53C2\u8003\u53CA 1K / 2K \u8F93\u51FA\u3002",
7257
7240
  kind: "image",
7258
7241
  family: "Grok Image",
@@ -7503,7 +7486,7 @@ var image_generated_default = [
7503
7486
  id: "xai/grok-imagine-image-quality",
7504
7487
  contractVersion: 2,
7505
7488
  developer: "xai",
7506
- displayName: "grok-imagine-image-quality",
7489
+ displayName: "Grok Imagine Image Quality",
7507
7490
  summary: "Grok \u9AD8\u8D28\u91CF\u56FE\u7247\u751F\u6210\u4E0E\u7F16\u8F91\uFF0C\u652F\u6301\u591A\u56FE\u53C2\u8003\u53CA 1K / 2K \u8F93\u51FA\u3002",
7508
7491
  kind: "image",
7509
7492
  family: "Grok Image Quality",
@@ -9592,7 +9575,7 @@ var language_generated_default = [
9592
9575
  ]
9593
9576
  },
9594
9577
  {
9595
- id: "anthropic/claude-haiku-4-5",
9578
+ id: "anthropic/claude-haiku-4-5-20251001",
9596
9579
  contractVersion: 1,
9597
9580
  developer: "anthropic",
9598
9581
  displayName: "Claude Haiku 4.5",
@@ -9600,9 +9583,7 @@ var language_generated_default = [
9600
9583
  kind: "language",
9601
9584
  family: "Claude Haiku",
9602
9585
  versionLabel: "4.5",
9603
- aliases: [
9604
- "claude-haiku-4-5"
9605
- ],
9586
+ aliases: [],
9606
9587
  capabilities: {
9607
9588
  inputModalities: [
9608
9589
  "text",
@@ -14575,7 +14556,7 @@ var language_generated_default = [
14575
14556
  ]
14576
14557
  },
14577
14558
  {
14578
- id: "bytedance/seed-2-0-mini-260215",
14559
+ id: "bytedance/doubao-seed-2-0-mini-260428",
14579
14560
  contractVersion: 2,
14580
14561
  developer: "bytedance",
14581
14562
  displayName: "Doubao Seed 2.0 Mini",
@@ -14583,12 +14564,7 @@ var language_generated_default = [
14583
14564
  kind: "language",
14584
14565
  family: "Doubao Seed Mini",
14585
14566
  versionLabel: "2.0",
14586
- aliases: [
14587
- "doubao-seed-2-0-mini-260428",
14588
- "doubao-seed-2.0-mini",
14589
- "seed-2-0-mini",
14590
- "volcengine/seed-2-0-mini-260215"
14591
- ],
14567
+ aliases: [],
14592
14568
  capabilities: {
14593
14569
  inputModalities: [
14594
14570
  "text",
@@ -14632,12 +14608,12 @@ var language_generated_default = [
14632
14608
  title: "\u6A21\u578B ID",
14633
14609
  description: "Nexra \u516C\u5171\u6A21\u578B ID\uFF0C\u5FC5\u987B\u4E0E\u5916\u5C42 modelId \u76F8\u540C\u3002",
14634
14610
  examples: [
14635
- "bytedance/seed-2-0-mini-260215"
14611
+ "bytedance/doubao-seed-2-0-mini-260428"
14636
14612
  ],
14637
14613
  "x-ui": {
14638
14614
  order: 0
14639
14615
  },
14640
- const: "bytedance/seed-2-0-mini-260215"
14616
+ const: "bytedance/doubao-seed-2-0-mini-260428"
14641
14617
  },
14642
14618
  messages: {
14643
14619
  type: "array",
@@ -15410,10 +15386,10 @@ var language_generated_default = [
15410
15386
  model: {
15411
15387
  type: "string",
15412
15388
  title: "\u6A21\u578B ID",
15413
- const: "bytedance/seed-2-0-mini-260215",
15389
+ const: "bytedance/doubao-seed-2-0-mini-260428",
15414
15390
  description: "Nexra \u516C\u5171\u6A21\u578B ID\u3002",
15415
15391
  examples: [
15416
- "bytedance/seed-2-0-mini-260215"
15392
+ "bytedance/doubao-seed-2-0-mini-260428"
15417
15393
  ]
15418
15394
  },
15419
15395
  choices: {
@@ -15622,7 +15598,7 @@ var language_generated_default = [
15622
15598
  ]
15623
15599
  },
15624
15600
  {
15625
- id: "google/gemini-3-1-pro-preview",
15601
+ id: "google/gemini-3.1-pro-preview",
15626
15602
  contractVersion: 1,
15627
15603
  developer: "google",
15628
15604
  displayName: "Gemini 3.1 Pro Preview",
@@ -15630,10 +15606,7 @@ var language_generated_default = [
15630
15606
  kind: "language",
15631
15607
  family: "Gemini Pro",
15632
15608
  versionLabel: "3.1 Preview",
15633
- aliases: [
15634
- "gemini-3.1-pro",
15635
- "google/gemini-3.1-pro-preview"
15636
- ],
15609
+ aliases: [],
15637
15610
  capabilities: {
15638
15611
  inputModalities: [
15639
15612
  "text",
@@ -16037,7 +16010,7 @@ var language_generated_default = [
16037
16010
  ]
16038
16011
  },
16039
16012
  {
16040
- id: "google/gemini-3-5-flash",
16013
+ id: "google/gemini-3.5-flash",
16041
16014
  contractVersion: 1,
16042
16015
  developer: "google",
16043
16016
  displayName: "Gemini 3.5 Flash",
@@ -16045,10 +16018,7 @@ var language_generated_default = [
16045
16018
  kind: "language",
16046
16019
  family: "Gemini Flash",
16047
16020
  versionLabel: "3.5",
16048
- aliases: [
16049
- "gemini-3.5-flash",
16050
- "google/gemini-3.5-flash"
16051
- ],
16021
+ aliases: [],
16052
16022
  capabilities: {
16053
16023
  inputModalities: [
16054
16024
  "text",
@@ -16453,7 +16423,7 @@ var language_generated_default = [
16453
16423
  ]
16454
16424
  },
16455
16425
  {
16456
- id: "google/gemini-3-6-flash",
16426
+ id: "google/gemini-3.6-flash",
16457
16427
  contractVersion: 1,
16458
16428
  developer: "google",
16459
16429
  displayName: "Gemini 3.6 Flash",
@@ -16461,10 +16431,7 @@ var language_generated_default = [
16461
16431
  kind: "language",
16462
16432
  family: "Gemini Flash",
16463
16433
  versionLabel: "3.6",
16464
- aliases: [
16465
- "gemini-3.6-flash",
16466
- "google/gemini-3.6-flash"
16467
- ],
16434
+ aliases: [],
16468
16435
  capabilities: {
16469
16436
  inputModalities: [
16470
16437
  "text",
@@ -17284,18 +17251,15 @@ var language_generated_default = [
17284
17251
  ]
17285
17252
  },
17286
17253
  {
17287
- id: "moonshot-ai/kimi-k2-5",
17254
+ id: "moonshot-ai/moonshotai.kimi-k2.5",
17288
17255
  contractVersion: 1,
17289
17256
  developer: "moonshot-ai",
17290
- displayName: "Kimi K2.5 on Bedrock",
17257
+ displayName: "Kimi K2.5",
17291
17258
  summary: "Generate up to 16,000 output tokens from text and optional images with the multimodal Kimi K2.5 model through Amazon Bedrock.",
17292
17259
  kind: "language",
17293
17260
  family: "Kimi K2",
17294
17261
  versionLabel: "2.5",
17295
- aliases: [
17296
- "aws/kimi-k2-5",
17297
- "kimi-k2.5"
17298
- ],
17262
+ aliases: [],
17299
17263
  capabilities: {
17300
17264
  inputModalities: [
17301
17265
  "text",
@@ -17515,18 +17479,15 @@ var language_generated_default = [
17515
17479
  ]
17516
17480
  },
17517
17481
  {
17518
- id: "openai/gpt-5-4",
17482
+ id: "openai/gpt-5.4",
17519
17483
  contractVersion: 1,
17520
17484
  developer: "openai",
17521
- displayName: "GPT-5.4",
17485
+ displayName: "GPT 5.4",
17522
17486
  summary: "Generate streaming or complete text responses through the Azure AI Foundry Chat Completions deployment.",
17523
17487
  kind: "language",
17524
17488
  family: "GPT",
17525
17489
  versionLabel: "5.4",
17526
- aliases: [
17527
- "azure/gpt-5-4",
17528
- "gpt-5.4"
17529
- ],
17490
+ aliases: [],
17530
17491
  capabilities: {
17531
17492
  inputModalities: [
17532
17493
  "text"
@@ -17632,18 +17593,15 @@ var language_generated_default = [
17632
17593
  ]
17633
17594
  },
17634
17595
  {
17635
- id: "openai/gpt-5-5",
17596
+ id: "openai/gpt-5.5",
17636
17597
  contractVersion: 1,
17637
17598
  developer: "openai",
17638
- displayName: "GPT-5.5",
17599
+ displayName: "GPT 5.5",
17639
17600
  summary: "Generate text and structured responses through the Azure AI Foundry Responses API with image input, configurable reasoning, and continuation support.",
17640
17601
  kind: "language",
17641
17602
  family: "GPT",
17642
17603
  versionLabel: "5.5",
17643
- aliases: [
17644
- "azure/gpt-5-5",
17645
- "gpt-5.5"
17646
- ],
17604
+ aliases: [],
17647
17605
  capabilities: {
17648
17606
  inputModalities: [
17649
17607
  "text",
@@ -17981,18 +17939,15 @@ var language_generated_default = [
17981
17939
  ]
17982
17940
  },
17983
17941
  {
17984
- id: "openai/gpt-5-6-luna",
17942
+ id: "openai/gpt-5.6-luna",
17985
17943
  contractVersion: 1,
17986
17944
  developer: "openai",
17987
- displayName: "GPT-5.6 Luna",
17945
+ displayName: "GPT 5.6 Luna",
17988
17946
  summary: "Generate efficient text and structured responses with image input, standard or pro reasoning mode, and up to max reasoning effort through Azure AI Foundry.",
17989
17947
  kind: "language",
17990
17948
  family: "GPT Luna",
17991
17949
  versionLabel: "5.6",
17992
- aliases: [
17993
- "azure/gpt-5-6-luna",
17994
- "gpt-5.6-luna"
17995
- ],
17950
+ aliases: [],
17996
17951
  capabilities: {
17997
17952
  inputModalities: [
17998
17953
  "text",
@@ -18362,19 +18317,15 @@ var language_generated_default = [
18362
18317
  ]
18363
18318
  },
18364
18319
  {
18365
- id: "openai/gpt-5-6-sol",
18320
+ id: "openai/gpt-5.6-sol",
18366
18321
  contractVersion: 1,
18367
18322
  developer: "openai",
18368
- displayName: "GPT-5.6 Sol",
18323
+ displayName: "GPT 5.6 Sol",
18369
18324
  summary: "Generate frontier text and structured responses with image input, standard or pro reasoning mode, and up to max reasoning effort through Azure AI Foundry.",
18370
18325
  kind: "language",
18371
18326
  family: "GPT Sol",
18372
18327
  versionLabel: "5.6",
18373
- aliases: [
18374
- "azure/gpt-5-6-sol",
18375
- "gpt-5.6",
18376
- "gpt-5.6-sol"
18377
- ],
18328
+ aliases: [],
18378
18329
  capabilities: {
18379
18330
  inputModalities: [
18380
18331
  "text",
@@ -18744,18 +18695,15 @@ var language_generated_default = [
18744
18695
  ]
18745
18696
  },
18746
18697
  {
18747
- id: "openai/gpt-5-6-terra",
18698
+ id: "openai/gpt-5.6-terra",
18748
18699
  contractVersion: 1,
18749
18700
  developer: "openai",
18750
- displayName: "GPT-5.6 Terra",
18701
+ displayName: "GPT 5.6 Terra",
18751
18702
  summary: "Generate balanced text and structured responses with image input, standard or pro reasoning mode, and up to max reasoning effort through Azure AI Foundry.",
18752
18703
  kind: "language",
18753
18704
  family: "GPT Terra",
18754
18705
  versionLabel: "5.6",
18755
- aliases: [
18756
- "azure/gpt-5-6-terra",
18757
- "gpt-5.6-terra"
18758
- ],
18706
+ aliases: [],
18759
18707
  capabilities: {
18760
18708
  inputModalities: [
18761
18709
  "text",
@@ -19128,7 +19076,7 @@ var language_generated_default = [
19128
19076
  id: "xai/grok-4.3",
19129
19077
  contractVersion: 1,
19130
19078
  developer: "xai",
19131
- displayName: "grok-4.3",
19079
+ displayName: "Grok 4.3",
19132
19080
  summary: "Generate text and structured responses from text or image input with reasoning and response continuation support.",
19133
19081
  kind: "language",
19134
19082
  family: "Grok",
@@ -19387,7 +19335,7 @@ var language_generated_default = [
19387
19335
  id: "xai/grok-4.7",
19388
19336
  contractVersion: 1,
19389
19337
  developer: "xai",
19390
- displayName: "grok-4.7",
19338
+ displayName: "Grok 4.7",
19391
19339
  summary: "Generate text and structured responses from text or image input with reasoning and response continuation support.",
19392
19340
  kind: "language",
19393
19341
  family: "Grok",
@@ -19955,7 +19903,7 @@ var language_generated_default = [
19955
19903
  id: "openai/gpt-6-astra",
19956
19904
  contractVersion: 1,
19957
19905
  developer: "openai",
19958
- displayName: "GPT-6 Astra",
19906
+ displayName: "GPT 6 Astra",
19959
19907
  summary: "Generate text from text and image inputs with configurable reasoning.",
19960
19908
  kind: "language",
19961
19909
  aliases: [
@@ -20309,7 +20257,7 @@ var language_generated_default = [
20309
20257
  id: "openai/gpt-6-sol",
20310
20258
  contractVersion: 1,
20311
20259
  developer: "openai",
20312
- displayName: "GPT-6 Sol",
20260
+ displayName: "GPT 6 Sol",
20313
20261
  summary: "Generate text and structured responses with image input and configurable reasoning through Azure AI Foundry GPT-6 Sol.",
20314
20262
  kind: "language",
20315
20263
  family: "GPT Sol",
@@ -20693,7 +20641,7 @@ var language_generated_default = [
20693
20641
  id: "openai/gpt-6-luna",
20694
20642
  contractVersion: 1,
20695
20643
  developer: "openai",
20696
- displayName: "GPT-6 Luna",
20644
+ displayName: "GPT 6 Luna",
20697
20645
  summary: "Generate text and structured responses with image input and configurable reasoning through Azure AI Foundry GPT-6 Luna.",
20698
20646
  kind: "language",
20699
20647
  family: "GPT Luna",
@@ -21081,7 +21029,7 @@ var video_generated_default = [
21081
21029
  id: "yadan/minimax-h3-local",
21082
21030
  contractVersion: 3,
21083
21031
  developer: "minimax",
21084
- displayName: "MiniMax H3 Local\uFF08\u81EA\u90E8\u7F72\uFF09",
21032
+ displayName: "MiniMax H3 Pruned INT8",
21085
21033
  summary: "Generate a roughly five-second video with audio from a text prompt.",
21086
21034
  kind: "video",
21087
21035
  family: "H3 Local",
@@ -25433,21 +25381,15 @@ var video_generated_default = [
25433
25381
  endpoints: []
25434
25382
  },
25435
25383
  {
25436
- id: "alibaba/happy-horse",
25384
+ id: "alibaba/happyhorse-1.0",
25437
25385
  contractVersion: 2,
25438
25386
  developer: "alibaba",
25439
- displayName: "HappyHorse",
25387
+ displayName: "HappyHorse 1.0",
25440
25388
  summary: "HappyHorse 1.0 text, first-frame, and reference-image video generation at 480P, 720P, or 1080P.",
25441
25389
  kind: "video",
25442
25390
  family: "HappyHorse",
25443
25391
  versionLabel: "1.0",
25444
- aliases: [
25445
- "aliyun/happy-horse",
25446
- "happyhorse-1.0",
25447
- "happyhorse-1.0-t2v",
25448
- "happyhorse-1.0-i2v",
25449
- "happyhorse-1.0-r2v"
25450
- ],
25392
+ aliases: [],
25451
25393
  capabilities: {
25452
25394
  inputModalities: [
25453
25395
  "text",
@@ -25872,7 +25814,7 @@ var video_generated_default = [
25872
25814
  endpoints: []
25873
25815
  },
25874
25816
  {
25875
- id: "alibaba/happy-horse-1.1",
25817
+ id: "alibaba/happyhorse-1.1",
25876
25818
  contractVersion: 2,
25877
25819
  developer: "alibaba",
25878
25820
  displayName: "HappyHorse 1.1",
@@ -25880,13 +25822,7 @@ var video_generated_default = [
25880
25822
  kind: "video",
25881
25823
  family: "HappyHorse",
25882
25824
  versionLabel: "1.1",
25883
- aliases: [
25884
- "aliyun/happy-horse-1.1",
25885
- "happyhorse-1.1",
25886
- "happyhorse-1.1-t2v",
25887
- "happyhorse-1.1-i2v",
25888
- "happyhorse-1.1-r2v"
25889
- ],
25825
+ aliases: [],
25890
25826
  capabilities: {
25891
25827
  inputModalities: [
25892
25828
  "text",
@@ -26580,7 +26516,7 @@ var video_generated_default = [
26580
26516
  id: "alibaba/wan-2-6-i2v",
26581
26517
  contractVersion: 2,
26582
26518
  developer: "alibaba",
26583
- displayName: "Wan 2.6 Image-to-Video",
26519
+ displayName: "Wan 2.6 Image To Video",
26584
26520
  summary: "Generate a 2\u201315 second Wan 2.6 video from one first-frame image, an optional prompt, and optional driving audio at 720P or 1080P.",
26585
26521
  kind: "video",
26586
26522
  family: "Wan I2V",
@@ -26893,7 +26829,7 @@ var video_generated_default = [
26893
26829
  endpoints: []
26894
26830
  },
26895
26831
  {
26896
- id: "alibaba/wan-2-7",
26832
+ id: "alibaba/wan2.7",
26897
26833
  contractVersion: 2,
26898
26834
  developer: "alibaba",
26899
26835
  displayName: "Wan 2.7 Video",
@@ -26901,16 +26837,7 @@ var video_generated_default = [
26901
26837
  kind: "video",
26902
26838
  family: "Wan Video",
26903
26839
  versionLabel: "2.7",
26904
- aliases: [
26905
- "aliyun/wan-2-7",
26906
- "wan2.7",
26907
- "wan2.7-t2v",
26908
- "wan2.7-i2v",
26909
- "wan2.7-r2v",
26910
- "wan2.7-t2v-2026-06-12",
26911
- "wan2.7-i2v-2026-04-25",
26912
- "wan2.7-r2v-2026-06-12"
26913
- ],
26840
+ aliases: [],
26914
26841
  capabilities: {
26915
26842
  inputModalities: [
26916
26843
  "text",
@@ -27852,7 +27779,7 @@ var video_generated_default = [
27852
27779
  id: "bytedance/byteplus-seedance-2-0",
27853
27780
  contractVersion: 4,
27854
27781
  developer: "bytedance",
27855
- displayName: "BytePlus Seedance 2.0",
27782
+ displayName: "Seedance 2.0",
27856
27783
  summary: "\u901A\u8FC7 BytePlus Seedance 2.0\uFF0C\u4F7F\u7528\u6587\u672C\u3001\u56FE\u7247\u3001\u89C6\u9891\u548C\u97F3\u9891\u53C2\u8003\u751F\u6210 4\uFF5E15 \u79D2\u89C6\u9891\uFF0C\u652F\u6301\u6700\u9AD8 4K \u8F93\u51FA\u3002",
27857
27784
  kind: "video",
27858
27785
  family: "Seedance",
@@ -28461,7 +28388,7 @@ var video_generated_default = [
28461
28388
  id: "bytedance/byteplus-seedance-2-0-fast",
28462
28389
  contractVersion: 2,
28463
28390
  developer: "bytedance",
28464
- displayName: "BytePlus Seedance 2.0 Fast",
28391
+ displayName: "Seedance 2.0 Fast",
28465
28392
  summary: "BytePlus Seedance 2.0 Fast\uFF0C\u652F\u6301\u6587\u672C\u3001\u56FE\u7247\u3001\u89C6\u9891\u548C\u97F3\u9891\u53C2\u8003\uFF0C\u751F\u6210 4\uFF5E15 \u79D2\u89C6\u9891\uFF0C\u6700\u9AD8 720p\u3002",
28466
28393
  kind: "video",
28467
28394
  family: "Seedance Fast",
@@ -29090,7 +29017,7 @@ var video_generated_default = [
29090
29017
  id: "bytedance/byteplus-seedance-2-0-mini",
29091
29018
  contractVersion: 2,
29092
29019
  developer: "bytedance",
29093
- displayName: "BytePlus Seedance 2.0 Mini",
29020
+ displayName: "Seedance 2.0 Mini",
29094
29021
  summary: "BytePlus Seedance 2.0 Mini\uFF0C\u652F\u6301\u6587\u672C\u3001\u56FE\u7247\u3001\u89C6\u9891\u548C\u97F3\u9891\u53C2\u8003\uFF0C\u751F\u6210 4\uFF5E15 \u79D2\u89C6\u9891\uFF0C\u6700\u9AD8 720p\u3002",
29095
29022
  kind: "video",
29096
29023
  family: "Seedance Mini",
@@ -33214,7 +33141,7 @@ var video_generated_default = [
33214
33141
  id: "google/veo-3-1-fast",
33215
33142
  contractVersion: 1,
33216
33143
  developer: "google",
33217
- displayName: "API Mart Veo 3.1 Fast",
33144
+ displayName: "Veo 3.1 Fast",
33218
33145
  summary: "Generate an eight-second Veo 3.1 Fast video through API Mart from text, first/last frames, or up to three reference images at up to 4K.",
33219
33146
  kind: "video",
33220
33147
  family: "Veo Fast",
@@ -34128,7 +34055,7 @@ var video_generated_default = [
34128
34055
  endpoints: []
34129
34056
  },
34130
34057
  {
34131
- id: "google/veo-3-1-generate-001",
34058
+ id: "google/veo-3.1-generate-001",
34132
34059
  contractVersion: 1,
34133
34060
  developer: "google",
34134
34061
  displayName: "Veo 3.1",
@@ -34136,9 +34063,7 @@ var video_generated_default = [
34136
34063
  kind: "video",
34137
34064
  family: "Veo",
34138
34065
  versionLabel: "3.1",
34139
- aliases: [
34140
- "veo"
34141
- ],
34066
+ aliases: [],
34142
34067
  capabilities: {
34143
34068
  inputModalities: [
34144
34069
  "text",
@@ -34671,7 +34596,7 @@ var video_generated_default = [
34671
34596
  endpoints: []
34672
34597
  },
34673
34598
  {
34674
- id: "google/veo-3-1-lite-generate-001",
34599
+ id: "google/veo-3.1-lite-generate-001",
34675
34600
  contractVersion: 1,
34676
34601
  developer: "google",
34677
34602
  displayName: "Veo 3.1 Lite",
@@ -34679,9 +34604,7 @@ var video_generated_default = [
34679
34604
  kind: "video",
34680
34605
  family: "Veo Lite",
34681
34606
  versionLabel: "3.1",
34682
- aliases: [
34683
- "veo-lite"
34684
- ],
34607
+ aliases: [],
34685
34608
  capabilities: {
34686
34609
  inputModalities: [
34687
34610
  "text",
@@ -37036,7 +36959,7 @@ var video_generated_default = [
37036
36959
  endpoints: []
37037
36960
  },
37038
36961
  {
37039
- id: "minimax/minimax-h3",
36962
+ id: "minimax/MiniMax-H3",
37040
36963
  contractVersion: 1,
37041
36964
  developer: "minimax",
37042
36965
  displayName: "MiniMax H3",
@@ -37044,9 +36967,7 @@ var video_generated_default = [
37044
36967
  kind: "video",
37045
36968
  family: "MiniMax H3",
37046
36969
  versionLabel: "H3",
37047
- aliases: [
37048
- "minimax-h3"
37049
- ],
36970
+ aliases: [],
37050
36971
  capabilities: {
37051
36972
  inputModalities: [
37052
36973
  "text",
@@ -38990,7 +38911,7 @@ var video_generated_default = [
38990
38911
  id: "xai/grok-imagine-video",
38991
38912
  contractVersion: 2,
38992
38913
  developer: "xai",
38993
- displayName: "grok-imagine-video",
38914
+ displayName: "Grok Imagine Video",
38994
38915
  summary: "Generate, edit, or extend video from text, image, or video input with 1\u201315 second output at 480p or 720p.",
38995
38916
  kind: "video",
38996
38917
  family: "Grok Video",
@@ -39618,7 +39539,7 @@ var video_generated_default = [
39618
39539
  id: "xai/grok-imagine-video-1.5",
39619
39540
  contractVersion: 1,
39620
39541
  developer: "xai",
39621
- displayName: "grok-imagine-video-1.5",
39542
+ displayName: "Grok Imagine Video 1.5",
39622
39543
  summary: "Generate video from text, first and last frames, up to four timed keyframes, up to seven reference images, or up to three preset voices. Supports 1\u201315 seconds and up to 1080p; reference-to-video is capped at 720p.",
39623
39544
  kind: "video",
39624
39545
  family: "Grok Video",
@@ -40191,7 +40112,7 @@ var video_generated_default = [
40191
40112
  endpoints: []
40192
40113
  },
40193
40114
  {
40194
- id: "alibaba/wan-3-0",
40115
+ id: "alibaba/wan3.0-video",
40195
40116
  contractVersion: 2,
40196
40117
  developer: "alibaba",
40197
40118
  displayName: "Wan 3.0 Video",
@@ -40199,12 +40120,7 @@ var video_generated_default = [
40199
40120
  kind: "video",
40200
40121
  family: "Wan Video",
40201
40122
  versionLabel: "3.0",
40202
- aliases: [
40203
- "aliyun/wan-3-0",
40204
- "wan-3-0",
40205
- "wan3",
40206
- "wan3.0-video"
40207
- ],
40123
+ aliases: [],
40208
40124
  capabilities: {
40209
40125
  inputModalities: [
40210
40126
  "text",
@@ -41114,7 +41030,7 @@ var NexraWaitTimeoutError = class extends Error {
41114
41030
  };
41115
41031
 
41116
41032
  // src/generated/version.generated.ts
41117
- var SDK_VERSION = "0.1.0-alpha.27";
41033
+ var SDK_VERSION = "0.1.0-alpha.28";
41118
41034
 
41119
41035
  // src/transport.ts
41120
41036
  var DEFAULT_BASE_URL = "https://api.nexra-ai.com/v1";
@@ -41236,6 +41152,83 @@ async function waitForRetry(response, attempt, signal) {
41236
41152
  await sleep(Number.isFinite(seconds) ? seconds * 1e3 : 200 * 2 ** attempt, signal);
41237
41153
  }
41238
41154
 
41155
+ // src/sse.ts
41156
+ async function* parseServerSentEvents(response) {
41157
+ if (!response.body) throw new Error("SSE response did not contain a body");
41158
+ const reader = response.body.getReader();
41159
+ const decoder = new TextDecoder();
41160
+ let buffer = "";
41161
+ let current = emptyEvent();
41162
+ try {
41163
+ while (true) {
41164
+ const { value, done } = await reader.read();
41165
+ buffer += decoder.decode(value, { stream: !done });
41166
+ const lines = buffer.split(/\r?\n/);
41167
+ buffer = done ? "" : lines.pop() ?? "";
41168
+ for (const line of lines) {
41169
+ if (line === "") {
41170
+ const event = buildEvent(current);
41171
+ current = emptyEvent();
41172
+ if (event) yield event;
41173
+ continue;
41174
+ }
41175
+ if (line.startsWith(":")) continue;
41176
+ const separator = line.indexOf(":");
41177
+ const field2 = separator === -1 ? line : line.slice(0, separator);
41178
+ let content = separator === -1 ? "" : line.slice(separator + 1);
41179
+ if (content.startsWith(" ")) content = content.slice(1);
41180
+ if (field2 === "data") current.data.push(content);
41181
+ else if (field2 === "event") current.event = content;
41182
+ else if (field2 === "id") current.id = content;
41183
+ else if (field2 === "retry") current.retry = Number(content);
41184
+ }
41185
+ if (done) {
41186
+ const event = buildEvent(current);
41187
+ if (event) yield event;
41188
+ return;
41189
+ }
41190
+ }
41191
+ } finally {
41192
+ await reader.cancel().catch(() => void 0);
41193
+ reader.releaseLock();
41194
+ }
41195
+ }
41196
+ function emptyEvent() {
41197
+ return { data: [] };
41198
+ }
41199
+ function buildEvent(pending) {
41200
+ if (pending.data.length === 0) return void 0;
41201
+ return {
41202
+ id: pending.id,
41203
+ event: pending.event,
41204
+ retry: Number.isFinite(pending.retry) ? pending.retry : void 0,
41205
+ data: pending.data.join("\n")
41206
+ };
41207
+ }
41208
+
41209
+ // src/model-display-name.ts
41210
+ var canonicalTokens = /* @__PURE__ */ new Map([
41211
+ ["deepseek", "DeepSeek"],
41212
+ ["elevenlabs", "ElevenLabs"],
41213
+ ["gpt", "GPT"],
41214
+ ["happyhorse", "HappyHorse"],
41215
+ ["hd", "HD"],
41216
+ ["heygen", "HeyGen"],
41217
+ ["int8", "INT8"],
41218
+ ["minimax", "MiniMax"],
41219
+ ["pixverse", "PixVerse"],
41220
+ ["tts", "TTS"]
41221
+ ]);
41222
+ var displayNameOverrides = /* @__PURE__ */ new Map([
41223
+ ["wan-2-7-image-pro", "Wan 2.7 Image Pro"]
41224
+ ]);
41225
+ function formatModelDisplayName(displayName) {
41226
+ const name = displayName.trim();
41227
+ const override = displayNameOverrides.get(name.toLowerCase());
41228
+ if (override) return override;
41229
+ return name.replace(/[-_\u2010-\u2015\u2212]+/g, " ").split(/\s+/).filter(Boolean).map((token) => canonicalTokens.get(token.toLowerCase()) ?? token.charAt(0).toUpperCase() + token.slice(1)).join(" ");
41230
+ }
41231
+
41239
41232
  // src/catalog/index.ts
41240
41233
  var modelSpecs = deepFreeze(structuredClone(generatedCatalog));
41241
41234
  var byIdentifier = /* @__PURE__ */ new Map();
@@ -41250,6 +41243,30 @@ var CatalogClient = class {
41250
41243
  this.transport = transport;
41251
41244
  }
41252
41245
  transport;
41246
+ changes(params = {}, signal) {
41247
+ return this.transport.json(`/catalog/changes${queryString({ ...params })}`, { signal });
41248
+ }
41249
+ async model(modelId, operation, signal) {
41250
+ const state = await this.transport.json(
41251
+ `/catalog/models/${encodeURIComponent(modelId)}${queryString({ operation })}`,
41252
+ { signal }
41253
+ );
41254
+ return state.displayName === void 0 ? state : { ...state, displayName: formatModelDisplayName(state.displayName) };
41255
+ }
41256
+ async *events(options = {}) {
41257
+ const response = await this.transport.response(`/catalog/events${queryString({ after: options.after })}`, {
41258
+ headers: { accept: "text/event-stream" },
41259
+ signal: options.signal
41260
+ });
41261
+ for await (const event of parseServerSentEvents(response)) {
41262
+ if (event.event !== "catalog.quote-context.changed") continue;
41263
+ const page = JSON.parse(event.data);
41264
+ if (!page || !/^\d+$/.test(page.revision) || !Number.isFinite(Date.parse(page.changedAt)) || !Array.isArray(page.data) || page.data.some((entry) => !entry || typeof entry.modelId !== "string" || !entry.modelId || typeof entry.operation !== "string" || !entry.operation || !/^\d+$/.test(entry.revision) || BigInt(entry.revision) > BigInt(page.revision) || typeof entry.available !== "boolean")) {
41265
+ throw new Error("Catalog event payload is invalid");
41266
+ }
41267
+ yield page;
41268
+ }
41269
+ }
41253
41270
  listPrices(signal) {
41254
41271
  return this.transport.json(
41255
41272
  "/catalog/prices",
@@ -41314,6 +41331,8 @@ export {
41314
41331
  decodeMediaGeometry,
41315
41332
  applyMediaGeometry,
41316
41333
  applyNoWatermark,
41334
+ parseServerSentEvents,
41335
+ formatModelDisplayName,
41317
41336
  CatalogClient,
41318
41337
  getModelSpec,
41319
41338
  listModelSpecs
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  export { a as AssetImportRequest, b as AssetInput, A as AssetReference, c as AssetUploadOptions, M as MEDIA_KINDS, d as MediaAsset, e as MediaAssetStatus, f as MediaKind } from './assets-dUJMQNJD.js';
2
- import { H as HttpTransport, q as ModelSearchParams, T as TaskModelSummary, r as TaskModel, s as ModelSchema, t as ModelResourceList, u as NexraClientOptions } from './media-geometry-B7ip-nrA.js';
3
- export { b as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, g as MediaGeometryProjection, v as ModelCapabilitySummary, w as ModelDateVersion, x as ModelEndpointSummary, y as ModelModality, z as ModelResourceOption, h as NexraBillingCurrency, d as NexraCatalogRevision, c as NexraDisplayQuoteBatch, A as NexraDisplayQuoteBatchEntry, j as NexraModelOperation, e as NexraModelSpec, f as NexraModelSpecFilter, a as NexraQuote, k as NexraSalePrice, N as NexraSalePriceList, l as NexraSettlement, U as UnifiedMediaGeometry, m as applyMediaGeometry, n as decodeMediaGeometry, o as encodeMediaGeometry, p as projectMediaGeometry } from './media-geometry-B7ip-nrA.js';
2
+ import { H as HttpTransport, u as ModelSearchParams, T as TaskModelSummary, v as TaskModel, w as ModelSchema, x as ModelResourceList, y as NexraClientOptions } from './media-geometry-BoxkWQlj.js';
3
+ export { e as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, j as MediaGeometryProjection, z as ModelCapabilitySummary, A as ModelDateVersion, B as ModelEndpointSummary, D as ModelModality, E as ModelResourceOption, k as NexraBillingCurrency, g as NexraCatalogRevision, f as NexraDisplayQuoteBatch, G as NexraDisplayQuoteBatchEntry, n as NexraModelOperation, h as NexraModelSpec, i as NexraModelSpecFilter, d as NexraQuote, o as NexraSalePrice, c as NexraSalePriceList, p as NexraSettlement, U as UnifiedMediaGeometry, q as applyMediaGeometry, r as decodeMediaGeometry, s as encodeMediaGeometry, t as projectMediaGeometry } from './media-geometry-BoxkWQlj.js';
4
4
  import { C as CursorPage, a as JsonValue } from './json-Drjj1OKl.js';
5
5
  export { J as JsonObject, b as JsonPrimitive } from './json-Drjj1OKl.js';
6
- import { V as Voice, C as CreateVoiceRequest, a as VoiceCreation, A as AssetsClient, T as TasksClient, R as RunTaskOptions, b as RunResult, c as ApiErrorPayload, d as TaskResult } from './types-CGOhwG87.js';
7
- export { e as CreateTaskOptions, f as CreateTaskRequest, g as RequestDetails, h as TASK_STATUSES, i as Task, j as TaskCost, k as TaskError, l as TaskEvent, m as TaskEventType, n as TaskListParams, o as TaskPage, p as TaskProgress, q as TaskReceipt, r as TaskStatus, s as TaskTiming, t as TaskUsage, u as TaskWebhookConfig, v as TerminalTaskStatus, w as VerifyWebhookOptions, W as WaitTaskOptions, x as WatchTaskOptions, y as isTerminalTaskStatus, z as verifyWebhook } from './types-CGOhwG87.js';
6
+ import { V as Voice, C as CreateVoiceRequest, a as VoiceCreation, A as AssetsClient, T as TasksClient, R as RunTaskOptions, b as RunResult, c as ApiErrorPayload, d as TaskResult } from './types-BYmoc0n8.js';
7
+ export { e as CreateTaskOptions, f as CreateTaskRequest, g as RequestDetails, h as TASK_STATUSES, i as Task, j as TaskCost, k as TaskError, l as TaskEvent, m as TaskEventType, n as TaskListParams, o as TaskPage, p as TaskProgress, q as TaskReceipt, r as TaskStatus, s as TaskTiming, t as TaskUsage, u as TaskWebhookConfig, v as TerminalTaskStatus, w as VerifyWebhookOptions, W as WaitTaskOptions, x as WatchTaskOptions, y as isTerminalTaskStatus, z as verifyWebhook } from './types-BYmoc0n8.js';
8
8
  import { CatalogClient } from './catalog.js';
9
- export { getModelSpec, listModelSpecs } from './catalog.js';
9
+ export { formatModelDisplayName, getModelSpec, listModelSpecs } from './catalog.js';
10
10
  export { ceilDecimal, multiplyDecimal } from './decimal.js';
11
11
 
12
12
  declare class ModelsClient {
package/dist/index.js CHANGED
@@ -8,13 +8,15 @@ import {
8
8
  applyNoWatermark,
9
9
  decodeMediaGeometry,
10
10
  encodeMediaGeometry,
11
+ formatModelDisplayName,
11
12
  getModelSpec,
12
13
  jsonBody,
13
14
  listModelSpecs,
15
+ parseServerSentEvents,
14
16
  projectMediaGeometry,
15
17
  queryString,
16
18
  sleep
17
- } from "./chunk-N622DGTD.js";
19
+ } from "./chunk-ECF5MLSM.js";
18
20
  import {
19
21
  ceilDecimal,
20
22
  multiplyDecimal
@@ -24,7 +26,7 @@ import {
24
26
  TASK_STATUSES,
25
27
  createTaskRequest,
26
28
  isTerminalTaskStatus
27
- } from "./chunk-YQXMWTSV.js";
29
+ } from "./chunk-IEBCNRT4.js";
28
30
 
29
31
  // src/assets.ts
30
32
  var AssetsClient = class {
@@ -133,13 +135,16 @@ function isFile(value) {
133
135
  }
134
136
 
135
137
  // src/models.ts
138
+ function withModelDisplayName(model) {
139
+ return { ...model, displayName: formatModelDisplayName(model.displayName) };
140
+ }
136
141
  var ModelsClient = class {
137
142
  constructor(transport) {
138
143
  this.transport = transport;
139
144
  }
140
145
  transport;
141
- search(params = {}, signal) {
142
- return this.transport.json(
146
+ async search(params = {}, signal) {
147
+ const page = await this.transport.json(
143
148
  `/models${queryString({
144
149
  q: params.query,
145
150
  modality: params.modality,
@@ -150,11 +155,16 @@ var ModelsClient = class {
150
155
  })}`,
151
156
  { signal }
152
157
  );
158
+ return { ...page, data: page.data.map(withModelDisplayName) };
153
159
  }
154
- get(model, signal) {
155
- return this.transport.json(`/models/${encodeURIComponent(model)}`, {
160
+ async get(model, signal) {
161
+ const detail = await this.transport.json(`/models/${encodeURIComponent(model)}`, {
156
162
  signal
157
163
  });
164
+ return {
165
+ ...withModelDisplayName(detail),
166
+ ...detail.familyVersions ? { familyVersions: detail.familyVersions.map(withModelDisplayName) } : {}
167
+ };
158
168
  }
159
169
  schema(model, signal) {
160
170
  return this.transport.json(
@@ -255,55 +265,6 @@ function isMediaAsset(value) {
255
265
  return isPlainObject(value) && typeof value.id === "string" && typeof value.kind === "string" && typeof value.status === "string" && typeof value.source === "string";
256
266
  }
257
267
 
258
- // src/sse.ts
259
- async function* parseServerSentEvents(response) {
260
- if (!response.body) throw new Error("SSE response did not contain a body");
261
- const reader = response.body.getReader();
262
- const decoder = new TextDecoder();
263
- let buffer = "";
264
- let current = emptyEvent();
265
- while (true) {
266
- const { value, done } = await reader.read();
267
- buffer += decoder.decode(value, { stream: !done });
268
- const lines = buffer.split(/\r?\n/);
269
- buffer = done ? "" : lines.pop() ?? "";
270
- for (const line of lines) {
271
- if (line === "") {
272
- const event = buildEvent(current);
273
- current = emptyEvent();
274
- if (event) yield event;
275
- continue;
276
- }
277
- if (line.startsWith(":")) continue;
278
- const separator = line.indexOf(":");
279
- const field = separator === -1 ? line : line.slice(0, separator);
280
- let content = separator === -1 ? "" : line.slice(separator + 1);
281
- if (content.startsWith(" ")) content = content.slice(1);
282
- if (field === "data") current.data.push(content);
283
- else if (field === "event") current.event = content;
284
- else if (field === "id") current.id = content;
285
- else if (field === "retry") current.retry = Number(content);
286
- }
287
- if (done) {
288
- const event = buildEvent(current);
289
- if (event) yield event;
290
- return;
291
- }
292
- }
293
- }
294
- function emptyEvent() {
295
- return { data: [] };
296
- }
297
- function buildEvent(pending) {
298
- if (pending.data.length === 0) return void 0;
299
- return {
300
- id: pending.id,
301
- event: pending.event,
302
- retry: Number.isFinite(pending.retry) ? pending.retry : void 0,
303
- data: pending.data.join("\n")
304
- };
305
- }
306
-
307
268
  // src/tasks.ts
308
269
  var TasksClient = class {
309
270
  constructor(transport, assets) {
@@ -539,6 +500,7 @@ export {
539
500
  createNexra,
540
501
  decodeMediaGeometry,
541
502
  encodeMediaGeometry,
503
+ formatModelDisplayName,
542
504
  getModelSpec,
543
505
  isTerminalTaskStatus,
544
506
  listModelSpecs,
@@ -217,8 +217,16 @@ interface NexraSalePrice {
217
217
  priceRevision: string;
218
218
  effectiveFrom: string;
219
219
  rule: PriceRule;
220
+ displayEstimates?: readonly Readonly<{
221
+ parameters: JsonObject;
222
+ inputImageCounts: readonly number[];
223
+ amount: string;
224
+ maximumAmount: string;
225
+ }>[];
226
+ displayEstimatesValidUntil?: string;
220
227
  }
221
228
  interface NexraSalePriceList {
229
+ quoteContextRevision?: string;
222
230
  currency: NexraBillingCurrency;
223
231
  prices: readonly NexraSalePrice[];
224
232
  }
@@ -272,6 +280,27 @@ interface NexraCatalogRevision {
272
280
  revision: string;
273
281
  changedAt: string;
274
282
  }
283
+ interface NexraCatalogModelIdentity {
284
+ modelId: string;
285
+ operation: string;
286
+ revision: string;
287
+ available: boolean;
288
+ }
289
+ interface NexraCatalogChangeParams {
290
+ after?: string;
291
+ upper?: string;
292
+ cursor?: string;
293
+ limit?: number;
294
+ }
295
+ interface NexraCatalogChangePage extends NexraCatalogRevision {
296
+ data: readonly NexraCatalogModelIdentity[];
297
+ nextCursor?: string;
298
+ }
299
+ interface NexraCatalogModelState extends NexraCatalogModelIdentity {
300
+ displayName?: string;
301
+ inputSchema?: JsonObject;
302
+ prices: readonly NexraSalePrice[];
303
+ }
275
304
  interface NexraSettlement {
276
305
  amount: string;
277
306
  currency: NexraBillingCurrency;
@@ -329,4 +358,4 @@ declare function decodeMediaGeometry(_inputSchema: JsonObject, input: JsonObject
329
358
  /** Normalize the SDK convenience alias `ratio` without producing Native fields. */
330
359
  declare function applyMediaGeometry(inputSchema: JsonObject, input: JsonObject): JsonObject;
331
360
 
332
- export { type NexraDisplayQuoteBatchEntry as A, type CreateNexraQuoteRequest as C, type FetchLike as F, HttpTransport as H, type MediaGeometryField as M, type NexraSalePriceList as N, type TaskModelSummary as T, type UnifiedMediaGeometry as U, type NexraQuote as a, type CreateNexraDisplayQuoteBatchRequest as b, type NexraDisplayQuoteBatch as c, type NexraCatalogRevision as d, type NexraModelSpec as e, type NexraModelSpecFilter as f, type MediaGeometryProjection as g, type NexraBillingCurrency as h, type NexraModelEndpointSpec as i, type NexraModelOperation as j, type NexraSalePrice as k, type NexraSettlement as l, applyMediaGeometry as m, decodeMediaGeometry as n, encodeMediaGeometry as o, projectMediaGeometry as p, type ModelSearchParams as q, type TaskModel as r, type ModelSchema as s, type ModelResourceList as t, type NexraClientOptions as u, type ModelCapabilitySummary as v, type ModelDateVersion as w, type ModelEndpointSummary as x, type ModelModality as y, type ModelResourceOption as z };
361
+ export { type ModelDateVersion as A, type ModelEndpointSummary as B, type CreateNexraQuoteRequest as C, type ModelModality as D, type ModelResourceOption as E, type FetchLike as F, type NexraDisplayQuoteBatchEntry as G, HttpTransport as H, type MediaGeometryField as M, type NexraCatalogChangeParams as N, type TaskModelSummary as T, type UnifiedMediaGeometry as U, type NexraCatalogChangePage as a, type NexraCatalogModelState as b, type NexraSalePriceList as c, type NexraQuote as d, type CreateNexraDisplayQuoteBatchRequest as e, type NexraDisplayQuoteBatch as f, type NexraCatalogRevision as g, type NexraModelSpec as h, type NexraModelSpecFilter as i, type MediaGeometryProjection as j, type NexraBillingCurrency as k, type NexraCatalogModelIdentity as l, type NexraModelEndpointSpec as m, type NexraModelOperation as n, type NexraSalePrice as o, type NexraSettlement as p, applyMediaGeometry as q, decodeMediaGeometry as r, encodeMediaGeometry as s, projectMediaGeometry as t, type ModelSearchParams as u, type TaskModel as v, type ModelSchema as w, type ModelResourceList as x, type NexraClientOptions as y, type ModelCapabilitySummary as z };
package/dist/media.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  nexraMediaInputSchema,
11
11
  nexraMediaInputSchemaForMode,
12
12
  nexraMediaOperationForMode
13
- } from "./chunk-YQXMWTSV.js";
13
+ } from "./chunk-IEBCNRT4.js";
14
14
  export {
15
15
  NEXRA_GENERATION_OPERATIONS,
16
16
  NEXRA_MEDIA_API_VERSION,
@@ -1,5 +1,5 @@
1
1
  import { d as MediaAsset, c as AssetUploadOptions, a as AssetImportRequest, g as AssetCertificationRequest, h as AssetCertification, i as AssetCertificationWaitOptions } from './assets-dUJMQNJD.js';
2
- import { l as NexraSettlement, H as HttpTransport } from './media-geometry-B7ip-nrA.js';
2
+ import { p as NexraSettlement, H as HttpTransport } from './media-geometry-BoxkWQlj.js';
3
3
  import { J as JsonObject, a as JsonValue, C as CursorPage } from './json-Drjj1OKl.js';
4
4
 
5
5
  interface ApiErrorPayload {
@@ -66,6 +66,13 @@ interface TaskTiming {
66
66
  /** Background persistence elapsed time from first response to durable asset readiness. */
67
67
  persistMs?: number | null;
68
68
  totalMs: number | null;
69
+ /** Incident-only estimate of service readiness; actual public response remains in totalMs. */
70
+ correction?: {
71
+ incidentId: string;
72
+ outputReadyAt: string;
73
+ serviceReadyMs: number;
74
+ deploymentDelayMs: number;
75
+ };
69
76
  startSource: "client" | "server";
70
77
  /** Server clock reading taken when this snapshot was built; lets clients anchor live timers to server time. */
71
78
  observedAt?: string;
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { a as AssetImportRequest, b as AssetInput, A as AssetReference, c as AssetUploadOptions, d as MediaAsset, e as MediaAssetStatus, f as MediaKind } from './assets-dUJMQNJD.js';
2
- export { b as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, g as MediaGeometryProjection, v as ModelCapabilitySummary, w as ModelDateVersion, x as ModelEndpointSummary, y as ModelModality, t as ModelResourceList, z as ModelResourceOption, s as ModelSchema, q as ModelSearchParams, h as NexraBillingCurrency, d as NexraCatalogRevision, u as NexraClientOptions, c as NexraDisplayQuoteBatch, A as NexraDisplayQuoteBatchEntry, j as NexraModelOperation, e as NexraModelSpec, f as NexraModelSpecFilter, a as NexraQuote, k as NexraSalePrice, N as NexraSalePriceList, l as NexraSettlement, r as TaskModel, T as TaskModelSummary, U as UnifiedMediaGeometry } from './media-geometry-B7ip-nrA.js';
2
+ export { e as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, j as MediaGeometryProjection, z as ModelCapabilitySummary, A as ModelDateVersion, B as ModelEndpointSummary, D as ModelModality, x as ModelResourceList, E as ModelResourceOption, w as ModelSchema, u as ModelSearchParams, k as NexraBillingCurrency, g as NexraCatalogRevision, y as NexraClientOptions, f as NexraDisplayQuoteBatch, G as NexraDisplayQuoteBatchEntry, n as NexraModelOperation, h as NexraModelSpec, i as NexraModelSpecFilter, d as NexraQuote, o as NexraSalePrice, c as NexraSalePriceList, p as NexraSettlement, v as TaskModel, T as TaskModelSummary, U as UnifiedMediaGeometry } from './media-geometry-BoxkWQlj.js';
3
3
  export { C as CursorPage, J as JsonObject, b as JsonPrimitive, a as JsonValue } from './json-Drjj1OKl.js';
4
- export { c as ApiErrorPayload, e as CreateTaskOptions, f as CreateTaskRequest, C as CreateVoiceRequest, g as RequestDetails, b as RunResult, R as RunTaskOptions, i as Task, j as TaskCost, k as TaskError, l as TaskEvent, m as TaskEventType, n as TaskListParams, o as TaskPage, p as TaskProgress, q as TaskReceipt, d as TaskResult, r as TaskStatus, s as TaskTiming, t as TaskUsage, u as TaskWebhookConfig, v as TerminalTaskStatus, w as VerifyWebhookOptions, V as Voice, a as VoiceCreation, W as WaitTaskOptions, x as WatchTaskOptions } from './types-CGOhwG87.js';
4
+ export { c as ApiErrorPayload, e as CreateTaskOptions, f as CreateTaskRequest, C as CreateVoiceRequest, g as RequestDetails, b as RunResult, R as RunTaskOptions, i as Task, j as TaskCost, k as TaskError, l as TaskEvent, m as TaskEventType, n as TaskListParams, o as TaskPage, p as TaskProgress, q as TaskReceipt, d as TaskResult, r as TaskStatus, s as TaskTiming, t as TaskUsage, u as TaskWebhookConfig, v as TerminalTaskStatus, w as VerifyWebhookOptions, V as Voice, a as VoiceCreation, W as WaitTaskOptions, x as WatchTaskOptions } from './types-BYmoc0n8.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byte_fluffy/nexra-sdk",
3
- "version": "0.1.0-alpha.27",
3
+ "version": "0.1.0-alpha.28",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "sideEffects": false,
File without changes