@byte_fluffy/nexra-sdk 0.1.0-alpha.45 → 0.1.0-alpha.46

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/dist/catalog.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as JsonObject } from './json-Cz0MkWQn.js';
2
- 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 NexraModelEndpointSpec, j as NexraModelSpecFilter } from './media-geometry-KwQh1O8Y.js';
3
- export { M as MediaGeometryField, k as MediaGeometryProjection, l as NexraBillingCurrency, m as NexraCatalogModelIdentity, 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-KwQh1O8Y.js';
2
+ 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 NexraModelEndpointSpec, j as NexraModelSpecFilter } from './media-geometry-BS4DZh4B.js';
3
+ export { M as MediaGeometryField, k as MediaGeometryProjection, l as NexraBillingCurrency, m as NexraCatalogModelIdentity, 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-BS4DZh4B.js';
4
4
 
5
5
  declare function formatModelDisplayName(displayName: string, identity?: {
6
6
  modelId: string;
package/dist/catalog.js CHANGED
@@ -9,8 +9,8 @@ import {
9
9
  listModelSpecs,
10
10
  projectMediaGeometry,
11
11
  resolveNexraLanguageReasoning
12
- } from "./chunk-OX5GFYVN.js";
13
- import "./chunk-FEACXUHZ.js";
12
+ } from "./chunk-ZNPLN7N6.js";
13
+ import "./chunk-LXR3MEF3.js";
14
14
  export {
15
15
  CatalogClient,
16
16
  applyMediaGeometry,
@@ -419,21 +419,27 @@ var NEXRA_GENERATION_OPERATIONS = [
419
419
  "video.generate",
420
420
  "audio.generate",
421
421
  "image.upscale",
422
- "video.upscale"
422
+ "video.upscale",
423
+ "video.depth",
424
+ "video.segment"
423
425
  ];
424
426
  var NEXRA_MEDIA_OPERATIONS = [
425
427
  "image.generate",
426
428
  "video.generate",
427
429
  "audio.generate",
428
430
  "image.upscale",
429
- "video.upscale"
431
+ "video.upscale",
432
+ "video.depth",
433
+ "video.segment"
430
434
  ];
431
435
  var NEXRA_PUBLISHED_MEDIA_OPERATIONS = [
432
436
  "image.generate",
433
437
  "video.generate",
434
438
  "audio.generate",
435
439
  "image.upscale",
436
- "video.upscale"
440
+ "video.upscale",
441
+ "video.depth",
442
+ "video.segment"
437
443
  ];
438
444
  var NEXRA_MEDIA_FEATURES = [
439
445
  "text-to-image",
@@ -459,7 +465,9 @@ var NEXRA_MEDIA_FEATURES = [
459
465
  "voice-reference",
460
466
  "voice-design",
461
467
  "scale-factor",
462
- "target-resolution"
468
+ "target-resolution",
469
+ "video-depth",
470
+ "video-segment"
463
471
  ];
464
472
  var NEXRA_MEDIA_OPERATION_DEFINITIONS = Object.freeze([
465
473
  {
@@ -496,6 +504,20 @@ var NEXRA_MEDIA_OPERATION_DEFINITIONS = Object.freeze([
496
504
  outputKind: "video",
497
505
  features: ["scale-factor", "target-resolution"],
498
506
  parameterKeys: ["scale", "resolution", "output_format", "preserve_details"]
507
+ },
508
+ {
509
+ operation: "video.depth",
510
+ status: "active",
511
+ outputKind: "video",
512
+ features: ["video-depth"],
513
+ parameterKeys: ["resolution"]
514
+ },
515
+ {
516
+ operation: "video.segment",
517
+ status: "active",
518
+ outputKind: "video",
519
+ features: ["video-segment"],
520
+ parameterKeys: ["resolution"]
499
521
  }
500
522
  ]);
501
523
  var mediaSourceSchema = {
@@ -553,9 +575,20 @@ function inputSchema(contentItems, properties, contentBounds = {}) {
553
575
  };
554
576
  }
555
577
  var imagePart = mediaPartSchema("image", ["source", "reference", "first_frame", "last_frame", "mask", "control", "subject", "background"]);
556
- var videoImagePart = mediaPartSchema("image", ["source", "reference", "first_frame", "last_frame", "mask", "control", "subject", "background", "keyframe"]);
578
+ var videoImagePart = mediaPartSchema("image", ["source", "reference", "first_frame", "middle_frame", "last_frame", "mask", "control", "subject", "background", "keyframe"]);
557
579
  var videoPart = mediaPartSchema("video", ["source", "reference", "edit", "extend"]);
558
580
  var audioPart = mediaPartSchema("audio", ["source", "reference", "voice_reference"]);
581
+ var resourcePart = {
582
+ type: "object",
583
+ properties: {
584
+ type: { const: "resource" },
585
+ resource: { type: "string", enum: ["element", "voice"] },
586
+ source: { type: "string", minLength: 1 },
587
+ name: { type: "string", minLength: 1 }
588
+ },
589
+ required: ["type", "resource", "source", "name"],
590
+ additionalProperties: false
591
+ };
559
592
  var draftPart = {
560
593
  type: "object",
561
594
  properties: {
@@ -580,7 +613,7 @@ var NEXRA_MEDIA_INPUT_SCHEMAS = Object.freeze({
580
613
  }
581
614
  ),
582
615
  "video.generate": inputSchema(
583
- [textPartSchema(["prompt", "negative_prompt", "script"]), videoImagePart, videoPart, audioPart, draftPart],
616
+ [textPartSchema(["prompt", "negative_prompt", "script"]), videoImagePart, videoPart, audioPart, draftPart, resourcePart],
584
617
  {
585
618
  task_type: { type: "string", minLength: 1, "x-ui": { order: 8, control: "segmented" } },
586
619
  voice: { type: "string", minLength: 1, "x-ui": { order: 9, control: "resource", resource: "voice" } },
@@ -635,6 +668,16 @@ var NEXRA_MEDIA_INPUT_SCHEMAS = Object.freeze({
635
668
  preserve_details: { type: "boolean", "x-ui": { order: 13, control: "switch" } }
636
669
  },
637
670
  { minItems: 1, maxItems: 1 }
671
+ ),
672
+ "video.segment": inputSchema(
673
+ [textPartSchema(["prompt"]), mediaPartSchema("video", ["source"])],
674
+ { resolution: { type: "string", minLength: 1, "x-ui": { order: 10 } } },
675
+ { minItems: 2, maxItems: 2 }
676
+ ),
677
+ "video.depth": inputSchema(
678
+ [mediaPartSchema("video", ["source"])],
679
+ { resolution: { type: "string", minLength: 1, "x-ui": { order: 10 } } },
680
+ { minItems: 1, maxItems: 1 }
638
681
  )
639
682
  });
640
683
  function nexraMediaInputSchema(operation) {
@@ -649,6 +692,7 @@ function isNexraMediaInput(value) {
649
692
  return Array.isArray(content) && content.length > 0 && content.every((part) => {
650
693
  if (!part || typeof part !== "object" || Array.isArray(part)) return false;
651
694
  if (part.type === "text") return typeof part.text === "string" && part.text.length > 0;
695
+ if (part.type === "resource") return ["element", "voice"].includes(String(part.resource)) && typeof part.source === "string" && part.source.length > 0 && typeof part.name === "string" && part.name.length > 0;
652
696
  if (part.type === "draft_task") {
653
697
  const reference = part.draft_task;
654
698
  return Boolean(reference && typeof reference === "object" && !Array.isArray(reference) && typeof reference.id === "string" && reference.id.length > 0);
@@ -664,6 +708,8 @@ function nexraMediaOperationForMode(mode) {
664
708
  if (["text-to-speech", "text-to-music", "text-to-sfx"].includes(mode)) return "audio.generate";
665
709
  if (mode === "image-upscale") return "image.upscale";
666
710
  if (mode === "video-upscale") return "video.upscale";
711
+ if (mode === "video-depth") return "video.depth";
712
+ if (mode === "video-segment") return "video.segment";
667
713
  return void 0;
668
714
  }
669
715
  function nexraMediaInputSchemaForMode(mode) {
@@ -705,10 +751,11 @@ function nexraMediaInputSchemaForMode(mode) {
705
751
  variant.required = [...required];
706
752
  }
707
753
  }
708
- const requiredMedia = mode === "image-to-image" || mode === "image-to-video" || mode === "avatar-video" ? "image" : void 0;
754
+ const requiredMedia = ["video-depth", "video-segment"].includes(mode) ? "video" : mode === "image-to-image" || mode === "image-to-video" || mode === "avatar-video" ? "image" : void 0;
709
755
  const requiresReferenceMedia = mode === "multimodal-to-video";
756
+ const hasTextPart = items.oneOf.some((variant) => variant.properties.type.const === "text");
710
757
  content.allOf = [
711
- ...mode === "avatar-video" ? [] : [{
758
+ ...mode === "avatar-video" || !hasTextPart ? [] : [{
712
759
  contains: { type: "object", properties: { type: { const: "text" } }, required: ["type"] },
713
760
  minContains: 1
714
761
  }],