@nodaro/sdk 2.77.0 → 2.78.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/{chunk-HUYI5G3D.js → chunk-3NG4HPM5.js} +2 -2
- package/dist/{chunk-HUYI5G3D.js.map → chunk-3NG4HPM5.js.map} +1 -1
- package/dist/chunk-5QNCWXKG.cjs +22 -0
- package/dist/chunk-5QNCWXKG.cjs.map +1 -0
- package/dist/{chunk-MGVK4PJF.cjs → chunk-6BPQYCUG.cjs} +41 -3
- package/dist/chunk-6BPQYCUG.cjs.map +1 -0
- package/dist/{chunk-WSOLDULF.js → chunk-6ZKW7767.js} +41 -3
- package/dist/chunk-6ZKW7767.js.map +1 -0
- package/dist/{chunk-VKEFUXQJ.cjs → chunk-7WVQZPUW.cjs} +2 -2
- package/dist/chunk-7WVQZPUW.cjs.map +1 -0
- package/dist/{chunk-GIQDM2MH.js → chunk-C3H3V5PN.js} +2 -2
- package/dist/{chunk-GIQDM2MH.js.map → chunk-C3H3V5PN.js.map} +1 -1
- package/dist/{chunk-A3XA6UNM.cjs → chunk-FQHMDWSP.cjs} +2 -2
- package/dist/{chunk-A3XA6UNM.cjs.map → chunk-FQHMDWSP.cjs.map} +1 -1
- package/dist/{chunk-XF7IDNMR.cjs → chunk-G6ASA5RQ.cjs} +14 -14
- package/dist/{chunk-XF7IDNMR.cjs.map → chunk-G6ASA5RQ.cjs.map} +1 -1
- package/dist/{chunk-4VKV3HW3.cjs → chunk-HEJE6L3E.cjs} +3 -3
- package/dist/{chunk-4VKV3HW3.cjs.map → chunk-HEJE6L3E.cjs.map} +1 -1
- package/dist/{chunk-M5ZXVXZL.js → chunk-IAHNPMIX.js} +3 -3
- package/dist/{chunk-M5ZXVXZL.js.map → chunk-IAHNPMIX.js.map} +1 -1
- package/dist/{chunk-EKVE3DBA.js → chunk-JCLJRCMR.js} +8 -8
- package/dist/{chunk-EKVE3DBA.js.map → chunk-JCLJRCMR.js.map} +1 -1
- package/dist/{chunk-KNBZFWVO.cjs → chunk-JIFGF6PA.cjs} +13 -2
- package/dist/chunk-JIFGF6PA.cjs.map +1 -0
- package/dist/{chunk-GWL4O3J2.js → chunk-PNTVCJZV.js} +13 -2
- package/dist/chunk-PNTVCJZV.js.map +1 -0
- package/dist/{chunk-57GANTLV.cjs → chunk-USBDYHSO.cjs} +2 -2
- package/dist/{chunk-57GANTLV.cjs.map → chunk-USBDYHSO.cjs.map} +1 -1
- package/dist/{chunk-3M7AHJG5.js → chunk-VPBPVDKY.js} +2 -2
- package/dist/chunk-VPBPVDKY.js.map +1 -0
- package/dist/chunk-YPZCTRFB.js +12 -0
- package/dist/chunk-YPZCTRFB.js.map +1 -0
- package/dist/entries/cast-swap.cjs +2 -2
- package/dist/entries/cast-swap.d.cts +1 -1
- package/dist/entries/cast-swap.d.ts +1 -1
- package/dist/entries/cast-swap.js +1 -1
- package/dist/entries/characters.d.cts +2 -1
- package/dist/entries/characters.d.ts +2 -1
- package/dist/entries/client.cjs +12 -12
- package/dist/entries/client.d.cts +2 -2
- package/dist/entries/client.d.ts +2 -2
- package/dist/entries/client.js +7 -7
- package/dist/entries/core.cjs +5 -5
- package/dist/entries/core.js +1 -1
- package/dist/entries/creatures.cjs +6 -6
- package/dist/entries/creatures.d.cts +2 -3
- package/dist/entries/creatures.d.ts +2 -3
- package/dist/entries/creatures.js +1 -1
- package/dist/entries/edit.cjs +7 -7
- package/dist/entries/edit.d.cts +7 -0
- package/dist/entries/edit.d.ts +7 -0
- package/dist/entries/edit.js +1 -1
- package/dist/entries/locations.d.cts +2 -1
- package/dist/entries/locations.d.ts +2 -1
- package/dist/entries/media.d.cts +2 -1
- package/dist/entries/media.d.ts +2 -1
- package/dist/entries/nodes.cjs +9 -5
- package/dist/entries/nodes.d.cts +3 -2
- package/dist/entries/nodes.d.ts +3 -2
- package/dist/entries/nodes.js +2 -2
- package/dist/entries/objects.cjs +6 -6
- package/dist/entries/objects.d.cts +2 -3
- package/dist/entries/objects.d.ts +2 -3
- package/dist/entries/objects.js +1 -1
- package/dist/entries/scene3d.d.cts +3 -2
- package/dist/entries/scene3d.d.ts +3 -2
- package/dist/entries/trends.d.cts +1 -1
- package/dist/entries/trends.d.ts +1 -1
- package/dist/entries/video-remake.cjs +2 -2
- package/dist/entries/video-remake.d.cts +1 -1
- package/dist/entries/video-remake.d.ts +1 -1
- package/dist/entries/video-remake.js +1 -1
- package/dist/index.cjs +39 -35
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -8
- package/dist/{nodes-BaRqRB2Z.d.ts → nodes-C6e2wign.d.ts} +86 -8
- package/dist/{nodes-BHtjh6gl.d.cts → nodes-D71Ec9b5.d.cts} +86 -8
- package/dist/{video-remake-BEBbUmlY.d.ts → video-remake-CnnJMGwj.d.ts} +143 -5
- package/dist/{video-remake-LrhEaona.d.cts → video-remake-EHwCWlUW.d.cts} +143 -5
- package/package.json +3 -3
- package/dist/chunk-3M7AHJG5.js.map +0 -1
- package/dist/chunk-CHZBONJJ.js +0 -3
- package/dist/chunk-CHZBONJJ.js.map +0 -1
- package/dist/chunk-GWL4O3J2.js.map +0 -1
- package/dist/chunk-KNBZFWVO.cjs.map +0 -1
- package/dist/chunk-MGVK4PJF.cjs.map +0 -1
- package/dist/chunk-RKYZY6NA.cjs +0 -16
- package/dist/chunk-RKYZY6NA.cjs.map +0 -1
- package/dist/chunk-VKEFUXQJ.cjs.map +0 -1
- package/dist/chunk-WSOLDULF.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resources/cast-swap.ts"],"names":["nodaroMotionEngineFrom"],"mappings":";;;;;AA0mBO,IAAM,sBAAN,MAA0B;AAAA,EAC/B,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,E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oB,kBAAA,CAAmB,KAAK,CAAC,CAAA,sBAAA,CAAA,EAA0B,EAAE,IAAA,EAAM,IAAI,CAAA;AAAA,EACxH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,WAAA,CAAY,KAAA,EAAe,MAAA,GAAuC,EAAC,EAA0C;AAC3G,IAAA,MAAM,IAAA,GAAO,OAAO,SAAA,KAAc,MAAA,GAAY,EAAE,SAAA,EAAW,MAAA,CAAO,SAAA,EAAU,GAAI,EAAC;AACjF,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAQ,MAAA,EAAQ,CAAA,iBAAA,EAAoB,kBAAA,CAAmB,KAAK,CAAC,CAAA,aAAA,CAAA,EAAiB,EAAE,IAAA,EAAM,CAAA;AAAA,EAC3G;AACF;AASO,IAAM,gBAAA,GAAmB","file":"chunk-MGVK4PJF.cjs","sourcesContent":["import { nodaroMotionEngineFrom } from \"@nodaro/shared/models\"\nimport type { NodaroClientCore } from \"../core.js\"\n\n/**\n * Video Remake (the `videoRemake` resource; routes `/v1/video-remake`) — replace\n * the people, pets, products and/or the location in a short video with your\n * own references, keeping its motion, framing, timing and sound (the clip's\n * audio is kept, and the result is the clip's length).\n *\n * Before the video, each person, pet and product role's photos are turned\n * into one clean reference picture by an image model. This costs extra\n * credits (`breakdown.references` in the estimate), charged when it runs, even\n * if the video then fails; it adds about a minute, falls back to your own\n * photos if it fails, and is turned off with `prepareReferences: false`.\n * Locations are not prepared.\n *\n * Engines: a run is made on Nodaro Prism (`engine` left out, or\n * `\"nodaro-prism\"`) or Nodaro Pulse (`\"nodaro-pulse\"`). Prism renders\n * 480p (the default; plain unless `draft: true`), 720p or 1080p. Pulse renders\n * 720p (its default) or 1080p and makes a new take guided by the clip and\n * pictures; it has no draft, so no Full Quality: run it again at 1080p instead.\n *\n * How the clip is prepared for the video model (for one, whether faces are\n * hidden first, and whether a refused clip is retried) is set by Nodaro for\n * each engine; a run cannot change it. `faceMasking` is no longer read\n * (deprecated: accepted and ignored).\n *\n * Cloud edition only: `/v1/video-remake` is served by the cloud plugin and 404s\n * on self-hosted installs. `run()` answers 202 with a job id; follow it with\n * `client.jobs.get(jobId)` / `client.jobs.getStatus(jobId)` like any other job.\n *\n * Repeats: pass `{ idempotencyKey }` to `run()` and it is sent as the\n * `Idempotency-Key` header. A repeat with the same key within the credit\n * guard's dedup window (about 10 s) answers 200 `{ jobId, deduped: true }` with\n * an `X-Dedup-Hit` header; a later one answers 202 with the first run's\n * `jobId`. Nothing new is started or charged.\n *\n * Refusals (thrown as a `NodaroError` subclass; body `{ error: { code, message } }`), before\n * anything is charged: 400 `validation_error` (the body: no role with images,\n * no reference, no `prePrompt` or `postPrompt` and no art style (Flex on\n * Nodaro Prism), more roles of a kind\n * than allowed, more than 30 images in all, `draft: true` above 480p, a\n * `prePrompt` or `postPrompt` over 4,000 characters); on Nodaro Pulse,\n * `draft_unsupported` (`draft: true`), `resolution_unsupported` (480p),\n * `output_format_unsupported` (a MOV edit output) and `too_many_images` (more\n * than 10 images in the run, across every role and fixed reference);\n * `raw_reference_token` (also in a reference's `line`),\n * `invalid_role_mention` (also any `{role:N}` in a reference's `line`),\n * `unsafe_url`, `video_unreadable`, `clip_out_of_range` (4–30 s),\n * `preview_out_of_range`, `unnamed_role_needs_picture` (a role with no name\n * and no image), `no_roles_in_preview` (a preview that would change nothing,\n * judged on what it sends: no role kept in it with images, no fixed\n * reference, no `prePrompt` or `postPrompt` and no art style), `prompt_too_long`\n * (the prompt would build too long: a `{role:N}` reads as the role's name when\n * it sends no images; Nodaro Pulse's cap is 8,000 characters); 401; 402 `insufficient_credits` (`run()` only); 404\n * (a `sessionId` you may not use, `run()` only); 422 `job_blocked` (`run()`\n * only); 503 `host_too_old` (both); 503 `estimate_unavailable` (`estimate()`\n * only).\n */\n\n/**\n * The engine a Video Remake run is made on, by its public id. Left out =\n * `\"nodaro-prism\"`.\n *\n * - `\"nodaro-prism\"` (Nodaro Prism): 480p (the default; plain unless\n * `draft: true`), 720p or 1080p; Full Quality finishes a draft's own take at\n * 1080p.\n * - `\"nodaro-pulse\"` (Nodaro Pulse): 720p (the default) or 1080p, never a\n * draft (`draft: true` answers 400 `draft_unsupported`), so no Full Quality:\n * run it again at 1080p instead. A preview is still 4 s from `previewStart`.\n */\nexport type VideoRemakeEngine = \"nodaro-prism\" | \"nodaro-pulse\"\n\n/**\n * The engine ids an older client sent: the earlier public ids\n * (`\"motion-prism\"` and `\"motion-pro\"` = `\"nodaro-prism\"`, `\"motion-pulse\"`\n * and `\"motion-lite\"` = `\"nodaro-pulse\"`) and the internal ones\n * (`\"seedance-2-5\"`, `\"kling-4\"`). Still accepted in a request; never\n * returned.\n * @deprecated use {@link VideoRemakeEngine}.\n */\nexport type VideoRemakeEngineLegacyId = \"motion-prism\" | \"motion-pulse\" | \"motion-pro\" | \"motion-lite\" | \"seedance-2-5\" | \"kling-4\"\n\n/**\n * How a run follows its clip. Left out = `\"precise\"`.\n *\n * - `\"precise\"`: follows the clip exactly.\n * - `\"motion\"`: follows the clip's movement and takes the looks from your\n * photos, more freely than `\"precise\"`. Its price may differ from\n * `\"precise\"`'s: the estimate shows the exact price.\n */\nexport type VideoRemakeStyle = \"precise\" | \"motion\"\n\n/**\n * Where a Nodaro Pulse run cuts the clip to whole seconds (Pulse renders\n * whole seconds; asked for more than the clip, it would stretch the motion):\n * - `\"cut-end\"` (the default): drop the fraction of a second at its end;\n * - `\"cut-start\"`: drop it at its start.\n */\nexport type VideoRemakeMotionLength = \"cut-end\" | \"cut-start\"\n\n\n/** Whether a swapped subject takes this trait from the references (`\"new\"`) or keeps the video's (`\"original\"`). */\nexport type VideoRemakeTraitSource = \"new\" | \"original\"\n\n/**\n * Preview-only settings, on every role kind; a full run (`preview` not `true`)\n * ignores both.\n */\nexport interface VideoRemakeRolePreviewSettings {\n /** The name used instead of `name` in a preview. Same rules as `name` (1–200 characters). */\n previewName?: string\n /**\n * `false` leaves this role out of the preview: its reference images are not\n * sent, not prepared and not charged, and a `{role:N}` naming it reads as its\n * `previewName`, else its `name`. Default `true`. A preview that would\n * change nothing (no role kept in it with images, no fixed reference, no pre\n * or post prompt and no art style) answers 400 `no_roles_in_preview`.\n */\n inPreview?: boolean\n}\n\n/** A person in the video to recast. */\nexport interface VideoRemakePersonRole extends VideoRemakeRolePreviewSettings {\n kind: \"person\"\n /** How the person is told apart in the video, e.g. `\"the woman that attacks\"`.\n *\n * Direct runs only: omit it (or leave it empty) and the role is named by its\n * first picture — matched to the subject in the video it fits best; such a\n * role needs at least one image (else 400 `unnamed_role_needs_picture`). A\n * trend run's roles are always named (400 `role_name_required`).\n */\n name?: string\n /** 0–3 images of ONE person. Empty or `null` keeps the original person. */\n images: string[] | null\n /** Body from the references or the video. Default `\"new\"`. */\n body?: VideoRemakeTraitSource\n /** Outfit from the references or the video. Default `\"new\"`. */\n outfit?: VideoRemakeTraitSource\n /** Hairstyle and haircut from the references or the video. Default `\"new\"`. */\n hair?: VideoRemakeTraitSource\n}\n\n/** The place the video happens in. */\nexport interface VideoRemakeLocationRole extends VideoRemakeRolePreviewSettings {\n kind: \"location\"\n /** How the place is named. Default `\"the setting\"`. */\n name?: string\n /** 0–3 images of ONE place. Empty or `null` keeps the original place. */\n images: string[] | null\n}\n\n/** An animal in the video to recast. */\nexport interface VideoRemakePetRole extends VideoRemakeRolePreviewSettings {\n kind: \"pet\"\n /** How the animal is told apart in the video, e.g. `\"the dog\"`.\n *\n * Direct runs only: omit it (or leave it empty) and the role is named by its\n * first picture — matched to the subject in the video it fits best; such a\n * role needs at least one image (else 400 `unnamed_role_needs_picture`). A\n * trend run's roles are always named (400 `role_name_required`).\n */\n name?: string\n /** 0–3 images of ONE animal. Empty or `null` keeps the original animal. */\n images: string[] | null\n /** Body (shape, size and build) from the references or the video. Default `\"new\"`. */\n body?: VideoRemakeTraitSource\n /** Coat (fur, colors and markings) from the references or the video. Default `\"new\"`. */\n coat?: VideoRemakeTraitSource\n}\n\n/** An object in the video to recast. */\nexport interface VideoRemakeProductRole extends VideoRemakeRolePreviewSettings {\n kind: \"product\"\n /** How the object is told apart in the video, e.g. `\"the can\"`.\n *\n * Direct runs only: omit it (or leave it empty) and the role is named by its\n * first picture — matched to the subject in the video it fits best; such a\n * role needs at least one image (else 400 `unnamed_role_needs_picture`). A\n * trend run's roles are always named (400 `role_name_required`).\n */\n name?: string\n /** 0–3 images of ONE product. Empty or `null` keeps the original object. */\n images: string[] | null\n /** Shape and proportions from the references or the video. Default `\"new\"`. */\n shape?: VideoRemakeTraitSource\n /** Finish (colors, materials, label and markings) from the references or the video. Default `\"new\"`. */\n finish?: VideoRemakeTraitSource\n}\n\nexport type VideoRemakeRole = VideoRemakePersonRole | VideoRemakeLocationRole | VideoRemakePetRole | VideoRemakeProductRole\n\n/**\n * A fixed reference: 1–3 images of ONE thing that no role replaces, and the\n * line that says what it is (`\"the glass she drinks from\"`). Sent as given,\n * never prepared; its images count toward the 30.\n */\nexport interface VideoRemakeReference {\n /** 1–3 http(s) image URLs of one thing. */\n images: string[]\n /**\n * What it is, 1–500 characters. `{image}` in the line stands for this\n * reference's first image (`\"Use {image} for the sky\"`); a line without it\n * gets it appended. A `{role:N}` or a raw `{image:` / `{video:` / `{audio:`\n * token answers 400.\n */\n line: string\n}\n\n/**\n * @deprecated Nodaro sets this per engine; a run's `faceMasking` is ignored.\n */\nexport interface VideoRemakeFaceMaskingZone {\n leftPct?: number\n rightPct?: number\n topPct?: number\n bottomPct?: number\n}\n\n/**\n * @deprecated Nodaro sets how the clip is prepared for the video model, per\n * engine; a run cannot change it. A `faceMasking` sent is accepted and\n * ignored (no error), so older code keeps working unchanged.\n */\nexport interface VideoRemakeFaceMasking {\n mode: \"off\" | \"always\" | \"auto\"\n fill?: \"blur\" | \"depth\"\n minFaceHeightPct?: number\n maxFaceHeightPct?: number\n zone?: VideoRemakeFaceMaskingZone | null\n blurStrengthPct?: number\n threshold?: number\n}\n\n/** The body of `POST /v1/video-remake` and `POST /v1/video-remake/estimate`. */\nexport interface VideoRemakeParams {\n /** The source clip, 4–30 seconds. */\n videoUrl: string\n /**\n * Who and what to swap: at most 6 person roles, 1 location role, 3 pet roles\n * and 3 product roles, with at most 30 images in all. A role with no images\n * is skipped (that subject or place stays as in the video). At least one role\n * with images, a fixed reference, a `prePrompt` or `postPrompt`, or an art\n * style (`direction`, Flex on Nodaro Prism) is required. With an art\n * style and nothing to swap, a run restyles the whole clip (see `direction`).\n */\n roles: VideoRemakeRole[]\n /**\n * Fixed references (at most 5): things the video should show that no role\n * replaces, each with the line that names it. Their images count toward the\n * 30. A reference alone is enough for a run (no role needs images).\n */\n references?: VideoRemakeReference[]\n /**\n * Your own words placed at the start of the prompt, before the role\n * instructions; at most 4,000 characters. Mention a role as `{role:N}`, as in\n * `postPrompt`; the same 400 refusals apply (an N outside 1..`roles.length`,\n * a raw `{image:` / `{video:` / `{audio:` token).\n */\n prePrompt?: string\n /**\n * Extra instructions in your own words, at most 4,000 characters. Mention a\n * role as `{role:N}`, where N is its 1-based position in `roles`\n * (`{role:1}` is `roles[0]`; empty roles count).\n *\n * The route answers 400, before charging, for an N outside 1..`roles.length`,\n * for a raw `{image:` / `{video:` / `{audio:` token in the pre or post prompt\n * or a role's `name`, for a clip outside 4–30 s, and for a preview past the clip's\n * end (`previewStart + 4` > its length).\n */\n postPrompt?: string\n /** `true` runs on 4 seconds of the clip, starting at `previewStart`: a cheap check of the roles and choices. */\n preview?: boolean\n /** Where the preview starts, in seconds. Default 0. */\n previewStart?: number\n /**\n * The engine (see {@link VideoRemakeEngine}). Default `\"nodaro-prism\"`. The job\n * records it in `input_data.engine`, and a completed job's output in its\n * `engine`. The ids an older client sent ({@link VideoRemakeEngineLegacyId})\n * are still accepted.\n */\n engine?: VideoRemakeEngine | VideoRemakeEngineLegacyId\n /**\n * How the run follows the clip (see {@link VideoRemakeStyle}). Default\n * `\"precise\"`; the job records it in `input_data.style`.\n */\n style?: VideoRemakeStyle\n /**\n * A direct run on Nodaro Prism: an art style that restyles the whole\n * video, as a `direction.style` id of the platform's `style` picker catalog\n * (the same ids an image's `direction.style` takes); the platform words it.\n * A Flex run (`style: \"motion\"`) takes one, and so does a Precise run where\n * {@link VideoRemakeResource.styleChoice} answers `preciseArtStyle` true for the\n * engine. Nodaro may make such a Precise request the way a Flex run is made\n * (its engine does by default, unless Nodaro turns that off): its estimate,\n * price and Full Quality are then a Flex run's, while the job still records\n * the style sent (`input_data.style` absent, or `\"precise\"`; jobs made so\n * before the style was kept record `\"motion\"`). Otherwise it is Precise's edit\n * of the clip, drawn in the art style. Refused with\n * 400 `unknown_art_style` (not in the catalog), `art_style_not_supported` (a\n * saved moodboard, `moodboard:…`) or `art_style_needs_flex` (a trend run, a\n * Flex run whose prompt is made Precise by Nodaro's setting for how Flex\n * runs are prepared, or a Precise request on an engine from before Precise\n * runs took one), and on Nodaro Pulse with `art_style_needs_prism`.\n * The estimate (sent with the same `direction`) shows the price: it changes\n * only where Nodaro's setting for such runs first redraws the role pictures\n * in the art style.\n *\n * Style only: with no role with images and no fixed reference, the art style\n * alone is the run's change (a pre or post prompt is still added). It\n * restyles the whole clip, keeping the people, places, motion and sound, and\n * is charged for what it runs (the estimate shows it; no clip-preparation\n * `privacy` part). By default a black-and-white art style comes out\n * monochrome. Nodaro may run it the way other art-style runs run instead,\n * priced as those are and not made monochrome.\n * A preview takes its full run's path. Runs this way only on a Flex run, and\n * only where {@link VideoRemakeResource.styleChoice} answers `styleOnly` true\n * for the engine; elsewhere on Nodaro Prism an art style alone is\n * refused (on a Precise run that stays Precise too, unless\n * {@link VideoRemakeResource.styleChoice} answers `preciseArtStyleAlone` true for\n * the engine, where it is that run's change), and one with a pre or post prompt\n * runs as any other art-style run. The job records it in\n * `input_data.direction`.\n */\n direction?: { style: string }\n /**\n * Nodaro Pulse only (Prism ignores it): which end of the clip is cut to\n * whole seconds (see {@link VideoRemakeMotionLength}). Default `\"cut-end\"`.\n */\n motionLength?: VideoRemakeMotionLength\n /** @deprecated use {@link motionLength} (still accepted). */\n klingLength?: VideoRemakeMotionLength\n /**\n * The output resolution. Nodaro Prism: `\"480p\"` (default), `\"720p\"` or\n * `\"1080p\"`. Nodaro Pulse: `\"720p\"` (default) or `\"1080p\"`; `\"480p\"`\n * answers 400.\n */\n resolution?: \"480p\" | \"720p\" | \"1080p\"\n /**\n * `true` makes a draft: a 480p run whose same take Full Quality can finish\n * at 1080p (Nodaro Prism only). Default `false`: a plain run, at 480p\n * too, which Full Quality cannot finish. `true` with `\"720p\"` or `\"1080p\"`\n * answers 400 (draft is 480p only). Nodaro Pulse has no draft: `true`\n * answers 400 `draft_unsupported`.\n */\n draft?: boolean\n /**\n * Turn each person, pet and product role's photos into one clean reference\n * picture before the video (extra credits, shown in `breakdown.references`;\n * about a minute longer; falls back to your own photos if it fails).\n * Default `true`.\n */\n prepareReferences?: boolean\n /**\n * Ignored: Nodaro sets how the clip is prepared, per engine. Accepted (no\n * error) so older code keeps working.\n * @deprecated leave it out.\n */\n faceMasking?: VideoRemakeFaceMasking\n /**\n * `\"draft\"` means 480p draft.\n * @deprecated use `resolution` + `draft`.\n */\n quality?: \"draft\"\n /** A generation session to file the result in. */\n sessionId?: string\n /** The client app that sent the run (stored on the job as `input_data.origin`). */\n origin?: string\n}\n\n/** What a run would cost, in credits. */\nexport interface VideoRemakeEstimate {\n /**\n * The engine the run would use, by its public id (absent from an older\n * server = `\"nodaro-prism\"`). An id an older server answers is read as the\n * public id it names.\n */\n engine?: VideoRemakeEngine\n /**\n * What is held when the run starts. The run is charged what it actually\n * costs, which is expected to be `expectedCredits`.\n */\n totalCredits: number\n /**\n * The charge the run is expected to come to. Never above `totalCredits`\n * (on Nodaro Pulse it equals it: Pulse renders exactly the length\n * asked for, so the hold is what it settles at). Absent from an older\n * server: read `totalCredits` then.\n */\n expectedCredits?: number\n /**\n * The parts of the quote, by name, for display only:\n * - `base`: the run itself (its base fee). An older server\n * names it `castSwap` instead: read `base`, else `castSwap`;\n * - `references`: preparing the reference pictures (0 when\n * `prepareReferences` is off or there is nothing to prepare);\n * - `motion`: what the video holds (on Nodaro Pulse, what it costs);\n * - `motionExpected`: what the video is expected to be charged, never above\n * `motion` (Nodaro Prism);\n * - `privacy`: preparing the clip, when the engine's setting does. In both\n * totals when it always runs; outside both when it is the retry\n * (`privacyCredits`).\n * - `prompt`: the prompt written for the run by a language model, when\n * Nodaro's setting for the engine does so (absent otherwise).\n * - `referenceAudio`: preparing the clip's sound for the video model, when\n * Nodaro's setting for the engine runs that step (absent otherwise).\n *\n * `motion` and `motionExpected` are alternatives, so the parts sum to more\n * than either total: read `totalCredits` and `expectedCredits`, never the\n * sum. Other parts may appear.\n */\n breakdown: {\n base?: number\n /** @deprecated read {@link base} (an older server answered this name for the same part). */\n castSwap?: number\n references: number\n motion?: number\n motionExpected?: number\n privacy?: number\n prompt?: number\n referenceAudio?: number\n } & Record<string, number>\n /**\n * The extra credits charged only if the video model refuses the clip and\n * the run is retried (Nodaro's setting for the engine decides whether it\n * does). Not in `totalCredits` or `expectedCredits`; `run()` needs credits\n * for both the hold and this (else 402).\n */\n privacyCredits?: number\n /** @deprecated read {@link privacyCredits} (an older server answered this name). */\n maskingCredits?: number\n /**\n * `true` when the video is made at Auto length (every Nodaro Prism\n * run): the final charge is expected to come out lower than `totalCredits`,\n * at about `expectedCredits`. `false` on Nodaro Pulse.\n */\n settlesLower: boolean\n}\n\n/** Per-call options for {@link VideoRemakeResource.run}. */\nexport interface VideoRemakeRunOptions {\n /**\n * Sent as the `Idempotency-Key` header, unchanged (the SDK checks nothing;\n * an empty string sends no header, like no key).\n * The server takes 8–200 characters and answers 400 for any other length.\n * Reuse the same value when retrying the same run: within about 10 s the\n * repeat answers 200 `{ jobId, deduped: true }`, later 202 with the first\n * run's `jobId`. Nothing new is started or charged.\n */\n idempotencyKey?: string\n}\n\n/**\n * What a Full Quality version would be: `\"same-take\"` finishes a Nodaro\n * Prism draft's own take at 1080p, and the draft stays. `\"new-take\"` was a new\n * Nodaro Pulse take at 1080p from a 720p run's inputs; Pulse no longer\n * has Full Quality, so a quote no longer answers it (kept so code that reads\n * it still compiles).\n */\nexport type VideoRemakeFullQualityKind = \"same-take\" | \"new-take\"\n\n/**\n * What a Full Quality version of a run would cost\n * (`POST /v1/video-remake/:jobId/full-quality/estimate`): a Nodaro Prism\n * draft (a 480p run made with `draft: true`).\n */\nexport interface VideoRemakeFullQualityEstimate {\n /**\n * Which Full Quality this is ({@link VideoRemakeFullQualityKind}), so it can\n * be worded right. Absent from an older server: `\"same-take\"`.\n */\n kind?: VideoRemakeFullQualityKind\n /** The quote in credits: `breakdown.base` plus the 1080p render (same take) or the new take. */\n totalCredits: number\n /**\n * The parts of the quote, by name, for display only: `base` (the Full\n * Quality job's own steps; an older server names it\n * `castSwap` instead: read `base`, else `castSwap`), and `motionHd` (a same\n * take: the 1080p render, 0 when an earlier try of this draft already\n * finished that render, which is then reused) or `motion` (a new take).\n */\n breakdown: {\n base?: number\n /** @deprecated read {@link base} (an older server answered this name for the same part). */\n castSwap?: number\n motionHd?: number\n motion?: number\n } & Record<string, number>\n /** ISO time until which the run can be finished at Full Quality (7 days after it completed). */\n availableUntil: string\n}\n\n/** Options for {@link VideoRemakeResource.fullQuality}. */\nexport interface VideoRemakeFullQualityParams {\n /** A generation session to file the Full Quality result in. */\n sessionId?: string\n}\n\n/** The Full Quality job (`POST /v1/video-remake/:jobId/full-quality`). */\nexport interface VideoRemakeFullQualityResult {\n jobId: string\n /** `true` when this run's Full Quality was already running or done: that job is answered, nothing new is started or charged. */\n existing?: boolean\n}\n\n/**\n * The `code` of a Full Quality refusal (`NodaroError.code`), all before\n * anything is charged:\n * - `unauthorized` (401): no authenticated user;\n * - `not_found` (404): not your job, or not a Video Remake run; also a\n * `sessionId` you may not use;\n * - `not_completed` (409): the run has not finished;\n * - `not_a_draft` (409): the run is not a Nodaro Prism draft: a plain\n * run (480p made without `draft: true` included; make a draft with\n * `draft: true`), or any Nodaro Pulse run (Pulse makes no drafts: run\n * it again at 1080p);\n * - `draft_expired` (410): more than 7 days after the draft completed, or\n * the draft can no longer be finished at Full Quality;\n * - `full_quality_pending` (409, `details.retryable: true`): not final — an\n * earlier try's 1080p render of this draft is being reviewed, or has not\n * started yet; try again later (once the review ends). The only refusal\n * that ends on its own;\n * - `full_quality_unavailable` (409): final — nothing kept to re-render, no\n * readable completion time, or the 1080p finalize refuses this draft; on\n * the start only, also \"failed too many times\" (every try failed) or no\n * try can be started for this run;\n * - `insufficient_credits` (402), or in a workspace `budget_exceeded`,\n * `member_cap_exceeded` or `user_allowance_exceeded`;\n * - `job_blocked` (422): the request was blocked by the job policy;\n * - `job_read_failed` (503, retryable), `estimate_unavailable` (503, try\n * again shortly), `host_too_old` (503).\n *\n * Open-ended: a code not listed here may still arrive.\n */\nexport type VideoRemakeFullQualityRefusalCode =\n | \"unauthorized\"\n | \"not_found\"\n | \"not_completed\"\n | \"not_a_draft\"\n | \"draft_expired\"\n | \"full_quality_pending\"\n | \"full_quality_unavailable\"\n | \"insufficient_credits\"\n | \"budget_exceeded\"\n | \"member_cap_exceeded\"\n | \"user_allowance_exceeded\"\n | \"job_blocked\"\n | \"job_read_failed\"\n | \"estimate_unavailable\"\n | \"host_too_old\"\n | (string & {})\n\n/**\n * Who decides a direct run's style on one engine:\n * - `\"user\"`: the person (the request's `style`, left out = `\"precise\"`);\n * show a Style control;\n * - `\"precise\"`: Nodaro's own apps run Precise on that engine and show no\n * Style control; it changes no request: a direct run and quote take the\n * request's `style`, as on `\"user\"`;\n * - `\"flex\"`: an admin forced it — every direct run and quote of that engine\n * runs Flex (`style: \"motion\"`) whatever the request's `style` says; show\n * no Style control.\n *\n * A trend run keeps its own trend's style.\n */\nexport type VideoRemakeStyleChoiceOption = \"user\" | \"precise\" | \"flex\"\n\n/** What {@link VideoRemakeResource.styleChoice} answers: every engine's choice, by its public id. */\nexport interface VideoRemakeStyleChoice {\n engines: Record<VideoRemakeEngine, VideoRemakeStyleChoiceOption>\n /**\n * Per engine, whether the engine takes style-only runs: a Flex run\n * (`style: \"motion\"`) with an art style (`direction`) and nothing to swap\n * (no role with images, no fixed reference). It follows the engine alone, so\n * read it with {@link engines}: an engine answered `\"flex\"` makes a Precise\n * request Flex too, and one answered `\"precise\"` changes no request, so a\n * Flex request there runs as on `\"user\"`. Nodaro Pulse is always\n * `false` (it takes no art style). Absent from an older server, and\n * an engine missing from it: `false`.\n */\n styleOnly?: Partial<Record<VideoRemakeEngine, boolean>>\n /**\n * Per engine, whether a Precise run (no `style`, or `\"precise\"`) takes an\n * art style (`direction`), as a Flex run does. Nodaro may run such a request as\n * a Flex run (see {@link VideoRemakeParams}'s `direction`), which this does not\n * say; otherwise it is Precise's edit of the clip, drawn in the art style, and,\n * where {@link VideoRemakeStyleChoice.preciseArtStyleAlone} is not true for the\n * engine, not on its own: a Precise run with nothing else to change is then refused.\n * Nodaro Pulse is always `false` (it takes no art style). Absent from\n * an older server, and an engine missing from it: `false` (offer an art style\n * on Flex runs alone).\n */\n preciseArtStyle?: Partial<Record<VideoRemakeEngine, boolean>>\n /**\n * Per engine, whether an art style (`direction`) alone is a Precise run's\n * change there, so the run needs no role, reference or prompt. Nodaro may run\n * such a request as a Flex run (see {@link VideoRemakeParams}'s `direction`), which\n * this does not say. It answers\n * `false` until the engine takes such runs. Nodaro Pulse is always\n * `false` (it takes no art style). Absent from an older server, and an engine\n * missing from it: `false`.\n */\n preciseArtStyleAlone?: Partial<Record<VideoRemakeEngine, boolean>>\n}\n\n/**\n * What {@link VideoRemakeResource.advanced} answers: whether the Video Remake\n * page shows its Advanced options.\n */\nexport interface VideoRemakeAdvanced {\n /**\n * Whether the Video Remake page shows `prepareReferences` and `prePrompt`\n * under its Advanced options: `false` until Nodaro turns them on, one\n * setting for the whole page, the same for every engine.\n */\n show: boolean\n}\n\nexport class VideoRemakeResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * Start a Video Remake run (`POST /v1/video-remake`, 202 `{ jobId }`). Returns the\n * job to follow. With `options.idempotencyKey` (sent as the\n * `Idempotency-Key` header; 8–200 characters, else 400) a repeat with the\n * same key within about 10 s answers 200 `{ jobId, deduped: true }`, a later\n * one 202 with the first run's `jobId`; nothing new starts.\n */\n run(params: VideoRemakeParams, options?: VideoRemakeRunOptions): Promise<{ jobId: string; deduped?: boolean }> {\n return this.client.request(\"POST\", \"/v1/video-remake\", {\n body: params,\n ...(options?.idempotencyKey ? { headers: { \"Idempotency-Key\": options.idempotencyKey } } : {}),\n })\n }\n\n /**\n * Whether people choose a direct run's style, per engine\n * (`GET /v1/video-remake/style-choice`): `\"user\"` = show a Style control;\n * `\"precise\"` = Nodaro's own apps run Precise on that engine and hide the\n * control, while a run's `style` is still taken as sent; `\"flex\"` = an admin\n * forced Flex for the engine, so a run's `style` is overridden and the\n * control is best hidden. Its\n * `styleOnly` says, per engine, whether a Flex run with an art style and\n * nothing to swap restyles the whole clip there. Where it is not `true`\n * (absent, or an engine missing from it, included) on Nodaro Prism, an\n * art style alone is refused, and one with a pre or post prompt runs as any\n * other art-style run. Its `preciseArtStyle` says, per engine, whether a\n * Precise run takes an art style there too, and its `preciseArtStyleAlone`\n * whether that art style alone is the run's change.\n * Public (no sign-in needed); the answer may be up to a minute old.\n */\n styleChoice(): Promise<VideoRemakeStyleChoice> {\n return this.client.request(\"GET\", \"/v1/video-remake/style-choice\")\n }\n\n /**\n * Whether the Video Remake page shows its Advanced options\n * (`GET /v1/video-remake/advanced`): `show` is `true` where the page offers\n * `prepareReferences` and `prePrompt`, and `false` until Nodaro turns them\n * on. One answer for the whole page, whatever the engine, so an app built\n * on the SDK can show or hide the same options. It describes the page only:\n * {@link run} and {@link estimate} take both fields as sent, whatever it\n * answers.\n * Public (no sign-in needed); the answer may be up to a minute old.\n */\n advanced(): Promise<VideoRemakeAdvanced> {\n return this.client.request(\"GET\", \"/v1/video-remake/advanced\")\n }\n\n /** Quote a run before starting it (`POST /v1/video-remake/estimate`); spends nothing. */\n async estimate(params: VideoRemakeParams): Promise<VideoRemakeEstimate> {\n const quote = await this.client.request<VideoRemakeEstimate>(\"POST\", \"/v1/video-remake/estimate\", { body: params })\n // An older server names the engine by an earlier id: answered as the public id it names.\n const engine = nodaroMotionEngineFrom(quote?.engine)\n return engine && engine !== quote.engine ? { ...quote, engine } : quote\n }\n\n /**\n * Quote finishing a run at Full Quality (`POST\n * /v1/video-remake/:jobId/full-quality/estimate`); spends nothing. `jobId` is a\n * finished Nodaro Prism DRAFT run (a Video Remake or trend run made\n * with `draft: true`), whose same take Full Quality finishes at 1080p. The\n * quote does not look for a Full Quality already running: when one is,\n * {@link fullQuality} answers it (`existing: true`) and charges nothing.\n * Refusals: {@link VideoRemakeFullQualityRefusalCode}.\n */\n fullQualityEstimate(jobId: string): Promise<VideoRemakeFullQualityEstimate> {\n return this.client.request(\"POST\", `/v1/video-remake/${encodeURIComponent(jobId)}/full-quality/estimate`, { body: {} })\n }\n\n /**\n * Finish a run at Full Quality (`POST /v1/video-remake/:jobId/full-quality`):\n * at 1080p, with the clip's audio, as a new job linked to the run — a\n * Nodaro Prism draft's own take re-rendered. SPENDS CREDITS: quote it first with\n * {@link fullQualityEstimate}. Answers 202 `{ jobId }`, or 200\n * `{ jobId, existing: true }` when this run's Full Quality is already\n * running or done (one per run; a failed one may be asked again). Follow\n * the job with `client.jobs.get(jobId)`. No `Idempotency-Key` is taken: the\n * server keys the job by the draft. The new job keeps the draft's origin.\n * Refusals: {@link VideoRemakeFullQualityRefusalCode}.\n */\n fullQuality(jobId: string, params: VideoRemakeFullQualityParams = {}): Promise<VideoRemakeFullQualityResult> {\n const body = params.sessionId !== undefined ? { sessionId: params.sessionId } : {}\n return this.client.request(\"POST\", `/v1/video-remake/${encodeURIComponent(jobId)}/full-quality`, { body })\n }\n}\n\n// ---------------------------------------------------------------------------\n// The names this resource had before (`client.castSwap`, `CastSwap*`): the\n// same resource and the same types, kept so code written against them still\n// builds.\n// ---------------------------------------------------------------------------\n\n/** @deprecated use {@link VideoRemakeResource} (`client.videoRemake`). */\nexport const CastSwapResource = VideoRemakeResource\n/** @deprecated use {@link VideoRemakeResource} (`client.videoRemake`). */\nexport type CastSwapResource = VideoRemakeResource\n/** @deprecated use {@link VideoRemakeEngine}. */\nexport type CastSwapEngine = VideoRemakeEngine\n/** @deprecated use {@link VideoRemakeEngine}. */\nexport type CastSwapEngineLegacyId = VideoRemakeEngineLegacyId\n/** @deprecated use {@link VideoRemakeStyle}. */\nexport type CastSwapStyle = VideoRemakeStyle\n/** @deprecated use {@link VideoRemakeMotionLength}. */\nexport type CastSwapMotionLength = VideoRemakeMotionLength\n/** @deprecated use {@link VideoRemakeMotionLength}. */\nexport type CastSwapKlingLength = VideoRemakeMotionLength\n/** @deprecated use {@link VideoRemakeTraitSource}. */\nexport type CastSwapTraitSource = VideoRemakeTraitSource\n/** @deprecated use {@link VideoRemakeRolePreviewSettings}. */\nexport type CastSwapRolePreviewSettings = VideoRemakeRolePreviewSettings\n/** @deprecated use {@link VideoRemakePersonRole}. */\nexport type CastSwapPersonRole = VideoRemakePersonRole\n/** @deprecated use {@link VideoRemakeLocationRole}. */\nexport type CastSwapLocationRole = VideoRemakeLocationRole\n/** @deprecated use {@link VideoRemakePetRole}. */\nexport type CastSwapPetRole = VideoRemakePetRole\n/** @deprecated use {@link VideoRemakeProductRole}. */\nexport type CastSwapProductRole = VideoRemakeProductRole\n/** @deprecated use {@link VideoRemakeRole}. */\nexport type CastSwapRole = VideoRemakeRole\n/** @deprecated use {@link VideoRemakeReference}. */\nexport type CastSwapReference = VideoRemakeReference\n/** @deprecated use {@link VideoRemakeFaceMaskingZone}. */\nexport type CastSwapFaceMaskingZone = VideoRemakeFaceMaskingZone\n/** @deprecated use {@link VideoRemakeFaceMasking}. */\nexport type CastSwapFaceMasking = VideoRemakeFaceMasking\n/** @deprecated use {@link VideoRemakeParams}. */\nexport type CastSwapParams = VideoRemakeParams\n/** @deprecated use {@link VideoRemakeEstimate}. */\nexport type CastSwapEstimate = VideoRemakeEstimate\n/** @deprecated use {@link VideoRemakeRunOptions}. */\nexport type CastSwapRunOptions = VideoRemakeRunOptions\n/** @deprecated use {@link VideoRemakeFullQualityKind}. */\nexport type CastSwapFullQualityKind = VideoRemakeFullQualityKind\n/** @deprecated use {@link VideoRemakeFullQualityEstimate}. */\nexport type CastSwapFullQualityEstimate = VideoRemakeFullQualityEstimate\n/** @deprecated use {@link VideoRemakeFullQualityParams}. */\nexport type CastSwapFullQualityParams = VideoRemakeFullQualityParams\n/** @deprecated use {@link VideoRemakeFullQualityResult}. */\nexport type CastSwapFullQualityResult = VideoRemakeFullQualityResult\n/** @deprecated use {@link VideoRemakeFullQualityRefusalCode}. */\nexport type CastSwapFullQualityRefusalCode = VideoRemakeFullQualityRefusalCode\n/** @deprecated use {@link VideoRemakeStyleChoiceOption}. */\nexport type CastSwapStyleChoiceOption = VideoRemakeStyleChoiceOption\n/** @deprecated use {@link VideoRemakeStyleChoice}. */\nexport type CastSwapStyleChoice = VideoRemakeStyleChoice\n"]}
|
package/dist/chunk-RKYZY6NA.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var nodes = require('@nodaro/shared/nodes');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "PROMPT_PREFIX_KEY", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () { return nodes.PROMPT_PREFIX_KEY; }
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, "PROMPT_SUFFIX_KEY", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return nodes.PROMPT_SUFFIX_KEY; }
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=chunk-RKYZY6NA.cjs.map
|
|
16
|
-
//# sourceMappingURL=chunk-RKYZY6NA.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-RKYZY6NA.cjs","sourcesContent":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resources/edit-use-case-inputs.ts","../src/resources/edit-podcast-pack.ts","../src/resources/edit.ts"],"names":["USE_CASE_NODE_TYPES","isUseCaseNodeType","NodaroError","ForbiddenError","resolveEditPlanSources","describeAudioSyncOffsetIssue","transcriptSpeakerLabels","speakerMapResultOf","cameraSwitchSpeakerMap","edl","remapTranscriptThroughEdl"],"mappings":";;;;;;;AAiIO,IAAM,eAAA,GAAkB,CAAC,MAAA,EAAQ,KAAA,EAAO,OAAO,MAAM;AA4BrD,IAAM,wBAAA,GAA2B;AACjC,IAAM,wBAAA,GAA2B;AA4GjC,SAAS,eAAiD,KAAA,EAAmC;AAClG,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,gBAAgB,OAAA,EAAS,GAAG,MAAK,GAAI,KAAA;AAClE,EAAA,IAAI,aAAa,MAAA,IAAa,SAAA,KAAc,QAAW,MAAM,IAAI,UAAU,sCAAsC,CAAA;AACjH,EAAA,MAAM,aAAa,SAAA,KAAc,QAAA,KAAa,MAAA,GAAY,CAAC,QAAQ,CAAA,GAAI,MAAA,CAAA;AACvE,EAAA,IAAI,CAAC,UAAA,EAAY,MAAM,IAAI,UAAU,4BAA4B,CAAA;AACjE,EAAA,OAAO;AAAA,IACL,SAAA,EAAW,CAAC,GAAG,UAAU,CAAA;AAAA,IACzB,GAAI,cAAA,KAAmB,MAAA,GAAY,EAAE,cAAA,KAAmB,EAAC;AAAA,IACzD,GAAI,OAAA,KAAY,MAAA,GAAY,EAAE,OAAA,KAAY,EAAC;AAAA,IAC3C,GAAG,MAAA,CAAO,WAAA,CAAY,MAAA,CAAO,QAAQ,IAAI,CAAA,CAAE,MAAA,CAAO,CAAC,GAAG,CAAC,CAAA,KAAM,CAAA,KAAM,MAAS,CAAC;AAAA,GAC/E;AACF;AAOO,SAAS,eAAA,CAAmB,OAAsC,IAAA,EAAiE;AACxI,EAAA,IAAI,IAAA;AACJ,EAAA,IAA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AAA,EAAW,GAAI;AAAC;AAC3E,KACD,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,eAAA,CAAgBC,OAAU,UAAA,EAAoC;AAC5D,IAAA,OAAOC,6BAAA,CAA0BD,OAAK,UAAU,CAAA;AAAA,EAClD;AACF","file":"chunk-VKEFUXQJ.cjs","sourcesContent":["/**\n * The inputs of the podcast use-case runs on the `edit` resource (Tighten\n * Episode, Chapters, Trailer, Clip Pack, Speaker Layout) and the request body each one sends.\n * Split from `edit.ts`, which holds the methods, the type list and the\n * continue routes; every name here is re-exported from there.\n */\nimport type { EditPlanTier, EdlTargetAspect, SpeakerEmphasisStyle, SpeakerSwitchId } from \"@nodaro/shared/edl\"\nimport type { CaptionStyle } from \"@nodaro/shared/captions\"\n\n/**\n * The recordings of a use-case run: one (`mediaUrl`), or the recordings of one\n * conversation (`mediaUrls`, in order — the cameras; one may be sound only),\n * an optional Master audio and the Cameras settings. Pass `mediaUrl` or\n * `mediaUrls`, not both.\n *\n * Several recordings or a Master audio need Speaker Map, which tells who is on\n * which camera: where it is not available to you the\n * request is refused `403 node_not_available` — send one recording.\n */\nexport interface UseCaseRecordingsInput {\n /** The recording — a video or audio URL, up to 3 hours. */\n mediaUrl?: string\n /**\n * Instead of `mediaUrl`: the recordings of one conversation, in order — up\n * to six in all with the Master audio; without one, two or more cameras keep\n * a place for the sound, so up to five. With two or more the run lines them\n * up, works out who is on which camera and cuts to whoever is talking.\n */\n mediaUrls?: string[]\n /** The mixer or recorder track: the episode's sound and the clock the recordings are lined up to. */\n masterAudioUrl?: string\n /** With several recordings or a Master audio: the Cameras settings (ignored with one recording and no Master audio). */\n cameras?: {\n /** Which recording (1-based) is the wide shot, shown when a speaker has no camera of their own; `null` for none. */\n wide?: number | null\n /** The recordings already share one clock: skip lining them up. */\n synced?: boolean\n /** Who is on which camera: speaker number (`\"1\"` = the first voice heard) → recording number, 0 = the wide shot. Overrides the automatic map. */\n speakerCameras?: Record<string, number>\n }\n}\n\n/**\n * Input for {@link EditResource.tightenEpisode} and\n * {@link EditResource.estimateTightenEpisode}: the recording (or the\n * recordings of one conversation, see {@link UseCaseRecordingsInput}) in, the\n * tightened episode out. Only the recording is required; every other field\n * left out takes the node's default.\n */\nexport interface TightenEpisodeInput extends UseCaseRecordingsInput {\n /** Optional music bed, ducked under the voice and ending with the episode. */\n musicUrl?: string\n /** `\"video\"` or `\"audio\"`; an audio recording always makes an audio episode. */\n output?: \"video\" | \"audio\"\n /**\n * Frame a video episode with Speaker View: an output aspect and a layout,\n * over automatic boxes on the speakers on screen. A layout the aspect does\n * not draw is snapped to one it does. `null` or absent: no framing.\n */\n framing?: {\n aspect: EdlTargetAspect\n layout: \"auto\" | \"single\" | \"side-by-side\" | \"stacked\" | \"grid\" | \"pip\"\n } | null\n /**\n * With a framing, how it follows the speakers: `\"static\"` (the default)\n * splits the frame evenly by speaker; `\"tracking\"` follows faces with\n * Speaker Frames (charged per started block of 1,000 sampled frames; a\n * camera shared by several speakers keeps the even split until faces are\n * named; refused 403 where Speaker Frames is not available to the caller);\n * `\"auto\"` follows faces while Speaker Frames is available to the caller,\n * else the even split. Ignored without a framing.\n */\n framingSource?: \"auto\" | \"static\" | \"tracking\"\n /** Captions on a video episode (on by default). */\n captions?: boolean\n /** The captions' look. */\n captionStyle?: CaptionStyle\n /**\n * Stop at a quick preview for a person to review; render the full-quality\n * episode afterwards with {@link EditResource.continueUseCase}\n * (`mode: \"render-final\"`).\n */\n reviewBeforeRender?: boolean\n /** The planner's tier. */\n planTier?: EditPlanTier\n /** Editing instructions for the planner (up to 4 000 characters). */\n instructions?: string\n /** A style guide for the planner (up to 4 000 characters). */\n styleGuide?: string\n /** How far the music dips under the voice, 0–100 (default 75). */\n musicDuckAmount?: number\n /** See {@link UseCaseSpeakerNamesInput.speakerNames}. */\n speakerNames?: UseCaseSpeakerNamesInput[\"speakerNames\"]\n}\n\n/**\n * The speakers' names a Tighten Episode or Speaker Layout run reports back.\n */\nexport interface UseCaseSpeakerNamesInput {\n /**\n * Speaker label (as the run's transcript names them, e.g. `\"speaker_0\"`) →\n * the name to show (up to 80 characters; at most 32 speakers). The job keeps\n * them and the finished job's `output_data.speakers[].name` carries them\n * (`TightenEpisodeOutputData`, `SpeakerLayoutOutputData`); the\n * run itself never reads them, so nothing is renamed in the captions, the\n * transcript or the edit. A name is trimmed and a blank one dropped; a\n * label nobody in the recording has is ignored. A continuation keeps them.\n */\n speakerNames?: Record<string, string>\n}\n\n/**\n * Input for {@link EditResource.episodeChapters} and\n * {@link EditResource.estimateEpisodeChapters}: one recording in, its chapters\n * out. Only `mediaUrl` is required; every other field left out takes the\n * node's default.\n */\nexport interface EpisodeChaptersInput {\n /** The recording — a video or audio URL, up to 3 hours. */\n mediaUrl: string\n /** The planner's tier (default `\"economy\"`). */\n planTier?: EditPlanTier\n /** Instructions for the chapters, e.g. \"5 to 8 chapters\" (up to 4 000 characters). */\n instructions?: string\n /** A style guide for the chapter titles (up to 4 000 characters). */\n styleGuide?: string\n}\n\n/** The formats a Trailer is delivered in, in delivery order (16:9 is a 1920×1080 landscape). */\nexport const TRAILER_FORMATS = [\"9:16\", \"1:1\", \"4:5\", \"16:9\"] as const\n/** One Trailer format (see {@link TRAILER_FORMATS}). */\nexport type TrailerFormat = (typeof TRAILER_FORMATS)[number]\n\n/**\n * Input for {@link EditResource.episodeTrailer} and\n * {@link EditResource.estimateEpisodeTrailer}: one video recording (or the\n * recordings of one conversation, see {@link UseCaseRecordingsInput}) in, a\n * 20–40 s trailer out in each chosen format. Only the recording is required.\n */\nexport interface EpisodeTrailerInput extends UseCaseRecordingsInput {\n /** The recording — a video URL, up to 3 hours (a run with no picture is refused). Or `mediaUrls`. */\n mediaUrl?: string\n /** An optional intro card: a short video (15 s at most) played before the trailer. */\n introCardUrl?: string\n /** The formats to deliver, padded, never cropped (default `[\"9:16\", \"1:1\", \"4:5\"]`; an empty list, or one that names a format twice, is refused `400 validation_error`). */\n formats?: TrailerFormat[]\n /** Stop at a preview of the trailer; render every format with {@link EditResource.continueUseCase} (`mode: \"render-final\"`). */\n reviewBeforeRender?: boolean\n /** The planner's tier (default `\"standard\"`). */\n planTier?: EditPlanTier\n /** Instructions for the trailer (up to 4 000 characters). */\n instructions?: string\n /** A style guide for the planner (up to 4 000 characters). */\n styleGuide?: string\n}\n\n/** The shortest and longest clip a Clip Pack asks the plan for, in seconds. */\nexport const CLIP_PACK_MIN_TARGET_SEC = 5\nexport const CLIP_PACK_MAX_TARGET_SEC = 180\n\n/**\n * A Clip Pack emphasis: `\"none\"`, or one or more of `\"scale\"`, `\"border\"` and\n * `\"dim\"` joined with `\"+\"` (each once — the route refuses a repeat).\n */\nexport type ClipPackEmphasis = SpeakerEmphasisStyle | `${Exclude<SpeakerEmphasisStyle, \"none\">}+${string}`\n\n/**\n * Input for {@link EditResource.clipPack} and\n * {@link EditResource.estimateClipPack}: the recording (or the recordings of\n * one conversation, see {@link UseCaseRecordingsInput} — each clip then cuts\n * to whoever is talking) in, a pack of short clips out. An audio recording\n * makes audio clips (no framing, no captions). Only the recording is\n * required; every other field left out takes the node's default.\n */\nexport interface ClipPackInput extends UseCaseRecordingsInput {\n /** How many clips to find, 1–50 (default 8). The plan may find fewer. */\n count?: number\n /** Each clip's target length in seconds, {@link CLIP_PACK_MIN_TARGET_SEC}–{@link CLIP_PACK_MAX_TARGET_SEC} (default 60). */\n targetDurationSec?: number\n /**\n * Frame each video clip with Speaker View on automatic boxes over the\n * episode's speakers: the shape, and optionally the layout (default\n * `\"stacked\"`; one the shape does not draw is snapped), the switch at each\n * speaker change (default `\"pan\"`) and the emphasis (default `\"scale\"`;\n * `\"none\"`, or `\"scale\"`, `\"border\"` and `\"dim\"` joined with `\"+\"`). Left\n * out: 9:16, stacked, pan, scale. `null`: no framing (the recording's shape).\n */\n framing?: {\n aspect: EdlTargetAspect\n layout?: \"auto\" | \"single\" | \"side-by-side\" | \"stacked\" | \"grid\" | \"pip\"\n switchType?: SpeakerSwitchId\n emphasisStyle?: ClipPackEmphasis\n } | null\n /**\n * With a framing, how it follows the speakers: `\"static\"` splits the frame\n * evenly by speaker (what a request that leaves this out gets); `\"tracking\"`\n * runs Speaker Frames once over the whole pack to follow faces (charged per\n * started block of 1,000 sampled frames; refused 403 where Speaker Frames is\n * not available to the caller); `\"auto\"` follows faces while Speaker Frames\n * is available to the caller, else the even split. Ignored without a framing.\n */\n framingSource?: \"auto\" | \"static\" | \"tracking\"\n /** Caption each video clip (on by default). */\n captions?: boolean\n /** The captions' look (default `\"karaoke\"`). */\n captionStyle?: CaptionStyle\n /**\n * Stop at quick previews of the clips for a person to review; render the\n * kept clips at full quality with {@link EditResource.continueUseCase}\n * (`mode: \"render-final\"`, an `editedEdl` that keeps or drops clips).\n */\n reviewBeforeRender?: boolean\n /** The planner's tier (default `\"standard\"`). */\n planTier?: EditPlanTier\n /** Instructions for picking the clips (up to 4 000 characters). */\n instructions?: string\n /** A style guide for the planner (up to 4 000 characters). */\n styleGuide?: string\n}\n\n/**\n * Input for {@link EditResource.speakerLayout} and\n * {@link EditResource.estimateSpeakerLayout}: one video recording (or the\n * recordings of one conversation, see {@link UseCaseRecordingsInput}) in, the\n * whole recording framed by speaker out — the same length, nothing cut. Only\n * the recording is required; every other field left out takes the node's\n * default.\n */\nexport interface SpeakerLayoutInput extends UseCaseRecordingsInput {\n /** The recording — a video URL, up to 3 hours (an audio-only recording is refused). Or `mediaUrls`. */\n mediaUrl?: string\n /** The video's shape (default `\"9:16\"`). With one recording, a video already as narrow as the shape (or narrower) is refused `400 media_shape`. */\n targetAspect?: EdlTargetAspect\n /** How the speakers are laid out (default `\"stacked\"`; one the shape does not draw is snapped to one it does). */\n layout?: \"auto\" | \"single\" | \"side-by-side\" | \"stacked\" | \"grid\" | \"pip\"\n /** The switch at each speaker change (default `\"cut\"`). */\n switchType?: SpeakerSwitchId\n /** How the speaker talking is emphasised (default `\"scale\"`): `\"none\"`, or `\"scale\"`, `\"border\"` and `\"dim\"` joined with `\"+\"`. */\n emphasisStyle?: ClipPackEmphasis\n /**\n * How the speakers are followed: `\"auto\"` (the default) follows faces with\n * Speaker Frames while it is available to the caller, else splits the frame\n * evenly; `\"static\"` splits the frame evenly by speaker; `\"tracking\"`\n * follows faces (charged per started block of 1,000 sampled frames;\n * refused 403 where Speaker Frames is not available to the caller). Faces\n * aren't named after a speaker yet, so a camera shared by several speakers\n * keeps the even split.\n */\n framingSource?: \"auto\" | \"static\" | \"tracking\"\n /**\n * Stop at a quick preview for a person to review; render it at full\n * quality with {@link EditResource.continueUseCase}\n * (`mode: \"render-final\"`, no `editedEdl`: the layout has no cut to change).\n */\n reviewBeforeRender?: boolean\n /** See {@link UseCaseSpeakerNamesInput.speakerNames}. */\n speakerNames?: UseCaseSpeakerNamesInput[\"speakerNames\"]\n}\n\n/**\n * The body's recordings (`mediaUrls`, then `masterAudioUrl` and `cameras` when\n * given), and the rest of the input as it came: the one mapper every use-case\n * body goes through (the podcast pack's too, edit-podcast-pack.ts). Throws\n * before any request when the input names both `mediaUrl` and `mediaUrls`, or\n * neither.\n */\nexport function withRecordings<T extends UseCaseRecordingsInput>(input: T): Record<string, unknown> {\n const { mediaUrl, mediaUrls, masterAudioUrl, cameras, ...rest } = input\n if (mediaUrl !== undefined && mediaUrls !== undefined) throw new TypeError(\"pass mediaUrl or mediaUrls, not both\")\n const recordings = mediaUrls ?? (mediaUrl !== undefined ? [mediaUrl] : undefined)\n if (!recordings) throw new TypeError(\"pass mediaUrl or mediaUrls\")\n return {\n mediaUrls: [...recordings],\n ...(masterAudioUrl !== undefined ? { masterAudioUrl } : {}),\n ...(cameras !== undefined ? { cameras } : {}),\n ...Object.fromEntries(Object.entries(rest).filter(([, v]) => v !== undefined)),\n }\n}\n\n/**\n * Sends `send` the body `build` makes, or rejects (never throws) with the\n * error of an input the body cannot take — before any request, as every input\n * check of the `edit` resource rejects.\n */\nexport function withUseCaseBody<T>(build: () => Record<string, unknown>, send: (body: Record<string, unknown>) => Promise<T>): Promise<T> {\n let body: Record<string, unknown>\n try {\n body = build()\n } catch (err) {\n return Promise.reject(err)\n }\n return send(body)\n}\n\nexport function tightenBody(input: TightenEpisodeInput): Record<string, unknown> {\n return withRecordings(input)\n}\n\nexport function chaptersBody(input: EpisodeChaptersInput): Record<string, unknown> {\n return withRecordings({\n mediaUrl: input.mediaUrl,\n ...(input.planTier !== undefined ? { planTier: input.planTier } : {}),\n ...(input.instructions !== undefined ? { instructions: input.instructions } : {}),\n ...(input.styleGuide !== undefined ? { styleGuide: input.styleGuide } : {}),\n })\n}\n\nexport function trailerBody(input: EpisodeTrailerInput): Record<string, unknown> {\n return withRecordings({\n mediaUrl: input.mediaUrl,\n mediaUrls: input.mediaUrls,\n masterAudioUrl: input.masterAudioUrl,\n cameras: input.cameras,\n ...(input.introCardUrl !== undefined ? { introCardUrl: input.introCardUrl } : {}),\n // An empty list is sent as is: the route refuses it (at least one format).\n ...(input.formats !== undefined ? { formats: input.formats } : {}),\n ...(input.reviewBeforeRender !== undefined ? { reviewBeforeRender: input.reviewBeforeRender } : {}),\n ...(input.planTier !== undefined ? { planTier: input.planTier } : {}),\n ...(input.instructions !== undefined ? { instructions: input.instructions } : {}),\n ...(input.styleGuide !== undefined ? { styleGuide: input.styleGuide } : {}),\n })\n}\n\n/** Clip Pack's body: what the caller set, `framing: null` included (no framing). */\nexport function clipPackBody(input: ClipPackInput): Record<string, unknown> {\n return withRecordings(input)\n}\n\n/** Speaker Layout's body: the recordings, then what the caller set. */\nexport function speakerLayoutBody(input: SpeakerLayoutInput): Record<string, unknown> {\n return withRecordings(input)\n}\n","/**\n * The podcast pack on the `edit` resource (`POST /v1/podcast-pack`): several\n * podcast tools on one recording, for one price. Its input (the recording\n * once, and each tool's own settings), the body it sends and what it answers.\n * Split from `edit.ts`, which holds the methods; every name here is\n * re-exported from there.\n */\nimport { USE_CASE_NODE_TYPES, type UseCaseNodeType } from \"@nodaro/shared/nodes\"\nimport type { EditJobResult, EditResource } from \"./edit.js\"\nimport {\n withRecordings,\n type UseCaseRecordingsInput,\n type UseCaseSpeakerNamesInput,\n} from \"./edit-use-case-inputs.js\"\n\n/** The tools a podcast pack can run, in the order the pack starts them. */\nexport const PODCAST_PACK_TOOLS: readonly UseCaseNodeType[] = USE_CASE_NODE_TYPES\n\n/** One tool a podcast pack can run (see {@link PODCAST_PACK_TOOLS}). */\nexport type PodcastPackTool = (typeof PODCAST_PACK_TOOLS)[number]\n\n/**\n * The fields a tool's settings leave out in a pack: the recording and the\n * speakers' names belong to the pack, sent once for every tool.\n */\nexport type PodcastPackRecordingField = keyof UseCaseRecordingsInput | keyof UseCaseSpeakerNamesInput\n\n/** A tool's type spelled as its method's name: `tighten-episode` → `tightenEpisode`. */\ntype MethodNameOf<S extends string> = S extends `${infer Head}-${infer Tail}` ? `${Head}${Capitalize<MethodNameOf<Tail>>}` : S\n\n/**\n * Each tool's settings in a pack: what its own method takes (`tightenEpisode`,\n * `episodeChapters`, …), without the recording fields — read from the method\n * itself, so a tool and its settings never drift (a tool with no method of its\n * own fails to type here).\n */\nexport type PodcastPackToolSettings = EveryPackToolHasAMethod extends true\n ? { [T in PodcastPackTool]: Omit<ToolInputOf<T>, PodcastPackRecordingField> }\n : never\n\n/** What a tool's own method takes as its input. */\ntype ToolInputOf<T extends PodcastPackTool> = EditResource[MethodNameOf<T> & keyof EditResource] extends (input: infer I, ...rest: never[]) => unknown ? I : never\n\n/** Every tool has a method of its own: a type with none fails to compile here. */\ntype AssertTrue<T extends true> = T\ntype EveryPackToolHasAMethod = AssertTrue<{ [T in PodcastPackTool]: MethodNameOf<T> extends keyof EditResource ? true : false }[PodcastPackTool]>\n\n/** The tools a pack runs, each with its settings (`{}` takes the tool's defaults). */\nexport type PodcastPackTools = { [T in PodcastPackTool]?: PodcastPackToolSettings[T] }\n\n/**\n * Input for {@link EditResource.podcastPack} and\n * {@link EditResource.estimatePodcastPack}: the recording (or the recordings\n * of one conversation, see {@link UseCaseRecordingsInput}) once, and the tools\n * to run on it. Each tool refuses in a pack what it refuses on its own (Chapters\n * takes one recording, Trailer and Speaker Layout need a picture).\n */\nexport interface PodcastPackInput extends UseCaseRecordingsInput {\n /**\n * The tools to run, at least one (an empty object is refused `400\n * validation_error`). A tool's settings are what its own method takes,\n * without the recording.\n */\n tools: PodcastPackTools\n /**\n * Speaker label → the name to show (see\n * {@link UseCaseSpeakerNamesInput.speakerNames}); passed only to the tools\n * that take it (Tighten Episode, Speaker Layout).\n */\n speakerNames?: UseCaseSpeakerNamesInput[\"speakerNames\"]\n /** A workflow (its id) to tie the pack's job and its tools' runs to. */\n workflowId?: string\n /** With `workflowId`: the node on it. */\n nodeId?: string\n}\n\n/** One tool of a pack that started: its own run, followed by its own job. */\nexport interface PodcastPackToolRun {\n tool: PodcastPackTool\n /** The tool's job: the same job its own method answers. Follow it with `client.jobs.getStatus(jobId)`. */\n jobId: string\n /** The tool's run. */\n executionId: string | null\n}\n\n/** One tool of a pack that did not start, and why. */\nexport interface PodcastPackNotStarted {\n tool: PodcastPackTool\n error: { code: string; message: string; tool?: PodcastPackTool }\n}\n\n/**\n * What a pack's job holds once its tools have started (its `output_data`),\n * and what {@link EditResource.podcastPack} answers beside the pack's `jobId`.\n */\nexport interface PodcastPackOutputData {\n /** The tools that started, in the pack's order. */\n tools: PodcastPackToolRun[]\n /** The tools that did not start (absent when every tool started). */\n notStarted?: PodcastPackNotStarted[]\n /** The recording's length, in seconds. */\n durationSec: number\n /** The units the pack is charged: every started 15 seconds of the recording. */\n units: number\n}\n\n/** A pack started by this request: its job, and each tool's. */\nexport interface PodcastPackStarted extends EditJobResult, PodcastPackOutputData {\n deduped?: false\n}\n\n/**\n * An `Idempotency-Key` retry that found the pack already started: `jobId` is\n * that pack's job, whose `output_data` lists its tools\n * ({@link PodcastPackOutputData}).\n */\nexport interface PodcastPackDeduped extends EditJobResult {\n deduped: true\n}\n\n/** What {@link EditResource.podcastPack} answers (`202`). */\nexport type PodcastPackJobResult = PodcastPackStarted | PodcastPackDeduped\n\n/** What {@link EditResource.startPodcastPackTool} answers (`202`): the tool's run, followed like any run. */\nexport interface PodcastPackToolStarted {\n /** The tool's run: its job, to follow with `jobs.get` (and to continue free if it fails). */\n jobId: string\n /** The run's execution, when it started one. */\n executionId: string | null\n tool: PodcastPackTool\n}\n\n/** What a pack is estimated at (`data`). Nothing is created or charged. */\nexport interface PodcastPackEstimate {\n /** The tools the pack would run, in the pack's order. */\n tools: PodcastPackTool[]\n /** The recording's length, in seconds. */\n durationSec: number\n /** Every started 15 seconds of the recording. */\n units: number\n /** The pack's price, every tool included: 0 on an edition without credits, `null` when this server has no price for it. */\n credits: number | null\n}\n\n/** The pack's body: the recordings once, then the tools and the rest as given. */\nexport function podcastPackBody(input: PodcastPackInput): Record<string, unknown> {\n return withRecordings(input)\n}\n","import type { NodaroClientCore } from \"../core.js\"\nimport { ForbiddenError, NodaroError } from \"../errors.js\"\nimport {\n remapTranscriptThroughEdl,\n unwrapEditPlanOutput,\n resolveEditPlanSources,\n describeAudioSyncOffsetIssue,\n transcriptSpeakerLabels,\n cameraSwitchSpeakerMap, speakerMapResultOf, type SpeakerMapResult,\n type Edl,\n type Transcript,\n type EditPlanMode,\n type EditPlanTier,\n type EdlClipSet,\n type ChapterSet,\n type EdlTargetAspect\n} from \"@nodaro/shared/edl\"\nimport { USE_CASE_NODE_TYPES, isUseCaseNodeType, type UseCaseNodeType } from \"@nodaro/shared/nodes\"\nimport type { SpeakerMapInput } from \"./speaker-map-inputs.js\"\nimport {\n chaptersBody,\n clipPackBody,\n speakerLayoutBody,\n tightenBody,\n trailerBody,\n withUseCaseBody,\n type ClipPackInput,\n type EpisodeChaptersInput,\n type EpisodeTrailerInput,\n type SpeakerLayoutInput,\n type TightenEpisodeInput,\n} from \"./edit-use-case-inputs.js\"\n\nexport { CLIP_PACK_MAX_TARGET_SEC, CLIP_PACK_MIN_TARGET_SEC, TRAILER_FORMATS } from \"./edit-use-case-inputs.js\"\nexport type { ClipPackEmphasis, ClipPackInput, EpisodeChaptersInput, EpisodeTrailerInput, SpeakerLayoutInput, TightenEpisodeInput, TrailerFormat, UseCaseRecordingsInput, UseCaseSpeakerNamesInput } from \"./edit-use-case-inputs.js\"\nimport type {\n TightenEpisodeEstimate,\n TightenEpisodeJobResult,\n UseCaseContinueInput,\n UseCaseEstimate,\n UseCaseJobResult,\n UseCaseRequestOptions,\n} from \"./edit-use-case-results.js\"\nexport type { TightenEpisodeEstimate, TightenEpisodeJobResult, UseCaseContinueInput, UseCaseEstimate, UseCaseJobResult, UseCaseRequestOptions }\nimport { podcastPackBody, type PodcastPackEstimate, type PodcastPackInput, type PodcastPackJobResult, type PodcastPackTool, type PodcastPackToolStarted } from \"./edit-podcast-pack.js\"\nexport { PODCAST_PACK_TOOLS } from \"./edit-podcast-pack.js\"\nexport type { PodcastPackDeduped, PodcastPackEstimate, PodcastPackInput, PodcastPackJobResult, PodcastPackNotStarted, PodcastPackOutputData, PodcastPackRecordingField, PodcastPackStarted, PodcastPackTool, PodcastPackToolRun, PodcastPackToolSettings, PodcastPackToolStarted, PodcastPackTools } from \"./edit-podcast-pack.js\"\n\n// Re-export the canonical EDL / transcript vocabulary from `@nodaro/shared`\n// (single source of truth — the shapes live at `packages/shared/src/edl.ts`).\n// `@nodaro/shared` is already a hard dep of this package, so there is no\n// bundle-size cost to importing from it, and an integration builds requests and\n// reads results with one dependency. `EdlClipSet` / `ChapterSet` are the raw\n// `output_data` shapes of the `clips` / `chapters` modes, and\n// `unwrapEditPlanOutput` is the sanctioned way to normalize any edit-plan job's\n// `output_data` (it also strips the relay's `viaNodaroCloud` marker).\nexport type { Edl, Transcript, EditPlanMode, EditPlanTier, EdlClipSet, ChapterSet }\nexport { unwrapEditPlanOutput }\n\n/**\n * A silence-detect job's `output_data.json` — the value to pass as\n * {@link EditPlanInput.silence}. It is NOT what {@link EditResource.silenceDetect}\n * returns (that is `{ jobId }`); fetch the finished job and read its\n * `output_data.json`. The planner reads the `ranges` array — an input without\n * one is silently ignored, so pass this whole object.\n */\nexport interface SilenceRanges {\n /** Wire version of the payload. */\n version?: number\n /** Silence spans on the source clock, in ms. */\n ranges: ReadonlyArray<{ startMs: number; endMs: number }>\n /** Total source duration, in ms. */\n durationMs?: number\n}\n\n/** Every editorial route answers with the queued job to poll. */\nexport interface EditJobResult {\n /** The queued job id — follow it via `client.jobs.getStatus(jobId)`. */\n jobId: string\n}\n\nexport interface SilenceDetectInput {\n /**\n * An audio OR video source. A single ffmpeg `silencedetect` pass runs over the\n * source's audio proxy either way — no provider key required.\n */\n audioUrl: string\n /** dBFS threshold, always ≤ 0. Default -35 (a good podcast default). */\n thresholdDb?: number\n /** Minimum silence length to report, in ms. Default 700. */\n minSilenceMs?: number\n /** Padding kept around speech, in ms — shrinks each reported range inward. Default 120. */\n padMs?: number\n /**\n * Optionally associate this run with a workflow execution (display only — it\n * ties the standalone job back to a workflow for the execution history).\n */\n workflowId?: string\n}\n\n/** One recording for {@link EditResource.audioSync}. */\nexport interface AudioSyncSource {\n /**\n * Your id for this recording (1–200 chars, unique within the request) —\n * echoed back as its offset's `sourceId`. Use the id your EDL gives the same\n * recording (`EdlSource.id`) and the result folds straight into it.\n */\n id: string\n /** An audio OR video URL — the audio track is read either way. */\n url: string\n}\n\nexport interface AudioSyncInput {\n /** The 2–6 recordings of one conversation to line up (camera files and/or a master mic). */\n sources: AudioSyncSource[]\n /**\n * The id of the source every offset is measured against (its own offset is\n * 0). Must be one of `sources`' ids; default: the first source.\n */\n reference?: string\n /** Optionally associate this run with a workflow execution (display only). */\n workflowId?: string\n}\n\n/** One recording's measured clock offset in an {@link AudioSyncResult}. */\nexport interface AudioSyncOffset {\n /** The recording's `id` from the request. */\n sourceId: string\n /**\n * Where this recording sits on the reference's clock, in integer ms:\n * `referenceMs = sourceMs + offsetMs` (the EDL's D19 sign — the value\n * `EdlSource.offsetMs` takes when the reference is the master).\n */\n offsetMs: number\n /** 0–1. Below 0.5 a `notes` line asks for a check by ear. */\n confidence: number\n /**\n * Measured clock drift against the reference, in ms gained per hour; `null`\n * when the shared stretch was too short to measure it. Drift is reported,\n * never corrected — the offset is taken at the middle of the overlap.\n */\n driftMsPerHour: number | null\n}\n\n/**\n * An audio-sync job's `output_data.json`. It is NOT what\n * {@link EditResource.audioSync} returns (that is `{ jobId }`); fetch the\n * finished job and read its `output_data.json`.\n */\nexport interface AudioSyncResult {\n /** Wire version of the payload. */\n version: number\n /** The source every offset is measured against (its own offset is 0). */\n reference: string\n offsets: AudioSyncOffset[]\n /** Human-readable warnings: low confidence, measured drift, no shared sound. */\n notes: string[]\n}\n\nexport interface ApplyEdlInput {\n /** The edit decision list to render. Media resolves from each `edl.sources[i].url`. */\n edl: Edl\n /**\n * Optional media-URL overrides for `edl.sources[i].url`, POSITIONAL in this\n * array's order. Each URL is SSRF-guarded server-side like any media the\n * platform fetches.\n */\n sources?: string[]\n /**\n * Optional transcript to remap through the cut. The rendered job returns the\n * remapped transcript on its `json` output. A word-level multi-hour transcript\n * is several MB — if you only need the re-timed transcript (not a render), use\n * {@link EditResource.remapTranscript} locally instead of sending it here.\n */\n transcript?: Transcript\n /** Render a full video (default) or an audio-only cut. */\n output?: \"video\" | \"audio\"\n /** Fast proxy draft or the final render. Default \"final\". */\n quality?: \"proxy\" | \"final\"\n /**\n * Default crossfade (ms) on boundaries with no explicit transition; 0 = hard\n * cuts. Per-boundary clamped to the ffmpeg-xfade limit server-side. Default 0.\n */\n crossfadeMs?: number\n /**\n * The plan clip this render cuts — `edlSpanKey(clip)` from `@nodaro/shared`\n * (`\"<first inMs>-<last outMs>\"`). The job's result carries it back as\n * `output_data.clipKey`, so renders of a clip set can be matched to their\n * clips. Omit for a render of no plan clip.\n */\n clipKey?: string\n /**\n * The plan value this render cuts — `renderReadBasis(value)` from\n * `@nodaro/shared` (16 lowercase hex digits), where `value` is the Edit\n * Plan's Tighten EDL with any review applied, or the clip this render cuts.\n * The job's result carries it back as `output_data.planBasis`, so a take can\n * be told apart from one cut from an earlier plan. Send it only when the EDL\n * you send IS that value (not one an intermediate step re-cut from an older\n * plan); omit it otherwise. The result's `output_data.renderBasis` (the\n * render's own settings and sources) is stamped by the server.\n */\n planBasis?: string\n /** Optionally associate this run with a workflow execution (display only). */\n workflowId?: string\n}\n\n/**\n * One media source for an edit-plan run. Mirrors the shape the workflow engine\n * sends: a stable `id` (adopted verbatim as the plan's `EdlSource` id), the\n * media `url`, and the `kind`, plus optional per-source annotations the planner\n * honors.\n */\nexport interface EditPlanSource {\n /** Stable id for this source — becomes the `EdlSource` id in the returned plan. */\n id: string\n /** The source's media URL (SSRF-guarded server-side). */\n url: string\n /** This source's medium. */\n kind: \"video\" | \"audio\"\n /** Role annotation. `\"master-audio\"` marks the clock the plan is reserved on. */\n role?: \"master-audio\" | \"camera\" | \"wide\" | \"screen\"\n /** Speaker labels present in this source. */\n speakers?: string[]\n /**\n * This source's origin on the master clock (masterMs = sourceMs + offsetMs).\n * Set by hand, it wins over a measured offset from `offsets`.\n */\n offsetMs?: number\n}\n\nexport interface EditPlanInput {\n /**\n * Planning mode. The finished job's `output_data` carries the plan — read it\n * with {@link unwrapEditPlanOutput}, which also strips the relay's\n * `viaNodaroCloud` marker:\n * - `\"tighten\"` → an `Edl`.\n * - `\"clips\"` → an {@link EdlClipSet} (`{ version, clips: Edl[] }`);\n * `unwrapEditPlanOutput` returns the bare `Edl[]`.\n * - `\"chapters\"` → a {@link ChapterSet} (`{ version, chapters: [...] }`).\n * - `\"trailer\"` → an `Edl` (one short teaser cut from the strongest moments).\n */\n mode: EditPlanMode\n /** Reasoning tier — affects plan quality AND the credit bucket. */\n planTier: EditPlanTier\n /** The timed transcript driving the plan. */\n transcript: Transcript\n /**\n * Optional detected silence ranges. Pass the silence-detect JOB'S RESULT —\n * `getStatus(jobId).data.output_data.json` (a {@link SilenceRanges} object),\n * NOT the `{ jobId }` that {@link EditResource.silenceDetect} returns. The\n * planner reads the `ranges` array; an input without one is silently ignored.\n */\n silence?: SilenceRanges\n /** The recording's media sources (1–6). */\n sources: EditPlanSource[]\n /**\n * Multicam: an {@link AudioSyncResult} (the audio-sync job's\n * `output_data.json`) measured over these same source ids. Each source's\n * measured offset is written onto its `offsetMs` BEFORE the request, on the\n * master's clock (the `master-audio` source, else the first) — a source's\n * own `offsetMs` wins. `editPlan` rejects with a {@link NodaroError}\n * (`code: \"edit_plan_sources\"`), before any request or charge, when a\n * source was not measured or matched weakly (confidence < 0.5 — set its\n * `offsetMs` by hand), or the master was not measured.\n */\n offsets?: AudioSyncResult | string\n /**\n * The id of the source the transcript was made from, when you know it. The\n * plan follows the master's clock, so a transcript made from a source that\n * is off it is rejected the same way.\n */\n transcriptSourceId?: string\n /** Free-text editing steer. */\n instructions?: string\n /** Style-guide text applied to the plan. */\n styleGuide?: string\n /** `\"clips\"` mode only: how many clips to cut. */\n count?: number\n /** `\"clips\"` mode only: target duration per clip, in seconds. */\n targetDurationSec?: number\n /** Target aspect for cut clips (`\"clips\"`) or the teaser (`\"trailer\"`). */\n targetAspect?: \"16:9\" | \"9:16\" | \"1:1\" | \"4:5\"\n /** Target platform hint (e.g. a social platform name). */\n platform?: string\n /** Optionally associate this run with a workflow execution (display only). */\n workflowId?: string\n}\n\n/**\n * What {@link EditResource.editPlanCapabilities} answers: the Edit Plan modes\n * this server can plan, who answered, and how Edit Plan is priced here.\n */\nexport interface EditPlanCapabilities {\n /**\n * The modes this server plans. `tighten`, `clips` and `chapters` are always\n * listed; `trailer` once the server can plan a trailer. A mode not listed is\n * refused before anything is charged (`400 mode_not_available`).\n */\n modes: EditPlanMode[]\n /**\n * Who answered: `\"server\"` (nodaro.ai, or a self-hosted install that is not\n * connected), `\"nodaro.ai\"` (a connected self-hosted install, with\n * nodaro.ai's answer), or `\"nodaro.ai-unreachable\"` (a connected self-hosted\n * install that could not reach nodaro.ai; only the three original modes are\n * listed then). A newer server may add a value.\n */\n source: \"server\" | \"nodaro.ai\" | \"nodaro.ai-unreachable\" | (string & {})\n /**\n * `true` when Edit Plan is charged per started minute of the recording,\n * `false` when at the 15/30/60/90/120/180-minute step its length rounds up to.\n */\n perMinute: boolean\n}\n\n/** Input for {@link EditResource.cameraSwitch} (podcast B5). */\nexport interface CameraSwitchInput {\n /** One EDL — an `editPlan` result (`unwrapEditPlanOutput`), not a clip set. */\n edl: Edl\n /** The word transcript WITH speaker labels (transcribe with speaker detection). */\n transcript: Transcript\n /** Speaker label → the EDL source id of that speaker's camera. A speaker\n * left out shows the source whose `speakers` list names them, else the\n * `wide` camera, else any camera that filmed them. */\n speakerMap?: Record<string, string>\n /** A {@link EditResource.speakerMap} job's `output_data.json`: a label in `speakerMap`\n * wins, then this result, then the n-th speaker heard gets the n-th camera. */\n speakerMapResult?: SpeakerMapResult | string\n /** Speaker label → display name (on the segments and the returned transcript). */\n speakerNames?: Record<string, string>\n /** The shortest shot in ms (default 2 500): a shorter turn holds the shot. */\n minShotMs?: number\n /** Cut this long before the new speaker starts, ms (default 200). */\n leadMs?: number\n /** Delay each cut by this long, ms (0–5 000, default 0): `leadMs`'s counterpart. */\n lagMs?: number\n /** With a `wide` source: break to it after this long on one camera, ms (default 20 000). */\n maxShotMs?: number\n /** With a `wide` source: every N-th cut goes to the wide (default 0 = off). */\n wideEvery?: number\n /** Overlapping speech → a layout hint (default false; Apply EDL renders cut-only edits). */\n layoutHints?: boolean\n /** Optionally associate this run with a workflow execution (display only). */\n workflowId?: string\n}\n\n/**\n * The podcast use-case node types, each one a route (`POST /v1/<type>`, and\n * `POST /v1/<type>/continue` to continue one of its runs).\n */\nexport { USE_CASE_NODE_TYPES, type UseCaseNodeType }\n\n/** The route that continues a run of `type`. */\nconst continuePathOf = (type: UseCaseNodeType): `/v1/${UseCaseNodeType}/continue` => `/v1/${type}/continue`\n\nfunction idempotencyHeaders(options?: UseCaseRequestOptions): { headers?: Record<string, string> } {\n return options?.idempotencyKey ? { headers: { \"Idempotency-Key\": options.idempotencyKey } } : {}\n}\n\n/**\n * Editorial primitives for podcast / long-form video editing, single-camera\n * and multicam: measure the cameras' offsets ({@link audioSync}), plan the cut\n * ({@link editPlan}), put each cut on the speaker's camera\n * ({@link cameraSwitch}), render a Preview to review (`applyEdl` with\n * `quality: \"proxy\"`), then the final (`quality: \"final\"`).\n *\n * - {@link silenceDetect}, {@link audioSync} and {@link applyEdl} are core nodes\n * available on every edition.\n * - {@link editPlan} and {@link cameraSwitch} run on nodaro.ai; a self-hosted\n * install relays them once it is connected (a 503\n * `code: \"nodaro_connection_required\"` otherwise).\n * - {@link tightenEpisode} runs the whole chain (transcribe, plan, render, and\n * optionally captions, music and framing) in one call. It is core, but a\n * self-hosted install needs a nodaro.ai connection for the steps that run\n * there (a 503 `code: \"nodaro_connection_required\"` otherwise).\n * {@link continueUseCase} continues one of its runs.\n * - {@link episodeChapters} lists a recording's chapters (transcribe, then the\n * plan in chapters mode) in one call; nothing renders. Like\n * {@link tightenEpisode}, a self-hosted install needs a nodaro.ai connection.\n * - {@link episodeTrailer} cuts a 20–40 s trailer of a recording and delivers\n * it in each chosen format in one call; the same connection applies.\n * - {@link clipPack} cuts a recording into a pack of short clips (framed and\n * captioned by default) in one call; the same connection applies.\n * - {@link speakerLayout} frames a whole recording by speaker (the same\n * length, nothing cut) in one call; the same connection applies.\n * - {@link podcastPack} runs several of those tools on one recording, for one\n * price by its length; each tool runs as its own run, with its own job.\n * - {@link remapTranscript} is a PURE local transform (no request) — the same\n * remap `applyEdl` performs on its `transcript`, exposed for callers that hold\n * an EDL and a transcript and only want the re-timed transcript.\n *\n * Every request method except the estimates ({@link estimateTightenEpisode},\n * {@link estimateEpisodeChapters}, {@link estimateEpisodeTrailer},\n * {@link estimateClipPack}, {@link estimateSpeakerLayout},\n * {@link estimatePodcastPack}: a quote, `{ data }`)\n * and {@link editPlanCapabilities} (a read: {@link EditPlanCapabilities}) returns\n * {@link EditJobResult} (the use-case runs a {@link UseCaseJobResult}, the\n * pack a {@link PodcastPackJobResult}); poll the `jobId` with\n * `client.jobs.getStatus(jobId)`.\n */\nexport class EditResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * Detect silence ranges in an audio/video source (`POST /v1/silence-detect`).\n * Keyless — one ffmpeg pass over the source's audio proxy.\n */\n silenceDetect(input: SilenceDetectInput): Promise<EditJobResult> {\n return this.client.request(\"POST\", \"/v1/silence-detect\", {\n body: {\n audioUrl: input.audioUrl,\n ...(input.thresholdDb !== undefined ? { thresholdDb: input.thresholdDb } : {}),\n ...(input.minSilenceMs !== undefined ? { minSilenceMs: input.minSilenceMs } : {}),\n ...(input.padMs !== undefined ? { padMs: input.padMs } : {}),\n ...(input.workflowId !== undefined ? { workflowId: input.workflowId } : {}),\n },\n })\n }\n\n /**\n * Measure how far apart the clocks of 2–6 recordings of one conversation are\n * (`POST /v1/audio-sync`), by cross-correlating their audio — keyless, one\n * ffmpeg decode per source. The finished job's `output_data.json` is an\n * {@link AudioSyncResult}. A malformed request (fewer than 2 or more than 6\n * sources, a repeated id, a `reference` that is not one of the ids) throws a\n * typed `NodaroError` (400, `code: \"validation_error\"`) before any credits\n * are reserved.\n */\n audioSync(input: AudioSyncInput): Promise<EditJobResult> {\n return this.client.request(\"POST\", \"/v1/audio-sync\", {\n body: {\n sources: input.sources.map((s) => ({ id: s.id, url: s.url })),\n ...(input.reference !== undefined ? { reference: input.reference } : {}),\n ...(input.workflowId !== undefined ? { workflowId: input.workflowId } : {}),\n },\n })\n }\n\n /**\n * Which camera each speaker is on, from the cameras' own microphones (`POST\n * /v1/speaker-map`), keyless. `output_data.json` is a `SpeakerMapResult`: pass\n * it to {@link cameraSwitch} as `speakerMapResult`. A malformed request throws\n * a `NodaroError` (400 `validation_error`; 422 `no_speakers` for a transcript\n * with no speaker labels) before any credits are reserved.\n */\n speakerMap(input: SpeakerMapInput): Promise<EditJobResult> {\n return this.client.request(\"POST\", \"/v1/speaker-map\", {\n body: {\n sources: input.sources.map((s) => ({ id: s.id, url: s.url, ...(s.kind ? { kind: s.kind } : {}) })),\n transcript: input.transcript,\n ...(input.offsets !== undefined ? { offsets: input.offsets } : {}),\n ...(input.masterSourceId !== undefined ? { masterSourceId: input.masterSourceId } : {}),\n ...(input.wideSourceId !== undefined ? { wideSourceId: input.wideSourceId } : {}),\n ...(input.marginDb !== undefined ? { marginDb: input.marginDb } : {}),\n ...(input.workflowId !== undefined ? { workflowId: input.workflowId } : {}),\n },\n })\n }\n\n /**\n * Render an edit decision list into a video or audio cut (`POST /v1/apply-edl`).\n * The EDL is validated at ingress — an unresolvable source or a picture-less\n * segment on a video edit throws a typed `NodaroError` (400, `code:\n * \"invalid_edl\"`) before any credits are reserved.\n */\n applyEdl(input: ApplyEdlInput): Promise<EditJobResult> {\n return this.client.request(\"POST\", \"/v1/apply-edl\", {\n body: {\n edl: input.edl,\n ...(input.sources !== undefined ? { sources: input.sources } : {}),\n ...(input.transcript !== undefined ? { transcript: input.transcript } : {}),\n ...(input.output !== undefined ? { output: input.output } : {}),\n ...(input.quality !== undefined ? { quality: input.quality } : {}),\n ...(input.crossfadeMs !== undefined ? { crossfadeMs: input.crossfadeMs } : {}),\n ...(input.clipKey !== undefined ? { clipKey: input.clipKey } : {}),\n ...(input.planBasis !== undefined ? { planBasis: input.planBasis } : {}),\n ...(input.workflowId !== undefined ? { workflowId: input.workflowId } : {}),\n },\n })\n }\n\n /**\n * Tighten Episode (`POST /v1/tighten-episode`): tighten a podcast recording\n * in one call — transcribe, cut the silences and filler, render, with\n * optional captions, music and framing. Answers the run's job to poll; its\n * `output_data` holds the episode, and `output_data.speakers` each speaker's\n * label, the name `speakerNames` gave it and how long they talk across the\n * recording (`{ label, name?, talkMs }[]`, `TightenEpisodeOutputData`).\n * The run is priced as its steps at their own\n * rates plus the listed per-run fee. Quote it first with\n * {@link estimateTightenEpisode}.\n */\n tightenEpisode(input: TightenEpisodeInput, options?: UseCaseRequestOptions): Promise<TightenEpisodeJobResult> {\n return withUseCaseBody(() => tightenBody(input), (body) => this.client.request(\"POST\", \"/v1/tighten-episode\", { body, ...idempotencyHeaders(options) }))\n }\n\n /**\n * What a Tighten Episode run is estimated at (`POST /v1/tighten-episode/estimate`):\n * its steps at their own rates plus its per-run fee. Nothing is created or\n * charged. The estimate leans high: the render is priced at the recording's\n * full length, while the charge follows the minutes actually rendered.\n */\n estimateTightenEpisode(input: TightenEpisodeInput): Promise<{ data: TightenEpisodeEstimate }> {\n return withUseCaseBody(() => tightenBody(input), (body) => this.client.request(\"POST\", \"/v1/tighten-episode/estimate\", { body }))\n }\n\n /**\n * Chapters (`POST /v1/episode-chapters`): transcribe a recording and list its\n * chapters in one call. Answers the run's job to poll; the finished job's\n * `output_data.text` is the list as show notes (one `0:00 Title` line per\n * chapter; once a chapter starts at 1:00:00 or later, every line is\n * `H:MM:SS`), `output_data.json` the list itself (`{ startMs, title }[]`, the\n * same rows; the first starts at 0). A run that finds no chapters fails,\n * and its fee is refunded. Priced as its steps at their own rates plus the\n * listed per-run fee; quote it first with {@link estimateEpisodeChapters}.\n */\n episodeChapters(input: EpisodeChaptersInput, options?: UseCaseRequestOptions): Promise<UseCaseJobResult> {\n return withUseCaseBody(() => chaptersBody(input), (body) => this.client.request(\"POST\", \"/v1/episode-chapters\", { body, ...idempotencyHeaders(options) }))\n }\n\n /**\n * What a Chapters run is estimated at (`POST /v1/episode-chapters/estimate`):\n * its steps at their own rates plus its per-run fee. Nothing is created or\n * charged. A recording whose length cannot be read is estimated at the\n * 180-minute ceiling.\n */\n estimateEpisodeChapters(input: EpisodeChaptersInput): Promise<{ data: UseCaseEstimate }> {\n return withUseCaseBody(() => chaptersBody(input), (body) => this.client.request(\"POST\", \"/v1/episode-chapters/estimate\", { body }))\n }\n\n /**\n * Trailer (`POST /v1/episode-trailer`): cut a 20–40 s trailer of a recording\n * and deliver it in each chosen format (padded, never cropped), optionally\n * after an intro card, in one call. The finished job's `output_data.formats`\n * is `{ format, url }[]` in format order, the first also `output_data.videoUrl`;\n * a format that failed is named in `output_data.failedFormats` (the run keeps\n * the others). With `reviewBeforeRender` the run stops at a preview\n * (`videoUrl`, no formats yet). Priced as its steps at their own rates plus\n * the listed per-run fee; quote it first with {@link estimateEpisodeTrailer}.\n */\n episodeTrailer(input: EpisodeTrailerInput, options?: UseCaseRequestOptions): Promise<UseCaseJobResult> {\n return withUseCaseBody(() => trailerBody(input), (body) => this.client.request(\"POST\", \"/v1/episode-trailer\", { body, ...idempotencyHeaders(options) }))\n }\n\n /**\n * What a Trailer run is estimated at (`POST /v1/episode-trailer/estimate`):\n * its steps at their own rates plus its per-run fee. Nothing is created or\n * charged. The trailer is quoted at 40 seconds, the longest trailer the\n * plan cuts; a Render final is quoted on the trailer the run cut (with the\n * review's edits), plus the intro card.\n */\n estimateEpisodeTrailer(input: EpisodeTrailerInput): Promise<{ data: UseCaseEstimate }> {\n return withUseCaseBody(() => trailerBody(input), (body) => this.client.request(\"POST\", \"/v1/episode-trailer/estimate\", { body }))\n }\n\n /**\n * Clip Pack (`POST /v1/clip-pack`): cut a recording into a pack of short\n * clips in one call — the plan finds the best moments (`count`, default 8,\n * of about `targetDurationSec`, default 60), each is rendered (framed 9:16\n * with the speakers stacked by default; `framing: null` keeps the\n * recording's shape) and captioned. An audio recording makes audio clips.\n * The finished job's `output_data.clips` is `{ url, title?, hook?, clipKey,\n * thumbnailUrl?, captionsFailed?, sourceStartMs?, sourceEndMs?,\n * sourceSpans? }[]` in plan order (`ClipPackClip`: where each clip is\n * in the recording, on its clock), the first also\n * `output_data.videoUrl` (`audioUrl` for audio clips). Every clip is tried:\n * one that cannot be rendered is skipped, not charged, counted on\n * `failedClips` and named on `failedClipList` (the pack keeps the others and its fee); a clip whose\n * captions failed comes uncaptioned (`captionsFailed`, counted on\n * `failedCaptions`). When no clip renders the run fails and its fee is\n * refunded. With `reviewBeforeRender` the run stops at previews; Render\n * final ({@link continueUseCase}) renders only the clips the edit keeps.\n * Priced as its steps at their own rates plus the listed per-run fee;\n * quote it first with {@link estimateClipPack}.\n */\n clipPack(input: ClipPackInput, options?: UseCaseRequestOptions): Promise<UseCaseJobResult> {\n return withUseCaseBody(() => clipPackBody(input), (body) => this.client.request(\"POST\", \"/v1/clip-pack\", { body, ...idempotencyHeaders(options) }))\n }\n\n /**\n * What a Clip Pack run is estimated at (`POST /v1/clip-pack/estimate`): its\n * steps at their own rates plus its per-run fee. Nothing is created or\n * charged. Each clip is quoted at twice the target length (the plan may cut\n * a clip longer than asked); the charge follows each clip's real length.\n */\n estimateClipPack(input: ClipPackInput): Promise<{ data: UseCaseEstimate }> {\n return withUseCaseBody(() => clipPackBody(input), (body) => this.client.request(\"POST\", \"/v1/clip-pack/estimate\", { body }))\n }\n\n /**\n * Speaker Layout (`POST /v1/speaker-layout`): frame a whole recording by\n * speaker in one call — the same length, nothing cut. One recording: each\n * speaker framed in turn; several recordings of one conversation: lined up,\n * each speaker shown on their own camera. The finished job's\n * `output_data.videoUrl` is the framed video, `output_data.json` the edit\n * Speaker View drew, and `output_data.speakers` each speaker's label, the\n * name `speakerNames` gave it and how long they talk (`{ label, name?,\n * talkMs }[]`, `SpeakerLayoutOutputData`). With `reviewBeforeRender` the run stops at a preview;\n * {@link continueUseCase} (`mode: \"render-final\"`, no `editedEdl`) renders\n * it at full quality. Priced as its steps at their own rates plus the listed\n * per-run fee; quote it first with {@link estimateSpeakerLayout}.\n */\n speakerLayout(input: SpeakerLayoutInput, options?: UseCaseRequestOptions): Promise<UseCaseJobResult> {\n return withUseCaseBody(() => speakerLayoutBody(input), (body) => this.client.request(\"POST\", \"/v1/speaker-layout\", { body, ...idempotencyHeaders(options) }))\n }\n\n /**\n * What a Speaker Layout run is estimated at (`POST /v1/speaker-layout/estimate`):\n * its steps at their own rates plus its per-run fee. Nothing is created or\n * charged. A recording whose length cannot be read is estimated at the\n * 180-minute ceiling.\n */\n estimateSpeakerLayout(input: SpeakerLayoutInput): Promise<{ data: UseCaseEstimate }> {\n return withUseCaseBody(() => speakerLayoutBody(input), (body) => this.client.request(\"POST\", \"/v1/speaker-layout/estimate\", { body }))\n }\n\n /**\n * Podcast pack (`POST /v1/podcast-pack`): run several of the podcast tools\n * on one recording for one price, every started 15 seconds of the\n * recording with every chosen tool included. Every tool's own refusals come\n * first (a refusal's `details.tool` names the tool), before anything is\n * charged. Answers the pack's job and each tool's (`tools`: the same job\n * its own method answers), plus the tools that did not start. A tool that\n * fails is continued free with {@link continueUseCase} (`\"from-failed\"`).\n * Quote it first with {@link estimatePodcastPack}.\n */\n podcastPack(input: PodcastPackInput, options?: UseCaseRequestOptions): Promise<PodcastPackJobResult> {\n return withUseCaseBody(() => podcastPackBody(input), (body) => this.client.request(\"POST\", \"/v1/podcast-pack\", { body, ...idempotencyHeaders(options) }))\n }\n\n /**\n * What a podcast pack is charged (`POST /v1/podcast-pack/estimate`): the\n * same refusals, then the recording's length, its units and the price.\n * Nothing is created or charged.\n */\n estimatePodcastPack(input: PodcastPackInput): Promise<{ data: PodcastPackEstimate }> {\n return withUseCaseBody(() => podcastPackBody(input), (body) => this.client.request(\"POST\", \"/v1/podcast-pack/estimate\", { body }))\n }\n\n /**\n * Start, free, a tool a podcast pack paid for that did not start (`POST\n * /v1/podcast-pack/:id/start`, the pack's `notStarted`): on the recording and\n * the settings the pack kept. Once per tool — a tool that already has a run\n * in its pack is refused (a failed run is continued with `continueUseCase`,\n * free too); a pack held for review is refused (`pack_under_review`).\n */\n startPodcastPackTool(packJobId: string, tool: PodcastPackTool): Promise<PodcastPackToolStarted> {\n return this.client.request(\"POST\", `/v1/podcast-pack/${encodeURIComponent(packJobId)}/start`, { body: { tool } })\n }\n\n /**\n * Continue a use-case run as a new job (`POST /v1/<type>/continue`, the\n * run's own type: `input.nodeType`, else the type the job records, read with\n * `GET /v1/jobs/:id`; when that read cannot tell, this rejects with a\n * `NodaroError` coded `use_case_type_unknown` — pass `nodeType` then):\n * `\"from-failed\"` keeps the steps that finished and runs the rest (the fee\n * is held again; the failed run's was refunded);\n * `\"render-final\"` renders the full-quality result after a review-on preview,\n * with the preview's settings and no fee. A refusal that names another job\n * (`already_running`, `continuation_superseded`,\n * `render_final_already_rendered`) throws a `ContinuationRefusedError`\n * carrying that `jobId`.\n */\n async continueUseCase(input: UseCaseContinueInput, options?: UseCaseRequestOptions): Promise<UseCaseJobResult> {\n if (input.nodeType !== undefined && !isUseCaseNodeType(input.nodeType)) {\n throw new NodaroError(\n `continueUseCase: nodeType \"${String(input.nodeType)}\" is not a use-case node type (${USE_CASE_NODE_TYPES.join(\", \")})`,\n \"invalid_node_type\",\n 400,\n )\n }\n const type = input.nodeType ?? (await this.runTypeOf(input.jobId))\n return this.client.request(\"POST\", continuePathOf(type), {\n body: { jobId: input.jobId, mode: input.mode, ...(input.editedEdl !== undefined ? { editedEdl: input.editedEdl } : {}) },\n ...idempotencyHeaders(options),\n })\n }\n\n /**\n * The use-case type a run records (`input_data.type`, else its `job_type`).\n * When the key lacks the `jobs:read` scope (403 naming that scope) or the job\n * names no use-case type, the type cannot be read: this rejects with a\n * `NodaroError` (`use_case_type_unknown`, 400) asking for `nodeType`, and\n * nothing is posted (decided 2026-10-18: no route is guessed for the run).\n * Any other failure of the read, any other 403 included, is thrown as is.\n */\n private async runTypeOf(jobId: string): Promise<UseCaseNodeType> {\n const unknown = () =>\n new NodaroError(\"continueUseCase: the run's node type cannot be read — pass nodeType\", \"use_case_type_unknown\", 400)\n let row: { job_type?: unknown; input_data?: unknown } | undefined\n try {\n row = (await this.client.request<{ data?: { job_type?: unknown; input_data?: unknown } }>(\"GET\", `/v1/jobs/${encodeURIComponent(jobId)}`)).data\n } catch (err) {\n if (err instanceof ForbiddenError && err.missingScope === \"jobs:read\") throw unknown()\n throw err\n }\n const input = row?.input_data\n const recorded = input && typeof input === \"object\" && !Array.isArray(input) ? (input as { type?: unknown }).type : undefined\n const type = typeof recorded === \"string\" && recorded.length > 0 ? recorded : row?.job_type\n if (!isUseCaseNodeType(type)) throw unknown()\n return type\n }\n\n /**\n * Plan a transcript-driven cut (`POST /v1/edit-plan`). Reads a timed\n * transcript (plus optional silence ranges) and the media sources, and plans\n * the edit. The finished job's `output_data` holds the plan: an `Edl`\n * (`\"tighten\"` or `\"trailer\"`), an {@link EdlClipSet} (`\"clips\"`), or a\n * {@link ChapterSet} (`\"chapters\"`) — normalize it with {@link unwrapEditPlanOutput}.\n *\n * On a self-hosted install the request relays to nodaro.ai and needs the\n * install connected (a 503 `code: \"nodaro_connection_required\"` otherwise);\n * on nodaro.ai it runs directly.\n */\n editPlan(input: EditPlanInput): Promise<EditJobResult> {\n // The same pre-dispatch check the canvas and MCP run (B4): the server never\n // sees `offsets` — they are written onto the sources here.\n const planned = resolveEditPlanSources(input.sources, {\n offsets: input.offsets,\n transcriptSourceId: input.transcriptSourceId,\n })\n if (!planned.ok) {\n const message = planned.issues.map((issue) => describeAudioSyncOffsetIssue(issue)).join(\"; \")\n return Promise.reject(new NodaroError(`editPlan: ${message}`, \"edit_plan_sources\", 400))\n }\n const transcript = planned.transcriptSourceId\n ? { ...input.transcript, sourceId: planned.transcriptSourceId }\n : input.transcript\n return this.client.request(\"POST\", \"/v1/edit-plan\", {\n body: {\n mode: input.mode,\n planTier: input.planTier,\n transcript,\n sources: planned.sources,\n ...(input.silence !== undefined ? { silence: input.silence } : {}),\n ...(input.instructions !== undefined ? { instructions: input.instructions } : {}),\n ...(input.styleGuide !== undefined ? { styleGuide: input.styleGuide } : {}),\n ...(input.count !== undefined ? { count: input.count } : {}),\n ...(input.targetDurationSec !== undefined ? { targetDurationSec: input.targetDurationSec } : {}),\n ...(input.targetAspect !== undefined ? { targetAspect: input.targetAspect } : {}),\n ...(input.platform !== undefined ? { platform: input.platform } : {}),\n ...(input.workflowId !== undefined ? { workflowId: input.workflowId } : {}),\n },\n })\n }\n\n /**\n * The Edit Plan modes this server can plan (`GET /v1/edit-plan/capabilities`),\n * who answered, and whether Edit Plan is charged per started minute. Ask it\n * before offering a mode: one it does not list is refused by\n * {@link editPlan} before anything is charged. Nothing is created or charged.\n */\n editPlanCapabilities(): Promise<EditPlanCapabilities> {\n return this.client.request<EditPlanCapabilities>(\"GET\", \"/v1/edit-plan/capabilities\")\n }\n\n /**\n * Camera Switch (podcast B5): choose which camera shows each cut of `edl`\n * by who is speaking — the sound never changes. Runs on nodaro.ai (a\n * connected self-hosted install relays it); a flat price. The finished job's `output_data.json` is the switched EDL (feed it\n * to {@link applyEdl}) and `output_data.transcript` the transcript with\n * `speakerNames` applied. A transcript with no speaker labels rejects with\n * a {@link NodaroError} (`code: \"no_speakers\"`) before any request or charge.\n */\n cameraSwitch(input: CameraSwitchInput): Promise<EditJobResult> {\n if (transcriptSpeakerLabels(input.transcript).length === 0) {\n return Promise.reject(new NodaroError(\n \"cameraSwitch: the transcript has no speaker labels — transcribe with speaker detection on\",\n \"no_speakers\",\n 422,\n ))\n }\n const result = input.speakerMapResult\n if (result !== undefined && !speakerMapResultOf(result)) return Promise.reject(new NodaroError(\"cameraSwitch: speakerMapResult is not a Speaker Map result — pass that job's output_data.json\", \"not_a_speaker_map\", 400))\n const speakerMap = result !== undefined ? cameraSwitchSpeakerMap({ speakerMap: input.speakerMap }, input.edl, input.transcript, { speakerMap: result }) : input.speakerMap\n return this.client.request(\"POST\", \"/v1/camera-switch\", {\n body: {\n edl: input.edl,\n transcript: input.transcript,\n ...(speakerMap !== undefined ? { speakerMap } : {}),\n ...(input.speakerNames !== undefined ? { speakerNames: input.speakerNames } : {}),\n ...(input.minShotMs !== undefined ? { minShotMs: input.minShotMs } : {}),\n ...(input.leadMs !== undefined ? { leadMs: input.leadMs } : {}),\n ...(input.lagMs !== undefined ? { lagMs: input.lagMs } : {}),\n ...(input.maxShotMs !== undefined ? { maxShotMs: input.maxShotMs } : {}),\n ...(input.wideEvery !== undefined ? { wideEvery: input.wideEvery } : {}),\n ...(input.layoutHints !== undefined ? { layoutHints: input.layoutHints } : {}),\n ...(input.workflowId !== undefined ? { workflowId: input.workflowId } : {}),\n },\n })\n }\n\n /**\n * Remap a transcript through an EDL — a PURE client-side transform (NO\n * request). Returns a new transcript whose word (and segment) timings are on\n * the EDL's rendered output clock, dropping words that fall in cut regions and\n * clipping straddlers. Runs `@nodaro/shared`'s canonical\n * `remapTranscriptThroughEdl`, the same remap `applyEdl` performs server-side.\n */\n remapTranscript(edl: Edl, transcript: Transcript): Transcript {\n return remapTranscriptThroughEdl(edl, transcript)\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resources/cast-swap.ts"],"names":[],"mappings":";;;AA0mBO,IAAM,sBAAN,MAA0B;AAAA,EAC/B,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASpB,GAAA,CAAI,QAA2B,OAAA,EAAgF;AAC7G,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAQ,MAAA,EAAQ,kBAAA,EAAoB;AAAA,MACrD,IAAA,EAAM,MAAA;AAAA,MACN,GAAI,OAAA,EAAS,cAAA,GAAiB,EAAE,OAAA,EAAS,EAAE,iBAAA,EAAmB,OAAA,CAAQ,cAAA,EAAe,EAAE,GAAI;AAAC,KAC7F,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,WAAA,GAA+C;AAC7C,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAQ,KAAA,EAAO,+BAA+B,CAAA;AAAA,EACnE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,QAAA,GAAyC;AACvC,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAQ,KAAA,EAAO,2BAA2B,CAAA;AAAA,EAC/D;AAAA;AAAA,EAGA,MAAM,SAAS,MAAA,EAAyD;AACtE,IAAA,MAAM,KAAA,GAAQ,MAAM,IAAA,CAAK,MAAA,CAAO,OAAA,CAA6B,QAAQ,2BAAA,EAA6B,EAAE,IAAA,EAAM,MAAA,EAAQ,CAAA;AAElH,IAAA,MAAM,MAAA,GAAS,sBAAA,CAAuB,KAAA,EAAO,MAAM,CAAA;AACnD,IAAA,OAAO,MAAA,IAAU,WAAW,KAAA,CAAM,MAAA,GAAS,EAAE,GAAG,KAAA,EAAO,QAAO,GAAI,KAAA;AAAA,EACpE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,oBAAoB,KAAA,EAAwD;AAC1E,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAQ,MAAA,EAAQ,CAAA,iBAAA,EAAoB,kBAAA,CAAmB,KAAK,CAAC,CAAA,sBAAA,CAAA,EAA0B,EAAE,IAAA,EAAM,IAAI,CAAA;AAAA,EACxH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,WAAA,CAAY,KAAA,EAAe,MAAA,GAAuC,EAAC,EAA0C;AAC3G,IAAA,MAAM,IAAA,GAAO,OAAO,SAAA,KAAc,MAAA,GAAY,EAAE,SAAA,EAAW,MAAA,CAAO,SAAA,EAAU,GAAI,EAAC;AACjF,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAQ,MAAA,EAAQ,CAAA,iBAAA,EAAoB,kBAAA,CAAmB,KAAK,CAAC,CAAA,aAAA,CAAA,EAAiB,EAAE,IAAA,EAAM,CAAA;AAAA,EAC3G;AACF;AASO,IAAM,gBAAA,GAAmB","file":"chunk-WSOLDULF.js","sourcesContent":["import { nodaroMotionEngineFrom } from \"@nodaro/shared/models\"\nimport type { NodaroClientCore } from \"../core.js\"\n\n/**\n * Video Remake (the `videoRemake` resource; routes `/v1/video-remake`) — replace\n * the people, pets, products and/or the location in a short video with your\n * own references, keeping its motion, framing, timing and sound (the clip's\n * audio is kept, and the result is the clip's length).\n *\n * Before the video, each person, pet and product role's photos are turned\n * into one clean reference picture by an image model. This costs extra\n * credits (`breakdown.references` in the estimate), charged when it runs, even\n * if the video then fails; it adds about a minute, falls back to your own\n * photos if it fails, and is turned off with `prepareReferences: false`.\n * Locations are not prepared.\n *\n * Engines: a run is made on Nodaro Prism (`engine` left out, or\n * `\"nodaro-prism\"`) or Nodaro Pulse (`\"nodaro-pulse\"`). Prism renders\n * 480p (the default; plain unless `draft: true`), 720p or 1080p. Pulse renders\n * 720p (its default) or 1080p and makes a new take guided by the clip and\n * pictures; it has no draft, so no Full Quality: run it again at 1080p instead.\n *\n * How the clip is prepared for the video model (for one, whether faces are\n * hidden first, and whether a refused clip is retried) is set by Nodaro for\n * each engine; a run cannot change it. `faceMasking` is no longer read\n * (deprecated: accepted and ignored).\n *\n * Cloud edition only: `/v1/video-remake` is served by the cloud plugin and 404s\n * on self-hosted installs. `run()` answers 202 with a job id; follow it with\n * `client.jobs.get(jobId)` / `client.jobs.getStatus(jobId)` like any other job.\n *\n * Repeats: pass `{ idempotencyKey }` to `run()` and it is sent as the\n * `Idempotency-Key` header. A repeat with the same key within the credit\n * guard's dedup window (about 10 s) answers 200 `{ jobId, deduped: true }` with\n * an `X-Dedup-Hit` header; a later one answers 202 with the first run's\n * `jobId`. Nothing new is started or charged.\n *\n * Refusals (thrown as a `NodaroError` subclass; body `{ error: { code, message } }`), before\n * anything is charged: 400 `validation_error` (the body: no role with images,\n * no reference, no `prePrompt` or `postPrompt` and no art style (Flex on\n * Nodaro Prism), more roles of a kind\n * than allowed, more than 30 images in all, `draft: true` above 480p, a\n * `prePrompt` or `postPrompt` over 4,000 characters); on Nodaro Pulse,\n * `draft_unsupported` (`draft: true`), `resolution_unsupported` (480p),\n * `output_format_unsupported` (a MOV edit output) and `too_many_images` (more\n * than 10 images in the run, across every role and fixed reference);\n * `raw_reference_token` (also in a reference's `line`),\n * `invalid_role_mention` (also any `{role:N}` in a reference's `line`),\n * `unsafe_url`, `video_unreadable`, `clip_out_of_range` (4–30 s),\n * `preview_out_of_range`, `unnamed_role_needs_picture` (a role with no name\n * and no image), `no_roles_in_preview` (a preview that would change nothing,\n * judged on what it sends: no role kept in it with images, no fixed\n * reference, no `prePrompt` or `postPrompt` and no art style), `prompt_too_long`\n * (the prompt would build too long: a `{role:N}` reads as the role's name when\n * it sends no images; Nodaro Pulse's cap is 8,000 characters); 401; 402 `insufficient_credits` (`run()` only); 404\n * (a `sessionId` you may not use, `run()` only); 422 `job_blocked` (`run()`\n * only); 503 `host_too_old` (both); 503 `estimate_unavailable` (`estimate()`\n * only).\n */\n\n/**\n * The engine a Video Remake run is made on, by its public id. Left out =\n * `\"nodaro-prism\"`.\n *\n * - `\"nodaro-prism\"` (Nodaro Prism): 480p (the default; plain unless\n * `draft: true`), 720p or 1080p; Full Quality finishes a draft's own take at\n * 1080p.\n * - `\"nodaro-pulse\"` (Nodaro Pulse): 720p (the default) or 1080p, never a\n * draft (`draft: true` answers 400 `draft_unsupported`), so no Full Quality:\n * run it again at 1080p instead. A preview is still 4 s from `previewStart`.\n */\nexport type VideoRemakeEngine = \"nodaro-prism\" | \"nodaro-pulse\"\n\n/**\n * The engine ids an older client sent: the earlier public ids\n * (`\"motion-prism\"` and `\"motion-pro\"` = `\"nodaro-prism\"`, `\"motion-pulse\"`\n * and `\"motion-lite\"` = `\"nodaro-pulse\"`) and the internal ones\n * (`\"seedance-2-5\"`, `\"kling-4\"`). Still accepted in a request; never\n * returned.\n * @deprecated use {@link VideoRemakeEngine}.\n */\nexport type VideoRemakeEngineLegacyId = \"motion-prism\" | \"motion-pulse\" | \"motion-pro\" | \"motion-lite\" | \"seedance-2-5\" | \"kling-4\"\n\n/**\n * How a run follows its clip. Left out = `\"precise\"`.\n *\n * - `\"precise\"`: follows the clip exactly.\n * - `\"motion\"`: follows the clip's movement and takes the looks from your\n * photos, more freely than `\"precise\"`. Its price may differ from\n * `\"precise\"`'s: the estimate shows the exact price.\n */\nexport type VideoRemakeStyle = \"precise\" | \"motion\"\n\n/**\n * Where a Nodaro Pulse run cuts the clip to whole seconds (Pulse renders\n * whole seconds; asked for more than the clip, it would stretch the motion):\n * - `\"cut-end\"` (the default): drop the fraction of a second at its end;\n * - `\"cut-start\"`: drop it at its start.\n */\nexport type VideoRemakeMotionLength = \"cut-end\" | \"cut-start\"\n\n\n/** Whether a swapped subject takes this trait from the references (`\"new\"`) or keeps the video's (`\"original\"`). */\nexport type VideoRemakeTraitSource = \"new\" | \"original\"\n\n/**\n * Preview-only settings, on every role kind; a full run (`preview` not `true`)\n * ignores both.\n */\nexport interface VideoRemakeRolePreviewSettings {\n /** The name used instead of `name` in a preview. Same rules as `name` (1–200 characters). */\n previewName?: string\n /**\n * `false` leaves this role out of the preview: its reference images are not\n * sent, not prepared and not charged, and a `{role:N}` naming it reads as its\n * `previewName`, else its `name`. Default `true`. A preview that would\n * change nothing (no role kept in it with images, no fixed reference, no pre\n * or post prompt and no art style) answers 400 `no_roles_in_preview`.\n */\n inPreview?: boolean\n}\n\n/** A person in the video to recast. */\nexport interface VideoRemakePersonRole extends VideoRemakeRolePreviewSettings {\n kind: \"person\"\n /** How the person is told apart in the video, e.g. `\"the woman that attacks\"`.\n *\n * Direct runs only: omit it (or leave it empty) and the role is named by its\n * first picture — matched to the subject in the video it fits best; such a\n * role needs at least one image (else 400 `unnamed_role_needs_picture`). A\n * trend run's roles are always named (400 `role_name_required`).\n */\n name?: string\n /** 0–3 images of ONE person. Empty or `null` keeps the original person. */\n images: string[] | null\n /** Body from the references or the video. Default `\"new\"`. */\n body?: VideoRemakeTraitSource\n /** Outfit from the references or the video. Default `\"new\"`. */\n outfit?: VideoRemakeTraitSource\n /** Hairstyle and haircut from the references or the video. Default `\"new\"`. */\n hair?: VideoRemakeTraitSource\n}\n\n/** The place the video happens in. */\nexport interface VideoRemakeLocationRole extends VideoRemakeRolePreviewSettings {\n kind: \"location\"\n /** How the place is named. Default `\"the setting\"`. */\n name?: string\n /** 0–3 images of ONE place. Empty or `null` keeps the original place. */\n images: string[] | null\n}\n\n/** An animal in the video to recast. */\nexport interface VideoRemakePetRole extends VideoRemakeRolePreviewSettings {\n kind: \"pet\"\n /** How the animal is told apart in the video, e.g. `\"the dog\"`.\n *\n * Direct runs only: omit it (or leave it empty) and the role is named by its\n * first picture — matched to the subject in the video it fits best; such a\n * role needs at least one image (else 400 `unnamed_role_needs_picture`). A\n * trend run's roles are always named (400 `role_name_required`).\n */\n name?: string\n /** 0–3 images of ONE animal. Empty or `null` keeps the original animal. */\n images: string[] | null\n /** Body (shape, size and build) from the references or the video. Default `\"new\"`. */\n body?: VideoRemakeTraitSource\n /** Coat (fur, colors and markings) from the references or the video. Default `\"new\"`. */\n coat?: VideoRemakeTraitSource\n}\n\n/** An object in the video to recast. */\nexport interface VideoRemakeProductRole extends VideoRemakeRolePreviewSettings {\n kind: \"product\"\n /** How the object is told apart in the video, e.g. `\"the can\"`.\n *\n * Direct runs only: omit it (or leave it empty) and the role is named by its\n * first picture — matched to the subject in the video it fits best; such a\n * role needs at least one image (else 400 `unnamed_role_needs_picture`). A\n * trend run's roles are always named (400 `role_name_required`).\n */\n name?: string\n /** 0–3 images of ONE product. Empty or `null` keeps the original object. */\n images: string[] | null\n /** Shape and proportions from the references or the video. Default `\"new\"`. */\n shape?: VideoRemakeTraitSource\n /** Finish (colors, materials, label and markings) from the references or the video. Default `\"new\"`. */\n finish?: VideoRemakeTraitSource\n}\n\nexport type VideoRemakeRole = VideoRemakePersonRole | VideoRemakeLocationRole | VideoRemakePetRole | VideoRemakeProductRole\n\n/**\n * A fixed reference: 1–3 images of ONE thing that no role replaces, and the\n * line that says what it is (`\"the glass she drinks from\"`). Sent as given,\n * never prepared; its images count toward the 30.\n */\nexport interface VideoRemakeReference {\n /** 1–3 http(s) image URLs of one thing. */\n images: string[]\n /**\n * What it is, 1–500 characters. `{image}` in the line stands for this\n * reference's first image (`\"Use {image} for the sky\"`); a line without it\n * gets it appended. A `{role:N}` or a raw `{image:` / `{video:` / `{audio:`\n * token answers 400.\n */\n line: string\n}\n\n/**\n * @deprecated Nodaro sets this per engine; a run's `faceMasking` is ignored.\n */\nexport interface VideoRemakeFaceMaskingZone {\n leftPct?: number\n rightPct?: number\n topPct?: number\n bottomPct?: number\n}\n\n/**\n * @deprecated Nodaro sets how the clip is prepared for the video model, per\n * engine; a run cannot change it. A `faceMasking` sent is accepted and\n * ignored (no error), so older code keeps working unchanged.\n */\nexport interface VideoRemakeFaceMasking {\n mode: \"off\" | \"always\" | \"auto\"\n fill?: \"blur\" | \"depth\"\n minFaceHeightPct?: number\n maxFaceHeightPct?: number\n zone?: VideoRemakeFaceMaskingZone | null\n blurStrengthPct?: number\n threshold?: number\n}\n\n/** The body of `POST /v1/video-remake` and `POST /v1/video-remake/estimate`. */\nexport interface VideoRemakeParams {\n /** The source clip, 4–30 seconds. */\n videoUrl: string\n /**\n * Who and what to swap: at most 6 person roles, 1 location role, 3 pet roles\n * and 3 product roles, with at most 30 images in all. A role with no images\n * is skipped (that subject or place stays as in the video). At least one role\n * with images, a fixed reference, a `prePrompt` or `postPrompt`, or an art\n * style (`direction`, Flex on Nodaro Prism) is required. With an art\n * style and nothing to swap, a run restyles the whole clip (see `direction`).\n */\n roles: VideoRemakeRole[]\n /**\n * Fixed references (at most 5): things the video should show that no role\n * replaces, each with the line that names it. Their images count toward the\n * 30. A reference alone is enough for a run (no role needs images).\n */\n references?: VideoRemakeReference[]\n /**\n * Your own words placed at the start of the prompt, before the role\n * instructions; at most 4,000 characters. Mention a role as `{role:N}`, as in\n * `postPrompt`; the same 400 refusals apply (an N outside 1..`roles.length`,\n * a raw `{image:` / `{video:` / `{audio:` token).\n */\n prePrompt?: string\n /**\n * Extra instructions in your own words, at most 4,000 characters. Mention a\n * role as `{role:N}`, where N is its 1-based position in `roles`\n * (`{role:1}` is `roles[0]`; empty roles count).\n *\n * The route answers 400, before charging, for an N outside 1..`roles.length`,\n * for a raw `{image:` / `{video:` / `{audio:` token in the pre or post prompt\n * or a role's `name`, for a clip outside 4–30 s, and for a preview past the clip's\n * end (`previewStart + 4` > its length).\n */\n postPrompt?: string\n /** `true` runs on 4 seconds of the clip, starting at `previewStart`: a cheap check of the roles and choices. */\n preview?: boolean\n /** Where the preview starts, in seconds. Default 0. */\n previewStart?: number\n /**\n * The engine (see {@link VideoRemakeEngine}). Default `\"nodaro-prism\"`. The job\n * records it in `input_data.engine`, and a completed job's output in its\n * `engine`. The ids an older client sent ({@link VideoRemakeEngineLegacyId})\n * are still accepted.\n */\n engine?: VideoRemakeEngine | VideoRemakeEngineLegacyId\n /**\n * How the run follows the clip (see {@link VideoRemakeStyle}). Default\n * `\"precise\"`; the job records it in `input_data.style`.\n */\n style?: VideoRemakeStyle\n /**\n * A direct run on Nodaro Prism: an art style that restyles the whole\n * video, as a `direction.style` id of the platform's `style` picker catalog\n * (the same ids an image's `direction.style` takes); the platform words it.\n * A Flex run (`style: \"motion\"`) takes one, and so does a Precise run where\n * {@link VideoRemakeResource.styleChoice} answers `preciseArtStyle` true for the\n * engine. Nodaro may make such a Precise request the way a Flex run is made\n * (its engine does by default, unless Nodaro turns that off): its estimate,\n * price and Full Quality are then a Flex run's, while the job still records\n * the style sent (`input_data.style` absent, or `\"precise\"`; jobs made so\n * before the style was kept record `\"motion\"`). Otherwise it is Precise's edit\n * of the clip, drawn in the art style. Refused with\n * 400 `unknown_art_style` (not in the catalog), `art_style_not_supported` (a\n * saved moodboard, `moodboard:…`) or `art_style_needs_flex` (a trend run, a\n * Flex run whose prompt is made Precise by Nodaro's setting for how Flex\n * runs are prepared, or a Precise request on an engine from before Precise\n * runs took one), and on Nodaro Pulse with `art_style_needs_prism`.\n * The estimate (sent with the same `direction`) shows the price: it changes\n * only where Nodaro's setting for such runs first redraws the role pictures\n * in the art style.\n *\n * Style only: with no role with images and no fixed reference, the art style\n * alone is the run's change (a pre or post prompt is still added). It\n * restyles the whole clip, keeping the people, places, motion and sound, and\n * is charged for what it runs (the estimate shows it; no clip-preparation\n * `privacy` part). By default a black-and-white art style comes out\n * monochrome. Nodaro may run it the way other art-style runs run instead,\n * priced as those are and not made monochrome.\n * A preview takes its full run's path. Runs this way only on a Flex run, and\n * only where {@link VideoRemakeResource.styleChoice} answers `styleOnly` true\n * for the engine; elsewhere on Nodaro Prism an art style alone is\n * refused (on a Precise run that stays Precise too, unless\n * {@link VideoRemakeResource.styleChoice} answers `preciseArtStyleAlone` true for\n * the engine, where it is that run's change), and one with a pre or post prompt\n * runs as any other art-style run. The job records it in\n * `input_data.direction`.\n */\n direction?: { style: string }\n /**\n * Nodaro Pulse only (Prism ignores it): which end of the clip is cut to\n * whole seconds (see {@link VideoRemakeMotionLength}). Default `\"cut-end\"`.\n */\n motionLength?: VideoRemakeMotionLength\n /** @deprecated use {@link motionLength} (still accepted). */\n klingLength?: VideoRemakeMotionLength\n /**\n * The output resolution. Nodaro Prism: `\"480p\"` (default), `\"720p\"` or\n * `\"1080p\"`. Nodaro Pulse: `\"720p\"` (default) or `\"1080p\"`; `\"480p\"`\n * answers 400.\n */\n resolution?: \"480p\" | \"720p\" | \"1080p\"\n /**\n * `true` makes a draft: a 480p run whose same take Full Quality can finish\n * at 1080p (Nodaro Prism only). Default `false`: a plain run, at 480p\n * too, which Full Quality cannot finish. `true` with `\"720p\"` or `\"1080p\"`\n * answers 400 (draft is 480p only). Nodaro Pulse has no draft: `true`\n * answers 400 `draft_unsupported`.\n */\n draft?: boolean\n /**\n * Turn each person, pet and product role's photos into one clean reference\n * picture before the video (extra credits, shown in `breakdown.references`;\n * about a minute longer; falls back to your own photos if it fails).\n * Default `true`.\n */\n prepareReferences?: boolean\n /**\n * Ignored: Nodaro sets how the clip is prepared, per engine. Accepted (no\n * error) so older code keeps working.\n * @deprecated leave it out.\n */\n faceMasking?: VideoRemakeFaceMasking\n /**\n * `\"draft\"` means 480p draft.\n * @deprecated use `resolution` + `draft`.\n */\n quality?: \"draft\"\n /** A generation session to file the result in. */\n sessionId?: string\n /** The client app that sent the run (stored on the job as `input_data.origin`). */\n origin?: string\n}\n\n/** What a run would cost, in credits. */\nexport interface VideoRemakeEstimate {\n /**\n * The engine the run would use, by its public id (absent from an older\n * server = `\"nodaro-prism\"`). An id an older server answers is read as the\n * public id it names.\n */\n engine?: VideoRemakeEngine\n /**\n * What is held when the run starts. The run is charged what it actually\n * costs, which is expected to be `expectedCredits`.\n */\n totalCredits: number\n /**\n * The charge the run is expected to come to. Never above `totalCredits`\n * (on Nodaro Pulse it equals it: Pulse renders exactly the length\n * asked for, so the hold is what it settles at). Absent from an older\n * server: read `totalCredits` then.\n */\n expectedCredits?: number\n /**\n * The parts of the quote, by name, for display only:\n * - `base`: the run itself (its base fee). An older server\n * names it `castSwap` instead: read `base`, else `castSwap`;\n * - `references`: preparing the reference pictures (0 when\n * `prepareReferences` is off or there is nothing to prepare);\n * - `motion`: what the video holds (on Nodaro Pulse, what it costs);\n * - `motionExpected`: what the video is expected to be charged, never above\n * `motion` (Nodaro Prism);\n * - `privacy`: preparing the clip, when the engine's setting does. In both\n * totals when it always runs; outside both when it is the retry\n * (`privacyCredits`).\n * - `prompt`: the prompt written for the run by a language model, when\n * Nodaro's setting for the engine does so (absent otherwise).\n * - `referenceAudio`: preparing the clip's sound for the video model, when\n * Nodaro's setting for the engine runs that step (absent otherwise).\n *\n * `motion` and `motionExpected` are alternatives, so the parts sum to more\n * than either total: read `totalCredits` and `expectedCredits`, never the\n * sum. Other parts may appear.\n */\n breakdown: {\n base?: number\n /** @deprecated read {@link base} (an older server answered this name for the same part). */\n castSwap?: number\n references: number\n motion?: number\n motionExpected?: number\n privacy?: number\n prompt?: number\n referenceAudio?: number\n } & Record<string, number>\n /**\n * The extra credits charged only if the video model refuses the clip and\n * the run is retried (Nodaro's setting for the engine decides whether it\n * does). Not in `totalCredits` or `expectedCredits`; `run()` needs credits\n * for both the hold and this (else 402).\n */\n privacyCredits?: number\n /** @deprecated read {@link privacyCredits} (an older server answered this name). */\n maskingCredits?: number\n /**\n * `true` when the video is made at Auto length (every Nodaro Prism\n * run): the final charge is expected to come out lower than `totalCredits`,\n * at about `expectedCredits`. `false` on Nodaro Pulse.\n */\n settlesLower: boolean\n}\n\n/** Per-call options for {@link VideoRemakeResource.run}. */\nexport interface VideoRemakeRunOptions {\n /**\n * Sent as the `Idempotency-Key` header, unchanged (the SDK checks nothing;\n * an empty string sends no header, like no key).\n * The server takes 8–200 characters and answers 400 for any other length.\n * Reuse the same value when retrying the same run: within about 10 s the\n * repeat answers 200 `{ jobId, deduped: true }`, later 202 with the first\n * run's `jobId`. Nothing new is started or charged.\n */\n idempotencyKey?: string\n}\n\n/**\n * What a Full Quality version would be: `\"same-take\"` finishes a Nodaro\n * Prism draft's own take at 1080p, and the draft stays. `\"new-take\"` was a new\n * Nodaro Pulse take at 1080p from a 720p run's inputs; Pulse no longer\n * has Full Quality, so a quote no longer answers it (kept so code that reads\n * it still compiles).\n */\nexport type VideoRemakeFullQualityKind = \"same-take\" | \"new-take\"\n\n/**\n * What a Full Quality version of a run would cost\n * (`POST /v1/video-remake/:jobId/full-quality/estimate`): a Nodaro Prism\n * draft (a 480p run made with `draft: true`).\n */\nexport interface VideoRemakeFullQualityEstimate {\n /**\n * Which Full Quality this is ({@link VideoRemakeFullQualityKind}), so it can\n * be worded right. Absent from an older server: `\"same-take\"`.\n */\n kind?: VideoRemakeFullQualityKind\n /** The quote in credits: `breakdown.base` plus the 1080p render (same take) or the new take. */\n totalCredits: number\n /**\n * The parts of the quote, by name, for display only: `base` (the Full\n * Quality job's own steps; an older server names it\n * `castSwap` instead: read `base`, else `castSwap`), and `motionHd` (a same\n * take: the 1080p render, 0 when an earlier try of this draft already\n * finished that render, which is then reused) or `motion` (a new take).\n */\n breakdown: {\n base?: number\n /** @deprecated read {@link base} (an older server answered this name for the same part). */\n castSwap?: number\n motionHd?: number\n motion?: number\n } & Record<string, number>\n /** ISO time until which the run can be finished at Full Quality (7 days after it completed). */\n availableUntil: string\n}\n\n/** Options for {@link VideoRemakeResource.fullQuality}. */\nexport interface VideoRemakeFullQualityParams {\n /** A generation session to file the Full Quality result in. */\n sessionId?: string\n}\n\n/** The Full Quality job (`POST /v1/video-remake/:jobId/full-quality`). */\nexport interface VideoRemakeFullQualityResult {\n jobId: string\n /** `true` when this run's Full Quality was already running or done: that job is answered, nothing new is started or charged. */\n existing?: boolean\n}\n\n/**\n * The `code` of a Full Quality refusal (`NodaroError.code`), all before\n * anything is charged:\n * - `unauthorized` (401): no authenticated user;\n * - `not_found` (404): not your job, or not a Video Remake run; also a\n * `sessionId` you may not use;\n * - `not_completed` (409): the run has not finished;\n * - `not_a_draft` (409): the run is not a Nodaro Prism draft: a plain\n * run (480p made without `draft: true` included; make a draft with\n * `draft: true`), or any Nodaro Pulse run (Pulse makes no drafts: run\n * it again at 1080p);\n * - `draft_expired` (410): more than 7 days after the draft completed, or\n * the draft can no longer be finished at Full Quality;\n * - `full_quality_pending` (409, `details.retryable: true`): not final — an\n * earlier try's 1080p render of this draft is being reviewed, or has not\n * started yet; try again later (once the review ends). The only refusal\n * that ends on its own;\n * - `full_quality_unavailable` (409): final — nothing kept to re-render, no\n * readable completion time, or the 1080p finalize refuses this draft; on\n * the start only, also \"failed too many times\" (every try failed) or no\n * try can be started for this run;\n * - `insufficient_credits` (402), or in a workspace `budget_exceeded`,\n * `member_cap_exceeded` or `user_allowance_exceeded`;\n * - `job_blocked` (422): the request was blocked by the job policy;\n * - `job_read_failed` (503, retryable), `estimate_unavailable` (503, try\n * again shortly), `host_too_old` (503).\n *\n * Open-ended: a code not listed here may still arrive.\n */\nexport type VideoRemakeFullQualityRefusalCode =\n | \"unauthorized\"\n | \"not_found\"\n | \"not_completed\"\n | \"not_a_draft\"\n | \"draft_expired\"\n | \"full_quality_pending\"\n | \"full_quality_unavailable\"\n | \"insufficient_credits\"\n | \"budget_exceeded\"\n | \"member_cap_exceeded\"\n | \"user_allowance_exceeded\"\n | \"job_blocked\"\n | \"job_read_failed\"\n | \"estimate_unavailable\"\n | \"host_too_old\"\n | (string & {})\n\n/**\n * Who decides a direct run's style on one engine:\n * - `\"user\"`: the person (the request's `style`, left out = `\"precise\"`);\n * show a Style control;\n * - `\"precise\"`: Nodaro's own apps run Precise on that engine and show no\n * Style control; it changes no request: a direct run and quote take the\n * request's `style`, as on `\"user\"`;\n * - `\"flex\"`: an admin forced it — every direct run and quote of that engine\n * runs Flex (`style: \"motion\"`) whatever the request's `style` says; show\n * no Style control.\n *\n * A trend run keeps its own trend's style.\n */\nexport type VideoRemakeStyleChoiceOption = \"user\" | \"precise\" | \"flex\"\n\n/** What {@link VideoRemakeResource.styleChoice} answers: every engine's choice, by its public id. */\nexport interface VideoRemakeStyleChoice {\n engines: Record<VideoRemakeEngine, VideoRemakeStyleChoiceOption>\n /**\n * Per engine, whether the engine takes style-only runs: a Flex run\n * (`style: \"motion\"`) with an art style (`direction`) and nothing to swap\n * (no role with images, no fixed reference). It follows the engine alone, so\n * read it with {@link engines}: an engine answered `\"flex\"` makes a Precise\n * request Flex too, and one answered `\"precise\"` changes no request, so a\n * Flex request there runs as on `\"user\"`. Nodaro Pulse is always\n * `false` (it takes no art style). Absent from an older server, and\n * an engine missing from it: `false`.\n */\n styleOnly?: Partial<Record<VideoRemakeEngine, boolean>>\n /**\n * Per engine, whether a Precise run (no `style`, or `\"precise\"`) takes an\n * art style (`direction`), as a Flex run does. Nodaro may run such a request as\n * a Flex run (see {@link VideoRemakeParams}'s `direction`), which this does not\n * say; otherwise it is Precise's edit of the clip, drawn in the art style, and,\n * where {@link VideoRemakeStyleChoice.preciseArtStyleAlone} is not true for the\n * engine, not on its own: a Precise run with nothing else to change is then refused.\n * Nodaro Pulse is always `false` (it takes no art style). Absent from\n * an older server, and an engine missing from it: `false` (offer an art style\n * on Flex runs alone).\n */\n preciseArtStyle?: Partial<Record<VideoRemakeEngine, boolean>>\n /**\n * Per engine, whether an art style (`direction`) alone is a Precise run's\n * change there, so the run needs no role, reference or prompt. Nodaro may run\n * such a request as a Flex run (see {@link VideoRemakeParams}'s `direction`), which\n * this does not say. It answers\n * `false` until the engine takes such runs. Nodaro Pulse is always\n * `false` (it takes no art style). Absent from an older server, and an engine\n * missing from it: `false`.\n */\n preciseArtStyleAlone?: Partial<Record<VideoRemakeEngine, boolean>>\n}\n\n/**\n * What {@link VideoRemakeResource.advanced} answers: whether the Video Remake\n * page shows its Advanced options.\n */\nexport interface VideoRemakeAdvanced {\n /**\n * Whether the Video Remake page shows `prepareReferences` and `prePrompt`\n * under its Advanced options: `false` until Nodaro turns them on, one\n * setting for the whole page, the same for every engine.\n */\n show: boolean\n}\n\nexport class VideoRemakeResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * Start a Video Remake run (`POST /v1/video-remake`, 202 `{ jobId }`). Returns the\n * job to follow. With `options.idempotencyKey` (sent as the\n * `Idempotency-Key` header; 8–200 characters, else 400) a repeat with the\n * same key within about 10 s answers 200 `{ jobId, deduped: true }`, a later\n * one 202 with the first run's `jobId`; nothing new starts.\n */\n run(params: VideoRemakeParams, options?: VideoRemakeRunOptions): Promise<{ jobId: string; deduped?: boolean }> {\n return this.client.request(\"POST\", \"/v1/video-remake\", {\n body: params,\n ...(options?.idempotencyKey ? { headers: { \"Idempotency-Key\": options.idempotencyKey } } : {}),\n })\n }\n\n /**\n * Whether people choose a direct run's style, per engine\n * (`GET /v1/video-remake/style-choice`): `\"user\"` = show a Style control;\n * `\"precise\"` = Nodaro's own apps run Precise on that engine and hide the\n * control, while a run's `style` is still taken as sent; `\"flex\"` = an admin\n * forced Flex for the engine, so a run's `style` is overridden and the\n * control is best hidden. Its\n * `styleOnly` says, per engine, whether a Flex run with an art style and\n * nothing to swap restyles the whole clip there. Where it is not `true`\n * (absent, or an engine missing from it, included) on Nodaro Prism, an\n * art style alone is refused, and one with a pre or post prompt runs as any\n * other art-style run. Its `preciseArtStyle` says, per engine, whether a\n * Precise run takes an art style there too, and its `preciseArtStyleAlone`\n * whether that art style alone is the run's change.\n * Public (no sign-in needed); the answer may be up to a minute old.\n */\n styleChoice(): Promise<VideoRemakeStyleChoice> {\n return this.client.request(\"GET\", \"/v1/video-remake/style-choice\")\n }\n\n /**\n * Whether the Video Remake page shows its Advanced options\n * (`GET /v1/video-remake/advanced`): `show` is `true` where the page offers\n * `prepareReferences` and `prePrompt`, and `false` until Nodaro turns them\n * on. One answer for the whole page, whatever the engine, so an app built\n * on the SDK can show or hide the same options. It describes the page only:\n * {@link run} and {@link estimate} take both fields as sent, whatever it\n * answers.\n * Public (no sign-in needed); the answer may be up to a minute old.\n */\n advanced(): Promise<VideoRemakeAdvanced> {\n return this.client.request(\"GET\", \"/v1/video-remake/advanced\")\n }\n\n /** Quote a run before starting it (`POST /v1/video-remake/estimate`); spends nothing. */\n async estimate(params: VideoRemakeParams): Promise<VideoRemakeEstimate> {\n const quote = await this.client.request<VideoRemakeEstimate>(\"POST\", \"/v1/video-remake/estimate\", { body: params })\n // An older server names the engine by an earlier id: answered as the public id it names.\n const engine = nodaroMotionEngineFrom(quote?.engine)\n return engine && engine !== quote.engine ? { ...quote, engine } : quote\n }\n\n /**\n * Quote finishing a run at Full Quality (`POST\n * /v1/video-remake/:jobId/full-quality/estimate`); spends nothing. `jobId` is a\n * finished Nodaro Prism DRAFT run (a Video Remake or trend run made\n * with `draft: true`), whose same take Full Quality finishes at 1080p. The\n * quote does not look for a Full Quality already running: when one is,\n * {@link fullQuality} answers it (`existing: true`) and charges nothing.\n * Refusals: {@link VideoRemakeFullQualityRefusalCode}.\n */\n fullQualityEstimate(jobId: string): Promise<VideoRemakeFullQualityEstimate> {\n return this.client.request(\"POST\", `/v1/video-remake/${encodeURIComponent(jobId)}/full-quality/estimate`, { body: {} })\n }\n\n /**\n * Finish a run at Full Quality (`POST /v1/video-remake/:jobId/full-quality`):\n * at 1080p, with the clip's audio, as a new job linked to the run — a\n * Nodaro Prism draft's own take re-rendered. SPENDS CREDITS: quote it first with\n * {@link fullQualityEstimate}. Answers 202 `{ jobId }`, or 200\n * `{ jobId, existing: true }` when this run's Full Quality is already\n * running or done (one per run; a failed one may be asked again). Follow\n * the job with `client.jobs.get(jobId)`. No `Idempotency-Key` is taken: the\n * server keys the job by the draft. The new job keeps the draft's origin.\n * Refusals: {@link VideoRemakeFullQualityRefusalCode}.\n */\n fullQuality(jobId: string, params: VideoRemakeFullQualityParams = {}): Promise<VideoRemakeFullQualityResult> {\n const body = params.sessionId !== undefined ? { sessionId: params.sessionId } : {}\n return this.client.request(\"POST\", `/v1/video-remake/${encodeURIComponent(jobId)}/full-quality`, { body })\n }\n}\n\n// ---------------------------------------------------------------------------\n// The names this resource had before (`client.castSwap`, `CastSwap*`): the\n// same resource and the same types, kept so code written against them still\n// builds.\n// ---------------------------------------------------------------------------\n\n/** @deprecated use {@link VideoRemakeResource} (`client.videoRemake`). */\nexport const CastSwapResource = VideoRemakeResource\n/** @deprecated use {@link VideoRemakeResource} (`client.videoRemake`). */\nexport type CastSwapResource = VideoRemakeResource\n/** @deprecated use {@link VideoRemakeEngine}. */\nexport type CastSwapEngine = VideoRemakeEngine\n/** @deprecated use {@link VideoRemakeEngine}. */\nexport type CastSwapEngineLegacyId = VideoRemakeEngineLegacyId\n/** @deprecated use {@link VideoRemakeStyle}. */\nexport type CastSwapStyle = VideoRemakeStyle\n/** @deprecated use {@link VideoRemakeMotionLength}. */\nexport type CastSwapMotionLength = VideoRemakeMotionLength\n/** @deprecated use {@link VideoRemakeMotionLength}. */\nexport type CastSwapKlingLength = VideoRemakeMotionLength\n/** @deprecated use {@link VideoRemakeTraitSource}. */\nexport type CastSwapTraitSource = VideoRemakeTraitSource\n/** @deprecated use {@link VideoRemakeRolePreviewSettings}. */\nexport type CastSwapRolePreviewSettings = VideoRemakeRolePreviewSettings\n/** @deprecated use {@link VideoRemakePersonRole}. */\nexport type CastSwapPersonRole = VideoRemakePersonRole\n/** @deprecated use {@link VideoRemakeLocationRole}. */\nexport type CastSwapLocationRole = VideoRemakeLocationRole\n/** @deprecated use {@link VideoRemakePetRole}. */\nexport type CastSwapPetRole = VideoRemakePetRole\n/** @deprecated use {@link VideoRemakeProductRole}. */\nexport type CastSwapProductRole = VideoRemakeProductRole\n/** @deprecated use {@link VideoRemakeRole}. */\nexport type CastSwapRole = VideoRemakeRole\n/** @deprecated use {@link VideoRemakeReference}. */\nexport type CastSwapReference = VideoRemakeReference\n/** @deprecated use {@link VideoRemakeFaceMaskingZone}. */\nexport type CastSwapFaceMaskingZone = VideoRemakeFaceMaskingZone\n/** @deprecated use {@link VideoRemakeFaceMasking}. */\nexport type CastSwapFaceMasking = VideoRemakeFaceMasking\n/** @deprecated use {@link VideoRemakeParams}. */\nexport type CastSwapParams = VideoRemakeParams\n/** @deprecated use {@link VideoRemakeEstimate}. */\nexport type CastSwapEstimate = VideoRemakeEstimate\n/** @deprecated use {@link VideoRemakeRunOptions}. */\nexport type CastSwapRunOptions = VideoRemakeRunOptions\n/** @deprecated use {@link VideoRemakeFullQualityKind}. */\nexport type CastSwapFullQualityKind = VideoRemakeFullQualityKind\n/** @deprecated use {@link VideoRemakeFullQualityEstimate}. */\nexport type CastSwapFullQualityEstimate = VideoRemakeFullQualityEstimate\n/** @deprecated use {@link VideoRemakeFullQualityParams}. */\nexport type CastSwapFullQualityParams = VideoRemakeFullQualityParams\n/** @deprecated use {@link VideoRemakeFullQualityResult}. */\nexport type CastSwapFullQualityResult = VideoRemakeFullQualityResult\n/** @deprecated use {@link VideoRemakeFullQualityRefusalCode}. */\nexport type CastSwapFullQualityRefusalCode = VideoRemakeFullQualityRefusalCode\n/** @deprecated use {@link VideoRemakeStyleChoiceOption}. */\nexport type CastSwapStyleChoiceOption = VideoRemakeStyleChoiceOption\n/** @deprecated use {@link VideoRemakeStyleChoice}. */\nexport type CastSwapStyleChoice = VideoRemakeStyleChoice\n"]}
|