@nodaro/sdk 2.45.1 → 2.47.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.
Files changed (95) hide show
  1. package/dist/chunk-6NTKEXT5.js +3 -0
  2. package/dist/chunk-6NTKEXT5.js.map +1 -0
  3. package/dist/{chunk-34JMD6ZO.cjs → chunk-7LTVS75S.cjs} +36 -12
  4. package/dist/chunk-7LTVS75S.cjs.map +1 -0
  5. package/dist/{chunk-J6FHBQ4Z.cjs → chunk-DIF7A5OH.cjs} +2 -2
  6. package/dist/chunk-DIF7A5OH.cjs.map +1 -0
  7. package/dist/{chunk-3Y5TV37H.js → chunk-FCYN4N3M.js} +3 -3
  8. package/dist/{chunk-3Y5TV37H.js.map → chunk-FCYN4N3M.js.map} +1 -1
  9. package/dist/{chunk-55ZX6TE3.cjs → chunk-GDDV5U32.cjs} +6 -6
  10. package/dist/chunk-GDDV5U32.cjs.map +1 -0
  11. package/dist/{chunk-JB4GVP4Q.js → chunk-GW76IRQD.js} +2 -2
  12. package/dist/{chunk-JB4GVP4Q.js.map → chunk-GW76IRQD.js.map} +1 -1
  13. package/dist/{chunk-RQY2WJD3.js → chunk-I7AHLDXV.js} +13 -9
  14. package/dist/chunk-I7AHLDXV.js.map +1 -0
  15. package/dist/chunk-KBHDUHKM.js +21 -0
  16. package/dist/chunk-KBHDUHKM.js.map +1 -0
  17. package/dist/{chunk-WFWZBYBS.cjs → chunk-MYTMNPCP.cjs} +3 -3
  18. package/dist/{chunk-WFWZBYBS.cjs.map → chunk-MYTMNPCP.cjs.map} +1 -1
  19. package/dist/{chunk-A7HOOWKS.cjs → chunk-NP6KDFIJ.cjs} +19 -15
  20. package/dist/chunk-NP6KDFIJ.cjs.map +1 -0
  21. package/dist/{chunk-HKDIIFG2.js → chunk-OWG3XAHQ.js} +6 -6
  22. package/dist/chunk-OWG3XAHQ.js.map +1 -0
  23. package/dist/{chunk-6MQ2LTJZ.js → chunk-PQHZUWSL.js} +36 -12
  24. package/dist/chunk-PQHZUWSL.js.map +1 -0
  25. package/dist/{chunk-5IXZLQNT.cjs → chunk-TK2CEVSK.cjs} +2 -2
  26. package/dist/{chunk-5IXZLQNT.cjs.map → chunk-TK2CEVSK.cjs.map} +1 -1
  27. package/dist/chunk-UANHMQ3A.cjs +4 -0
  28. package/dist/chunk-UANHMQ3A.cjs.map +1 -0
  29. package/dist/{chunk-PEMLIAPZ.cjs → chunk-WMT7HEBZ.cjs} +40 -7
  30. package/dist/chunk-WMT7HEBZ.cjs.map +1 -0
  31. package/dist/{chunk-Y6VDCZPB.js → chunk-WS4ZQ4AA.js} +40 -7
  32. package/dist/chunk-WS4ZQ4AA.js.map +1 -0
  33. package/dist/{chunk-CKHCSZCV.js → chunk-XILR6TFO.js} +2 -2
  34. package/dist/chunk-XILR6TFO.js.map +1 -0
  35. package/dist/chunk-XKDVEQVD.cjs +23 -0
  36. package/dist/chunk-XKDVEQVD.cjs.map +1 -0
  37. package/dist/entries/cast-swap.cjs +2 -2
  38. package/dist/entries/cast-swap.d.cts +126 -146
  39. package/dist/entries/cast-swap.d.ts +126 -146
  40. package/dist/entries/cast-swap.js +1 -1
  41. package/dist/entries/characters.d.cts +1 -1
  42. package/dist/entries/characters.d.ts +1 -1
  43. package/dist/entries/client.cjs +14 -13
  44. package/dist/entries/client.d.cts +4 -1
  45. package/dist/entries/client.d.ts +4 -1
  46. package/dist/entries/client.js +9 -8
  47. package/dist/entries/core.cjs +5 -5
  48. package/dist/entries/core.js +1 -1
  49. package/dist/entries/creatures.d.cts +1 -1
  50. package/dist/entries/creatures.d.ts +1 -1
  51. package/dist/entries/jobs.cjs +2 -2
  52. package/dist/entries/jobs.d.cts +57 -8
  53. package/dist/entries/jobs.d.ts +57 -8
  54. package/dist/entries/jobs.js +1 -1
  55. package/dist/entries/locations.d.cts +1 -1
  56. package/dist/entries/locations.d.ts +1 -1
  57. package/dist/entries/nodes.cjs +2 -2
  58. package/dist/entries/nodes.d.cts +1 -1
  59. package/dist/entries/nodes.d.ts +1 -1
  60. package/dist/entries/nodes.js +1 -1
  61. package/dist/entries/objects.d.cts +1 -1
  62. package/dist/entries/objects.d.ts +1 -1
  63. package/dist/entries/scene3d.d.cts +2 -2
  64. package/dist/entries/scene3d.d.ts +2 -2
  65. package/dist/entries/sessions.cjs +2 -2
  66. package/dist/entries/sessions.d.cts +58 -8
  67. package/dist/entries/sessions.d.ts +58 -8
  68. package/dist/entries/sessions.js +1 -1
  69. package/dist/entries/trash.cjs +13 -0
  70. package/dist/entries/trash.cjs.map +1 -0
  71. package/dist/entries/trash.d.cts +71 -0
  72. package/dist/entries/trash.d.ts +71 -0
  73. package/dist/entries/trash.js +4 -0
  74. package/dist/entries/trash.js.map +1 -0
  75. package/dist/entries/trends.cjs +2 -2
  76. package/dist/entries/trends.d.cts +30 -21
  77. package/dist/entries/trends.d.ts +30 -21
  78. package/dist/entries/trends.js +1 -1
  79. package/dist/index.cjs +30 -24
  80. package/dist/index.d.cts +5 -4
  81. package/dist/index.d.ts +5 -4
  82. package/dist/index.js +11 -9
  83. package/dist/{nodes-MThDit8l.d.ts → nodes-C9j0PFto.d.ts} +11 -1
  84. package/dist/{nodes-Szl6HrZ_.d.cts → nodes-DGIefTze.d.cts} +11 -1
  85. package/package.json +7 -2
  86. package/dist/chunk-34JMD6ZO.cjs.map +0 -1
  87. package/dist/chunk-55ZX6TE3.cjs.map +0 -1
  88. package/dist/chunk-6MQ2LTJZ.js.map +0 -1
  89. package/dist/chunk-A7HOOWKS.cjs.map +0 -1
  90. package/dist/chunk-CKHCSZCV.js.map +0 -1
  91. package/dist/chunk-HKDIIFG2.js.map +0 -1
  92. package/dist/chunk-J6FHBQ4Z.cjs.map +0 -1
  93. package/dist/chunk-PEMLIAPZ.cjs.map +0 -1
  94. package/dist/chunk-RQY2WJD3.js.map +0 -1
  95. package/dist/chunk-Y6VDCZPB.js.map +0 -1
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ // src/resources/trash.ts
4
+ var TrashResource = class {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ client;
9
+ /** One newest-first page of the Trash, on your side of the workspace line. */
10
+ list(params = {}) {
11
+ const query = {};
12
+ if (params.projectId) query.projectId = params.projectId;
13
+ if (params.tool) query.tool = params.tool;
14
+ if (params.type !== void 0) query.type = typeof params.type === "string" ? params.type : params.type.join(",");
15
+ if (params.limit !== void 0) query.limit = String(params.limit);
16
+ if (params.cursor) query.cursor = params.cursor;
17
+ return this.client.request("GET", "/v1/trash", { query });
18
+ }
19
+ };
20
+
21
+ exports.TrashResource = TrashResource;
22
+ //# sourceMappingURL=chunk-XKDVEQVD.cjs.map
23
+ //# sourceMappingURL=chunk-XKDVEQVD.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resources/trash.ts"],"names":[],"mappings":";;;AAyDO,IAAM,gBAAN,MAAoB;AAAA,EACzB,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA,EAGpB,IAAA,CAAK,MAAA,GAA0B,EAAC,EAAuB;AACrD,IAAA,MAAM,QAAgC,EAAC;AACvC,IAAA,IAAI,MAAA,CAAO,SAAA,EAAW,KAAA,CAAM,SAAA,GAAY,MAAA,CAAO,SAAA;AAC/C,IAAA,IAAI,MAAA,CAAO,IAAA,EAAM,KAAA,CAAM,IAAA,GAAO,MAAA,CAAO,IAAA;AACrC,IAAA,IAAI,MAAA,CAAO,IAAA,KAAS,MAAA,EAAW,KAAA,CAAM,OAAO,OAAO,MAAA,CAAO,IAAA,KAAS,QAAA,GAAW,MAAA,CAAO,IAAA,GAAO,MAAA,CAAO,IAAA,CAAK,KAAK,GAAG,CAAA;AAChH,IAAA,IAAI,OAAO,KAAA,KAAU,MAAA,QAAiB,KAAA,GAAQ,MAAA,CAAO,OAAO,KAAK,CAAA;AACjE,IAAA,IAAI,MAAA,CAAO,MAAA,EAAQ,KAAA,CAAM,MAAA,GAAS,MAAA,CAAO,MAAA;AACzC,IAAA,OAAO,KAAK,MAAA,CAAO,OAAA,CAAQ,OAAO,WAAA,EAAa,EAAE,OAAO,CAAA;AAAA,EAC1D;AACF","file":"chunk-XKDVEQVD.cjs","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\nimport type { Job } from \"./jobs.js\"\n\n/** The session a removed item was removed from. */\nexport interface TrashSession {\n id: string\n title: string | null\n projectId: string | null\n}\n\n/**\n * One entry of the Trash: an item removed from a session, or a deleted job.\n * Narrow on `kind`.\n *\n * - `removed`: kept until restored (`client.sessions.restoreItem(session.id, job.id)`)\n * or deleted for good (`client.sessions.removeItem(session.id, job.id, { forever: true })`).\n * - `deleted`: kept until `purgeAt` (30 days after `deletedAt`), then deleted for\n * good (a copy saved to the Library stays); restore with `client.jobs.restore(job.id)`, or delete\n * now with `client.jobs.delete(job.id, { forever: true })`.\n *\n * A removed item whose job was also deleted is listed once, as the deleted job.\n */\nexport type TrashEntry =\n | { kind: \"removed\"; removedAt: string; session: TrashSession; job: Job }\n | { kind: \"deleted\"; deletedAt: string; purgeAt: string; job: Job }\n\nexport interface ListTrashParams {\n /**\n * A project's id: its sessions' removed items, and deleted jobs a session of\n * it held. `\"none\"`: the sessions with no project, and General.\n */\n projectId?: string | \"none\"\n /**\n * A creation tool (e.g. `\"create-image\"`): what a session of that tool holds\n * or held. A job no session ever held has no tool and is left out — filter by\n * `type` alone to include it.\n */\n tool?: string\n /**\n * The job's `input_data.type` (`\"generate-image\"`, …), like `client.jobs.list`.\n * One value or several (up to 20). Every filter combines with AND.\n */\n type?: string | readonly string[]\n /** Page size, 1–100 (server default 50). */\n limit?: number\n /** The previous page's `next`. */\n cursor?: string\n}\n\nexport interface TrashPage {\n /** A page may hold fewer than `limit` entries and still carry a `next`; page on `next`. */\n data: TrashEntry[]\n /** Pass back as `cursor` for the next page; `null` on the last one. */\n next: string | null\n}\n\n/** Your Trash (`GET /v1/trash`): one entry beside General in a creation tool's sessions list. */\nexport class TrashResource {\n constructor(private client: NodaroClientCore) {}\n\n /** One newest-first page of the Trash, on your side of the workspace line. */\n list(params: ListTrashParams = {}): Promise<TrashPage> {\n const query: Record<string, string> = {}\n if (params.projectId) query.projectId = params.projectId\n if (params.tool) query.tool = params.tool\n if (params.type !== undefined) query.type = typeof params.type === \"string\" ? params.type : params.type.join(\",\")\n if (params.limit !== undefined) query.limit = String(params.limit)\n if (params.cursor) query.cursor = params.cursor\n return this.client.request(\"GET\", \"/v1/trash\", { query })\n }\n}\n"]}
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  require('../chunk-RQSGS7ZK.cjs');
4
- var chunk55ZX6TE3_cjs = require('../chunk-55ZX6TE3.cjs');
4
+ var chunkGDDV5U32_cjs = require('../chunk-GDDV5U32.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "CastSwapResource", {
9
9
  enumerable: true,
10
- get: function () { return chunk55ZX6TE3_cjs.CastSwapResource; }
10
+ get: function () { return chunkGDDV5U32_cjs.CastSwapResource; }
11
11
  });
12
12
  //# sourceMappingURL=cast-swap.cjs.map
13
13
  //# sourceMappingURL=cast-swap.cjs.map
@@ -3,9 +3,10 @@ import '@nodaro/shared/apps';
3
3
  import '@nodaro/shared/organizations';
4
4
 
5
5
  /**
6
- * Cast Swap — replace the people, pets, products and/or the location in a
7
- * short video with your own references, keeping its motion, framing, timing
8
- * and sound (the clip's audio is kept, and the result is the clip's length).
6
+ * Nodaro Motion (the `castSwap` resource; routes `/v1/cast-swap`) — replace
7
+ * the people, pets, products and/or the location in a short video with your
8
+ * own references, keeping its motion, framing, timing and sound (the clip's
9
+ * audio is kept, and the result is the clip's length).
9
10
  *
10
11
  * Before the video, each person, pet and product role's photos are turned
11
12
  * into one clean reference picture by an image model. This costs extra
@@ -14,11 +15,16 @@ import '@nodaro/shared/organizations';
14
15
  * photos if it fails, and is turned off with `prepareReferences: false`.
15
16
  * Locations are not prepared.
16
17
  *
17
- * Engines: a run is made on Seedance 2.5 (`engine` left out, or
18
- * `"seedance-2-5"`) or Kling 4 (`"kling-4"`). Kling 4 renders 720p (its
19
- * default) or 1080p and has no draft; it makes a new take guided by the clip
20
- * and pictures, so its Full Quality is a new take at 1080p rather than the
21
- * same take re-rendered (`CastSwapFullQualityEstimate.kind`).
18
+ * Engines: a run is made on Nodaro Motion Pro (`engine` left out, or
19
+ * `"motion-pro"`) or Nodaro Motion Lite (`"motion-lite"`). Lite renders 720p
20
+ * (its default) or 1080p and has no draft; it makes a new take guided by the
21
+ * clip and pictures, so its Full Quality is a new take at 1080p rather than
22
+ * the same take re-rendered (`CastSwapFullQualityEstimate.kind`).
23
+ *
24
+ * How the clip is prepared for the video model (for one, whether faces are
25
+ * hidden first, and whether a refused clip is retried) is set by Nodaro for
26
+ * each engine; a run cannot change it. `faceMasking` is no longer read
27
+ * (deprecated: accepted and ignored).
22
28
  *
23
29
  * Cloud edition only: `/v1/cast-swap` is served by the cloud plugin and 404s
24
30
  * on self-hosted installs. `run()` answers 202 with a job id; follow it with
@@ -34,40 +40,50 @@ import '@nodaro/shared/organizations';
34
40
  * anything is charged: 400 `validation_error` (the body: no role with images,
35
41
  * no reference and no `prePrompt` or `postPrompt`, more roles of a kind
36
42
  * than allowed, more than 30 images in all, `draft: true` above 480p, a
37
- * `prePrompt` or `postPrompt` over 4,000 characters, a `faceMasking` setting
38
- * out of range); on Kling 4, `draft_unsupported` (`draft: true`),
39
- * `resolution_unsupported` (480p), `output_format_unsupported` (a MOV edit
40
- * output) and `too_many_images` (more than 10 images in the run, across every
41
- * role and fixed reference); `raw_reference_token` (also in a reference's `line`),
43
+ * `prePrompt` or `postPrompt` over 4,000 characters); on Nodaro Motion Lite,
44
+ * `draft_unsupported` (`draft: true`), `resolution_unsupported` (480p),
45
+ * `output_format_unsupported` (a MOV edit output) and `too_many_images` (more
46
+ * than 10 images in the run, across every role and fixed reference);
47
+ * `raw_reference_token` (also in a reference's `line`),
42
48
  * `invalid_role_mention` (also any `{role:N}` in a reference's `line`),
43
49
  * `unsafe_url`, `video_unreadable`, `clip_out_of_range` (4–30 s),
44
50
  * `preview_out_of_range`, `no_roles_in_preview` (a preview with every role
45
51
  * `inPreview: false`, always refused even with a prompt, or with no role kept
46
52
  * in it that has images and no `prePrompt` or `postPrompt`), `prompt_too_long`
47
53
  * (the prompt would build too long: a `{role:N}` reads as the role's name when
48
- * it sends no images; Kling 4's cap is 8,000 characters); 401; 402 `insufficient_credits` (`run()` only); 404
54
+ * it sends no images; Nodaro Motion Lite's cap is 8,000 characters); 401; 402 `insufficient_credits` (`run()` only); 404
49
55
  * (a `sessionId` you may not use, `run()` only); 422 `job_blocked` (`run()`
50
56
  * only); 503 `host_too_old` (both); 503 `estimate_unavailable` (`estimate()`
51
57
  * only).
52
58
  */
53
59
  /**
54
- * The video engine a Cast Swap run is made on. Left out = `"seedance-2-5"`.
60
+ * The engine a Nodaro Motion run is made on, by its public id. Left out =
61
+ * `"motion-pro"`.
55
62
  *
56
- * - `"seedance-2-5"`: 480p (the default, a draft unless `draft: false`), 720p
57
- * or 1080p; Full Quality re-renders a draft's own take at 1080p.
58
- * - `"kling-4"`: 720p (the default) or 1080p, never a draft (`draft: true`
59
- * answers 400 `draft_unsupported`); Full Quality makes a new take at 1080p
60
- * from a completed 720p run's inputs. A preview is still 4 s from
61
- * `previewStart`.
63
+ * - `"motion-pro"` (Nodaro Motion Pro): 480p (the default, a draft unless
64
+ * `draft: false`), 720p or 1080p; Full Quality re-renders a draft's own take
65
+ * at 1080p.
66
+ * - `"motion-lite"` (Nodaro Motion Lite): 720p (the default) or 1080p, never a
67
+ * draft (`draft: true` answers 400 `draft_unsupported`); Full Quality makes a
68
+ * new take at 1080p from a completed 720p run's inputs. A preview is still
69
+ * 4 s from `previewStart`.
70
+ */
71
+ type CastSwapEngine = "motion-pro" | "motion-lite";
72
+ /**
73
+ * The engine ids an older client sent (`"seedance-2-5"` = `"motion-pro"`,
74
+ * `"kling-4"` = `"motion-lite"`). Still accepted in a request; never returned.
75
+ * @deprecated use {@link CastSwapEngine}.
62
76
  */
63
- type CastSwapEngine = "seedance-2-5" | "kling-4";
77
+ type CastSwapEngineLegacyId = "seedance-2-5" | "kling-4";
64
78
  /**
65
- * Where a Kling 4 run cuts the clip to whole seconds (Kling renders whole
66
- * seconds; asked for more than the clip, it would stretch the motion):
79
+ * Where a Nodaro Motion Lite run cuts the clip to whole seconds (Lite renders
80
+ * whole seconds; asked for more than the clip, it would stretch the motion):
67
81
  * - `"cut-end"` (the default): drop the fraction of a second at its end;
68
82
  * - `"cut-start"`: drop it at its start.
69
83
  */
70
- type CastSwapKlingLength = "cut-end" | "cut-start";
84
+ type CastSwapMotionLength = "cut-end" | "cut-start";
85
+ /** @deprecated use {@link CastSwapMotionLength}. */
86
+ type CastSwapKlingLength = CastSwapMotionLength;
71
87
  /** Whether a swapped subject takes this trait from the references (`"new"`) or keeps the video's (`"original"`). */
72
88
  type CastSwapTraitSource = "new" | "original";
73
89
  /**
@@ -150,62 +166,26 @@ interface CastSwapReference {
150
166
  line: string;
151
167
  }
152
168
  /**
153
- * Margins of the frame, each 0–49 %: a face whose centre lies in a margin is
154
- * not masked, so only faces inside the inner rectangle are. A margin left out
155
- * of a zone that is given is 0. (A `zone` left out altogether is 10 % at the
156
- * left and right: see `CastSwapFaceMasking.zone`.)
169
+ * @deprecated Nodaro sets this per engine; a run's `faceMasking` is ignored.
157
170
  */
158
171
  interface CastSwapFaceMaskingZone {
159
- /** % of the frame's width from the left edge. Default 0 in a zone that is given. */
160
172
  leftPct?: number;
161
- /** % of the frame's width from the right edge. Default 0 in a zone that is given. */
162
173
  rightPct?: number;
163
- /** % of the frame's height from the top edge. Default 0. */
164
174
  topPct?: number;
165
- /** % of the frame's height from the bottom edge. Default 0. */
166
175
  bottomPct?: number;
167
176
  }
168
177
  /**
169
- * Face masking: the faces in the source clip are covered before the video
170
- * model sees it, keeping their movement and lip timing while the rest of the
171
- * clip is sent as it is.
172
- *
173
- * - `"off"` (the same as leaving `faceMasking` out): the clip is sent as it is.
174
- * - `"always"`: the faces are masked before the first attempt. Its credits are
175
- * in the quote (`breakdown.masking`, counted in `totalCredits`).
176
- * - `"auto"`: the run starts unmasked; only if the video model refuses the
177
- * source clip is it retried once with the faces masked. Any other failure is
178
- * not retried. The extra credits, charged only when that retry runs, are the
179
- * estimate's `maskingCredits` (not in `totalCredits`).
180
- *
181
- * A completed job's output carries `faceMasking: { applied, reason }`:
182
- * `applied` is whether the video was made from the masked clip, and `reason`
183
- * is `"always"` (masked before the first attempt), `"input_refused"` (`auto`
184
- * retried after the source clip was refused), `"no_faces"` (no face was left
185
- * to mask after the filters: an `always` run continues unmasked; an `auto`
186
- * run fails with the original refusal instead) or `"off"`.
178
+ * @deprecated Nodaro sets how the clip is prepared for the video model, per
179
+ * engine; a run cannot change it. A `faceMasking` sent is accepted and
180
+ * ignored (no error), so older code keeps working unchanged.
187
181
  */
188
182
  interface CastSwapFaceMasking {
189
183
  mode: "off" | "always" | "auto";
190
- /** What covers a masked face: `"blur"` (default) or `"depth"` (a depth-color view of it). */
191
184
  fill?: "blur" | "depth";
192
- /** Mask only faces at least this % of the frame's height, 0–100. Default 15. */
193
185
  minFaceHeightPct?: number;
194
- /**
195
- * Mask only faces at most this % of the frame's height, 0–100. Default 0 (no
196
- * limit). When above 0 it must be at least `minFaceHeightPct` (else 400).
197
- */
198
186
  maxFaceHeightPct?: number;
199
- /**
200
- * Leave out faces near the edges of the frame. Default (left out):
201
- * `{ leftPct: 10, rightPct: 10, topPct: 0, bottomPct: 0 }`, so people at the
202
- * left and right edges are not masked. `null`, or all four margins 0, means
203
- * no margins.
204
- */
205
187
  zone?: CastSwapFaceMaskingZone | null;
206
- /** The blur's strength, 0.1–5 % of the frame's width (`fill: "blur"`). Default 2. */
207
188
  blurStrengthPct?: number;
208
- /** How sure the face finder must be, 0.05–0.95: lower finds more faces. Default 0.5. */
209
189
  threshold?: number;
210
190
  }
211
191
  /** The body of `POST /v1/cast-swap` and `POST /v1/cast-swap/estimate`. */
@@ -248,27 +228,30 @@ interface CastSwapParams {
248
228
  /** Where the preview starts, in seconds. Default 0. */
249
229
  previewStart?: number;
250
230
  /**
251
- * The video engine (see {@link CastSwapEngine}). Default `"seedance-2-5"`.
252
- * The job records it in `input_data.engine`, and a completed job's output
253
- * in its `engine`. A Cast Swap engine older than Kling 4 support ignores
254
- * the field and runs Seedance 2.5: a Kling 4 quote names `engine:
255
- * "kling-4"`, so check the estimate's `engine` before running.
231
+ * The engine (see {@link CastSwapEngine}). Default `"motion-pro"`. The job
232
+ * records it in `input_data.engine`, and a completed job's output in its
233
+ * `engine`. The ids an older client sent ({@link CastSwapEngineLegacyId})
234
+ * are still accepted.
256
235
  */
257
- engine?: CastSwapEngine;
236
+ engine?: CastSwapEngine | CastSwapEngineLegacyId;
258
237
  /**
259
- * Kling 4 only (Seedance 2.5 ignores it): which end of the clip is cut to
260
- * whole seconds (see {@link CastSwapKlingLength}). Default `"cut-end"`.
238
+ * Nodaro Motion Lite only (Pro ignores it): which end of the clip is cut to
239
+ * whole seconds (see {@link CastSwapMotionLength}). Default `"cut-end"`.
261
240
  */
241
+ motionLength?: CastSwapMotionLength;
242
+ /** @deprecated use {@link motionLength} (still accepted). */
262
243
  klingLength?: CastSwapKlingLength;
263
244
  /**
264
- * The output resolution. Seedance 2.5: `"480p"` (default), `"720p"` or
265
- * `"1080p"`. Kling 4: `"720p"` (default) or `"1080p"`; `"480p"` answers 400.
245
+ * The output resolution. Nodaro Motion Pro: `"480p"` (default), `"720p"` or
246
+ * `"1080p"`. Nodaro Motion Lite: `"720p"` (default) or `"1080p"`; `"480p"`
247
+ * answers 400.
266
248
  */
267
249
  resolution?: "480p" | "720p" | "1080p";
268
250
  /**
269
- * Render as a draft (Seedance 2.5 only). Defaults to `true` at 480p and
251
+ * Render as a draft (Nodaro Motion Pro only). Defaults to `true` at 480p and
270
252
  * `false` above it; `true` with `"720p"` or `"1080p"` answers 400 (draft is
271
- * 480p only). Kling 4 has no draft: `true` answers 400 `draft_unsupported`.
253
+ * 480p only). Nodaro Motion Lite has no draft: `true` answers 400
254
+ * `draft_unsupported`.
272
255
  */
273
256
  draft?: boolean;
274
257
  /**
@@ -278,7 +261,11 @@ interface CastSwapParams {
278
261
  * Default `true`.
279
262
  */
280
263
  prepareReferences?: boolean;
281
- /** Mask the faces in the source clip (see {@link CastSwapFaceMasking}). Default: off. */
264
+ /**
265
+ * Ignored: Nodaro sets how the clip is prepared, per engine. Accepted (no
266
+ * error) so older code keeps working.
267
+ * @deprecated leave it out.
268
+ */
282
269
  faceMasking?: CastSwapFaceMasking;
283
270
  /**
284
271
  * `"draft"` means 480p draft.
@@ -293,71 +280,61 @@ interface CastSwapParams {
293
280
  /** What a run would cost, in credits. */
294
281
  interface CastSwapEstimate {
295
282
  /**
296
- * The engine the run would use. Sent by an engine that knows Kling 4 on a
297
- * Kling 4 quote (`"kling-4"`); absent = Seedance 2.5.
283
+ * The engine the run would use, by its public id (absent from an older
284
+ * server = `"motion-pro"`).
298
285
  */
299
286
  engine?: CastSwapEngine;
300
287
  /**
301
- * What is held when the run starts: `breakdown.castSwap +
302
- * breakdown.seedance + breakdown.references` (on Kling 4,
303
- * `breakdown.kling` in place of `breakdown.seedance`), plus
304
- * `breakdown.masking` with face masking `"always"`. The run is charged what it actually costs, which
305
- * is expected to be `expectedCredits`.
288
+ * What is held when the run starts. The run is charged what it actually
289
+ * costs, which is expected to be `expectedCredits`.
306
290
  */
307
291
  totalCredits: number;
308
292
  /**
309
- * The charge the run is expected to come to: `breakdown.castSwap +
310
- * breakdown.seedanceExpected + breakdown.references`, plus
311
- * `breakdown.masking` with face masking `"always"` (the hold, with the video
312
- * model's expected charge in place of its hold). Never above `totalCredits`.
313
- * With `"auto"` the masking is in neither total (see `maskingCredits`).
314
- * `totalCredits` is what is held when the run starts; the run is charged
315
- * what it actually costs.
316
- *
317
- * Absent from an older Cast Swap engine: read `totalCredits` then. On
318
- * Kling 4 it equals `totalCredits` (Kling renders exactly the length asked
319
- * for, so the hold is what it settles at).
293
+ * The charge the run is expected to come to. Never above `totalCredits`
294
+ * (on Nodaro Motion Lite it equals it: Lite renders exactly the length
295
+ * asked for, so the hold is what it settles at). Absent from an older
296
+ * server: read `totalCredits` then.
320
297
  */
321
298
  expectedCredits?: number;
322
299
  /**
323
- * The parts of the quote:
324
- * - `castSwap`: the run itself;
325
- * - `seedance`: what the video model it calls holds (the video's length is
326
- * left to the model, so it is held at the model's longest output);
327
- * - `seedanceExpected`: what the video model is expected to be charged (the
328
- * clip in and about as much out), never above `seedance`. It takes
329
- * `seedance`'s place in `expectedCredits`; it is not added to it. Absent
330
- * from an older Cast Swap engine, like `expectedCredits`;
331
- * - `kling`: Kling 4 only, in place of `seedance` and `seedanceExpected`:
332
- * what the Kling take costs (held and charged alike);
300
+ * The parts of the quote, by name, for display only:
301
+ * - `base`: the run itself (its base fee). A server before Cast Swap 0.396.0
302
+ * names it `castSwap` instead: read `base`, else `castSwap`;
333
303
  * - `references`: preparing the reference pictures (0 when
334
304
  * `prepareReferences` is off or there is nothing to prepare);
335
- * - `masking`: masking the faces, present only when `faceMasking` is on.
336
- * With `"always"` it is in both totals; with `"auto"` it equals
337
- * `maskingCredits` and is in neither.
305
+ * - `motion`: what the video holds (on Nodaro Motion Lite, what it costs);
306
+ * - `motionExpected`: what the video is expected to be charged, never above
307
+ * `motion` (Nodaro Motion Pro);
308
+ * - `privacy`: preparing the clip, when the engine's setting does. In both
309
+ * totals when it always runs; outside both when it is the retry
310
+ * (`privacyCredits`).
338
311
  *
339
- * So the parts sum to more than either total: `seedance` and
340
- * `seedanceExpected` are alternatives, and `"auto"` masking is outside both.
312
+ * `motion` and `motionExpected` are alternatives, so the parts sum to more
313
+ * than either total: read `totalCredits` and `expectedCredits`, never the
314
+ * sum. Other parts may appear.
341
315
  */
342
316
  breakdown: {
343
- castSwap: number;
344
- seedance?: number;
317
+ base?: number;
318
+ /** @deprecated read {@link base} (an older server answered this name for the same part). */
319
+ castSwap?: number;
345
320
  references: number;
346
- seedanceExpected?: number;
347
- kling?: number;
348
- masking?: number;
349
- };
321
+ motion?: number;
322
+ motionExpected?: number;
323
+ privacy?: number;
324
+ } & Record<string, number>;
350
325
  /**
351
- * Face masking `"auto"` only: the extra credits charged if the source clip
352
- * is refused and the run is retried with the faces masked. Not in
353
- * `totalCredits` or `expectedCredits`; `run()` needs credits for both the
354
- * hold and this (else 402).
326
+ * The extra credits charged only if the video model refuses the clip and
327
+ * the run is retried (Nodaro's setting for the engine decides whether it
328
+ * does). Not in `totalCredits` or `expectedCredits`; `run()` needs credits
329
+ * for both the hold and this (else 402).
355
330
  */
331
+ privacyCredits?: number;
332
+ /** @deprecated read {@link privacyCredits} (an older server answered this name). */
356
333
  maskingCredits?: number;
357
334
  /**
358
- * `true` when the video is made at Auto length (every Seedance 2.5 run): the
359
- * final charge is expected to come out lower than `totalCredits`, at about
360
- * `expectedCredits`. `false` on Kling 4.
335
+ * `true` when the video is made at Auto length (every Nodaro Motion Pro
336
+ * run): the final charge is expected to come out lower than `totalCredits`,
337
+ * at about `expectedCredits`. `false` on Nodaro Motion Lite.
361
338
  */
362
339
  settlesLower: boolean;
363
340
  }
@@ -374,36 +351,39 @@ interface CastSwapRunOptions {
374
351
  idempotencyKey?: string;
375
352
  }
376
353
  /**
377
- * What a Full Quality version would be: `"same-take"` re-renders a Seedance
378
- * 2.5 draft's own take at 1080p; `"new-take"` makes a new Kling 4 take at
354
+ * What a Full Quality version would be: `"same-take"` re-renders a Nodaro
355
+ * Motion Pro draft's own take at 1080p; `"new-take"` makes a new Nodaro Motion Lite take at
379
356
  * 1080p from a 720p run's inputs (it will not match the 720p run frame for
380
357
  * frame). The 720p run or draft stays either way.
381
358
  */
382
359
  type CastSwapFullQualityKind = "same-take" | "new-take";
383
360
  /**
384
361
  * What a Full Quality version of a run would cost
385
- * (`POST /v1/cast-swap/:jobId/full-quality/estimate`): a Seedance 2.5 draft,
386
- * or a completed Kling 4 run at 720p.
362
+ * (`POST /v1/cast-swap/:jobId/full-quality/estimate`): a Nodaro Motion Pro
363
+ * draft, or a completed Nodaro Motion Lite run at 720p.
387
364
  */
388
365
  interface CastSwapFullQualityEstimate {
389
366
  /**
390
367
  * Which Full Quality this is ({@link CastSwapFullQualityKind}), so it can
391
- * be worded right. Absent from an older Cast Swap engine: `"same-take"`.
368
+ * be worded right. Absent from an older server: `"same-take"`.
392
369
  */
393
370
  kind?: CastSwapFullQualityKind;
394
- /** The quote in credits: `breakdown.castSwap` + `breakdown.seedanceHd` (same take) or `breakdown.kling` (new take). */
371
+ /** The quote in credits: `breakdown.base` plus the 1080p render (same take) or the new take. */
395
372
  totalCredits: number;
396
373
  /**
397
- * `castSwap`: the Full Quality job's own steps; `seedanceHd` (a same take):
398
- * the 1080p render of the draft's take (0 when an earlier try of this draft
399
- * already finished that render, which is then reused); `kling` (a new take,
400
- * in place of `seedanceHd`): the new Kling 4 take at 1080p.
374
+ * The parts of the quote, by name, for display only: `base` (the Full
375
+ * Quality job's own steps; a server before Cast Swap 0.396.0 names it
376
+ * `castSwap` instead: read `base`, else `castSwap`), and `motionHd` (a same
377
+ * take: the 1080p render, 0 when an earlier try of this draft already
378
+ * finished that render, which is then reused) or `motion` (a new take).
401
379
  */
402
380
  breakdown: {
403
- castSwap: number;
404
- seedanceHd?: number;
405
- kling?: number;
406
- };
381
+ base?: number;
382
+ /** @deprecated read {@link base} (an older server answered this name for the same part). */
383
+ castSwap?: number;
384
+ motionHd?: number;
385
+ motion?: number;
386
+ } & Record<string, number>;
407
387
  /** ISO time until which the run can be finished at Full Quality (7 days after it completed). */
408
388
  availableUntil: string;
409
389
  }
@@ -422,11 +402,11 @@ interface CastSwapFullQualityResult {
422
402
  * The `code` of a Full Quality refusal (`NodaroError.code`), all before
423
403
  * anything is charged:
424
404
  * - `unauthorized` (401): no authenticated user;
425
- * - `not_found` (404): not your job, or not a Cast Swap run; also a
405
+ * - `not_found` (404): not your job, or not a Nodaro Motion run; also a
426
406
  * `sessionId` you may not use;
427
407
  * - `not_completed` (409): the run has not finished;
428
- * - `not_a_draft` (409): the run is neither a Seedance 2.5 draft nor a
429
- * Kling 4 run at 720p (a Kling 4 run at 1080p is already Full Quality);
408
+ * - `not_a_draft` (409): the run is neither a Nodaro Motion Pro draft nor a
409
+ * Nodaro Motion Lite run at 720p (a Lite run at 1080p is already Full Quality);
430
410
  * - `draft_expired` (410): more than 7 days after the draft completed, or
431
411
  * the draft can no longer be finished at Full Quality;
432
412
  * - `full_quality_pending` (409, `details.retryable: true`): not final — an
@@ -450,7 +430,7 @@ declare class CastSwapResource {
450
430
  private client;
451
431
  constructor(client: NodaroClientCore);
452
432
  /**
453
- * Start a Cast Swap run (`POST /v1/cast-swap`, 202 `{ jobId }`). Returns the
433
+ * Start a Nodaro Motion run (`POST /v1/cast-swap`, 202 `{ jobId }`). Returns the
454
434
  * job to follow. With `options.idempotencyKey` (sent as the
455
435
  * `Idempotency-Key` header; 8–200 characters, else 400) a repeat with the
456
436
  * same key within about 10 s answers 200 `{ jobId, deduped: true }`, a later
@@ -465,8 +445,8 @@ declare class CastSwapResource {
465
445
  /**
466
446
  * Quote finishing a run at Full Quality (`POST
467
447
  * /v1/cast-swap/:jobId/full-quality/estimate`); spends nothing. `jobId` is a
468
- * finished Seedance 2.5 DRAFT run, or a finished Kling 4 run at 720p (a Cast
469
- * Swap or trend run); the quote's `kind` says whether it is the same take
448
+ * finished Nodaro Motion Pro DRAFT run, or a finished Nodaro Motion Lite
449
+ * run at 720p (a Nodaro Motion or trend run); the quote's `kind` says whether it is the same take
470
450
  * re-rendered or a new take. The quote
471
451
  * does not look for a Full Quality already running: when one is,
472
452
  * {@link fullQuality} answers it (`existing: true`) and charges nothing.
@@ -476,7 +456,7 @@ declare class CastSwapResource {
476
456
  /**
477
457
  * Finish a run at Full Quality (`POST /v1/cast-swap/:jobId/full-quality`):
478
458
  * at 1080p, with the clip's audio, as a new job linked to the run — a
479
- * Seedance 2.5 draft's own take re-rendered, or a new Kling 4 take from a
459
+ * Nodaro Motion Pro draft's own take re-rendered, or a new Nodaro Motion Lite take from a
480
460
  * 720p run's inputs (the quote's `kind`). SPENDS CREDITS: quote it first with
481
461
  * {@link fullQualityEstimate}. Answers 202 `{ jobId }`, or 200
482
462
  * `{ jobId, existing: true }` when this run's Full Quality is already
@@ -488,4 +468,4 @@ declare class CastSwapResource {
488
468
  fullQuality(jobId: string, params?: CastSwapFullQualityParams): Promise<CastSwapFullQualityResult>;
489
469
  }
490
470
 
491
- export { type CastSwapEngine, type CastSwapEstimate, type CastSwapFaceMasking, type CastSwapFaceMaskingZone, type CastSwapFullQualityEstimate, type CastSwapFullQualityKind, type CastSwapFullQualityParams, type CastSwapFullQualityRefusalCode, type CastSwapFullQualityResult, type CastSwapKlingLength, type CastSwapLocationRole, type CastSwapParams, type CastSwapPersonRole, type CastSwapPetRole, type CastSwapProductRole, type CastSwapReference, CastSwapResource, type CastSwapRole, type CastSwapRolePreviewSettings, type CastSwapRunOptions, type CastSwapTraitSource };
471
+ export { type CastSwapEngine, type CastSwapEngineLegacyId, type CastSwapEstimate, type CastSwapFaceMasking, type CastSwapFaceMaskingZone, type CastSwapFullQualityEstimate, type CastSwapFullQualityKind, type CastSwapFullQualityParams, type CastSwapFullQualityRefusalCode, type CastSwapFullQualityResult, type CastSwapKlingLength, type CastSwapLocationRole, type CastSwapMotionLength, type CastSwapParams, type CastSwapPersonRole, type CastSwapPetRole, type CastSwapProductRole, type CastSwapReference, CastSwapResource, type CastSwapRole, type CastSwapRolePreviewSettings, type CastSwapRunOptions, type CastSwapTraitSource };