@byte_fluffy/nexra-sdk 0.1.0-alpha.5 → 0.1.0-alpha.50

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,343 @@
1
+ import { a as JsonObject } from './json-Cz0MkWQn.js';
2
+
3
+ declare const MEDIA_KINDS: readonly ["image", "video", "audio", "document", "archive", "other"];
4
+ type MediaKind = (typeof MEDIA_KINDS)[number];
5
+ type MediaAssetStatus = "pending" | "ready" | "failed" | "deleted";
6
+ interface MediaAsset {
7
+ id: string;
8
+ kind: MediaKind;
9
+ status: MediaAssetStatus;
10
+ source: "upload" | "generated" | "provider" | "imported";
11
+ name?: string;
12
+ mimeType?: string;
13
+ sizeBytes?: number;
14
+ width?: number;
15
+ height?: number;
16
+ durationMs?: number;
17
+ checksumSha256?: string;
18
+ url?: string;
19
+ downloadUrl?: string;
20
+ expiresAt?: string;
21
+ metadata?: JsonObject;
22
+ createdAt: string;
23
+ }
24
+ interface AssetReference {
25
+ assetId: string;
26
+ }
27
+ type AssetInput = AssetReference | Blob | File | MediaAsset | string | URL;
28
+ interface AssetUploadOptions {
29
+ kind?: MediaKind;
30
+ name?: string;
31
+ signal?: AbortSignal;
32
+ }
33
+ interface AssetImportRequest {
34
+ url: string;
35
+ kind?: MediaKind;
36
+ name?: string;
37
+ }
38
+ type AssetCertificationProvider = "seedance";
39
+ type AssetCertificationStatus = "processing" | "ready" | "failed";
40
+ interface AssetCertification {
41
+ assetId: string;
42
+ provider: AssetCertificationProvider;
43
+ status: AssetCertificationStatus;
44
+ providerAssetId?: string;
45
+ assetUri?: string;
46
+ groupId?: string;
47
+ library: "general" | "liveness";
48
+ error?: string;
49
+ createdAt: string;
50
+ updatedAt: string;
51
+ }
52
+ interface AssetCertificationRequest {
53
+ library?: "general" | "liveness";
54
+ }
55
+ interface AssetCertificationWaitOptions {
56
+ pollIntervalMs?: number;
57
+ timeoutMs?: number;
58
+ signal?: AbortSignal;
59
+ }
60
+
61
+ declare const NEXRA_MEDIA_API_VERSION: 1;
62
+ /** Catalog-level generation taxonomy. Text keeps its native endpoint protocols. */
63
+ declare const NEXRA_GENERATION_OPERATIONS: readonly ["text.generate", "image.generate", "video.generate", "audio.generate", "audio.transcribe", "image.upscale", "video.upscale", "video.depth", "video.segment"];
64
+ type NexraGenerationOperation = (typeof NEXRA_GENERATION_OPERATIONS)[number];
65
+ declare const NEXRA_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "audio.transcribe", "image.upscale", "video.upscale", "video.depth", "video.segment"];
66
+ type NexraMediaOperation = (typeof NEXRA_MEDIA_OPERATIONS)[number];
67
+ declare const NEXRA_PUBLISHED_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "audio.transcribe", "image.upscale", "video.upscale", "video.depth", "video.segment"];
68
+ type NexraPublishedMediaOperation = (typeof NEXRA_PUBLISHED_MEDIA_OPERATIONS)[number];
69
+ declare const NEXRA_MEDIA_FEATURES: readonly ["text-to-image", "image-to-image", "image-reference", "image-edit", "image-inpaint", "image-control", "text-to-video", "first-frame", "first-last-frame", "image-to-video", "video-to-video", "audio-to-video", "avatar-video", "reference-image", "reference-video", "reference-audio", "omni-reference", "asr", "tts", "music", "sfx", "voice-reference", "voice-design", "scale-factor", "target-resolution", "video-depth", "video-segment"];
70
+ type NexraMediaFeature = (typeof NEXRA_MEDIA_FEATURES)[number];
71
+ /** JSON wire locator. SDK-only Blob/File support is normalized into one of these forms. */
72
+ type NexraMediaSource = string | AssetReference;
73
+ type NexraTextRole = "prompt" | "negative_prompt" | "script" | "lyrics";
74
+ type NexraImageRole = "source" | "reference" | "first_frame" | "middle_frame" | "last_frame" | "mask" | "control" | "subject" | "background";
75
+ type NexraVideoRole = "source" | "reference" | "edit" | "extend";
76
+ type NexraAudioRole = "source" | "reference" | "voice_reference";
77
+ type NexraTextContentPart = Readonly<{
78
+ type: "text";
79
+ text: string;
80
+ role?: NexraTextRole;
81
+ }>;
82
+ type NexraImageContentPart = Readonly<{
83
+ type: "image";
84
+ source: NexraMediaSource;
85
+ role?: NexraImageRole;
86
+ /** Stable prompt reference name for models that address media as `@name`. */
87
+ name?: string;
88
+ }>;
89
+ /** An image pinned inside a generated video; only models declaring this role accept it. */
90
+ type NexraVideoKeyframeContentPart = Readonly<{
91
+ type: "image";
92
+ source: NexraMediaSource;
93
+ role: "keyframe";
94
+ /** Position in seconds, strictly inside the generated clip. */
95
+ timestamp: number;
96
+ }>;
97
+ type NexraVideoContentPart = Readonly<{
98
+ type: "video";
99
+ source: NexraMediaSource;
100
+ role?: NexraVideoRole;
101
+ name?: string;
102
+ }>;
103
+ type NexraAudioContentPart = Readonly<{
104
+ type: "audio";
105
+ source: NexraMediaSource;
106
+ role?: NexraAudioRole;
107
+ }>;
108
+ type NexraResourceContentPart = Readonly<{
109
+ type: "resource";
110
+ resource: "element" | "voice";
111
+ source: string;
112
+ name: string;
113
+ }>;
114
+ type NexraMediaContentPart = NexraResourceContentPart | NexraTextContentPart | NexraImageContentPart | NexraVideoContentPart | NexraAudioContentPart;
115
+ type NexraDraftContentPart = Readonly<{
116
+ type: "draft_task";
117
+ draft_task: Readonly<{
118
+ id: string;
119
+ }>;
120
+ }>;
121
+ type NexraImageGenerateInput = Readonly<{
122
+ content: readonly (NexraTextContentPart | NexraImageContentPart)[];
123
+ output_mode?: "image" | "layers";
124
+ prompt_optimization?: "standard" | "fast";
125
+ aspect_ratio?: string;
126
+ resolution?: string;
127
+ quality?: string;
128
+ count?: number;
129
+ output_format?: string;
130
+ seed?: number;
131
+ }>;
132
+ type NexraImageLayer = Readonly<{
133
+ image_index: number;
134
+ z_index: number;
135
+ size: string;
136
+ name?: string;
137
+ description?: string;
138
+ output_format?: string;
139
+ bounding_box?: Readonly<{
140
+ absolute: readonly [number, number, number, number];
141
+ normalized: readonly [number, number, number, number];
142
+ }>;
143
+ }>;
144
+ type NexraImageLayerDecompositionOutput = Readonly<{
145
+ images: readonly string[];
146
+ layer_decomposition: Readonly<{
147
+ layers: readonly NexraImageLayer[];
148
+ }>;
149
+ }>;
150
+ type NexraVideoGenerateInput = Readonly<{
151
+ content: readonly (NexraMediaContentPart | NexraDraftContentPart | NexraVideoKeyframeContentPart)[];
152
+ task_type?: string;
153
+ draft?: boolean;
154
+ /** Explicit no-watermark value, only on models whose contract declares it. */
155
+ watermark?: false;
156
+ /** Optional preset or cloned voice used by talking-avatar video models. */
157
+ voice?: string;
158
+ aspect_ratio?: string;
159
+ resolution?: string;
160
+ quality?: string;
161
+ duration?: number;
162
+ fit?: "contain" | "cover";
163
+ title?: string;
164
+ generate_audio?: boolean;
165
+ output_format?: string;
166
+ seed?: number;
167
+ }>;
168
+ type NexraAudioGenerateInput = Readonly<{
169
+ content: readonly (NexraTextContentPart | NexraAudioContentPart)[];
170
+ voice?: string;
171
+ language?: string;
172
+ duration?: number;
173
+ output_format?: string;
174
+ sample_rate?: number;
175
+ speed?: number;
176
+ volume?: number;
177
+ pitch?: number;
178
+ emotion?: string;
179
+ instrumental?: boolean;
180
+ loop?: boolean;
181
+ prompt_influence?: number;
182
+ seed?: number;
183
+ }>;
184
+ type NexraAudioTranscribeInput = Readonly<{
185
+ content: readonly [NexraAudioContentPart];
186
+ language?: string;
187
+ input_format: string;
188
+ punctuate?: boolean;
189
+ diarize?: boolean;
190
+ timestamps?: boolean;
191
+ }>;
192
+ type NexraImageUpscaleInput = Readonly<{
193
+ content: readonly [NexraImageContentPart];
194
+ enable_hdr?: boolean;
195
+ enable_wb?: boolean;
196
+ scale?: number;
197
+ resolution?: string;
198
+ output_format?: string;
199
+ preserve_details?: boolean;
200
+ }>;
201
+ type NexraVideoUpscaleInput = Readonly<{
202
+ source_duration: number;
203
+ config?: string;
204
+ scale?: number;
205
+ resolution?: string;
206
+ output_format?: string;
207
+ preserve_details?: boolean;
208
+ }> & (Readonly<{
209
+ content: readonly [NexraVideoContentPart];
210
+ vid?: never;
211
+ }> | Readonly<{
212
+ vid: string;
213
+ content?: never;
214
+ }>);
215
+ type NexraVideoDepthInput = Readonly<{
216
+ content: readonly [NexraVideoContentPart];
217
+ resolution?: string;
218
+ }>;
219
+ type NexraVideoSegmentInput = Readonly<{
220
+ content: readonly [NexraVideoContentPart, NexraTextContentPart] | readonly [NexraTextContentPart, NexraVideoContentPart];
221
+ resolution?: string;
222
+ }>;
223
+ type NexraMediaInputByOperation = Readonly<{
224
+ "image.generate": NexraImageGenerateInput;
225
+ "video.generate": NexraVideoGenerateInput;
226
+ "audio.generate": NexraAudioGenerateInput;
227
+ "audio.transcribe": NexraAudioTranscribeInput;
228
+ "image.upscale": NexraImageUpscaleInput;
229
+ "video.upscale": NexraVideoUpscaleInput;
230
+ "video.depth": NexraVideoDepthInput;
231
+ "video.segment": NexraVideoSegmentInput;
232
+ }>;
233
+ type NexraMediaKind = "image" | "video" | "audio";
234
+ type NexraMediaInputSlot = Readonly<{
235
+ mediaKind: NexraMediaKind;
236
+ role: string;
237
+ min?: number;
238
+ max: number;
239
+ maxBytes?: number;
240
+ minDurationSeconds?: number;
241
+ maxDurationSeconds?: number;
242
+ }>;
243
+ type NexraMediaInputMode = Readonly<{
244
+ id: string;
245
+ slots: readonly NexraMediaInputSlot[];
246
+ }>;
247
+ type NexraMediaParameterValue = string | number | boolean;
248
+ type NexraMediaParameter = Readonly<{
249
+ key: string;
250
+ label?: string;
251
+ }> & (Readonly<{
252
+ kind: "enum";
253
+ options: readonly NexraMediaParameterValue[];
254
+ default: NexraMediaParameterValue;
255
+ allowCustom?: boolean;
256
+ }> | Readonly<{
257
+ kind: "range";
258
+ min: number;
259
+ max: number;
260
+ step: number;
261
+ default: number;
262
+ autoValue?: number;
263
+ unit?: string;
264
+ }> | Readonly<{
265
+ kind: "toggle";
266
+ default: boolean;
267
+ }> | Readonly<{
268
+ kind: "resource";
269
+ resource: "voice";
270
+ default?: string;
271
+ allowCustom?: boolean;
272
+ }>);
273
+ type NexraMediaParameterConstraint = Readonly<{
274
+ when: Readonly<Record<string, NexraMediaParameterValue | readonly NexraMediaParameterValue[]>>;
275
+ parameter: string;
276
+ allowedValues?: readonly NexraMediaParameterValue[];
277
+ fixedValue?: NexraMediaParameterValue;
278
+ disabled?: boolean;
279
+ }>;
280
+ type NexraMediaOperationDefinition = Readonly<{
281
+ operation: NexraMediaOperation;
282
+ status: "active" | "hold";
283
+ outputKind: NexraMediaKind | "text";
284
+ features: readonly NexraMediaFeature[];
285
+ parameterKeys: readonly string[];
286
+ }>;
287
+ declare const NEXRA_MEDIA_OPERATION_DEFINITIONS: readonly [{
288
+ readonly operation: "image.generate";
289
+ readonly status: "active";
290
+ readonly outputKind: "image";
291
+ readonly features: readonly ["text-to-image", "image-to-image", "image-reference", "image-edit", "image-inpaint", "image-control"];
292
+ readonly parameterKeys: readonly ["aspect_ratio", "resolution", "quality", "count", "output_format", "seed", "output_mode", "prompt_optimization"];
293
+ }, {
294
+ readonly operation: "video.generate";
295
+ readonly status: "active";
296
+ readonly outputKind: "video";
297
+ readonly features: readonly ["text-to-video", "first-frame", "first-last-frame", "image-to-video", "video-to-video", "audio-to-video", "avatar-video", "reference-image", "reference-video", "reference-audio", "omni-reference"];
298
+ readonly parameterKeys: readonly ["voice", "aspect_ratio", "resolution", "quality", "duration", "fit", "title", "generate_audio", "output_format", "seed", "watermark"];
299
+ }, {
300
+ readonly operation: "audio.generate";
301
+ readonly status: "active";
302
+ readonly outputKind: "audio";
303
+ readonly features: readonly ["tts", "music", "sfx", "voice-reference", "voice-design"];
304
+ readonly parameterKeys: readonly ["voice", "language", "duration", "output_format", "sample_rate", "speed", "volume", "pitch", "emotion", "instrumental", "loop", "prompt_influence", "seed"];
305
+ }, {
306
+ readonly operation: "audio.transcribe";
307
+ readonly status: "active";
308
+ readonly outputKind: "text";
309
+ readonly features: readonly ["asr"];
310
+ readonly parameterKeys: readonly ["input_format", "language", "punctuate", "diarize", "timestamps"];
311
+ }, {
312
+ readonly operation: "image.upscale";
313
+ readonly status: "active";
314
+ readonly outputKind: "image";
315
+ readonly features: readonly ["scale-factor", "target-resolution"];
316
+ readonly parameterKeys: readonly ["scale", "resolution", "output_format", "preserve_details"];
317
+ }, {
318
+ readonly operation: "video.upscale";
319
+ readonly status: "active";
320
+ readonly outputKind: "video";
321
+ readonly features: readonly ["scale-factor", "target-resolution"];
322
+ readonly parameterKeys: readonly ["scale", "resolution", "output_format", "preserve_details"];
323
+ }, {
324
+ readonly operation: "video.depth";
325
+ readonly status: "active";
326
+ readonly outputKind: "video";
327
+ readonly features: readonly ["video-depth"];
328
+ readonly parameterKeys: readonly ["resolution"];
329
+ }, {
330
+ readonly operation: "video.segment";
331
+ readonly status: "active";
332
+ readonly outputKind: "video";
333
+ readonly features: readonly ["video-segment"];
334
+ readonly parameterKeys: readonly ["resolution"];
335
+ }];
336
+ declare const NEXRA_MEDIA_INPUT_SCHEMAS: Readonly<Record<NexraPublishedMediaOperation, JsonObject>>;
337
+ declare function nexraMediaInputSchema(operation: NexraMediaOperation): JsonObject | undefined;
338
+ declare function isNexraMediaInput(value: unknown): value is JsonObject;
339
+ declare function nexraMediaOperationForMode(mode: string): NexraPublishedMediaOperation | undefined;
340
+ /** Narrow the shared category vocabulary for one Experience Center input mode. */
341
+ declare function nexraMediaInputSchemaForMode(mode: string): JsonObject | undefined;
342
+
343
+ export { type AssetImportRequest as A, type NexraMediaInputByOperation as B, type NexraMediaInputMode as C, type NexraMediaInputSlot as D, type NexraMediaKind as E, type NexraMediaOperation as F, type NexraMediaOperationDefinition as G, type NexraMediaParameter as H, type NexraMediaParameterConstraint as I, type NexraMediaSource as J, type NexraPublishedMediaOperation as K, type NexraResourceContentPart as L, MEDIA_KINDS as M, type NexraImageLayer as N, type NexraTextContentPart as O, type NexraVideoContentPart as P, type NexraVideoDepthInput as Q, type NexraVideoGenerateInput as R, type NexraVideoKeyframeContentPart as S, type NexraVideoUpscaleInput as T, isNexraMediaInput as U, nexraMediaInputSchema as V, nexraMediaInputSchemaForMode as W, nexraMediaOperationForMode as X, type AssetInput as a, type AssetReference as b, type AssetUploadOptions as c, type MediaAsset as d, type MediaAssetStatus as e, type MediaKind as f, type NexraImageLayerDecompositionOutput as g, type AssetCertificationRequest as h, type AssetCertification as i, type AssetCertificationWaitOptions as j, NEXRA_GENERATION_OPERATIONS as k, NEXRA_MEDIA_API_VERSION as l, NEXRA_MEDIA_FEATURES as m, NEXRA_MEDIA_INPUT_SCHEMAS as n, NEXRA_MEDIA_OPERATIONS as o, NEXRA_MEDIA_OPERATION_DEFINITIONS as p, NEXRA_PUBLISHED_MEDIA_OPERATIONS as q, type NexraAudioContentPart as r, type NexraAudioGenerateInput as s, type NexraAudioTranscribeInput as t, type NexraGenerationOperation as u, type NexraImageContentPart as v, type NexraImageGenerateInput as w, type NexraImageUpscaleInput as x, type NexraMediaContentPart as y, type NexraMediaFeature as z };
@@ -1,37 +1,7 @@
1
- type JsonPrimitive = boolean | number | string | null;
2
- type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
3
- interface JsonObject {
4
- [key: string]: JsonValue;
5
- }
6
- interface CursorPage<T> {
7
- data: T[];
8
- nextCursor?: string;
9
- }
1
+ import { b as JsonPrimitive, a as JsonObject, J as JsonValue } from './json-Cz0MkWQn.js';
10
2
 
11
3
  declare const BILLING_METRICS: readonly ["requests", "input_tokens", "cached_input_tokens", "cache_write_tokens", "cache_creation_5m_input_tokens", "cache_creation_1h_input_tokens", "cache_read_input_tokens", "output_tokens", "input_characters", "input_utf8_bytes", "input_images", "output_images", "input_audio_seconds", "output_audio_seconds", "input_video_seconds", "output_video_seconds", "provider_credits", "web_search_requests"];
12
4
  type BillingMetric = (typeof BILLING_METRICS)[number];
13
- declare const BILLING_EXPORT_DIMENSIONS: readonly ["resolution", "duration", "layer_decomposition", "with_audio", "has_input_video", "hd", "prompt_extend", "modality", "tier", "quality", "image_count", "input_token_tier", "input_modality", "service_tier", "inference_geo", "speed", "region_scope", "has_reference_image", "mode"];
14
- type UsageComponentEvidence = {
15
- source: "provider_native" | "request_derived" | "response_derived" | "tariff_equivalent" | "unknown";
16
- paths?: string[];
17
- calculation?: string;
18
- };
19
- interface MeteredUsageComponent {
20
- metric: BillingMetric;
21
- quantity: number;
22
- dimensions?: Record<string, JsonPrimitive>;
23
- evidence?: UsageComponentEvidence;
24
- }
25
- /**
26
- * Provider evidence is normalized into independent metered components instead
27
- * of one canonical model response. This keeps protocol conversion separate
28
- * from billing and allows one request to carry differently-dimensioned usage.
29
- */
30
- interface NormalizedUsageV1 {
31
- schemaVersion: 1;
32
- components: MeteredUsageComponent[];
33
- billingEvidenceComplete?: boolean;
34
- }
35
5
  interface MeteredPriceRate {
36
6
  metric: BillingMetric;
37
7
  unitSize: number;
@@ -46,42 +16,8 @@ interface MeteredPriceRuleV1 {
46
16
  rates: MeteredPriceRate[];
47
17
  }
48
18
  type PriceRule = MeteredPriceRuleV1;
49
- interface PriceEvaluationLine {
50
- evidence?: UsageComponentEvidence;
51
- metric: BillingMetric;
52
- quantity: number;
53
- unitSize: number;
54
- unitPrice: string;
55
- rounding: "proportional" | "ceil";
56
- includedQuantity: number;
57
- dimensions?: Record<string, JsonPrimitive>;
58
- amount: string;
59
- discountedAmount?: string;
60
- }
61
- /** Preserve frozen row order when distributing the eight-decimal remainder. */
62
- declare function allocateDiscountedPriceLines(lines: readonly PriceEvaluationLine[], saleAmount: string): PriceEvaluationLine[];
63
- interface PriceEvaluationIssue {
64
- code: "dimension_mismatch" | "ambiguous_rate" | "missing_usage";
65
- metric: BillingMetric;
66
- componentIndex: number;
67
- }
68
- interface PriceEvaluation {
69
- status: "rated" | "incomplete";
70
- amount: string;
71
- lines: PriceEvaluationLine[];
72
- issues: PriceEvaluationIssue[];
73
- }
74
- declare function validateNormalizedUsage(value: unknown): asserts value is NormalizedUsageV1;
75
- /**
76
- * Deterministically rates normalized usage without mutating wallets or billing
77
- * records. Amounts are rounded half-up to the database's eight-decimal money
78
- * scale per line; ceil rates round usage units before multiplying the price.
79
- */
80
- declare function evaluatePriceRule(ruleValue: unknown, usageValue: unknown): PriceEvaluation;
81
- declare function validatePriceRule(value: unknown): asserts value is PriceRule;
82
19
 
83
20
  type MeteringKind = "token" | "non_token" | "mixed";
84
- type UsageEvidenceStatus = "complete" | "partial" | "missing" | "invalid" | "not_expected";
85
21
  interface MeteringContract {
86
22
  schemaVersion: 1;
87
23
  kind: MeteringKind;
@@ -91,19 +27,33 @@ interface MeteringContract {
91
27
  whenFeature?: string;
92
28
  }>;
93
29
  }
94
- interface UsageEvidenceAssessment {
95
- kind: MeteringKind | "unknown";
96
- evidenceStatus: UsageEvidenceStatus;
97
- expectedMetrics: BillingMetric[];
98
- observedMetrics: BillingMetric[];
99
- missingMetrics: BillingMetric[];
100
- issues: string[];
101
- }
102
- declare function validateMeteringContract(value: unknown): asserts value is MeteringContract;
103
- /** Evidence completeness is independent of sale/cost prices and delivery success. */
104
- declare function assessUsageEvidence(contract: unknown, usage: unknown, features?: Readonly<Record<string, boolean>>): UsageEvidenceAssessment;
105
30
 
106
31
  type ModelModality = "language" | "embedding" | "reranker" | "image" | "video" | "audio" | "world" | "multimodal" | "other";
32
+ /** A concrete operation of a code-owned endpoint contract, shared by API and UI. */
33
+ type ModelHttpOperation = Readonly<{
34
+ key: string;
35
+ transport?: "http" | "websocket";
36
+ kind: "request" | "create" | "query" | "cancel" | "delete" | "stream" | "generate" | "edit";
37
+ httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
38
+ pathTemplate: string;
39
+ documentationUrl?: string;
40
+ schemaProjection: "request" | "bearer-request" | "managed-task-create" | "managed-task-query" | "managed-task-cancel" | "native-task-create" | "native-task-query" | "native-task-delete";
41
+ responseStatus?: number;
42
+ idempotencyKey?: boolean;
43
+ queryParameters?: Readonly<JsonObject>;
44
+ headerParameters?: Readonly<JsonObject>;
45
+ pathParameters?: Readonly<JsonObject>;
46
+ /** Operation-specific body; binary fields describe multipart file parts. */
47
+ bodyParameters?: Readonly<JsonObject>;
48
+ /** Initial JSON configuration carried by a WebSocket message, not a GET body. */
49
+ messageParameters?: Readonly<JsonObject>;
50
+ responseBody?: Readonly<JsonObject>;
51
+ requestBody?: Readonly<{
52
+ properties: readonly string[];
53
+ required: readonly string[];
54
+ oneOfRequired?: readonly (readonly string[])[];
55
+ }>;
56
+ }>;
107
57
  interface ModelEndpointSummary {
108
58
  key: string;
109
59
  label: string;
@@ -114,6 +64,8 @@ interface ModelEndpointSummary {
114
64
  capabilities: string[];
115
65
  /** Task execution of this native endpoint, not a second model parameter definition. */
116
66
  sourceEndpointKey?: string | null;
67
+ documentationUrl?: string;
68
+ httpOperations?: readonly ModelHttpOperation[];
117
69
  }
118
70
  interface ModelCapabilitySummary {
119
71
  inputModalities: string[];
@@ -121,6 +73,10 @@ interface ModelCapabilitySummary {
121
73
  /** User-facing input patterns such as text-to-video or image-to-image. */
122
74
  inputModes: string[];
123
75
  features: string[];
76
+ /** Maximum combined input and output context supported by the model. */
77
+ contextWindowTokens?: number;
78
+ /** Maximum generated output tokens supported by the model. */
79
+ maxOutputTokens?: number;
124
80
  }
125
81
  interface ModelDateVersion {
126
82
  id: string;
@@ -156,6 +112,8 @@ interface TaskModelSummary {
156
112
  }
157
113
  interface TaskModel extends TaskModelSummary {
158
114
  description?: string;
115
+ /** Code-owned contracts for documentation; endpoints remains executable supply only. */
116
+ documentedEndpoints?: ModelEndpointSummary[];
159
117
  regions: string[];
160
118
  metadata?: JsonObject;
161
119
  /** Public list and customer-facing sale prices. Channel costs are never exposed here. */
@@ -181,6 +139,8 @@ interface TaskModel extends TaskModelSummary {
181
139
  interface ModelSchema {
182
140
  model: string;
183
141
  version: number;
142
+ /** Contract owner for the returned schema. Defaults to nexra for older servers. */
143
+ contract?: "nexra" | "native";
184
144
  dialect: "https://json-schema.org/draft/2020-12/schema" | string;
185
145
  inputSchema: JsonObject;
186
146
  outputSchema: JsonObject;
@@ -228,6 +188,18 @@ interface NexraModelOperation {
228
188
  outputSchema: JsonObject;
229
189
  metering: MeteringContract;
230
190
  }
191
+ /** Public native wire endpoint metadata. Provider routing and credentials stay private. */
192
+ interface NexraModelEndpointSpec {
193
+ endpointKey: string;
194
+ operation: string;
195
+ protocol: string;
196
+ method: string;
197
+ path: string;
198
+ capabilities: readonly string[];
199
+ inputSchema?: JsonObject;
200
+ outputSchema?: JsonObject;
201
+ httpOperations?: readonly ModelHttpOperation[];
202
+ }
231
203
  interface NexraModelSpec {
232
204
  id: string;
233
205
  contractVersion: number;
@@ -240,6 +212,7 @@ interface NexraModelSpec {
240
212
  aliases: readonly string[];
241
213
  capabilities: ModelCapabilitySummary;
242
214
  operations: readonly NexraModelOperation[];
215
+ endpoints: readonly NexraModelEndpointSpec[];
243
216
  }
244
217
  interface NexraModelSpecFilter {
245
218
  kind?: ModelModality;
@@ -252,12 +225,32 @@ interface NexraSalePrice {
252
225
  priceRevision: string;
253
226
  effectiveFrom: string;
254
227
  rule: PriceRule;
228
+ displayEstimates?: readonly Readonly<{
229
+ parameters: JsonObject;
230
+ inputImageCounts: readonly number[];
231
+ amount: string;
232
+ maximumAmount: string;
233
+ }>[];
234
+ displayEstimatesValidUntil?: string;
235
+ }
236
+ interface NexraSalePriceList {
237
+ quoteContextRevision?: string;
238
+ currency: NexraBillingCurrency;
239
+ prices: readonly NexraSalePrice[];
255
240
  }
256
241
  interface CreateNexraQuoteRequest {
257
242
  modelId: string;
258
243
  operation: string;
259
244
  input: JsonObject;
260
245
  }
246
+ interface CreateNexraDisplayQuoteBatchRequest {
247
+ modelId: string;
248
+ operation: string;
249
+ entries: readonly Readonly<{
250
+ key: string;
251
+ input: JsonObject;
252
+ }>[];
253
+ }
261
254
  interface NexraQuote {
262
255
  quoteToken: string;
263
256
  modelId: string;
@@ -269,6 +262,53 @@ interface NexraQuote {
269
262
  accuracy: "exact" | "estimated";
270
263
  expiresAt: string;
271
264
  }
265
+ type NexraDisplayQuoteBatchEntry = Readonly<{
266
+ key: string;
267
+ amount: string;
268
+ maximumAmount: string;
269
+ accuracy: "exact" | "estimated";
270
+ }> | Readonly<{
271
+ key: string;
272
+ error: {
273
+ code: string;
274
+ message: string;
275
+ };
276
+ }>;
277
+ interface NexraDisplayQuoteBatch {
278
+ modelId: string;
279
+ contractVersion: number;
280
+ priceRevision: string;
281
+ pricingPolicyRevision: string;
282
+ quoteContextRevision: string;
283
+ currency: NexraBillingCurrency;
284
+ entries: readonly NexraDisplayQuoteBatchEntry[];
285
+ expiresAt: string;
286
+ }
287
+ interface NexraCatalogRevision {
288
+ revision: string;
289
+ changedAt: string;
290
+ }
291
+ interface NexraCatalogModelIdentity {
292
+ modelId: string;
293
+ operation: string;
294
+ revision: string;
295
+ available: boolean;
296
+ }
297
+ interface NexraCatalogChangeParams {
298
+ after?: string;
299
+ upper?: string;
300
+ cursor?: string;
301
+ limit?: number;
302
+ }
303
+ interface NexraCatalogChangePage extends NexraCatalogRevision {
304
+ data: readonly NexraCatalogModelIdentity[];
305
+ nextCursor?: string;
306
+ }
307
+ interface NexraCatalogModelState extends NexraCatalogModelIdentity {
308
+ displayName?: string;
309
+ inputSchema?: JsonObject;
310
+ prices: readonly NexraSalePrice[];
311
+ }
272
312
  interface NexraSettlement {
273
313
  amount: string;
274
314
  currency: NexraBillingCurrency;
@@ -298,11 +338,8 @@ declare class HttpTransport {
298
338
  json<T>(path: string, init?: RequestInit, options?: RequestOptions): Promise<T>;
299
339
  response(path: string, init?: RequestInit, options?: RequestOptions): Promise<Response>;
300
340
  }
301
- declare function jsonBody(value: unknown): Pick<RequestInit, "body" | "headers">;
302
- declare function queryString(values: Record<string, string | number | undefined>): string;
303
- declare function sleep(milliseconds: number, signal?: AbortSignal | null): Promise<void>;
304
341
 
305
- /** Unified canvas vocabulary: resolution 1K/2K/4K, ratio X:X. */
342
+ /** UI-friendly view of Nexra's canonical geometry fields. */
306
343
  type UnifiedMediaGeometry = {
307
344
  resolution?: string;
308
345
  ratio?: string;
@@ -310,35 +347,23 @@ type UnifiedMediaGeometry = {
310
347
  };
311
348
  type MediaGeometryField = {
312
349
  field: string;
313
- nest?: string;
314
350
  options: readonly string[];
315
351
  default?: string;
316
352
  optionLabels: Readonly<Record<string, string>>;
317
353
  };
318
354
  type MediaGeometryProjection = {
319
- kind: "pixel-size" | "tier-size" | "resolution-ratio" | "ratio-only" | "none";
355
+ kind: "resolution-ratio" | "ratio-only" | "none";
320
356
  resolution?: MediaGeometryField;
321
357
  ratio?: MediaGeometryField;
322
358
  quality?: MediaGeometryField;
323
359
  };
324
- /** Schema → unified resolution/ratio/quality controls for app UIs. */
360
+ /** Read controls from the Nexra contract. It never exposes provider-native size fields. */
325
361
  declare function projectMediaGeometry(inputSchema: JsonObject): MediaGeometryProjection;
326
- /** Unified geometry → the model's native catalog fields (channel original params). */
362
+ /** UI geometry aliases → canonical Nexra request fields. */
327
363
  declare function encodeMediaGeometry(inputSchema: JsonObject, geometry: UnifiedMediaGeometry): JsonObject;
328
- /** Native catalog fields → unified resolution/ratio/quality. */
329
- declare function decodeMediaGeometry(inputSchema: JsonObject, nativeInput: JsonObject): UnifiedMediaGeometry;
330
- /**
331
- * Rewrite a Task/quote body: unified keys become native catalog fields.
332
- * Native size/ratio already present is left alone (existing callers keep working).
333
- */
364
+ /** Canonical Nexra request fields → UI geometry aliases. */
365
+ declare function decodeMediaGeometry(_inputSchema: JsonObject, input: JsonObject): UnifiedMediaGeometry;
366
+ /** Normalize the SDK convenience alias `ratio` without producing Native fields. */
334
367
  declare function applyMediaGeometry(inputSchema: JsonObject, input: JsonObject): JsonObject;
335
368
 
336
- declare class CatalogClient {
337
- private readonly transport;
338
- constructor(transport: HttpTransport);
339
- quote(request: CreateNexraQuoteRequest, signal?: AbortSignal): Promise<NexraQuote>;
340
- }
341
- declare function getModelSpec(modelId: string): NexraModelSpec | undefined;
342
- declare function listModelSpecs(filter?: NexraModelSpecFilter): readonly NexraModelSpec[];
343
-
344
- export { listModelSpecs as $, type NexraQuote as A, type BillingMetric as B, type CursorPage as C, type NexraSalePrice as D, type NormalizedUsageV1 as E, type FetchLike as F, type PriceEvaluationIssue as G, HttpTransport as H, type PriceEvaluationLine as I, type JsonObject as J, type PriceRule as K, type UsageComponentEvidence as L, type ModelSchema as M, type NexraSettlement as N, type UsageEvidenceAssessment as O, type PriceEvaluation as P, type UsageEvidenceStatus as Q, allocateDiscountedPriceLines as R, applyMediaGeometry as S, type TaskModelSummary as T, type UnifiedMediaGeometry as U, assessUsageEvidence as V, decodeMediaGeometry as W, encodeMediaGeometry as X, evaluatePriceRule as Y, getModelSpec as Z, jsonBody as _, type JsonValue as a, projectMediaGeometry as a0, queryString as a1, sleep as a2, validateMeteringContract as a3, validateNormalizedUsage as a4, validatePriceRule as a5, type ModelSearchParams as b, type TaskModel as c, CatalogClient as d, type NexraClientOptions as e, BILLING_EXPORT_DIMENSIONS as f, BILLING_METRICS as g, type CreateNexraQuoteRequest as h, type JsonPrimitive as i, type MediaGeometryField as j, type MediaGeometryProjection as k, type MeteredPriceRate as l, type MeteredPriceRuleV1 as m, type MeteredUsageComponent as n, type MeteringContract as o, type MeteringKind as p, type ModelCapabilitySummary as q, type ModelDateVersion as r, type ModelEndpointSummary as s, type ModelModality as t, type ModelResourceList as u, type ModelResourceOption as v, type NexraBillingCurrency as w, type NexraModelOperation as x, type NexraModelSpec as y, type NexraModelSpecFilter as z };
369
+ 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 NexraModelEndpointSpec as i, type NexraModelSpecFilter as j, type MediaGeometryProjection as k, type NexraBillingCurrency as l, type NexraCatalogModelIdentity 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 };
@@ -0,0 +1,2 @@
1
+ export { k as NEXRA_GENERATION_OPERATIONS, l as NEXRA_MEDIA_API_VERSION, m as NEXRA_MEDIA_FEATURES, n as NEXRA_MEDIA_INPUT_SCHEMAS, o as NEXRA_MEDIA_OPERATIONS, p as NEXRA_MEDIA_OPERATION_DEFINITIONS, q as NEXRA_PUBLISHED_MEDIA_OPERATIONS, r as NexraAudioContentPart, s as NexraAudioGenerateInput, t as NexraAudioTranscribeInput, u as NexraGenerationOperation, v as NexraImageContentPart, w as NexraImageGenerateInput, N as NexraImageLayer, g as NexraImageLayerDecompositionOutput, x as NexraImageUpscaleInput, y as NexraMediaContentPart, z as NexraMediaFeature, B as NexraMediaInputByOperation, C as NexraMediaInputMode, D as NexraMediaInputSlot, E as NexraMediaKind, F as NexraMediaOperation, G as NexraMediaOperationDefinition, H as NexraMediaParameter, I as NexraMediaParameterConstraint, J as NexraMediaSource, K as NexraPublishedMediaOperation, L as NexraResourceContentPart, O as NexraTextContentPart, P as NexraVideoContentPart, Q as NexraVideoDepthInput, R as NexraVideoGenerateInput, S as NexraVideoKeyframeContentPart, T as NexraVideoUpscaleInput, U as isNexraMediaInput, V as nexraMediaInputSchema, W as nexraMediaInputSchemaForMode, X as nexraMediaOperationForMode } from './media-DzOxLGs-.js';
2
+ import './json-Cz0MkWQn.js';