@byte_fluffy/nexra-sdk 0.1.0-alpha.21 → 0.1.0-alpha.22

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.
@@ -1,386 +0,0 @@
1
- // ../contracts/src/assets.ts
2
- var MEDIA_KINDS = [
3
- "image",
4
- "video",
5
- "audio",
6
- "document",
7
- "archive",
8
- "other"
9
- ];
10
-
11
- // ../contracts/src/media-api.ts
12
- var NEXRA_MEDIA_API_VERSION = 1;
13
- var NEXRA_GENERATION_OPERATIONS = [
14
- "text.generate",
15
- "image.generate",
16
- "video.generate",
17
- "audio.generate",
18
- "image.upscale",
19
- "video.upscale"
20
- ];
21
- var NEXRA_MEDIA_OPERATIONS = [
22
- "image.generate",
23
- "video.generate",
24
- "audio.generate",
25
- "image.upscale",
26
- "video.upscale"
27
- ];
28
- var NEXRA_PUBLISHED_MEDIA_OPERATIONS = [
29
- "image.generate",
30
- "video.generate",
31
- "audio.generate",
32
- "image.upscale"
33
- ];
34
- var NEXRA_MEDIA_FEATURES = [
35
- "text-to-image",
36
- "image-to-image",
37
- "image-reference",
38
- "image-edit",
39
- "image-inpaint",
40
- "image-control",
41
- "text-to-video",
42
- "first-frame",
43
- "first-last-frame",
44
- "image-to-video",
45
- "video-to-video",
46
- "audio-to-video",
47
- "avatar-video",
48
- "reference-image",
49
- "reference-video",
50
- "reference-audio",
51
- "omni-reference",
52
- "tts",
53
- "music",
54
- "sfx",
55
- "voice-reference",
56
- "scale-factor",
57
- "target-resolution"
58
- ];
59
- var NEXRA_MEDIA_OPERATION_DEFINITIONS = Object.freeze([
60
- {
61
- operation: "image.generate",
62
- status: "active",
63
- outputKind: "image",
64
- features: ["text-to-image", "image-to-image", "image-reference", "image-edit", "image-inpaint", "image-control"],
65
- parameterKeys: ["aspect_ratio", "resolution", "quality", "count", "output_format", "seed"]
66
- },
67
- {
68
- operation: "video.generate",
69
- status: "active",
70
- outputKind: "video",
71
- features: ["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"],
72
- parameterKeys: ["voice", "aspect_ratio", "resolution", "quality", "duration", "generate_audio", "output_format", "seed"]
73
- },
74
- {
75
- operation: "audio.generate",
76
- status: "active",
77
- outputKind: "audio",
78
- features: ["tts", "music", "sfx", "voice-reference"],
79
- parameterKeys: ["voice", "language", "duration", "output_format", "sample_rate", "speed", "volume", "pitch", "emotion", "instrumental", "loop", "prompt_influence", "seed"]
80
- },
81
- {
82
- operation: "image.upscale",
83
- status: "active",
84
- outputKind: "image",
85
- features: ["scale-factor", "target-resolution"],
86
- parameterKeys: ["scale", "resolution", "output_format", "preserve_details"]
87
- },
88
- {
89
- operation: "video.upscale",
90
- status: "hold",
91
- outputKind: "video",
92
- features: ["scale-factor", "target-resolution"],
93
- parameterKeys: ["scale", "resolution", "output_format", "preserve_details"]
94
- }
95
- ]);
96
- var mediaSourceSchema = {
97
- oneOf: [
98
- { type: "string", minLength: 1 },
99
- {
100
- type: "object",
101
- properties: { assetId: { type: "string", minLength: 1 } },
102
- required: ["assetId"],
103
- additionalProperties: false
104
- }
105
- ]
106
- };
107
- function textPartSchema(roles) {
108
- return {
109
- type: "object",
110
- properties: {
111
- type: { const: "text" },
112
- text: { type: "string", minLength: 1 },
113
- role: { type: "string", enum: [...roles] }
114
- },
115
- required: ["type", "text"],
116
- additionalProperties: false
117
- };
118
- }
119
- function mediaPartSchema(type, roles) {
120
- return {
121
- type: "object",
122
- properties: {
123
- type: { const: type },
124
- source: structuredClone(mediaSourceSchema),
125
- role: { type: "string", enum: [...roles] },
126
- ...type === "image" ? { name: { type: "string", minLength: 1, maxLength: 64, pattern: "^[^\\s@]+$" } } : {}
127
- },
128
- required: ["type", "source"],
129
- additionalProperties: false
130
- };
131
- }
132
- function inputSchema(contentItems, properties, contentBounds = {}) {
133
- return {
134
- $schema: "https://json-schema.org/draft/2020-12/schema",
135
- type: "object",
136
- properties: {
137
- content: {
138
- type: "array",
139
- minItems: contentBounds.minItems ?? 1,
140
- ...contentBounds.maxItems === void 0 ? {} : { maxItems: contentBounds.maxItems },
141
- items: { oneOf: contentItems.map((item) => structuredClone(item)) },
142
- "x-ui": { control: "content-parts", order: 0 }
143
- },
144
- ...properties
145
- },
146
- required: ["content"],
147
- additionalProperties: false
148
- };
149
- }
150
- var imagePart = mediaPartSchema("image", ["source", "reference", "first_frame", "last_frame", "mask", "control", "subject", "background"]);
151
- var videoPart = mediaPartSchema("video", ["source", "reference", "edit", "extend"]);
152
- var audioPart = mediaPartSchema("audio", ["source", "reference", "voice_reference"]);
153
- var draftPart = {
154
- type: "object",
155
- properties: {
156
- type: { const: "draft_task" },
157
- draft_task: { type: "object", properties: { id: { type: "string", minLength: 1 } }, required: ["id"], additionalProperties: false }
158
- },
159
- required: ["type", "draft_task"],
160
- additionalProperties: false
161
- };
162
- var NEXRA_MEDIA_INPUT_SCHEMAS = Object.freeze({
163
- "image.generate": inputSchema(
164
- [textPartSchema(["prompt", "negative_prompt"]), imagePart],
165
- {
166
- aspect_ratio: { type: "string", minLength: 1, "x-ui": { order: 10 } },
167
- resolution: { type: "string", minLength: 1, "x-ui": { order: 11 } },
168
- quality: { type: "string", minLength: 1, "x-ui": { order: 12 } },
169
- count: { type: "integer", minimum: 1, "x-ui": { order: 13, control: "number" } },
170
- output_format: { type: "string", minLength: 1, "x-ui": { order: 14 } },
171
- seed: { type: "integer", minimum: 0, "x-ui": { order: 15, control: "number" } }
172
- }
173
- ),
174
- "video.generate": inputSchema(
175
- [textPartSchema(["prompt", "negative_prompt", "script"]), imagePart, videoPart, audioPart, draftPart],
176
- {
177
- voice: { type: "string", minLength: 1, "x-ui": { order: 9, control: "resource", resource: "voice" } },
178
- draft: { type: "boolean", "x-ui": { control: "switch" } },
179
- aspect_ratio: { type: "string", minLength: 1, "x-ui": { order: 10 } },
180
- resolution: { type: "string", minLength: 1, "x-ui": { order: 11 } },
181
- quality: { type: "string", minLength: 1, "x-ui": { order: 12 } },
182
- duration: { type: "number", exclusiveMinimum: 0, "x-ui": { order: 13, control: "number" } },
183
- generate_audio: { type: "boolean", "x-ui": { order: 14, control: "switch" } },
184
- output_format: { type: "string", minLength: 1, "x-ui": { order: 15 } },
185
- seed: { type: "integer", minimum: 0, "x-ui": { order: 16, control: "number" } }
186
- }
187
- ),
188
- "audio.generate": inputSchema(
189
- [textPartSchema(["prompt", "script", "lyrics"]), audioPart],
190
- {
191
- voice: { type: "string", minLength: 1, "x-ui": { order: 10, control: "resource", resource: "voice" } },
192
- language: { type: "string", minLength: 1, "x-ui": { order: 11 } },
193
- duration: { type: "number", exclusiveMinimum: 0, "x-ui": { order: 12, control: "number" } },
194
- output_format: { type: "string", minLength: 1, "x-ui": { order: 13 } },
195
- sample_rate: { type: "integer", minimum: 1, "x-ui": { order: 14, control: "number" } },
196
- speed: { type: "number", exclusiveMinimum: 0, "x-ui": { order: 15, control: "number" } },
197
- volume: { type: "number", "x-ui": { order: 16, control: "number" } },
198
- pitch: { type: "number", "x-ui": { order: 17, control: "number" } },
199
- emotion: { type: "string", minLength: 1, "x-ui": { order: 18 } },
200
- instrumental: { type: "boolean", "x-ui": { order: 19, control: "switch" } },
201
- loop: { type: "boolean", "x-ui": { order: 20, control: "switch" } },
202
- prompt_influence: { type: "number", minimum: 0, maximum: 1, "x-ui": { order: 21, control: "number" } },
203
- seed: { type: "integer", minimum: 0, "x-ui": { order: 22, control: "number" } }
204
- }
205
- ),
206
- "image.upscale": inputSchema(
207
- [mediaPartSchema("image", ["source"])],
208
- {
209
- scale: { type: "number", exclusiveMinimum: 1, "x-ui": { order: 10, control: "number" } },
210
- resolution: { type: "string", minLength: 1, "x-ui": { order: 11 } },
211
- output_format: { type: "string", minLength: 1, "x-ui": { order: 12 } },
212
- preserve_details: { type: "boolean", "x-ui": { order: 13, control: "switch" } }
213
- },
214
- { minItems: 1, maxItems: 1 }
215
- )
216
- });
217
- function nexraMediaInputSchema(operation) {
218
- if (!(operation in NEXRA_MEDIA_INPUT_SCHEMAS)) return void 0;
219
- return structuredClone(NEXRA_MEDIA_INPUT_SCHEMAS[operation]);
220
- }
221
- function isNexraMediaInput(value) {
222
- if (!value || typeof value !== "object" || Array.isArray(value)) return false;
223
- const input = value;
224
- if ("model" in input) return false;
225
- const content = input.content;
226
- return Array.isArray(content) && content.length > 0 && content.every((part) => {
227
- if (!part || typeof part !== "object" || Array.isArray(part)) return false;
228
- if (part.type === "text") return typeof part.text === "string" && part.text.length > 0;
229
- if (!["image", "video", "audio"].includes(String(part.type))) return false;
230
- if (typeof part.source === "string") return part.source.length > 0;
231
- return Boolean(part.source && typeof part.source === "object" && !Array.isArray(part.source) && typeof part.source.assetId === "string" && part.source.assetId.length > 0);
232
- });
233
- }
234
- function nexraMediaOperationForMode(mode) {
235
- if (["text-to-image", "image-to-image"].includes(mode)) return "image.generate";
236
- if (["text-to-video", "image-to-video", "multimodal-to-video", "avatar-video"].includes(mode)) return "video.generate";
237
- if (["text-to-speech", "text-to-music", "text-to-sfx"].includes(mode)) return "audio.generate";
238
- if (mode === "image-upscale") return "image.upscale";
239
- return void 0;
240
- }
241
- function nexraMediaInputSchemaForMode(mode) {
242
- const operation = nexraMediaOperationForMode(mode);
243
- const schema = operation ? nexraMediaInputSchema(operation) : void 0;
244
- if (!schema) return void 0;
245
- const properties = schema.properties;
246
- const content = properties.content;
247
- const items = content.items;
248
- const variants = Array.isArray(items.oneOf) ? items.oneOf : [];
249
- if (mode === "avatar-video") {
250
- for (const variant of variants) {
251
- const variantProperties = variant.properties;
252
- if (variantProperties.type.const === "text") {
253
- variantProperties.role = { type: "string", enum: ["script"] };
254
- }
255
- }
256
- }
257
- const allowed = mode === "text-to-image" || mode === "text-to-video" || mode === "text-to-music" || mode === "text-to-sfx" ? /* @__PURE__ */ new Set(["text"]) : mode === "image-to-image" ? /* @__PURE__ */ new Set(["text", "image"]) : mode === "image-to-video" ? /* @__PURE__ */ new Set(["text", "image", "audio"]) : mode === "text-to-speech" ? /* @__PURE__ */ new Set(["text", "audio"]) : /* @__PURE__ */ new Set(["text", "image", "video", "audio"]);
258
- items.oneOf = variants.filter((variant) => allowed.has(String(variant.properties.type.const)));
259
- if (mode === "image-to-video") {
260
- for (const variant of items.oneOf) {
261
- const variantProperties = variant.properties;
262
- if (variantProperties.type.const !== "image") continue;
263
- variantProperties.role = { type: "string", enum: ["first_frame", "last_frame"] };
264
- const required = new Set(Array.isArray(variant.required) ? variant.required.filter((key) => typeof key === "string") : []);
265
- required.add("role");
266
- variant.required = [...required];
267
- }
268
- }
269
- if (mode === "multimodal-to-video") {
270
- for (const variant of items.oneOf) {
271
- const variantProperties = variant.properties;
272
- const type = String(variantProperties.type.const);
273
- if (!["image", "video", "audio"].includes(type)) continue;
274
- variantProperties.role = type === "image" ? { type: "string", enum: ["reference", "subject", "background"] } : type === "video" ? { type: "string", enum: ["reference", "edit", "extend"] } : { type: "string", const: "reference" };
275
- const required = new Set(Array.isArray(variant.required) ? variant.required.filter((key) => typeof key === "string") : []);
276
- required.add("role");
277
- variant.required = [...required];
278
- }
279
- }
280
- const requiredMedia = mode === "image-to-image" || mode === "image-to-video" || mode === "avatar-video" ? "image" : void 0;
281
- const requiresReferenceMedia = mode === "multimodal-to-video";
282
- content.allOf = [
283
- ...mode === "avatar-video" ? [] : [{
284
- contains: { type: "object", properties: { type: { const: "text" } }, required: ["type"] },
285
- minContains: 1
286
- }],
287
- ...requiredMedia ? [{
288
- contains: { type: "object", properties: { type: { const: requiredMedia } }, required: ["type"] },
289
- minContains: 1
290
- }] : [],
291
- ...requiresReferenceMedia ? [{
292
- contains: { type: "object", properties: { type: { enum: ["image", "video", "audio"] } }, required: ["type"] },
293
- minContains: 1
294
- }] : []
295
- ];
296
- if (mode === "text-to-speech") {
297
- properties.voice = { ...properties.voice, "x-ui": { order: 10, control: "resource", resource: "voice" } };
298
- }
299
- const allowedParameters = mode === "avatar-video" ? /* @__PURE__ */ new Set(["content", "voice", "aspect_ratio", "resolution"]) : mode === "text-to-speech" ? /* @__PURE__ */ new Set(["content", "voice", "language", "output_format", "sample_rate", "speed", "volume", "pitch", "emotion"]) : mode === "text-to-music" ? /* @__PURE__ */ new Set(["content", "duration", "output_format", "instrumental", "prompt_influence", "seed"]) : mode === "text-to-sfx" ? /* @__PURE__ */ new Set(["content", "duration", "output_format", "loop", "prompt_influence", "seed"]) : void 0;
300
- if (allowedParameters) {
301
- schema.properties = Object.fromEntries(Object.entries(properties).filter(([key]) => allowedParameters.has(key)));
302
- }
303
- return schema;
304
- }
305
-
306
- // ../contracts/src/tasks.ts
307
- var TASK_STATUSES = [
308
- "queued",
309
- "running",
310
- "succeeded",
311
- "failed",
312
- "cancelling",
313
- "cancelled"
314
- ];
315
- var CREATE_TASK_CONTROL_FIELDS = [
316
- "model",
317
- "callback_url",
318
- "metadata",
319
- "quoteToken",
320
- "submittedAt",
321
- "schemaVersion",
322
- "webhook"
323
- ];
324
- function createTaskRequest(model, input, controls = {}) {
325
- for (const field of [...CREATE_TASK_CONTROL_FIELDS, "input"]) {
326
- if (Object.hasOwn(input, field)) {
327
- throw new Error(`Nexra model parameters cannot use reserved Task field: ${field}`);
328
- }
329
- }
330
- return { model, ...input, ...controls };
331
- }
332
- function isTerminalTaskStatus(status) {
333
- return status === "succeeded" || status === "failed" || status === "cancelled";
334
- }
335
-
336
- // ../contracts/src/ratio-display-order.ts
337
- function parseRatioParts(value) {
338
- const matched = /^\s*(\d+(?:\.\d+)?)\s*:\s*(\d+(?:\.\d+)?)\s*$/.exec(value);
339
- if (!matched) return void 0;
340
- const w = Number(matched[1]);
341
- const h = Number(matched[2]);
342
- return w > 0 && h > 0 ? { w, h } : void 0;
343
- }
344
- function ratioDisplayOrderKey(value) {
345
- const normalized = value.trim();
346
- const parts = parseRatioParts(normalized);
347
- if (!parts) {
348
- const auto = normalized.toLowerCase() === "auto" ? 0 : 1;
349
- return [0, auto, 0, 0, value];
350
- }
351
- if (parts.w === parts.h) return [1, 0, 0, 0, value];
352
- const long = Math.max(parts.w, parts.h);
353
- const short = Math.min(parts.w, parts.h);
354
- const landscape = parts.w > parts.h ? 1 : 0;
355
- return short === 1 ? [3, long, landscape, -short, value] : [2, long, landscape, -short, value];
356
- }
357
- function compareRatioDisplayOrder(a, b) {
358
- const ka = ratioDisplayOrderKey(a);
359
- const kb = ratioDisplayOrderKey(b);
360
- for (let index = 0; index < ka.length; index += 1) {
361
- if (ka[index] !== kb[index]) return ka[index] < kb[index] ? -1 : 1;
362
- }
363
- return 0;
364
- }
365
- function sortRatioDisplayOrder(values) {
366
- return [...values].sort(compareRatioDisplayOrder);
367
- }
368
-
369
- export {
370
- MEDIA_KINDS,
371
- NEXRA_MEDIA_API_VERSION,
372
- NEXRA_GENERATION_OPERATIONS,
373
- NEXRA_MEDIA_OPERATIONS,
374
- NEXRA_PUBLISHED_MEDIA_OPERATIONS,
375
- NEXRA_MEDIA_FEATURES,
376
- NEXRA_MEDIA_OPERATION_DEFINITIONS,
377
- NEXRA_MEDIA_INPUT_SCHEMAS,
378
- nexraMediaInputSchema,
379
- isNexraMediaInput,
380
- nexraMediaOperationForMode,
381
- nexraMediaInputSchemaForMode,
382
- TASK_STATUSES,
383
- createTaskRequest,
384
- isTerminalTaskStatus,
385
- sortRatioDisplayOrder
386
- };
@@ -1,11 +0,0 @@
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
- }
10
-
11
- export type { CursorPage as C, JsonObject as J, JsonValue as a, JsonPrimitive as b };
package/dist/media.d.ts DELETED
@@ -1,200 +0,0 @@
1
- import { A as AssetReference } from './assets-dUJMQNJD.js';
2
- import { J as JsonObject } from './json-Drjj1OKl.js';
3
-
4
- declare const NEXRA_MEDIA_API_VERSION: 1;
5
- /** Catalog-level generation taxonomy. Text keeps its native endpoint protocols. */
6
- declare const NEXRA_GENERATION_OPERATIONS: readonly ["text.generate", "image.generate", "video.generate", "audio.generate", "image.upscale", "video.upscale"];
7
- type NexraGenerationOperation = (typeof NEXRA_GENERATION_OPERATIONS)[number];
8
- declare const NEXRA_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "image.upscale", "video.upscale"];
9
- type NexraMediaOperation = (typeof NEXRA_MEDIA_OPERATIONS)[number];
10
- declare const NEXRA_PUBLISHED_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "image.upscale"];
11
- type NexraPublishedMediaOperation = (typeof NEXRA_PUBLISHED_MEDIA_OPERATIONS)[number];
12
- 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", "tts", "music", "sfx", "voice-reference", "scale-factor", "target-resolution"];
13
- type NexraMediaFeature = (typeof NEXRA_MEDIA_FEATURES)[number];
14
- /** JSON wire locator. SDK-only Blob/File support is normalized into one of these forms. */
15
- type NexraMediaSource = string | AssetReference;
16
- type NexraTextRole = "prompt" | "negative_prompt" | "script" | "lyrics";
17
- type NexraImageRole = "source" | "reference" | "first_frame" | "last_frame" | "mask" | "control" | "subject" | "background";
18
- type NexraVideoRole = "source" | "reference" | "edit" | "extend";
19
- type NexraAudioRole = "source" | "reference" | "voice_reference";
20
- type NexraTextContentPart = Readonly<{
21
- type: "text";
22
- text: string;
23
- role?: NexraTextRole;
24
- }>;
25
- type NexraImageContentPart = Readonly<{
26
- type: "image";
27
- source: NexraMediaSource;
28
- role?: NexraImageRole;
29
- /** Stable prompt reference name for models that address media as `@name`. */
30
- name?: string;
31
- }>;
32
- type NexraVideoContentPart = Readonly<{
33
- type: "video";
34
- source: NexraMediaSource;
35
- role?: NexraVideoRole;
36
- }>;
37
- type NexraAudioContentPart = Readonly<{
38
- type: "audio";
39
- source: NexraMediaSource;
40
- role?: NexraAudioRole;
41
- }>;
42
- type NexraMediaContentPart = NexraTextContentPart | NexraImageContentPart | NexraVideoContentPart | NexraAudioContentPart;
43
- type NexraDraftContentPart = Readonly<{
44
- type: "draft_task";
45
- draft_task: Readonly<{
46
- id: string;
47
- }>;
48
- }>;
49
- type NexraImageGenerateInput = Readonly<{
50
- content: readonly (NexraTextContentPart | NexraImageContentPart)[];
51
- aspect_ratio?: string;
52
- resolution?: string;
53
- quality?: string;
54
- count?: number;
55
- output_format?: string;
56
- seed?: number;
57
- }>;
58
- type NexraVideoGenerateInput = Readonly<{
59
- content: readonly (NexraMediaContentPart | NexraDraftContentPart)[];
60
- draft?: boolean;
61
- /** Optional preset or cloned voice used by talking-avatar video models. */
62
- voice?: string;
63
- aspect_ratio?: string;
64
- resolution?: string;
65
- quality?: string;
66
- duration?: number;
67
- generate_audio?: boolean;
68
- output_format?: string;
69
- seed?: number;
70
- }>;
71
- type NexraAudioGenerateInput = Readonly<{
72
- content: readonly (NexraTextContentPart | NexraAudioContentPart)[];
73
- voice?: string;
74
- language?: string;
75
- duration?: number;
76
- output_format?: string;
77
- sample_rate?: number;
78
- speed?: number;
79
- volume?: number;
80
- pitch?: number;
81
- emotion?: string;
82
- instrumental?: boolean;
83
- loop?: boolean;
84
- prompt_influence?: number;
85
- seed?: number;
86
- }>;
87
- type NexraImageUpscaleInput = Readonly<{
88
- content: readonly [NexraImageContentPart];
89
- scale?: number;
90
- resolution?: string;
91
- output_format?: string;
92
- preserve_details?: boolean;
93
- }>;
94
- type NexraVideoUpscaleInput = Readonly<{
95
- content: readonly [NexraVideoContentPart];
96
- scale?: number;
97
- resolution?: string;
98
- output_format?: string;
99
- preserve_details?: boolean;
100
- }>;
101
- type NexraMediaInputByOperation = Readonly<{
102
- "image.generate": NexraImageGenerateInput;
103
- "video.generate": NexraVideoGenerateInput;
104
- "audio.generate": NexraAudioGenerateInput;
105
- "image.upscale": NexraImageUpscaleInput;
106
- "video.upscale": NexraVideoUpscaleInput;
107
- }>;
108
- type NexraMediaKind = "image" | "video" | "audio";
109
- type NexraMediaInputSlot = Readonly<{
110
- mediaKind: NexraMediaKind;
111
- role: string;
112
- min?: number;
113
- max: number;
114
- maxBytes?: number;
115
- minDurationSeconds?: number;
116
- maxDurationSeconds?: number;
117
- }>;
118
- type NexraMediaInputMode = Readonly<{
119
- id: string;
120
- slots: readonly NexraMediaInputSlot[];
121
- }>;
122
- type NexraMediaParameterValue = string | number | boolean;
123
- type NexraMediaParameter = Readonly<{
124
- key: string;
125
- label?: string;
126
- }> & (Readonly<{
127
- kind: "enum";
128
- options: readonly NexraMediaParameterValue[];
129
- default: NexraMediaParameterValue;
130
- allowCustom?: boolean;
131
- }> | Readonly<{
132
- kind: "range";
133
- min: number;
134
- max: number;
135
- step: number;
136
- default: number;
137
- autoValue?: number;
138
- unit?: string;
139
- }> | Readonly<{
140
- kind: "toggle";
141
- default: boolean;
142
- }> | Readonly<{
143
- kind: "resource";
144
- resource: "voice";
145
- default?: string;
146
- allowCustom?: boolean;
147
- }>);
148
- type NexraMediaParameterConstraint = Readonly<{
149
- when: Readonly<Record<string, NexraMediaParameterValue | readonly NexraMediaParameterValue[]>>;
150
- parameter: string;
151
- allowedValues?: readonly NexraMediaParameterValue[];
152
- fixedValue?: NexraMediaParameterValue;
153
- disabled?: boolean;
154
- }>;
155
- type NexraMediaOperationDefinition = Readonly<{
156
- operation: NexraMediaOperation;
157
- status: "active" | "hold";
158
- outputKind: NexraMediaKind;
159
- features: readonly NexraMediaFeature[];
160
- parameterKeys: readonly string[];
161
- }>;
162
- declare const NEXRA_MEDIA_OPERATION_DEFINITIONS: readonly [{
163
- readonly operation: "image.generate";
164
- readonly status: "active";
165
- readonly outputKind: "image";
166
- readonly features: readonly ["text-to-image", "image-to-image", "image-reference", "image-edit", "image-inpaint", "image-control"];
167
- readonly parameterKeys: readonly ["aspect_ratio", "resolution", "quality", "count", "output_format", "seed"];
168
- }, {
169
- readonly operation: "video.generate";
170
- readonly status: "active";
171
- readonly outputKind: "video";
172
- 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"];
173
- readonly parameterKeys: readonly ["voice", "aspect_ratio", "resolution", "quality", "duration", "generate_audio", "output_format", "seed"];
174
- }, {
175
- readonly operation: "audio.generate";
176
- readonly status: "active";
177
- readonly outputKind: "audio";
178
- readonly features: readonly ["tts", "music", "sfx", "voice-reference"];
179
- readonly parameterKeys: readonly ["voice", "language", "duration", "output_format", "sample_rate", "speed", "volume", "pitch", "emotion", "instrumental", "loop", "prompt_influence", "seed"];
180
- }, {
181
- readonly operation: "image.upscale";
182
- readonly status: "active";
183
- readonly outputKind: "image";
184
- readonly features: readonly ["scale-factor", "target-resolution"];
185
- readonly parameterKeys: readonly ["scale", "resolution", "output_format", "preserve_details"];
186
- }, {
187
- readonly operation: "video.upscale";
188
- readonly status: "hold";
189
- readonly outputKind: "video";
190
- readonly features: readonly ["scale-factor", "target-resolution"];
191
- readonly parameterKeys: readonly ["scale", "resolution", "output_format", "preserve_details"];
192
- }];
193
- declare const NEXRA_MEDIA_INPUT_SCHEMAS: Readonly<Record<NexraPublishedMediaOperation, JsonObject>>;
194
- declare function nexraMediaInputSchema(operation: NexraMediaOperation): JsonObject | undefined;
195
- declare function isNexraMediaInput(value: unknown): value is JsonObject;
196
- declare function nexraMediaOperationForMode(mode: string): NexraPublishedMediaOperation | undefined;
197
- /** Narrow the shared category vocabulary for one Experience Center input mode. */
198
- declare function nexraMediaInputSchemaForMode(mode: string): JsonObject | undefined;
199
-
200
- export { NEXRA_GENERATION_OPERATIONS, NEXRA_MEDIA_API_VERSION, NEXRA_MEDIA_FEATURES, NEXRA_MEDIA_INPUT_SCHEMAS, NEXRA_MEDIA_OPERATIONS, NEXRA_MEDIA_OPERATION_DEFINITIONS, NEXRA_PUBLISHED_MEDIA_OPERATIONS, type NexraAudioContentPart, type NexraAudioGenerateInput, type NexraGenerationOperation, type NexraImageContentPart, type NexraImageGenerateInput, type NexraImageUpscaleInput, type NexraMediaContentPart, type NexraMediaFeature, type NexraMediaInputByOperation, type NexraMediaInputMode, type NexraMediaInputSlot, type NexraMediaKind, type NexraMediaOperation, type NexraMediaOperationDefinition, type NexraMediaParameter, type NexraMediaParameterConstraint, type NexraMediaSource, type NexraPublishedMediaOperation, type NexraTextContentPart, type NexraVideoContentPart, type NexraVideoGenerateInput, type NexraVideoUpscaleInput, isNexraMediaInput, nexraMediaInputSchema, nexraMediaInputSchemaForMode, nexraMediaOperationForMode };
package/dist/media.js DELETED
@@ -1,26 +0,0 @@
1
- import {
2
- NEXRA_GENERATION_OPERATIONS,
3
- NEXRA_MEDIA_API_VERSION,
4
- NEXRA_MEDIA_FEATURES,
5
- NEXRA_MEDIA_INPUT_SCHEMAS,
6
- NEXRA_MEDIA_OPERATIONS,
7
- NEXRA_MEDIA_OPERATION_DEFINITIONS,
8
- NEXRA_PUBLISHED_MEDIA_OPERATIONS,
9
- isNexraMediaInput,
10
- nexraMediaInputSchema,
11
- nexraMediaInputSchemaForMode,
12
- nexraMediaOperationForMode
13
- } from "./chunk-TA3YGQQY.js";
14
- export {
15
- NEXRA_GENERATION_OPERATIONS,
16
- NEXRA_MEDIA_API_VERSION,
17
- NEXRA_MEDIA_FEATURES,
18
- NEXRA_MEDIA_INPUT_SCHEMAS,
19
- NEXRA_MEDIA_OPERATIONS,
20
- NEXRA_MEDIA_OPERATION_DEFINITIONS,
21
- NEXRA_PUBLISHED_MEDIA_OPERATIONS,
22
- isNexraMediaInput,
23
- nexraMediaInputSchema,
24
- nexraMediaInputSchemaForMode,
25
- nexraMediaOperationForMode
26
- };