@nodaro/sdk 2.9.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -475,8 +475,6 @@ var VideoProResource = class {
475
475
  });
476
476
  }
477
477
  };
478
-
479
- // src/resources/executions.ts
480
478
  var ExecutionsResource = class {
481
479
  constructor(client) {
482
480
  this.client = client;
@@ -625,6 +623,17 @@ var NodesResource = class {
625
623
  }
626
624
  }
627
625
  };
626
+
627
+ // src/resources/scene3d-types.ts
628
+ var SCENE3D_DELIVERY_ASSET_USAGE = {
629
+ poster: "poster",
630
+ "validation-report": "validation",
631
+ "shot-still": "shot-still",
632
+ /** The recipe a run that never compiled was refused for. See {@link Scene3DDeliveryAsset}. */
633
+ "source-json": "checkpoint"
634
+ };
635
+
636
+ // src/resources/scene3d.ts
628
637
  function newIdempotencyKey() {
629
638
  const random = globalThis.crypto?.randomUUID?.();
630
639
  return `sdk-pro3d-${random ?? `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`}`;
@@ -641,8 +650,16 @@ var Scene3DResource = class {
641
650
  getDelivery(jobId) {
642
651
  return this.client.request("GET", `/v1/3d-scene/deliveries/${encodeURIComponent(jobId)}`);
643
652
  }
653
+ /**
654
+ * The bytes of one descriptor the delivery listed.
655
+ *
656
+ * Checked against {@link SCENE3D_DELIVERY_ASSET_USAGE} rather than a hardcoded pair, which
657
+ * is why a `shot-still` now works: the route has served stills since they existed, and this
658
+ * guard refused them. `source-json` — the recipe a refused run was kept for — is on the same
659
+ * map; the server still decides whether THIS caller may read it.
660
+ */
644
661
  deliveryAssetBytes(jobId, asset, options) {
645
- if (asset.kind !== "poster" && asset.kind !== "validation-report" || asset.usage !== (asset.kind === "poster" ? "poster" : "validation")) {
662
+ if (SCENE3D_DELIVERY_ASSET_USAGE[asset.kind] !== asset.usage) {
646
663
  throw new Error("This asset is not available through the delivery endpoint");
647
664
  }
648
665
  if (!Number.isSafeInteger(asset.byteLength) || asset.byteLength < 1 || asset.byteLength > shared.SCENE3D_V2_LIMITS.maxRendererAssetBytes) {
@@ -653,6 +670,29 @@ var Scene3DResource = class {
653
670
  maxBytes: asset.byteLength
654
671
  });
655
672
  }
673
+ /**
674
+ * The recipe a 3D Render Pro run was refused for, parsed — or `null` when there is none.
675
+ *
676
+ * The one thing such a run leaves behind. Its recipe never compiled, so there is no scene
677
+ * revision, no poster and no `.blend`: `output_data` carries a `deliveryId`, the compiler's
678
+ * reasons, and `validation.sourceRetained` saying whether the recipe itself was kept. This
679
+ * fetches it in one call — delivery, then the `source-json` descriptor's bytes.
680
+ *
681
+ * `null` means the delivery has no retained recipe to hand back: no pass ever cleared
682
+ * admission, or this caller holds less than `edit` on the job's workflow and the descriptor
683
+ * is therefore not listed for them.
684
+ *
685
+ * Read it to see what was attempted and to inform the next prompt. There is no input that
686
+ * takes a recipe back: a refused run published no revision, so there is no `{kind:"scene"}`
687
+ * source to re-run it from.
688
+ */
689
+ async retainedRecipe(jobId, options) {
690
+ const delivery = await this.getDelivery(jobId);
691
+ const asset = delivery.assets.find((item) => item.kind === "source-json");
692
+ if (!asset) return null;
693
+ const bytes = await this.deliveryAssetBytes(jobId, asset, options);
694
+ return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
695
+ }
656
696
  /** Persist deterministic overlays without an LLM or a generation charge. */
657
697
  applyEdits(revisionId, params) {
658
698
  return this.client.request("POST", `/v1/3d-scene/revisions/${encodeURIComponent(revisionId)}/edits`, { body: params });
@@ -725,9 +765,21 @@ var Scene3DResource = class {
725
765
  *
726
766
  * Resolves with the settled result — `videoUrl` (the MP4) and `scenePlan`
727
767
  * (the exact composition it was rendered from), plus the revision, poster,
728
- * validation and renderer metadata. Re-render that same `scenePlan` later
729
- * with {@link render}, or with a `{kind:'scene'}` source; that costs no
730
- * authoring.
768
+ * validation and renderer metadata. A run that AUTHORED also reports its own
769
+ * account of the answer — `metadata.summary`, `repairPasses`,
770
+ * `admissionRetries`, `mechanicalPasses` (repairs the engine applied from
771
+ * the compiler's own remedy with no planner call, counted APART from
772
+ * `repairPasses` on their own quoted allowance), `restoredAssertions`, and
773
+ * any `SCENE_AUTHORING_ASSUMPTION` warnings. A
774
+ * completed result whose `metadata.review` is present passed every mandatory
775
+ * assertion but did NOT get the visual reviewer's approval: `verdict:
776
+ * "refused"` means it objected, each objection also a `SCENE_REVIEW_REFUSED`
777
+ * warning; `verdict: "unavailable"` means the review produced no usable
778
+ * verdict in `attempts` asks (`reason: "provider"` — never reached its
779
+ * provider; `"unusable"` — it answered, unusably), so nobody judged the scene and
780
+ * `SCENE_REVIEW_UNAVAILABLE` leads the warnings. Re-render that same
781
+ * `scenePlan` later with {@link render}, or with a `{kind:'scene'}` source;
782
+ * that costs no authoring.
731
783
  */
732
784
  async renderProAndWait(params, options) {
733
785
  const quoteId = typeof params.quoteId === "string" ? params.quoteId : (await this.quotePro(params)).quoteId;
@@ -1872,10 +1924,11 @@ var VoicesResource = class {
1872
1924
  return res.voiceClones;
1873
1925
  }
1874
1926
  /**
1875
- * Clone a voice from an already-uploaded audio URL
1876
- * (`POST /v1/voice-clones/from-url`). Costs credits. Returns the create
1877
- * subset of `VoiceClone` (`elevenlabsVoiceId` is the id to use at
1878
- * text-to-speech time).
1927
+ * @deprecated Voice cloning is no longer offered on Nodaro (retired
1928
+ * 2026-09-15). The route answers `410 voice_cloning_retired` and this call
1929
+ * rejects with that error. Clones created before the retirement are still
1930
+ * listed by {@link VoicesResource.listClones} and still work as voice ids.
1931
+ * For a new custom voice use {@link VoicesResource.design}.
1879
1932
  */
1880
1933
  createClone(input) {
1881
1934
  return this.client.request("POST", "/v1/voice-clones/from-url", { body: input });
@@ -2009,12 +2062,9 @@ var VoicesResource = class {
2009
2062
  return this.client.request("POST", "/v1/text-to-dialogue", { body: input });
2010
2063
  }
2011
2064
  /**
2012
- * Clone a voice from an audio FILE you hold in memory
2013
- * (`POST /v1/voice-clones`, multipart) — the counterpart to
2014
- * {@link VoicesResource.createClone}, which clones from an already-uploaded
2015
- * URL. Pass the raw audio `file` (a `Blob`/`File` in the browser, or a
2016
- * `Uint8Array`/`Buffer` in Node) plus a `name`. Costs credits. Returns the new
2017
- * {@link VoiceClone} (`elevenlabsVoiceId` is the id to recast/synthesize with).
2065
+ * @deprecated Voice cloning is no longer offered on Nodaro (retired
2066
+ * 2026-09-15). The route answers `410 voice_cloning_retired` and this call
2067
+ * rejects with that error. See {@link VoicesResource.createClone}.
2018
2068
  */
2019
2069
  createCloneFromFile(input) {
2020
2070
  const form = new FormData();
@@ -3401,7 +3451,7 @@ var WorkspacesResource = class {
3401
3451
  return this.client.requestText("GET", `/v1/workspaces/${encodeURIComponent(id)}/usage`, { query: { ...opts, format: "csv" } });
3402
3452
  }
3403
3453
  };
3404
- var SDK_VERSION = "2.9.0" ;
3454
+ var SDK_VERSION = "2.11.0" ;
3405
3455
  var CLIENT_HEADER = "X-Nodaro-Client";
3406
3456
  var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
3407
3457
  var NodaroClient = class _NodaroClient {
@@ -3710,6 +3760,10 @@ Object.defineProperty(exports, "OBJECT_ATTACH_COLUMNS", {
3710
3760
  enumerable: true,
3711
3761
  get: function () { return shared.OBJECT_ATTACH_COLUMNS; }
3712
3762
  });
3763
+ Object.defineProperty(exports, "OUTPUT_BEARING_NODE_STATUSES", {
3764
+ enumerable: true,
3765
+ get: function () { return shared.OUTPUT_BEARING_NODE_STATUSES; }
3766
+ });
3713
3767
  Object.defineProperty(exports, "PROMPT_PREFIX_KEY", {
3714
3768
  enumerable: true,
3715
3769
  get: function () { return shared.PROMPT_PREFIX_KEY; }
@@ -3730,6 +3784,10 @@ Object.defineProperty(exports, "WORKSPACE_HEADER", {
3730
3784
  enumerable: true,
3731
3785
  get: function () { return shared.WORKSPACE_HEADER; }
3732
3786
  });
3787
+ Object.defineProperty(exports, "nodeStateMayCarryOutput", {
3788
+ enumerable: true,
3789
+ get: function () { return shared.nodeStateMayCarryOutput; }
3790
+ });
3733
3791
  Object.defineProperty(exports, "PEOPLE", {
3734
3792
  enumerable: true,
3735
3793
  get: function () { return prompts.PEOPLE; }
@@ -3786,6 +3844,7 @@ exports.PromptHelperResource = PromptHelperResource;
3786
3844
  exports.RateLimitedError = RateLimitedError;
3787
3845
  exports.RecastResource = RecastResource;
3788
3846
  exports.ReduceResource = ReduceResource;
3847
+ exports.SCENE3D_DELIVERY_ASSET_USAGE = SCENE3D_DELIVERY_ASSET_USAGE;
3789
3848
  exports.Scene3DResource = Scene3DResource;
3790
3849
  exports.ShotsResource = ShotsResource;
3791
3850
  exports.StaticTokenAuth = StaticTokenAuth;