@nodaro/sdk 1.30.1 → 2.2.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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CollaboratorRole, GenericNode, GenericEdge, WorkflowExport, WorkflowImportReport, WorkflowVisibility, Scene3DReference, Scene3DPlan, Scene3DEditOperation, Scene3DJobOutput as Scene3DJobOutput$1, ModelInputAdjustment, ConnectedReference, DescribedReference, TtsProvider, EntityStyle, CharacterAspectRatio, CharacterAttachColumn, LocationAssetType, LocationAttachColumn, SurroundDirection, ObjectAssetType, ObjectAttachColumn, ObjectAspectRatio, CreatureAttachColumn, PipelineInput, PipelineStatus, PipelineMode, PipelineStageName, SubGateName, ChatEnabledStage, ProposedChange, ReduceStrategyId, ReduceMeta, Voice, VoiceLibraryParams, VoiceLibraryResponse, VoiceClone, AudioFxPreset, BrowseCommunityParams, BrowseCommunityResult, CommunityCard, CommunityFullDetail, CommunityEntityType, CloneListingResult, FavoriteListingResult, CommunityReportReason, ReportListingResult, PublishListingParams, PublishListingResult, SharedListing, OrganizationView, OrgKind, OrgSettings, OrgPage, OrgMemberView, MemberStatus, WorkspaceRole, InvitationDelivery, InvitationState, InvitationView, InvitationPreview, OrgAuditEntry, UsageQuery, UsageReport, UsageLogEntry, WorkspaceSummary, WorkspaceView, WorkspaceSettings, WorkspaceMemberView, JoinCodeView, MeOrganizations } from '@nodaro/shared';
1
+ import { CollaboratorRole, GenericNode, GenericEdge, WorkflowExport, WorkflowImportReport, WorkflowVisibility, Scene3DReference, Scene3DPlan, Scene3DEditOperation, Scene3DV2EditOperation, Pro3DRenderSource, Pro3DRenderEngine, Pro3DRenderQuality, Pro3DRenderStyle, Scene3DJobOutputAny, Pro3DRenderJobOutput as Pro3DRenderJobOutput$1, Pro3DRenderCapabilities, Scene3DPlanV2, Pro3DRenderQuote as Pro3DRenderQuote$1, ModelInputAdjustment, ConnectedReference, DescribedReference, Scene3DAssetRef, TtsProvider, EntityStyle, CharacterAspectRatio, CharacterAttachColumn, LocationAssetType, LocationAttachColumn, SurroundDirection, ObjectAssetType, ObjectAttachColumn, ObjectAspectRatio, CreatureAttachColumn, PipelineInput, PipelineStatus, PipelineMode, PipelineStageName, SubGateName, ChatEnabledStage, ProposedChange, ReduceStrategyId, ReduceMeta, Voice, VoiceLibraryParams, VoiceLibraryResponse, VoiceClone, AudioFxPreset, BrowseCommunityParams, BrowseCommunityResult, CommunityCard, CommunityFullDetail, CommunityEntityType, CloneListingResult, FavoriteListingResult, CommunityReportReason, ReportListingResult, PublishListingParams, PublishListingResult, SharedListing, OrganizationView, OrgKind, OrgSettings, OrgPage, OrgMemberView, MemberStatus, WorkspaceRole, InvitationDelivery, InvitationState, InvitationView, InvitationPreview, OrgAuditEntry, UsageQuery, UsageReport, UsageLogEntry, WorkspaceSummary, WorkspaceView, WorkspaceSettings, WorkspaceMemberView, JoinCodeView, MeOrganizations } from '@nodaro/shared';
2
2
  export { AudioFxPreset, BrowseCommunityParams, BrowseCommunityResult, CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, CharacterAspectRatio, CloneListingResult, CommunityCard, CommunityEntityType, CommunityReportReason, CommunitySort, ConnectedReference, ObjectAspectRatio as CreatureAspectRatio, CreatureAttachColumn, DescribedReference, EntityStyle, FavoriteListingResult, GenericEdge, GenericNode, InvitationDelivery, InvitationPreview, InvitationState, InvitationView, JoinCodeView, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, LocationAssetType, LocationAttachColumn, MeOrganizations, MemberStatus, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, ObjectAspectRatio, ObjectAssetType, ObjectAttachColumn, OrgAuditEntry, OrgErrorCode, OrgKind, OrgMemberView, OrgPage, OrgRole, OrgSettings, OrgStatus, OrganizationSummary, OrganizationView, PROMPT_PREFIX_KEY, PROMPT_SUFFIX_KEY, PipelineStageName, PromptAffixFields, PublishListingParams, PublishListingResult, ReduceMeta, ReduceStrategyId, ReportListingResult, SURROUND_DIRECTIONS, SharedListing, SharedVoice, SurroundDirection, USAGE_GROUP_BYS, UsageGroupBy, UsageLogEntry, UsageQuery, UsageReport, UsageReportRow, UsageReportTotals, UsageVarianceRow, Voice, VoiceClone, VoiceLibraryParams, VoiceLibraryResponse, WORKSPACE_HEADER, WorkflowExport, WorkflowExportCharacter, WorkflowExportLocation, WorkflowExportObject, WorkspaceMemberView, WorkspaceRole, WorkspaceSettings, WorkspaceSummary, WorkspaceView } from '@nodaro/shared';
3
3
  import { DirectionFields, SubjectFields, PersonValue, WizardNodeContext, WizardQuestion, WizardSelection, RecommendedModel, FactoryPreset } from '@nodaro/prompts';
4
4
  export { PEOPLE, PERSON_DIMENSION_LABELS, PERSON_DIMENSION_ORDER, PersonValue, RecommendedModel, WizardNodeContext, WizardOption, WizardQuestion, WizardSelection, buildPersonHints } from '@nodaro/prompts';
@@ -648,8 +648,68 @@ declare class ExecutionsResource {
648
648
  }>;
649
649
  }
650
650
 
651
+ /** Reuse newRevisionId for transport retries of the same immutable edit. */
652
+ interface RetainedScene3DEditParams {
653
+ newRevisionId: string;
654
+ expectedContentHash: string;
655
+ operations: readonly Scene3DV2EditOperation[];
656
+ lockedObjectIds?: readonly string[];
657
+ }
658
+ interface RetainedScene3DEditResult {
659
+ scenePlan: Scene3DPlanV2;
660
+ changeSummary: string;
661
+ }
662
+ interface Scene3DDeliveryAsset {
663
+ assetId: string;
664
+ kind: "poster" | "validation-report";
665
+ usage: "poster" | "validation";
666
+ byteLength: number;
667
+ sha256: string;
668
+ viaRevisionId: string | null;
669
+ }
670
+ /** Export evidence is retained separately from the immutable scene it rendered. */
671
+ interface Scene3DDelivery {
672
+ deliveryId: string;
673
+ sceneRevisionId: string;
674
+ sourcePlanSha256: string;
675
+ sourceContentHash: string | null;
676
+ sourceJobId: string | null;
677
+ workflowId: string | null;
678
+ mode: "authored" | "render-only";
679
+ createdAt: string;
680
+ access: "view" | "edit" | "own";
681
+ assets: Scene3DDeliveryAsset[];
682
+ }
683
+ type Scene3DAuthoringEngine = "basic" | "blender-cloud" | "blender-local";
684
+ interface Scene3DCapabilities {
685
+ basic: {
686
+ available: boolean;
687
+ sceneSchemaVersions: number[];
688
+ };
689
+ advanced: null | {
690
+ version: string;
691
+ engines: Array<Exclude<Scene3DAuthoringEngine, "basic">>;
692
+ sceneSchemaVersions: number[];
693
+ maxRepairPasses: number;
694
+ };
695
+ /**
696
+ * What this deployment can serve for `pro-3d-render`, including which
697
+ * quality profiles, engines and aspect ratios a client may OFFER. Optional so
698
+ * a client of this version reads an older backend without throwing; absent
699
+ * means the node is unavailable.
700
+ */
701
+ pro?: Pro3DRenderCapabilities;
702
+ }
703
+ interface Scene3DEngineParams {
704
+ /** Basic is the default. Discover optional engines through scene3d.capabilities(). */
705
+ engine?: Scene3DAuthoringEngine;
706
+ acceptedSceneSchemaVersions?: readonly number[];
707
+ localConnectionId?: string;
708
+ quoteId?: string;
709
+ maxRepairPasses?: number;
710
+ }
651
711
  /** Structured authoring inputs; reference roles are interpreted by the platform. */
652
- interface GenerateScene3DParams extends Record<string, unknown> {
712
+ interface GenerateScene3DParams extends Record<string, unknown>, Scene3DEngineParams {
653
713
  prompt: string;
654
714
  durationSeconds?: number;
655
715
  fps?: number;
@@ -661,14 +721,14 @@ interface GenerateScene3DParams extends Record<string, unknown> {
661
721
  nodeId?: string;
662
722
  }
663
723
  /** Editing creates a new revision and never mutates the supplied scene. */
664
- interface EditScene3DParams extends Record<string, unknown> {
724
+ interface EditScene3DParams extends Record<string, unknown>, Scene3DEngineParams {
665
725
  scenePlan: Scene3DPlan;
666
726
  expectedRevisionId: string;
667
727
  /** Replace the complete reference set, including clearing it with an empty list. Default: merge by id. */
668
728
  replaceReferences?: boolean;
669
729
  /** Supply an instruction or deterministic operations, never both. */
670
730
  prompt?: string;
671
- operations?: readonly Scene3DEditOperation[];
731
+ operations?: readonly (Scene3DEditOperation | Scene3DV2EditOperation)[];
672
732
  references?: readonly Scene3DReference[];
673
733
  lockedObjectIds?: readonly string[];
674
734
  selectedObjectIds?: readonly string[];
@@ -677,6 +737,62 @@ interface EditScene3DParams extends Record<string, unknown> {
677
737
  workflowId?: string;
678
738
  nodeId?: string;
679
739
  }
740
+ /**
741
+ * 3D Render Pro — ONE durable operation producing a composition and its MP4.
742
+ *
743
+ * `source` is a strict discriminated union, not a bag of optionals:
744
+ * - `{kind:'prompt', prompt, references?}` authors a new scene;
745
+ * - `{kind:'scene', revisionId, sourceJobId}` with NO `editPrompt` is the
746
+ * render-only export — it spends no authoring or build credits, and OMIT
747
+ * the field rather than sending `""`, which would buy an authoring pass;
748
+ * - `{kind:'local-export', exportId, connectionId}` uses a paired desktop.
749
+ *
750
+ * There is no model or effort field: the planner is fixed and server-owned.
751
+ *
752
+ * `durationSeconds` / `fps` / `aspectRatio` on a `scene` source are an EXPLICIT
753
+ * re-time request. Omit them to keep the source's own timing; a conflicting
754
+ * override is rejected rather than silently applied.
755
+ */
756
+ interface Pro3DRenderParams extends Record<string, unknown> {
757
+ source: Pro3DRenderSource;
758
+ /** Optional. An unknown or unavailable engine is rejected, never downgraded. */
759
+ engine?: Pro3DRenderEngine;
760
+ /** Names a paired desktop for a local run. */
761
+ localConnectionId?: string;
762
+ durationSeconds?: number;
763
+ fps?: number;
764
+ aspectRatio?: string;
765
+ quality?: Pro3DRenderQuality;
766
+ style?: Pro3DRenderStyle;
767
+ /** Correction budget, 0-2. Each pass is paid work. */
768
+ maxRepairPasses?: number;
769
+ /**
770
+ * Which scene-schema versions THIS client can render. A prompt or
771
+ * local-export source mints v2, so omitting 2 is refused for free; a scene
772
+ * source inherits its revision's version and is left to the server.
773
+ */
774
+ acceptedSceneSchemaVersions?: readonly number[];
775
+ workflowId?: string;
776
+ nodeId?: string;
777
+ /** Keep every artifact of this run out of publicly-readable storage. */
778
+ forcePrivate?: boolean;
779
+ }
780
+ /** A run additionally carries the quote it was priced under. */
781
+ interface Pro3DRenderRunParams extends Pro3DRenderParams {
782
+ quoteId: string;
783
+ }
784
+ /** The quote's answer. `maxCredits` is a ceiling; quoting spends nothing. */
785
+ type Pro3DRenderQuote = Readonly<Pro3DRenderQuote$1> & Readonly<Record<string, unknown>>;
786
+ /** Per-call transport controls for the paid run. */
787
+ interface Pro3DRenderRunOptions {
788
+ /**
789
+ * The `Idempotency-Key` the run is submitted under. Reuse the same value when
790
+ * retrying a call that timed out, so the run is not started twice; the SDK
791
+ * generates a fresh one per call when this is omitted, because two deliberate
792
+ * calls are two runs.
793
+ */
794
+ idempotencyKey?: string;
795
+ }
680
796
  /** Render the exact scene revision through the existing render-video node. */
681
797
  interface RenderScene3DParams extends Record<string, unknown> {
682
798
  planType: "3d-scene";
@@ -685,7 +801,9 @@ interface RenderScene3DParams extends Record<string, unknown> {
685
801
  nodeId?: string;
686
802
  }
687
803
  /** Preserve the shared wire contract while allowing additive job metadata. */
688
- type Scene3DJobOutput = Readonly<Scene3DJobOutput$1> & Readonly<Record<string, unknown>>;
804
+ type Scene3DJobOutput = Readonly<Scene3DJobOutputAny> & Readonly<Record<string, unknown>>;
805
+ /** The settled 3D Render Pro result, plus any additive job metadata. */
806
+ type Pro3DRenderJobOutput = Readonly<Pro3DRenderJobOutput$1> & Readonly<Record<string, unknown>>;
689
807
 
690
808
  type NodeCategory = "input" | "parameter" | "ai-image" | "ai-video" | "ai-audio" | "ai-text" | "processing" | "composition" | "trigger" | "output" | "control" | "entity" | "utility";
691
809
  type OutputType = "text" | "image" | "video" | "audio" | "data" | "none";
@@ -913,6 +1031,18 @@ interface RunAndWaitOptions {
913
1031
  readonly pollMs?: number;
914
1032
  /** Wall-clock cap before giving up, in ms. Default ~15 min (900_000). */
915
1033
  readonly maxMs?: number;
1034
+ /**
1035
+ * `Idempotency-Key` for the submit half. Reuse the same value when retrying a
1036
+ * call that timed out, so the run is not started or charged twice. Omitted →
1037
+ * no key, which is the historical behaviour for every node that does not
1038
+ * require one.
1039
+ */
1040
+ readonly idempotencyKey?: string;
1041
+ }
1042
+ /** Per-call transport controls for {@link NodesResource.run}. */
1043
+ interface RunNodeOptions {
1044
+ /** `Idempotency-Key` header. See {@link RunAndWaitOptions.idempotencyKey}. */
1045
+ readonly idempotencyKey?: string;
916
1046
  }
917
1047
  /** One settled result from {@link NodesResource.runMany}. */
918
1048
  interface RunManyResult {
@@ -952,11 +1082,12 @@ declare class NodesResource {
952
1082
  run(type: "generate-3d-scene", params: GenerateScene3DParams): Promise<RunNodeResult>;
953
1083
  run(type: "edit-3d-scene", params: EditScene3DParams): Promise<RunNodeResult>;
954
1084
  run(type: "render-video", params: RenderScene3DParams): Promise<RunNodeResult>;
1085
+ run(type: "pro-3d-render", params: Pro3DRenderRunParams, options?: RunNodeOptions): Promise<RunNodeResult>;
955
1086
  run(type: "generate-image", params?: GenerateImageParams): Promise<RunNodeResult>;
956
1087
  run(type: "generate-video", params?: GenerateVideoParams): Promise<RunNodeResult>;
957
1088
  run(type: "text-to-video", params: TextToVideoParams): Promise<RunNodeResult>;
958
1089
  run(type: "assemble-narrated-video", params?: AssembleNarratedVideoParams): Promise<RunNodeResult>;
959
- run(type: string, params?: Record<string, unknown>): Promise<RunNodeResult>;
1090
+ run(type: string, params?: Record<string, unknown>, options?: RunNodeOptions): Promise<RunNodeResult>;
960
1091
  /**
961
1092
  * Run a single async node to completion: {@link run} it, extract the
962
1093
  * `{ jobId }`, then client-poll `jobs.getStatus(jobId)` every `pollMs`
@@ -987,11 +1118,12 @@ declare class NodesResource {
987
1118
  runAndWait(type: "generate-3d-scene", params: GenerateScene3DParams, options?: RunAndWaitOptions): Promise<Scene3DJobOutput>;
988
1119
  runAndWait(type: "edit-3d-scene", params: EditScene3DParams, options?: RunAndWaitOptions): Promise<Scene3DJobOutput>;
989
1120
  runAndWait(type: "render-video", params: RenderScene3DParams, options?: RunAndWaitOptions): Promise<NodeJobOutput>;
1121
+ runAndWait(type: "pro-3d-render", params: Pro3DRenderRunParams, options?: RunAndWaitOptions): Promise<Pro3DRenderJobOutput>;
990
1122
  runAndWait(type: "generate-image", params?: GenerateImageParams, opts?: RunAndWaitOptions): Promise<NodeJobOutput>;
991
1123
  runAndWait(type: "generate-video", params?: GenerateVideoParams, opts?: RunAndWaitOptions): Promise<NodeJobOutput>;
992
1124
  runAndWait(type: "text-to-video", params: TextToVideoParams, opts?: RunAndWaitOptions): Promise<NodeJobOutput>;
993
1125
  runAndWait(type: "assemble-narrated-video", params?: AssembleNarratedVideoParams, opts?: RunAndWaitOptions): Promise<NodeJobOutput>;
994
- runAndWait<T extends string>(type: T, params?: Record<string, unknown>, opts?: RunAndWaitOptions): Promise<T extends "generate-3d-scene" | "edit-3d-scene" ? Scene3DJobOutput : NodeJobOutput>;
1126
+ runAndWait<T extends string>(type: T, params?: Record<string, unknown>, opts?: RunAndWaitOptions): Promise<T extends "pro-3d-render" ? Pro3DRenderJobOutput : T extends "generate-3d-scene" | "edit-3d-scene" ? Scene3DJobOutput : NodeJobOutput>;
995
1127
  /**
996
1128
  * Fan out N async runs of the same node `type` to completion concurrently —
997
1129
  * the candidate-grid path (generate N stills/clips in parallel). Each runs
@@ -1013,6 +1145,70 @@ declare class NodesResource {
1013
1145
  private pollJob;
1014
1146
  }
1015
1147
 
1148
+ /** Scene authoring and render-only export through the same platform nodes. */
1149
+ declare class Scene3DResource {
1150
+ private client;
1151
+ constructor(client: NodaroClient);
1152
+ capabilities(): Promise<Scene3DCapabilities>;
1153
+ /** Current access to both the delivery and its source is required on every read. */
1154
+ getDelivery(jobId: string): Promise<Scene3DDelivery>;
1155
+ deliveryAssetBytes(jobId: string, asset: Scene3DDeliveryAsset, options?: {
1156
+ signal?: AbortSignal;
1157
+ }): Promise<ArrayBuffer>;
1158
+ /** Persist deterministic overlays without an LLM or a generation charge. */
1159
+ applyEdits(revisionId: string, params: RetainedScene3DEditParams): Promise<RetainedScene3DEditResult>;
1160
+ /** Asset access is scoped to an exact retained revision, with fresh authentication. */
1161
+ assetBytes(revisionId: string, asset: Scene3DAssetRef, options?: {
1162
+ signal?: AbortSignal;
1163
+ }): Promise<ArrayBuffer>;
1164
+ /** The editable native file has its own authorization lane. */
1165
+ sourceBytes(revisionId: string, options?: {
1166
+ signal?: AbortSignal;
1167
+ }): Promise<ArrayBuffer>;
1168
+ generate(params: GenerateScene3DParams): Promise<RunNodeResult>;
1169
+ generateAndWait(params: GenerateScene3DParams, options?: RunAndWaitOptions): Promise<Scene3DJobOutput>;
1170
+ edit(params: EditScene3DParams): Promise<RunNodeResult>;
1171
+ editAndWait(params: EditScene3DParams, options?: RunAndWaitOptions): Promise<Scene3DJobOutput>;
1172
+ /**
1173
+ * Price a 3D Render Pro request WITHOUT starting it.
1174
+ *
1175
+ * Takes the same body a run takes, minus the `quoteId`, and answers a
1176
+ * ceiling (`maxCredits`), a `breakdown` to show, and the
1177
+ * `normalizedInputHash` admission re-checks. It reserves nothing and spends
1178
+ * nothing — a quote is a price, not a purchase.
1179
+ */
1180
+ quotePro(params: Pro3DRenderParams): Promise<Pro3DRenderQuote>;
1181
+ /**
1182
+ * Submit a quoted 3D Render Pro run.
1183
+ *
1184
+ * Requires the `quoteId` from {@link quotePro}: no run starts at a price
1185
+ * nobody showed. Sends an `Idempotency-Key` — a fresh one per call unless you
1186
+ * supply your own, which you should when retrying a call that timed out.
1187
+ *
1188
+ * Availability is a property of the deployment: `capabilities().pro` says
1189
+ * whether this install can serve it, and which controls you may offer.
1190
+ */
1191
+ runPro(params: Pro3DRenderRunParams, options?: Pro3DRenderRunOptions): Promise<RunNodeResult>;
1192
+ /**
1193
+ * Quote if needed, run, and wait — the whole operation in one call.
1194
+ *
1195
+ * Two HTTP requests at most, still ONE paid job: when `quoteId` is absent
1196
+ * this quotes the identical body first, so the run is admitted against a
1197
+ * hash of exactly what was priced. Pass a `quoteId` to run against a quote
1198
+ * you already showed the user.
1199
+ *
1200
+ * Resolves with the settled result — `videoUrl` (the MP4) and `scenePlan`
1201
+ * (the exact composition it was rendered from), plus the revision, poster,
1202
+ * validation and renderer metadata. Re-render that same `scenePlan` later
1203
+ * with {@link render}, or with a `{kind:'scene'}` source; that costs no
1204
+ * authoring.
1205
+ */
1206
+ renderProAndWait(params: Pro3DRenderParams | Pro3DRenderRunParams, options?: RunAndWaitOptions & Pro3DRenderRunOptions): Promise<Pro3DRenderJobOutput>;
1207
+ /** Uses the supplied immutable revision; never starts authoring or a rebuild. */
1208
+ render(params: RenderScene3DParams): Promise<RunNodeResult>;
1209
+ renderAndWait(params: RenderScene3DParams, options?: RunAndWaitOptions): Promise<NodeJobOutput>;
1210
+ }
1211
+
1016
1212
  /**
1017
1213
  * OAuth scopes that a developer app may request. Mirrors
1018
1214
  * `backend/src/lib/scopes.ts#ALL_SCOPES`.
@@ -5487,6 +5683,481 @@ declare class RecastResource {
5487
5683
  resolveGate(recastId: string, input: ResolveRecastGateInput): Promise<Record<string, unknown>>;
5488
5684
  }
5489
5685
 
5686
+ /**
5687
+ * Studio productions — `/v1/studio/productions`.
5688
+ *
5689
+ * A production is a Nodaro workflow whose `settings.studio` holds the shots:
5690
+ * each shot a framed still, an optional animated clip, and the plan, looks,
5691
+ * cast bindings and voice that made them. These routes are the platform's own
5692
+ * reader and writer of that document, so an agent, a script and the studio app
5693
+ * are looking at ONE production rather than three opinions about one row.
5694
+ *
5695
+ * Two rules run through the whole surface:
5696
+ *
5697
+ * - **Every change is an OPERATION** ({@link StudioProductionsResource.ops}),
5698
+ * addressed by stable key — a shot id, a role slug, a result's job id or url
5699
+ * — and never by position. That is what lets two writers hold the same
5700
+ * production open: a batch composed against a slightly older version still
5701
+ * applies correctly to the newest one, and the response says whether it was
5702
+ * rebased.
5703
+ * - **Generation is run-then-poll.** A still or clip run returns job ids and
5704
+ * records a marker on the production; the results land when anyone — your
5705
+ * poll, the app, a later {@link StudioProductionsResource.reconcile} —
5706
+ * reports the finished job. Nothing waits minutes inside a request.
5707
+ *
5708
+ * Reads are `detail: "summary"` by default (counts and the active urls);
5709
+ * `detail: "full"` adds every result with the context that regenerates it.
5710
+ *
5711
+ * **The ENVELOPES are typed here; the production DOCUMENT is not.** A view, a
5712
+ * summary, a shot and an operation are open JSON on this surface
5713
+ * ({@link StudioProduction}, `ops: unknown[]`) — their field-level types ship
5714
+ * with the studio app, which is the one consumer that narrows them, and a
5715
+ * second spelling of that vocabulary in the SDK would drift from it the first
5716
+ * time either grew. Everything a caller branches on — `version`, `rebased`,
5717
+ * `receipts`, `warnings`, a quote's `credits`, a run's `jobIds` — is typed.
5718
+ *
5719
+ * Cloud edition only: these routes 404 on deployments that do not serve them.
5720
+ * Feature-detect once with `list()` — a deployment without them 404s that too,
5721
+ * where a deployment with them answers an empty page.
5722
+ */
5723
+ /**
5724
+ * A production, a summary, a shot, a receipt's target: open JSON.
5725
+ *
5726
+ * Deliberately not narrowed here — see the note at the top of this module.
5727
+ */
5728
+ type StudioProduction = Record<string, unknown>;
5729
+ /** How much of a production a read returns. */
5730
+ type StudioProductionDetail = "summary" | "full";
5731
+ /** One thing wrong with a plan, addressed at the field that is wrong. */
5732
+ interface StudioPlanIssue {
5733
+ path: string;
5734
+ message: string;
5735
+ hint?: string;
5736
+ }
5737
+ /** `GET …/skill` — the authoring skill, rendered at request time from what is live. */
5738
+ interface StudioSkillResponse {
5739
+ /** The authoring guide. */
5740
+ skill: string;
5741
+ /** Every picker, model and enum, in full. */
5742
+ catalog: string;
5743
+ /** The strict JSON Schema a plan is validated against. */
5744
+ schema: Record<string, unknown>;
5745
+ /** The operating guide: the tool map, the loops, the rules. */
5746
+ operating: string;
5747
+ /** The versions the three were rendered from — bare semver, no package names. */
5748
+ generatedFrom: {
5749
+ prompts: string;
5750
+ shared: string;
5751
+ codec: string;
5752
+ };
5753
+ }
5754
+ interface StudioValidatePlanResponse {
5755
+ valid: boolean;
5756
+ errors: StudioPlanIssue[];
5757
+ warnings: StudioPlanIssue[];
5758
+ summary?: {
5759
+ name?: string;
5760
+ scenes: number;
5761
+ shots: number;
5762
+ cast: number;
5763
+ /** Cast entries that matched a row in the caller's library. */
5764
+ bound: number;
5765
+ };
5766
+ }
5767
+ interface StudioListProductionsResponse {
5768
+ data: StudioProduction[];
5769
+ nextCursor?: string;
5770
+ }
5771
+ /** What a create or an import did, in the words a receipt would use. */
5772
+ interface StudioImportSummary {
5773
+ shotsAdded: number;
5774
+ castEnrolled: number;
5775
+ /** Cast entries that resolved to a row in the caller's library. */
5776
+ castBound: number;
5777
+ }
5778
+ interface StudioProductionResponse {
5779
+ production: StudioProduction;
5780
+ warnings?: StudioPlanIssue[];
5781
+ summary?: StudioImportSummary;
5782
+ }
5783
+ interface StudioCreateProductionRequest {
5784
+ name?: string;
5785
+ plan?: Record<string, unknown>;
5786
+ }
5787
+ /** The caller's own retry token — 8–128 chars of `A-Za-z0-9_.:-`, never derived. */
5788
+ type StudioClientRequestId = string;
5789
+ /**
5790
+ * A batch of operations, applied atomically.
5791
+ *
5792
+ * `ops` is `unknown[]`: the operation union is the studio app's vocabulary and
5793
+ * the route validates it, refusing the whole batch with the offending index.
5794
+ * The served operating guide is the runtime reference for what an operation
5795
+ * looks like.
5796
+ */
5797
+ interface StudioOpsRequest {
5798
+ /** Applied in order. At most 100 per request. */
5799
+ ops: unknown[];
5800
+ /**
5801
+ * The version the batch was composed against. INFORMATIONAL by default: the
5802
+ * operations address by stable KEY, so a batch built on a slightly older
5803
+ * document still applies exactly to the newest one, and the response says
5804
+ * `rebased: true`. Omitting it means "apply to whatever is there".
5805
+ */
5806
+ baseVersion?: number;
5807
+ /**
5808
+ * Refuse to rebase. With `strict: true` a `baseVersion` older than the stored
5809
+ * one is a 409 `workflow_conflict` carrying the current production, instead
5810
+ * of a rebased apply — for the rare "replace exactly what I read" intent.
5811
+ */
5812
+ strict?: boolean;
5813
+ /** Your own token for this batch, so a transport retry is not applied twice. */
5814
+ clientRequestId?: StudioClientRequestId;
5815
+ }
5816
+ /**
5817
+ * One line of what an operation did, in the words a change log would use.
5818
+ *
5819
+ * Past tense, the target named the way the user sees it, the side effect in a
5820
+ * trailing parenthetical: `Deleted take 2 of Shot 1 (in the bin).`
5821
+ */
5822
+ interface StudioOpsReceipt {
5823
+ /** The operation this line reports, by name. */
5824
+ op: string;
5825
+ /** Past tense, naming the target the way a person would. */
5826
+ summary: string;
5827
+ /** Ids the operation MINTED — never ids the caller supplied. */
5828
+ ids?: string[];
5829
+ }
5830
+ /** What a batch produced. Adopt `production` whole; do not merge into it. */
5831
+ interface StudioOpsResponse {
5832
+ /** The canonical production AFTER the batch. */
5833
+ production: StudioProduction;
5834
+ /** The version the batch produced. Carry it as the next `baseVersion`. */
5835
+ version: number;
5836
+ /** True when the batch was applied to a newer document than it named. */
5837
+ rebased: boolean;
5838
+ /** One per operation, in order. */
5839
+ receipts: StudioOpsReceipt[];
5840
+ /**
5841
+ * Things worth saying that are not failures — an operation that changed
5842
+ * nothing, a rename that rewrote four prompts. A warning never rejects a
5843
+ * batch; a refusal does.
5844
+ */
5845
+ warnings: string[];
5846
+ }
5847
+ /** What landing the finished jobs did. */
5848
+ interface StudioReconcileResponse {
5849
+ /** Job ids whose media is now on the production. */
5850
+ landed: string[];
5851
+ /** Job ids still running — their markers stay; call again later. */
5852
+ pending: string[];
5853
+ /** Job ids that failed or were cancelled; their markers are cleared. */
5854
+ failed: string[];
5855
+ /** One line per landing that had something to say. */
5856
+ warnings: string[];
5857
+ /** The production after the landings. */
5858
+ production: StudioProduction;
5859
+ /** Its version — unchanged when nothing landed. */
5860
+ version: number;
5861
+ }
5862
+ /** `POST …/:id/describe` — a Director run that will land as scenes. */
5863
+ interface StudioDescribeRequest {
5864
+ brief: string;
5865
+ llmModel: string;
5866
+ /** `"append"` adds the drafted scenes; `"replace"` rewrites the film. */
5867
+ mode?: "append" | "replace";
5868
+ label?: string;
5869
+ clientRequestId?: StudioClientRequestId;
5870
+ }
5871
+ /**
5872
+ * `POST …/:id/generate` — one framing or directing run for one shot.
5873
+ *
5874
+ * `overrides` is what the CALL owns over what the shot's plan says: the model,
5875
+ * the prose, the aspect, the direction ids. Open JSON, because the request
5876
+ * builders' own option types are the contract and they ship with the studio.
5877
+ */
5878
+ interface StudioGenerateRequest {
5879
+ kind: "still" | "clip";
5880
+ shotId: string;
5881
+ /** Candidates to fan out (stills); the builder clamps it to the catalog's range. */
5882
+ count?: number;
5883
+ /** The directing input mode for a clip; absent ⇒ derived from the inputs. */
5884
+ mode?: "start" | "references";
5885
+ /** Price the run and return; nothing is submitted and nothing is written. */
5886
+ dryRun?: boolean;
5887
+ clientRequestId?: StudioClientRequestId;
5888
+ overrides?: Record<string, unknown>;
5889
+ }
5890
+ /** Which video route a directing run went to — chosen from the inputs, never asked for. */
5891
+ type StudioVideoLane = "generate-video" | "text-to-video";
5892
+ /** `dryRun: true` — what this run would cost, and nothing else. */
5893
+ interface StudioGenerateEstimate {
5894
+ dryRun: true;
5895
+ provider: string;
5896
+ count: number;
5897
+ /** `null` when the model is unpriced or the instance runs without credits. */
5898
+ credits: number | null;
5899
+ lane?: StudioVideoLane;
5900
+ }
5901
+ /**
5902
+ * A started (or already-started) run.
5903
+ *
5904
+ * `deduped` means the same `clientRequestId` came back and the job ids were
5905
+ * answered from the production's own markers — nothing was submitted and
5906
+ * nothing was charged, so `production` is absent.
5907
+ */
5908
+ interface StudioGenerateResponse {
5909
+ jobIds: string[];
5910
+ lane?: StudioVideoLane;
5911
+ deduped?: true;
5912
+ production?: StudioProduction;
5913
+ receipts?: StudioOpsReceipt[];
5914
+ warnings?: string[];
5915
+ }
5916
+ /** `POST …/:id/frame` — a still pulled out of the shot's clip. */
5917
+ interface StudioFrameRequest {
5918
+ shotId: string;
5919
+ mode?: "first" | "last" | "timestamp";
5920
+ /** Seconds, when `mode` is `"timestamp"`. */
5921
+ timestamp?: number;
5922
+ /** Where the grabbed image lands. `"new-shot"` inserts a shot after this one. */
5923
+ target?: "new-shot" | "start-frame" | "end-frame" | "still";
5924
+ clientRequestId?: StudioClientRequestId;
5925
+ }
5926
+ /** `POST …/:id/voice` — synthesize a shot's spoken line and record it. */
5927
+ interface StudioVoiceRequest {
5928
+ shotId: string;
5929
+ text: string;
5930
+ voiceId?: string;
5931
+ voiceType?: "premade" | "custom" | "library";
5932
+ ttsProvider?: string;
5933
+ /** The delivery levers; the text-to-speech route owns their bounds. */
5934
+ delivery?: Record<string, number>;
5935
+ clientRequestId?: StudioClientRequestId;
5936
+ }
5937
+ /** `POST …/:id/revoice` — recast the voices of the shot's active clip. */
5938
+ interface StudioRevoiceRequest {
5939
+ shotId: string;
5940
+ /** The speaker-ordered recast plan, forwarded to the voice route verbatim. */
5941
+ plan: Record<string, unknown>;
5942
+ clientRequestId?: StudioClientRequestId;
5943
+ }
5944
+ /** `POST …/:id/music` — the film's soundtrack. */
5945
+ interface StudioMusicRequest {
5946
+ prompt: string;
5947
+ duration?: number;
5948
+ instrumental?: boolean;
5949
+ vocalGender?: string;
5950
+ model?: string;
5951
+ clientRequestId?: StudioClientRequestId;
5952
+ }
5953
+ /**
5954
+ * What a route that finished its work answers with: the production as it now
5955
+ * stands, plus whatever that route produced.
5956
+ *
5957
+ * `jobId` is present on the routes that only STARTED something (a revoice, a
5958
+ * soundtrack, a draft) — the result lands through its marker.
5959
+ */
5960
+ interface StudioMediaResponse {
5961
+ production: StudioProduction;
5962
+ /** The grabbed frame's url, on the frame route. */
5963
+ url?: string;
5964
+ jobId?: string;
5965
+ receipts?: StudioOpsReceipt[];
5966
+ warnings?: string[];
5967
+ }
5968
+ /**
5969
+ * `GET …/:id/export-plan` — the ordered steps an export would run.
5970
+ *
5971
+ * The caller runs them with the verbs that already exist; a route that chained
5972
+ * three minutes-long jobs is the long-lived request every client times out on.
5973
+ */
5974
+ interface StudioExportPlanResponse {
5975
+ /** False when the production has fewer than two clips — nothing to stitch. */
5976
+ canExport: boolean;
5977
+ steps: StudioExportStep[];
5978
+ /** The step whose output IS the film, or `null` when nothing can run. */
5979
+ resultStepId: string | null;
5980
+ /** Total credits, or `null` when ANY step is unpriced (a partial sum understates). */
5981
+ estimate: number | null;
5982
+ /** The credit models with no price, each named once, in step order. */
5983
+ unpriced: string[];
5984
+ }
5985
+ interface StudioExportStep {
5986
+ /** Stable within one plan and derived from the production, never minted. */
5987
+ id: string;
5988
+ label: string;
5989
+ /** The node this step runs — `merge-video-audio`, `combine-videos`, `video-upscale`. */
5990
+ node: string;
5991
+ creditModel: string;
5992
+ credits: number | null;
5993
+ params: Record<string, unknown>;
5994
+ }
5995
+ /** `POST …/:id/clone` — a copy, which always starts private and visible. */
5996
+ interface StudioCloneRequest {
5997
+ name?: string;
5998
+ }
5999
+ /** Either arm of a generation reply: the quote, or the run that started. */
6000
+ type StudioGenerateResult = StudioGenerateEstimate | StudioGenerateResponse;
6001
+ /** True when a generation reply is the `dryRun` QUOTE rather than a started run. */
6002
+ declare function isStudioGenerateEstimate(result: StudioGenerateResult): result is StudioGenerateEstimate;
6003
+ /** What a `generateStill` / `generateClip` call decides, beyond `kind` and the shot. */
6004
+ type StudioGenerateOptions = Omit<StudioGenerateRequest, "kind" | "shotId">;
6005
+ /**
6006
+ * A route that only STARTED something — a draft, a revoice, a soundtrack. Its
6007
+ * `jobId` is always there, which is what makes `const { jobId } = await …` and
6008
+ * a poll the honest next line.
6009
+ *
6010
+ * `StudioMediaResponse` leaves `jobId` optional because the routes that FINISH
6011
+ * their work (a frame, a voiceover) share the shape and have no job to name.
6012
+ */
6013
+ type StudioJobStartedResponse = StudioMediaResponse & {
6014
+ jobId: string;
6015
+ };
6016
+ interface ListStudioProductionsOptions {
6017
+ limit?: number;
6018
+ /** From a previous page's `nextCursor`. */
6019
+ cursor?: string;
6020
+ /** Include the rows the dashboard hides. Off by default. */
6021
+ includeArchived?: boolean;
6022
+ }
6023
+ interface GetProductionOptions {
6024
+ detail?: StudioProductionDetail;
6025
+ /** Read ONE shot — the cheap way to re-read after a generation. */
6026
+ shotId?: string;
6027
+ }
6028
+ interface StudioExportPlanOptions {
6029
+ /** Plan the 4K finish too. Expensive, so it is always explicit. */
6030
+ upscale?: boolean;
6031
+ }
6032
+ /** `client.studio.productions` — see the note at the top of this module. */
6033
+ declare class StudioProductionsResource {
6034
+ private client;
6035
+ constructor(client: NodaroClient);
6036
+ private path;
6037
+ /**
6038
+ * The authoring guide, the full catalog, the plan's JSON Schema and the
6039
+ * operating guide — rendered server-side from the version that is live, so
6040
+ * they describe the platform you are actually talking to. Free.
6041
+ */
6042
+ skill(): Promise<StudioSkillResponse>;
6043
+ /**
6044
+ * Check a plan before it becomes anything. Free, persists nothing, and
6045
+ * resolves cast names against YOUR library — loop on `errors` until
6046
+ * `valid: true`, then `create({ plan })`.
6047
+ */
6048
+ validatePlan(plan: Record<string, unknown>): Promise<StudioValidatePlanResponse>;
6049
+ /** Your productions, newest first. Archived rows are hidden unless asked for. */
6050
+ list(opts?: ListStudioProductionsOptions): Promise<StudioListProductionsResponse>;
6051
+ /**
6052
+ * One production. A pure read — it never lands a finished job, so call
6053
+ * {@link reconcile} first if you are waiting on one.
6054
+ */
6055
+ get(productionId: string, opts?: GetProductionOptions): Promise<StudioProduction>;
6056
+ /**
6057
+ * The ordered steps that assemble the film, with what they will cost. Run
6058
+ * them yourself with the ordinary verbs — nothing here blocks for minutes,
6059
+ * and nothing here spends.
6060
+ */
6061
+ exportPlan(productionId: string, opts?: StudioExportPlanOptions): Promise<StudioExportPlanResponse>;
6062
+ /** A new production, optionally landed from a plan in the same call. */
6063
+ create(input?: StudioCreateProductionRequest): Promise<StudioProductionResponse>;
6064
+ /**
6065
+ * Apply a batch of operations. Atomic: one bad operation refuses the whole
6066
+ * batch with a `StudioOpError` naming its index, and nothing is written. On
6067
+ * success adopt `production` wholesale and carry `version` forward as the
6068
+ * next `baseVersion`.
6069
+ */
6070
+ ops(productionId: string, input: StudioOpsRequest): Promise<StudioOpsResponse>;
6071
+ /**
6072
+ * Land every generation that has finished since you last looked, and report
6073
+ * what is still running. The one call that turns finished jobs into results
6074
+ * without a browser open. It writes only when something actually landed.
6075
+ */
6076
+ reconcile(productionId: string): Promise<StudioReconcileResponse>;
6077
+ /** Add a plan's scenes to a production that already exists. */
6078
+ importPlan(productionId: string, plan: Record<string, unknown>, opts?: {
6079
+ mode?: "append";
6080
+ }): Promise<StudioProductionResponse>;
6081
+ /**
6082
+ * Turn a brief into scenes. The run is a platform job: poll it, and its
6083
+ * scenes land through {@link reconcile}. The production comes back with the
6084
+ * run recorded on it as a pending draft.
6085
+ */
6086
+ describe(productionId: string, input: StudioDescribeRequest): Promise<StudioJobStartedResponse>;
6087
+ /**
6088
+ * Frame or animate one shot.
6089
+ *
6090
+ * The request is assembled server-side from the shot's own plan, looks and
6091
+ * bound references, so a scripted run and a press of the button in the app
6092
+ * produce the same media; `overrides` changes THIS run without changing the
6093
+ * shot. Prefer {@link generateStill} / {@link generateClip}, which say which
6094
+ * kind they mean.
6095
+ *
6096
+ * `dryRun: true` returns the quote and writes nothing — narrow the reply with
6097
+ * {@link isStudioGenerateEstimate}.
6098
+ */
6099
+ generate(productionId: string, input: StudioGenerateRequest & {
6100
+ dryRun: true;
6101
+ }): Promise<StudioGenerateEstimate>;
6102
+ generate(productionId: string, input: StudioGenerateRequest): Promise<StudioGenerateResult>;
6103
+ /**
6104
+ * Frame a shot: submit `count` candidates and record a pending marker for
6105
+ * each. Results ACCUMULATE — a generate never replaces what is there.
6106
+ *
6107
+ * `clientRequestId` makes a retry safe: the same token answers with the jobs
6108
+ * the first call started (`deduped: true`) and submits nothing. Never retry a
6109
+ * spend without it.
6110
+ */
6111
+ generateStill(productionId: string, shotId: string, opts: StudioGenerateOptions & {
6112
+ dryRun: true;
6113
+ }): Promise<StudioGenerateEstimate>;
6114
+ generateStill(productionId: string, shotId: string, opts?: StudioGenerateOptions): Promise<StudioGenerateResult>;
6115
+ /**
6116
+ * Animate a shot. The LANE is chosen from the shot's inputs (a start frame,
6117
+ * references, a prompt) — never passed in — and reported back as `lane`.
6118
+ */
6119
+ generateClip(productionId: string, shotId: string, opts: StudioGenerateOptions & {
6120
+ dryRun: true;
6121
+ }): Promise<StudioGenerateEstimate>;
6122
+ generateClip(productionId: string, shotId: string, opts?: StudioGenerateOptions): Promise<StudioGenerateResult>;
6123
+ /**
6124
+ * Extract a frame from a shot's active clip and put it where `target` says —
6125
+ * a new shot after this one (the default), this shot's sticky start or end
6126
+ * frame, or another still of the same shot. Seconds, not minutes: this one
6127
+ * waits for the job and answers with the changed production.
6128
+ */
6129
+ frame(productionId: string, input: StudioFrameRequest): Promise<StudioMediaResponse>;
6130
+ /** Synthesize a shot's spoken line and record it. Waits for the job. */
6131
+ voice(productionId: string, input: StudioVoiceRequest): Promise<StudioMediaResponse>;
6132
+ /**
6133
+ * Recast the voices of a shot's active clip. Minutes of work, so it answers
6134
+ * `jobId` and the new clip lands as a result through its own marker.
6135
+ */
6136
+ revoice(productionId: string, input: StudioRevoiceRequest): Promise<StudioJobStartedResponse>;
6137
+ /** Score the film. The finished track lands through its pending marker. */
6138
+ music(productionId: string, input: StudioMusicRequest): Promise<StudioJobStartedResponse>;
6139
+ /**
6140
+ * Open the share-by-link read. Deliberately its own route rather than an
6141
+ * operation: who may see the work is decided by the owner, never as a side
6142
+ * effect of a batch that was editing something else.
6143
+ */
6144
+ share(productionId: string): Promise<StudioProduction>;
6145
+ /** Close it again. Sharing is opt-in AND reversible. */
6146
+ unshare(productionId: string): Promise<StudioProduction>;
6147
+ /**
6148
+ * Copy a production you own or can see into your own Studio project. The
6149
+ * copy starts PRIVATE and visible — sharing and archiving never travel — and
6150
+ * it is copied through YOUR view of the source, so somebody else's bin does
6151
+ * not come with it.
6152
+ */
6153
+ clone(productionId: string, input?: StudioCloneRequest): Promise<StudioProduction>;
6154
+ }
6155
+ /** `client.studio` — the studio's own surface on the platform. */
6156
+ declare class StudioResource {
6157
+ readonly productions: StudioProductionsResource;
6158
+ constructor(client: NodaroClient);
6159
+ }
6160
+
5490
6161
  /**
5491
6162
  * The community-listing types are the single source of truth in
5492
6163
  * `@nodaro/shared` (re-used by the backend, frontend, and CLI). Re-export them
@@ -6072,6 +6743,7 @@ declare class NodaroClient {
6072
6743
  readonly videoPro: VideoProResource;
6073
6744
  readonly executions: ExecutionsResource;
6074
6745
  readonly nodes: NodesResource;
6746
+ readonly scene3d: Scene3DResource;
6075
6747
  readonly developerApps: DeveloperAppsResource;
6076
6748
  readonly oauth: OAuthResource;
6077
6749
  readonly apps: AppsResource;
@@ -6095,6 +6767,7 @@ declare class NodaroClient {
6095
6767
  readonly models: ModelsResource;
6096
6768
  readonly shots: ShotsResource;
6097
6769
  readonly recast: RecastResource;
6770
+ readonly studio: StudioResource;
6098
6771
  readonly community: CommunityResource;
6099
6772
  readonly templates: TemplatesResource;
6100
6773
  readonly tutorials: TutorialsResource;
@@ -6123,6 +6796,10 @@ declare class NodaroClient {
6123
6796
  * ({@link request}) and the text path ({@link requestText}) go through here.
6124
6797
  */
6125
6798
  private send;
6799
+ /** Authenticated, bounded binary reads through the normal timeout/error transport. */
6800
+ requestBytes(method: string, path: string, options: RequestOptions & {
6801
+ maxBytes: number;
6802
+ }): Promise<ArrayBuffer>;
6126
6803
  request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
6127
6804
  /**
6128
6805
  * Like {@link request}, for endpoints that answer text (CSV exports). Errors
@@ -6187,7 +6864,39 @@ declare class WorkflowConflictError extends NodaroError {
6187
6864
  readonly currentUpdatedAt?: string | undefined;
6188
6865
  readonly currentVersion?: number | undefined;
6189
6866
  readonly currentRecord?: Record<string, unknown> | undefined;
6190
- constructor(message?: string, currentUpdatedAt?: string | undefined, currentVersion?: number | undefined, currentRecord?: Record<string, unknown> | undefined);
6867
+ constructor(message?: string, currentUpdatedAt?: string | undefined, currentVersion?: number | undefined, currentRecord?: Record<string, unknown> | undefined,
6868
+ /**
6869
+ * The wire code this conflict actually arrived with.
6870
+ *
6871
+ * `production_busy` is the studio production routes' own 409: the row
6872
+ * changed under a read-modify-write and the server exhausted its retries.
6873
+ * It is the same situation and the same remedy — re-read and apply again —
6874
+ * so it is the same ERROR, and a caller catching `WorkflowConflictError`
6875
+ * handles both. The code stays truthful because a caller that logs or
6876
+ * branches on it should see what the server said, not what the class is
6877
+ * usually called.
6878
+ */
6879
+ code?: WorkflowConflictCode);
6880
+ }
6881
+ /** The 409 codes that mean "somebody else wrote first; re-read and retry". */
6882
+ type WorkflowConflictCode = "workflow_conflict" | "production_busy";
6883
+ /**
6884
+ * A studio operation batch was refused, and the error names WHICH operation
6885
+ * (`opIndex`, zero-based) was wrong. Nothing in the batch was written: a batch
6886
+ * applies atomically or not at all, so fix that one operation and send the
6887
+ * whole batch again.
6888
+ *
6889
+ * Selected by SHAPE — any 4xx carrying a numeric `opIndex` — not by a list of
6890
+ * codes, so a new refusal reason (`op_invalid`, `op_target_missing`, whatever
6891
+ * the server adds next) reaches the caller as this error without an SDK
6892
+ * release. `code` is whatever the server sent.
6893
+ */
6894
+ declare class StudioOpError extends NodaroError {
6895
+ /** Zero-based index into the `ops` array that was sent. */
6896
+ readonly opIndex: number;
6897
+ constructor(message: string, code: string, status: number,
6898
+ /** Zero-based index into the `ops` array that was sent. */
6899
+ opIndex: number);
6191
6900
  }
6192
6901
  /**
6193
6902
  * HTTP 422 `job_blocked`. A job policy registered by this deployment refused
@@ -6266,9 +6975,10 @@ interface ApiErrorBody {
6266
6975
  required?: number;
6267
6976
  available?: number;
6268
6977
  limitBytes?: number;
6978
+ opIndex?: number;
6269
6979
  [key: string]: unknown;
6270
6980
  };
6271
6981
  }
6272
6982
  declare function throwFromResponse(status: number, body: ApiErrorBody): never;
6273
6983
 
6274
- export { type AccessTokenResponse, type AnalyzeInput, type AnalyzeResult, type AppRun, type AppRunResult, type ApplyChatProposalResult, type ApproveCreatureMainImageResult, type ApproveMainImageResult, type ApproveObjectMainImageResult, type ApprovePortraitResult, AppsResource, AudioResource, type Auth, type BranchPipelineInput, type BranchPipelineResult, type BrowseTemplatesParams, type BrowseTemplatesResult, CREATURE_ASSET_TYPES, CallbackAuth, type CancelExecutionParams, type CancelJobResult, CatalogsResource, type Character, type CharacterDetail, type CharacterUsage, CharactersResource, type ChatStageResult, type ChatTurn, type ClientOptions, type CloneTemplateParams, type CloneTemplateResult, CommunityResource, type ContinueVideoProResult, type CreateCreatureInput, type CreateDeveloperAppInput, type CreateDeveloperAppResult, type CreateLocationInput, type CreateObjectInput, type CreateOrgInput, type CreateProjectInput, type CreateRecastInput, type CreateShotInput, type CreateWorkflowInput, type CreateWorkspaceInput, type Creature, type CreatureAssetType, type CreatureDetail, type CreatureReferencePhoto, type CreatureReferencePhotoKind, CreaturesResource, type CreditStatus, CreditsResource, type DeleteAppRunResult, type DeleteJobResult, type DeveloperApp, type DeveloperAppScope, type DeveloperAppStatus, DeveloperAppsResource, type DownloadVideoProgress, type DubbingInput, type DuplicateCharacterInput, type EditScene3DParams, type EnhanceInput, type EstimateRecastInput, type EstimateRecastRescoreInput, type ExchangeCodeInput, type ExecutionStatus, type ExecutionTriggerType, ExecutionsResource, type FactoryPresetsResult, ForbiddenError, type GenerateAssetInput, type GenerateCharacterInput, type GenerateCharacterResult, type GenerateCreatureAssetInput, type GenerateCreatureAssetResult, type GenerateCreatureInput, type GenerateCreatureMotionInput, type GenerateCreatureMotionResult, type GenerateCreatureResult, type GenerateImageParams, type GenerateInput, type GenerateLocationAssetInput, type GenerateLocationInput, type GenerateLocationResult, type GenerateMotionInput, type GenerateObjectAssetInput, type GenerateObjectAssetResult, type GenerateObjectInput, type GenerateObjectMotionInput, type GenerateObjectMotionResult, type GenerateObjectResult, type GenerateScene3DParams, type GenerateSurroundContinuationInput, type GenerateVideoParams, type GetPickerCatalogOptions, InsufficientCreditsError, type InviteInput, type Job, JobAbortedError, JobBlockedError, type JobErrorHint, JobFailedError, JobHeldError, type JobStatus, type JobStatusResult, JobTimeoutError, JobsResource, type LibraryAsset, LibraryResource, type ListAppRunsParams, type ListAppsParams, type ListAppsResult, type ListCharactersParams, type ListCharactersResult, type ListCreaturesParams, type ListExecutionsForWorkflowParams, type ListExecutionsPage, type ListInvitationsOptions, type ListJobsPage, type ListJobsParams, type ListLibraryParams, type ListLibraryResult, type ListLocationsParams, type ListModelsOptions, type ListObjectsParams, type ListWorkflowsParams, LlmResource, type LlmStructuredInput, type LlmStructuredJobInput, type LlmStructuredJobOutput, type LlmStructuredResult, type Location, type LocationDetail, type LocationReferencePhoto, type LocationReferencePhotoKind, LocationsResource, type MediaProcessInput, type MediaProcessResult, MediaResource, type ModelCostsResult, type ModelSummary, type ModelsListResult, ModelsResource, NodaroClient, NodaroError, type NodeCategory, type NodeDescriptor, type NodeExecutionState, type NodeInputField, type NodeInputSchema, type NodeJobOutput, type NodePreset, type NodePresetGroup, NodesResource, NotFoundError, type OAuthAppInfo, OAuthResource, type Object$1 as Object, type ObjectCategory, type ObjectDetail, type ObjectReferencePhoto, type ObjectReferencePhotoKind, ObjectsResource, OrganizationsResource, type OutputType, type PickerCatalog, type PickerCatalogSummary, PickerCatalogsResource, type PickerDimension, type PickerOption, PipelinesResource, type PolicyBlockHint, PresetsResource, type Project, type ProjectedCatalog, type ProjectedCatalogDimension, type ProjectedCatalogOption, ProjectsResource, PromptHelperResource, type PromptResult, type PublishedApp, type PublishedAppDetail, RateLimitedError, type RecaptionCreatureResult, type RecaptionLocationResult, type RecaptionObjectResult, type RecaptionResult, type RecastAudioLayerName, type RecastAudioManifestV1, type RecastAudioMix, type RecastAudioMixControl, type RecastAudioSectionReplacement, type RecastEstimate, type RecastRescoreOperation, type RecastRescoreQuote, type RecastRescoreReplacement, type RecastRescoreRequestV2, type RecastRescoreResponse, RecastResource, type RecastRunSnapshot, type RecastScriptImportResult, type RecastScriptValidation, type RecastScriptValidationError, type ReduceInput, ReduceResource, type ReduceResult, type ReferencePhoto, type ReferencePhotoKind, type RenderScene3DParams, type ResolveRecastGateInput, type RotateSecretResult, type RunAndWaitOptions, type RunAppOptions, type RunManyResult, type RunNodeAdjustment, type RunNodeResult, type RunWorkflowParams, type RunWorkflowResult, type SafetyBlockHint, type Scene3DJobOutput, type Shot, type ShotEntityRef, type ShotMode, ShotsResource, StaticTokenAuth, type StopVideoProResult, StorageExceededError, type StructuredReferenceParams, type Template, type TemplateBrowseCard, type TemplateSort, TemplatesResource, type TextToVideoParams, type TutorialCategory, type TutorialFlowItem, type TutorialVideoItem, TutorialsResource, UnauthorizedError, type UpdateCreatureInput, type UpdateCreatureResult, type UpdateDeveloperAppInput, type UpdateLocationInput, type UpdateLocationResult, type UpdateObjectInput, type UpdateObjectResult, type UpdateProjectInput, type UpdateShotInput, type UpdateWorkflowInput, type UploadResult, UploadsResource, type UpsertCharacterInput, type UpsertCharacterResult, type UpsertCreatureInput, type UpsertCreatureResult, type UpsertObjectInput, type UpsertObjectResult, type UserBalance, type UserIdentity, type VcpAnalysis, type VcpAnalysisSpeaker, type VcpAnalyzeInput, type VcpExportInput, type VcpExportTrack, type VideoMetadata, VideoProResource, type VoiceChangerProInput, type VoiceChangerProVoice, type VoiceDesignInput, type VoiceRemixInput, VoicesResource, type Workflow, WorkflowConflictError, type WorkflowExecution, type WorkflowExecutionSummary, WorkflowsResource, WorkspacesResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
6984
+ export { type AccessTokenResponse, type AnalyzeInput, type AnalyzeResult, type AppRun, type AppRunResult, type ApplyChatProposalResult, type ApproveCreatureMainImageResult, type ApproveMainImageResult, type ApproveObjectMainImageResult, type ApprovePortraitResult, AppsResource, AudioResource, type Auth, type BranchPipelineInput, type BranchPipelineResult, type BrowseTemplatesParams, type BrowseTemplatesResult, CREATURE_ASSET_TYPES, CallbackAuth, type CancelExecutionParams, type CancelJobResult, CatalogsResource, type Character, type CharacterDetail, type CharacterUsage, CharactersResource, type ChatStageResult, type ChatTurn, type ClientOptions, type CloneTemplateParams, type CloneTemplateResult, CommunityResource, type ContinueVideoProResult, type CreateCreatureInput, type CreateDeveloperAppInput, type CreateDeveloperAppResult, type CreateLocationInput, type CreateObjectInput, type CreateOrgInput, type CreateProjectInput, type CreateRecastInput, type CreateShotInput, type CreateWorkflowInput, type CreateWorkspaceInput, type Creature, type CreatureAssetType, type CreatureDetail, type CreatureReferencePhoto, type CreatureReferencePhotoKind, CreaturesResource, type CreditStatus, CreditsResource, type DeleteAppRunResult, type DeleteJobResult, type DeveloperApp, type DeveloperAppScope, type DeveloperAppStatus, DeveloperAppsResource, type DownloadVideoProgress, type DubbingInput, type DuplicateCharacterInput, type EditScene3DParams, type EnhanceInput, type EstimateRecastInput, type EstimateRecastRescoreInput, type ExchangeCodeInput, type ExecutionStatus, type ExecutionTriggerType, ExecutionsResource, type FactoryPresetsResult, ForbiddenError, type GenerateAssetInput, type GenerateCharacterInput, type GenerateCharacterResult, type GenerateCreatureAssetInput, type GenerateCreatureAssetResult, type GenerateCreatureInput, type GenerateCreatureMotionInput, type GenerateCreatureMotionResult, type GenerateCreatureResult, type GenerateImageParams, type GenerateInput, type GenerateLocationAssetInput, type GenerateLocationInput, type GenerateLocationResult, type GenerateMotionInput, type GenerateObjectAssetInput, type GenerateObjectAssetResult, type GenerateObjectInput, type GenerateObjectMotionInput, type GenerateObjectMotionResult, type GenerateObjectResult, type GenerateScene3DParams, type GenerateSurroundContinuationInput, type GenerateVideoParams, type GetPickerCatalogOptions, type GetProductionOptions, InsufficientCreditsError, type InviteInput, type Job, JobAbortedError, JobBlockedError, type JobErrorHint, JobFailedError, JobHeldError, type JobStatus, type JobStatusResult, JobTimeoutError, JobsResource, type LibraryAsset, LibraryResource, type ListAppRunsParams, type ListAppsParams, type ListAppsResult, type ListCharactersParams, type ListCharactersResult, type ListCreaturesParams, type ListExecutionsForWorkflowParams, type ListExecutionsPage, type ListInvitationsOptions, type ListJobsPage, type ListJobsParams, type ListLibraryParams, type ListLibraryResult, type ListLocationsParams, type ListModelsOptions, type ListObjectsParams, type ListStudioProductionsOptions, type ListWorkflowsParams, LlmResource, type LlmStructuredInput, type LlmStructuredJobInput, type LlmStructuredJobOutput, type LlmStructuredResult, type Location, type LocationDetail, type LocationReferencePhoto, type LocationReferencePhotoKind, LocationsResource, type MediaProcessInput, type MediaProcessResult, MediaResource, type ModelCostsResult, type ModelSummary, type ModelsListResult, ModelsResource, NodaroClient, NodaroError, type NodeCategory, type NodeDescriptor, type NodeExecutionState, type NodeInputField, type NodeInputSchema, type NodeJobOutput, type NodePreset, type NodePresetGroup, NodesResource, NotFoundError, type OAuthAppInfo, OAuthResource, type Object$1 as Object, type ObjectCategory, type ObjectDetail, type ObjectReferencePhoto, type ObjectReferencePhotoKind, ObjectsResource, OrganizationsResource, type OutputType, type PickerCatalog, type PickerCatalogSummary, PickerCatalogsResource, type PickerDimension, type PickerOption, PipelinesResource, type PolicyBlockHint, PresetsResource, type Project, type ProjectedCatalog, type ProjectedCatalogDimension, type ProjectedCatalogOption, ProjectsResource, PromptHelperResource, type PromptResult, type PublishedApp, type PublishedAppDetail, RateLimitedError, type RecaptionCreatureResult, type RecaptionLocationResult, type RecaptionObjectResult, type RecaptionResult, type RecastAudioLayerName, type RecastAudioManifestV1, type RecastAudioMix, type RecastAudioMixControl, type RecastAudioSectionReplacement, type RecastEstimate, type RecastRescoreOperation, type RecastRescoreQuote, type RecastRescoreReplacement, type RecastRescoreRequestV2, type RecastRescoreResponse, RecastResource, type RecastRunSnapshot, type RecastScriptImportResult, type RecastScriptValidation, type RecastScriptValidationError, type ReduceInput, ReduceResource, type ReduceResult, type ReferencePhoto, type ReferencePhotoKind, type RenderScene3DParams, type ResolveRecastGateInput, type RetainedScene3DEditParams, type RetainedScene3DEditResult, type RotateSecretResult, type RunAndWaitOptions, type RunAppOptions, type RunManyResult, type RunNodeAdjustment, type RunNodeResult, type RunWorkflowParams, type RunWorkflowResult, type SafetyBlockHint, type Scene3DAuthoringEngine, type Scene3DCapabilities, type Scene3DDelivery, type Scene3DDeliveryAsset, type Scene3DJobOutput, Scene3DResource, type Shot, type ShotEntityRef, type ShotMode, ShotsResource, StaticTokenAuth, type StopVideoProResult, StorageExceededError, type StructuredReferenceParams, type StudioClientRequestId, type StudioCloneRequest, type StudioCreateProductionRequest, type StudioDescribeRequest, type StudioExportPlanOptions, type StudioExportPlanResponse, type StudioExportStep, type StudioFrameRequest, type StudioGenerateEstimate, type StudioGenerateOptions, type StudioGenerateRequest, type StudioGenerateResponse, type StudioGenerateResult, type StudioImportSummary, type StudioJobStartedResponse, type StudioListProductionsResponse, type StudioMediaResponse, type StudioMusicRequest, StudioOpError, type StudioOpsReceipt, type StudioOpsRequest, type StudioOpsResponse, type StudioPlanIssue, type StudioProduction, type StudioProductionDetail, type StudioProductionResponse, StudioProductionsResource, type StudioReconcileResponse, StudioResource, type StudioRevoiceRequest, type StudioSkillResponse, type StudioValidatePlanResponse, type StudioVideoLane, type StudioVoiceRequest, type Template, type TemplateBrowseCard, type TemplateSort, TemplatesResource, type TextToVideoParams, type TutorialCategory, type TutorialFlowItem, type TutorialVideoItem, TutorialsResource, UnauthorizedError, type UpdateCreatureInput, type UpdateCreatureResult, type UpdateDeveloperAppInput, type UpdateLocationInput, type UpdateLocationResult, type UpdateObjectInput, type UpdateObjectResult, type UpdateProjectInput, type UpdateShotInput, type UpdateWorkflowInput, type UploadResult, UploadsResource, type UpsertCharacterInput, type UpsertCharacterResult, type UpsertCreatureInput, type UpsertCreatureResult, type UpsertObjectInput, type UpsertObjectResult, type UserBalance, type UserIdentity, type VcpAnalysis, type VcpAnalysisSpeaker, type VcpAnalyzeInput, type VcpExportInput, type VcpExportTrack, type VideoMetadata, VideoProResource, type VoiceChangerProInput, type VoiceChangerProVoice, type VoiceDesignInput, type VoiceRemixInput, VoicesResource, type Workflow, type WorkflowConflictCode, WorkflowConflictError, type WorkflowExecution, type WorkflowExecutionSummary, WorkflowsResource, WorkspacesResource, buildPersonSeedPrompt, createClient, isStudioGenerateEstimate, supabaseAuth, throwFromResponse };