@nodaro/sdk 2.76.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.
Files changed (112) hide show
  1. package/dist/{chunk-HUYI5G3D.js → chunk-3NG4HPM5.js} +2 -2
  2. package/dist/{chunk-HUYI5G3D.js.map → chunk-3NG4HPM5.js.map} +1 -1
  3. package/dist/chunk-5QNCWXKG.cjs +22 -0
  4. package/dist/chunk-5QNCWXKG.cjs.map +1 -0
  5. package/dist/{chunk-IO7NEEZZ.cjs → chunk-6BPQYCUG.cjs} +54 -3
  6. package/dist/chunk-6BPQYCUG.cjs.map +1 -0
  7. package/dist/{chunk-TZFZDEWI.js → chunk-6ZKW7767.js} +54 -3
  8. package/dist/chunk-6ZKW7767.js.map +1 -0
  9. package/dist/{chunk-7PMOXQEO.cjs → chunk-7WVQZPUW.cjs} +51 -8
  10. package/dist/chunk-7WVQZPUW.cjs.map +1 -0
  11. package/dist/{chunk-GIQDM2MH.js → chunk-C3H3V5PN.js} +2 -2
  12. package/dist/{chunk-GIQDM2MH.js.map → chunk-C3H3V5PN.js.map} +1 -1
  13. package/dist/{chunk-CSNYBGHP.js → chunk-D45ATYCE.js} +2 -2
  14. package/dist/chunk-D45ATYCE.js.map +1 -0
  15. package/dist/{chunk-A3XA6UNM.cjs → chunk-FQHMDWSP.cjs} +2 -2
  16. package/dist/{chunk-A3XA6UNM.cjs.map → chunk-FQHMDWSP.cjs.map} +1 -1
  17. package/dist/{chunk-SGVTZ2J5.cjs → chunk-G6ASA5RQ.cjs} +18 -18
  18. package/dist/{chunk-SGVTZ2J5.cjs.map → chunk-G6ASA5RQ.cjs.map} +1 -1
  19. package/dist/{chunk-UPWAODYT.cjs → chunk-H6ZB7WYE.cjs} +26 -2
  20. package/dist/chunk-H6ZB7WYE.cjs.map +1 -0
  21. package/dist/{chunk-SGVJUVFD.cjs → chunk-HEJE6L3E.cjs} +3 -3
  22. package/dist/{chunk-SGVJUVFD.cjs.map → chunk-HEJE6L3E.cjs.map} +1 -1
  23. package/dist/{chunk-FOC4VPGK.js → chunk-IAHNPMIX.js} +3 -3
  24. package/dist/{chunk-FOC4VPGK.js.map → chunk-IAHNPMIX.js.map} +1 -1
  25. package/dist/{chunk-U2F6IHHY.js → chunk-JCLJRCMR.js} +10 -10
  26. package/dist/{chunk-U2F6IHHY.js.map → chunk-JCLJRCMR.js.map} +1 -1
  27. package/dist/{chunk-KNBZFWVO.cjs → chunk-JIFGF6PA.cjs} +13 -2
  28. package/dist/chunk-JIFGF6PA.cjs.map +1 -0
  29. package/dist/chunk-NDX4QUTI.js +3 -0
  30. package/dist/{chunk-CHZBONJJ.js.map → chunk-NDX4QUTI.js.map} +1 -1
  31. package/dist/{chunk-GWL4O3J2.js → chunk-PNTVCJZV.js} +13 -2
  32. package/dist/chunk-PNTVCJZV.js.map +1 -0
  33. package/dist/{chunk-AOHDYZSZ.js → chunk-QV4QD6XI.js} +26 -2
  34. package/dist/chunk-QV4QD6XI.js.map +1 -0
  35. package/dist/{chunk-6NIKAVI3.cjs → chunk-STKXUHEM.cjs} +2 -2
  36. package/dist/chunk-STKXUHEM.cjs.map +1 -0
  37. package/dist/{chunk-57GANTLV.cjs → chunk-USBDYHSO.cjs} +2 -2
  38. package/dist/{chunk-57GANTLV.cjs.map → chunk-USBDYHSO.cjs.map} +1 -1
  39. package/dist/{chunk-OO4AKYUN.js → chunk-VPBPVDKY.js} +52 -10
  40. package/dist/chunk-VPBPVDKY.js.map +1 -0
  41. package/dist/{chunk-D3F2BWD6.cjs → chunk-VZCCECKW.cjs} +2 -2
  42. package/dist/{chunk-D3F2BWD6.cjs.map → chunk-VZCCECKW.cjs.map} +1 -1
  43. package/dist/chunk-YPZCTRFB.js +12 -0
  44. package/dist/chunk-YPZCTRFB.js.map +1 -0
  45. package/dist/entries/cast-swap.cjs +2 -2
  46. package/dist/entries/cast-swap.d.cts +1 -1
  47. package/dist/entries/cast-swap.d.ts +1 -1
  48. package/dist/entries/cast-swap.js +1 -1
  49. package/dist/entries/characters.d.cts +2 -1
  50. package/dist/entries/characters.d.ts +2 -1
  51. package/dist/entries/client.cjs +14 -14
  52. package/dist/entries/client.d.cts +2 -2
  53. package/dist/entries/client.d.ts +2 -2
  54. package/dist/entries/client.js +9 -9
  55. package/dist/entries/core.cjs +5 -5
  56. package/dist/entries/core.js +1 -1
  57. package/dist/entries/creatures.cjs +6 -6
  58. package/dist/entries/creatures.d.cts +2 -3
  59. package/dist/entries/creatures.d.ts +2 -3
  60. package/dist/entries/creatures.js +1 -1
  61. package/dist/entries/edit.cjs +12 -8
  62. package/dist/entries/edit.d.cts +272 -71
  63. package/dist/entries/edit.d.ts +272 -71
  64. package/dist/entries/edit.js +2 -2
  65. package/dist/entries/locations.d.cts +2 -1
  66. package/dist/entries/locations.d.ts +2 -1
  67. package/dist/entries/media.cjs +2 -2
  68. package/dist/entries/media.d.cts +68 -2
  69. package/dist/entries/media.d.ts +68 -2
  70. package/dist/entries/media.js +1 -1
  71. package/dist/entries/nodes.cjs +9 -5
  72. package/dist/entries/nodes.d.cts +3 -2
  73. package/dist/entries/nodes.d.ts +3 -2
  74. package/dist/entries/nodes.js +2 -2
  75. package/dist/entries/objects.cjs +6 -6
  76. package/dist/entries/objects.d.cts +2 -3
  77. package/dist/entries/objects.d.ts +2 -3
  78. package/dist/entries/objects.js +1 -1
  79. package/dist/entries/scene3d.d.cts +3 -2
  80. package/dist/entries/scene3d.d.ts +3 -2
  81. package/dist/entries/trends.cjs +2 -2
  82. package/dist/entries/trends.d.cts +36 -17
  83. package/dist/entries/trends.d.ts +36 -17
  84. package/dist/entries/trends.js +1 -1
  85. package/dist/entries/video-remake.cjs +2 -2
  86. package/dist/entries/video-remake.d.cts +1 -1
  87. package/dist/entries/video-remake.d.ts +1 -1
  88. package/dist/entries/video-remake.js +1 -1
  89. package/dist/index.cjs +48 -40
  90. package/dist/index.d.cts +5 -5
  91. package/dist/index.d.ts +5 -5
  92. package/dist/index.js +11 -11
  93. package/dist/{nodes-BaRqRB2Z.d.ts → nodes-C6e2wign.d.ts} +86 -8
  94. package/dist/{nodes-BHtjh6gl.d.cts → nodes-D71Ec9b5.d.cts} +86 -8
  95. package/dist/{video-remake-C-KR7YtT.d.ts → video-remake-CnnJMGwj.d.ts} +166 -5
  96. package/dist/{video-remake-DTuCyhd9.d.cts → video-remake-EHwCWlUW.d.cts} +166 -5
  97. package/package.json +3 -3
  98. package/dist/chunk-6NIKAVI3.cjs.map +0 -1
  99. package/dist/chunk-7PMOXQEO.cjs.map +0 -1
  100. package/dist/chunk-AOHDYZSZ.js.map +0 -1
  101. package/dist/chunk-CHZBONJJ.js +0 -3
  102. package/dist/chunk-CSNYBGHP.js.map +0 -1
  103. package/dist/chunk-GWL4O3J2.js.map +0 -1
  104. package/dist/chunk-IO7NEEZZ.cjs.map +0 -1
  105. package/dist/chunk-KNBZFWVO.cjs.map +0 -1
  106. package/dist/chunk-OO4AKYUN.js.map +0 -1
  107. package/dist/chunk-RKYZY6NA.cjs +0 -16
  108. package/dist/chunk-RKYZY6NA.cjs.map +0 -1
  109. package/dist/chunk-TZFZDEWI.js.map +0 -1
  110. package/dist/chunk-UPWAODYT.cjs.map +0 -1
  111. package/dist/chunk-WFFVCGNU.js +0 -3
  112. package/dist/chunk-WFFVCGNU.js.map +0 -1
@@ -199,5 +199,5 @@ var CreaturesResource = class {
199
199
  };
200
200
 
201
201
  export { CREATURE_ASSET_TYPES, CreaturesResource };
202
- //# sourceMappingURL=chunk-HUYI5G3D.js.map
203
- //# sourceMappingURL=chunk-HUYI5G3D.js.map
202
+ //# sourceMappingURL=chunk-3NG4HPM5.js.map
203
+ //# sourceMappingURL=chunk-3NG4HPM5.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/creatures.ts"],"names":[],"mappings":";;;AA0DO,IAAM,oBAAA,GAAuB,CAAC,QAAA,EAAU,OAAA,EAAS,cAAc,QAAQ;AAyYvE,IAAM,oBAAN,MAAwB;AAAA,EA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A,cAAA,EACA,iBAAA,EACyC;AACzC,IAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,MAAA,CAAO,OAAA;AAAA,MAC5B,MAAA;AAAA,MACA,CAAA,cAAA,EAAiB,kBAAA,CAAmB,EAAE,CAAC,CAAA,mBAAA,CAAA;AAAA,MACvC,EAAE,IAAA,EAAM,EAAE,cAAA,EAAgB,mBAAkB;AAAE,KAChD;AAGA,IAAA,OAAO,EAAE,cAAA,EAAgB,GAAA,CAAI,gBAAgB,oBAAA,EAAsB,GAAA,CAAI,wBAAwB,IAAA,EAAK;AAAA,EACtG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,UAAU,EAAA,EAA8C;AACtD,IAAA,OAAO,KAAK,MAAA,CAAO,OAAA;AAAA,MACjB,MAAA;AAAA,MACA,CAAA,cAAA,EAAiB,kBAAA,CAAmB,EAAE,CAAC,CAAA,YAAA;AAAA,KACzC;AAAA,EACF;AACF","file":"chunk-HUYI5G3D.js","sourcesContent":["import type { ObjectAspectRatio, CreatureAttachColumn } from \"@nodaro/shared/entities\"\nimport type { TtsProvider } from \"@nodaro/shared/models\"\nexport type { CreatureAttachColumn, ObjectAspectRatio as CreatureAspectRatio } from \"@nodaro/shared/entities\"\nexport { CREATURE_ATTACH_COLUMNS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS } from \"@nodaro/shared/entities\"\nimport type { NodaroClientCore } from \"../core.js\"\nimport type { GenerationSessionParams, Subject } from \"./nodes.js\"\nimport type { SetKeeperCatalogInput, SetKeeperCatalogResult } from \"./keepers.js\"\n\n/**\n * Creature voice — IDENTICAL shape + semantics to `Character[\"voice\"]` (the\n * \"talking creature\" stack reuses the character voice plumbing verbatim).\n * Render speech via `client.nodes.run(\"text-to-speech\", { text, voice:\n * voiceId, provider: ttsProvider, voiceType })`, then feed the audio + the\n * creature's `sourceImageUrl` to `client.nodes.run(\"lip-sync\", …)` (or\n * speech-to-video) for a talking-creature clip.\n */\nexport interface CreatureVoice {\n voiceId: string\n voiceName: string\n traits: string\n voiceType?: \"premade\" | \"library\" | \"custom\"\n /** Playable preview sample (client-played only). */\n previewUrl?: string\n /** Recommended TTS provider — send as `provider` on text-to-speech. */\n ttsProvider?: TtsProvider\n}\n\n/**\n * Re-export the shared `CreatureAttachColumn` union + its runtime tuple so SDK\n * consumers don't have to add `@nodaro/shared` as a second dependency just to\n * typecheck the `attachToColumn` field. Single source of truth lives in\n * `@nodaro/shared/entity-prompts` (`CREATURE_ATTACH_COLUMNS`).\n *\n * `CreatureAspectRatio` is re-exported as an alias of the shared\n * `ObjectAspectRatio` — `generateMotion`'s `aspectRatio` field is the 5-value\n * object enum (1:1 / 3:4 / 16:9 / 9:16 / 4:3). The creature motion route\n * deliberately REUSES `OBJECT_ASPECT_OPTIONS` server-side (a creature reference\n * clip is centered product-showcase framing, not cinematic 16:9), so the SDK\n * surfaces the same enum under a creature-friendly name. The runtime tuple is\n * re-exported as `CREATURE_ASPECT_OPTIONS` / `CREATURE_ASPECT_DEFAULTS` aliases.\n */\n\n/**\n * Creature asset-type enum — the kinds of variant a user can generate off a\n * creature's anchor main image. Mirrors the literal accepted by\n * `POST /v1/generate-creature-asset` (`backend/src/routes/generate-creature-asset.ts`).\n *\n * Delta vs `ObjectAssetType`: object's `materials` becomes `poses` (a creature\n * has poses, not materials), and there is NO `motion` value — creature motion\n * variants flow through the dedicated `/v1/generate-creature-motion` endpoint\n * (worker-side a different BullMQ job type). `custom` is the free-form bucket;\n * callers must supply `attachToColumn` explicitly since the worker can't infer\n * the destination from the asset type.\n *\n * The shared `@nodaro/shared` package does NOT export a `CREATURE_ASSET_TYPES`\n * tuple (the route validates an inline Zod enum), so the SDK defines its own\n * single-source-of-truth tuple here.\n */\nexport const CREATURE_ASSET_TYPES = [\"angles\", \"poses\", \"variations\", \"custom\"] as const\nexport type CreatureAssetType = (typeof CREATURE_ASSET_TYPES)[number]\n\n/**\n * Reference-photo kind discriminator — the mood-board roles a user can attach\n * to a creature. Mirrors the `reference_photos.kind` field accepted by\n * `backend/src/routes/creatures.ts` (the route accepts open strings; this SDK\n * type narrows to the 6 canonical roles surfaced by the Studio). `other` is\n * the free-form bucket.\n */\nexport type CreatureReferencePhotoKind =\n | \"front\"\n | \"side\"\n | \"detail\"\n | \"context\"\n | \"moodBoard\"\n | \"other\"\n\nexport interface CreatureReferencePhoto {\n url: string\n kind: CreatureReferencePhotoKind\n}\n\n/**\n * A creature record returned by Nodaro's REST API. Mirrors the camelCase\n * shape produced by `backend/src/routes/creatures.ts::toCamel()`.\n *\n * Asset buckets (`angles`, `poses`, `variations`, `motionClips`) are\n * independent JSONB arrays keyed by a human-readable variant name (e.g.\n * `\"front\"`, `\"walking\"`, `\"scarred\"`). Each entry's `url` points at an\n * R2-hosted asset.\n *\n * Creature delta vs object:\n * - `species` — free-text creature type (e.g. `\"dragon\"`, `\"wolf\"`). This is\n * the subject of the establishing-shot prompt and the primary creature\n * differentiator (object has no equivalent).\n * - `poses` (where object has `materials`) — the pose-variant asset bucket.\n * - `category` is free-text (NOT object's fixed 10-value enum) — a creature\n * can be any animal/type.\n *\n * Identity-foundation fields:\n * - `referencePhotos` — caller-supplied mood-board refs (cap 20).\n * - `canonicalDescription` — ~80–120-word LLM-authored visual caption,\n * populated by `approveMainImage()` / `recaption()`. The wire still sends\n * `\"\"` on caption sub-failure, but `get()` normalizes `\"\"` → `null` so\n * consumers see the same `string | null` semantics as characters.\n * - `styleLock` — whether asset gens should anchor to the canonical style\n * captured at approval time. Defaults to `true` on new rows.\n */\nexport interface Creature {\n id: string\n userId: string\n nodeId: string\n projectId: string | null\n name: string\n description: string | null\n /** Free-text creature type/species (e.g. \"dragon\", \"wolf\") — the creature\n * delta vs object. `null` when unset. */\n species: string | null\n category: string | null\n style: string | null\n sourceImageUrl: string | null\n /** MODEL_CATALOG image-model id the main image was generated with (or `null`).\n * Set on create + editable via the update route. */\n imageProvider: string | null\n angles: Array<{ name: string; url: string }>\n poses: Array<{ name: string; url: string }>\n variations: Array<{ name: string; url: string }>\n motionClips: Array<{ name: string; url: string }>\n /** Named Creature Boards — dense reference sheets, one per variant/mood\n * (the `generate-image/creature-board` factory preset rendered from the\n * creature's images). A first-class bucket: community publish snapshots it\n * and clone hands the consumer their own copy to extend. Defaults to `[]`.\n * `type` marks an image-collage `\"identity\"` sheet vs a plain `\"looks\"`\n * board; `sourceImages` are the R2 URLs it was collaged from. Both optional\n * + backward-compatible (legacy boards have neither). */\n boards?: Array<{ name: string; url: string; type?: \"looks\" | \"identity\"; sourceImages?: string[] }> | null\n /** The creature's voice (the \"talking creature\" stack) — same shape and\n * flow as `Character[\"voice\"]`. `null` when no voice is selected. */\n voice?: CreatureVoice | null\n referencePhotos: CreatureReferencePhoto[]\n /** `null` when no caption is set (or the LLM caption sub-failed) — the wire\n * sends `\"\"`, normalized to `null` in `get()` to match character semantics. */\n canonicalDescription: string | null\n styleLock: boolean\n /** The user's chosen DEFAULT asset take per variant (Studio version history).\n * OPAQUE map: key `\"<bucket>:<variant>\"` (e.g. `\"angles:front\"`) → the chosen\n * asset URL (one already present in that bucket). Stored verbatim — keys are\n * NOT normalized; soft-capped server-side at 200 keys / 2048-char values\n * (overflow dropped silently). Defaults to `{}`. */\n selectedAssetByVariant?: Record<string, string> | null\n /** Nodaro Keepers: whether this row is on the shared shelf (`client.keepers`).\n * Admin-set through `setCatalog`; `false` on everyone else's rows and on\n * every copy. Optional on the read surface for older servers. */\n catalog?: boolean\n /** The shelf order (lowest first); `0` when never set. */\n catalogSort?: number\n /** The shelf heading, or `null`. */\n catalogCategory?: string | null\n deletedAt: string | null\n createdAt: string\n updatedAt: string\n}\n\n/**\n * GET /v1/creatures/:id may append a `pendingJobs` bucket the studio uses to\n * rehydrate spinners after a reload. Optional on the SDK surface — it doesn't\n * appear on `list()` rows.\n */\nexport interface CreatureDetail extends Creature {\n pendingJobs?: Array<{\n jobId: string\n assetType: string\n name: string\n status: string\n }>\n}\n\n/**\n * Body for `client.creatures.create()`. Mirrors the INSERT branch of\n * `upsertCreatureBody` in `backend/src/routes/creatures.ts`. `name` + `nodeId`\n * are required on create.\n */\nexport interface CreateCreatureInput {\n nodeId: string\n name: string\n description?: string\n /** Free-text creature type/species (the creature delta vs object). */\n species?: string\n /** Free-text category (NOT object's fixed enum — a creature can be anything). */\n category?: string\n style?: string\n workflowId?: string\n projectId?: string\n sourceImageUrl?: string\n /** Persistent image-model id (a MODEL_CATALOG image model). Validated\n * server-side — unknown / non-image / \"\" is stored as `null`. */\n imageProvider?: string | null\n referencePhotos?: CreatureReferencePhoto[]\n canonicalDescription?: string\n styleLock?: boolean\n /** The user's chosen DEFAULT asset take per variant. OPAQUE\n * `\"<bucket>:<variant>\"` → chosen-URL map; a write REPLACES the whole map.\n * Keys stored verbatim; soft-capped server-side at 200 keys / 2048-char values. */\n selectedAssetByVariant?: Record<string, string>\n /** Initial voice selection (see `CreatureVoice`). Omit for a voiceless creature. */\n voice?: CreatureVoice | null\n}\n\n/**\n * Body for `client.creatures.update()`. Mirrors the UPDATE branch of\n * `upsertCreatureBody` in `backend/src/routes/creatures.ts`.\n *\n * Worker-owned asset buckets (`angles` / `poses` / `variations` /\n * `motionClips`) are deliberately omitted — the route drops them on UPDATE\n * so a Studio auto-save with a stale snapshot cannot clobber the worker's\n * atomic `append_creature_asset()` writes.\n *\n * `expectedUpdatedAt` is the optimistic-concurrency token: when present, the\n * UPDATE only succeeds if the row's `updated_at` still matches; on mismatch\n * the route returns 409 so the studio can re-fetch + merge.\n */\nexport interface UpdateCreatureInput {\n name?: string\n description?: string\n /** Free-text creature type/species (the creature delta vs object). */\n species?: string\n category?: string\n style?: string\n sourceImageUrl?: string\n /** Persistent image-model id (a MODEL_CATALOG image model). Validated\n * server-side — unknown / non-image / \"\" is stored as `null`. */\n imageProvider?: string | null\n referencePhotos?: CreatureReferencePhoto[]\n canonicalDescription?: string\n styleLock?: boolean\n /** The user's chosen DEFAULT asset take per variant. OPAQUE\n * `\"<bucket>:<variant>\"` → chosen-URL map; a write REPLACES the whole map\n * (omit to leave untouched). Keys stored verbatim; soft-capped server-side\n * at 200 keys / 2048-char values. */\n selectedAssetByVariant?: Record<string, string>\n /** Named Creature Boards (see `Creature.boards`) — whole-array replace,\n * USER-owned (unlike the worker-owned buckets it flows through UPDATE).\n * Server caps: 24 boards, 200-char names, 30 sourceImages per board. */\n boards?: Array<{ name: string; url: string; type?: \"looks\" | \"identity\"; sourceImages?: string[] }>\n /** Voice selection (see `CreatureVoice`) — whole-object replace; pass\n * `null` to clear the voice, omit to leave untouched. */\n voice?: CreatureVoice | null\n expectedUpdatedAt?: string\n}\n\nexport interface UpdateCreatureResult {\n id: string\n updatedAt: string\n}\n\n/**\n * Combined create + update body (parameter for both branches). Exported for\n * callers that want to drive a single `upsert` flow without picking between\n * `Create*` and `Update*`. Mirrors the `upsertCreatureBody` Zod schema in\n * `backend/src/routes/creatures.ts`. `nodeId` + `name` are required on INSERT;\n * `id` flips the route into UPDATE mode.\n */\nexport interface UpsertCreatureInput extends CreateCreatureInput {\n id?: string\n expectedUpdatedAt?: string\n}\n\nexport type UpsertCreatureResult = { id: string } | UpdateCreatureResult\n\nexport interface ListCreaturesParams {\n /** When true, return archived creatures instead of active ones. */\n archived?: boolean\n /** Optional project filter — server-scoped to the caller's user. */\n projectId?: string\n /**\n * Search words: only the creatures whose name or description contains\n * every word (split on spaces, the first 5), in any order, ignoring case.\n * Each word is matched as written (`%`, `_` and `*` are not wildcards;\n * punctuation is kept); blank means no search; up to 200 characters.\n * Combines with the other filters and with `cursor` paging.\n */\n q?: string\n /**\n * Max rows to return (cap 500). OPT-IN: omitted, the server returns the\n * full legacy listing with no `nextCursor`; supplied, the response is one\n * page plus `nextCursor` — keep passing it back until it is `null`.\n */\n limit?: number\n /** Opaque cursor from a prior page's `nextCursor` (fetches the next page). */\n cursor?: string\n}\n\n/**\n * Input for `client.creatures.generate()` — fires the\n * `POST /v1/generate-creature` route. Produces 1–10 candidate\n * main images; each lands as one `jobs` row in `pending` state and is then\n * enqueued for the worker.\n *\n * When `attachToCreatureId` is set AND `count === 1`, the worker writes the\n * resulting URL directly to `creatures.source_image_url` on completion —\n * caller doesn't need a separate `approveMainImage` call. Multi-candidate\n * batches MUST go through explicit approval so the user picks the winner.\n *\n * `seedPromptHint` flows the parameter-picker's prompt fragment through to the\n * worker so a catalog selection (e.g. \"armored frost dragon\") gets appended to\n * the generated prompt context.\n */\nexport interface GenerateCreatureInput extends GenerationSessionParams {\n name: string\n description?: string\n userPrompt?: string\n /** Free-text creature type/species (the creature delta vs object). */\n species?: string\n category?: string\n style?: \"realistic\" | \"anime\" | \"3d-pixar\" | \"illustration\"\n sourceImageUrl?: string\n provider?: string\n /** Number of candidate images to generate (1–10; server-validated). */\n count?: number\n /** Auto-attach the result to this creature row (single-candidate only). */\n attachToCreatureId?: string\n /** Parameter-picker prompt-fragment pass-through. */\n seedPromptHint?: string\n /**\n * What the creature is, as picker-catalog ids ({@link Subject} — `animal`\n * above all; the same type and bounds as `generateImage`'s). The platform\n * writes the wording and folds it into the prompt after `description`, so\n * send ids rather than phrasing a pick yourself.\n */\n subject?: Subject\n /** Optional name to set on the attached row alongside the main image. */\n attachName?: string\n /** Optimistic-concurrency token for the single-candidate auto-attach path. */\n expectedUpdatedAt?: string\n}\n\n/**\n * `generate()` response — `jobIds` is ALWAYS present (the harmonized contract,\n * matching characters). `jobId` is a deprecated back-compat alias populated only\n * on `count === 1`; prefer `jobIds`. (Will be removed on the next major.)\n */\nexport interface GenerateCreatureResult {\n jobIds: string[]\n /** @deprecated count===1 back-compat alias — use `jobIds`. */\n jobId?: string\n}\n\n/**\n * Input for `client.creatures.generateAsset()` — fires the\n * `POST /v1/generate-creature-asset` route. Produces a single\n * angles / poses / variations / custom variant.\n *\n * When all three studio-path fields are set (`attachToCreatureId` +\n * `attachToColumn` + `attachName`), the worker appends\n * `{ name: attachName, url: <result> }` to the named JSONB array column on\n * the user's creature row on completion. `attachToColumn` is REQUIRED for\n * `assetType === \"custom\"` — the worker can't infer the bucket from the\n * asset type.\n */\nexport interface GenerateCreatureAssetInput extends GenerationSessionParams {\n assetType: CreatureAssetType\n variant: string\n name: string\n description?: string\n userPrompt?: string\n category?: string\n style?: string\n sourceImageUrl?: string\n provider?: string\n attachToCreatureId?: string\n attachToColumn?: CreatureAttachColumn\n attachName?: string\n /** Parameter-picker prompt-fragment pass-through. */\n seedPromptHint?: string\n}\n\nexport interface GenerateCreatureAssetResult {\n jobId: string\n}\n\n/**\n * Input for `client.creatures.generateMotion()` — fires the\n * `POST /v1/generate-creature-motion` route. Produces a single motion clip\n * (idle, prowl, attack, etc.) animated FROM a static creature-shot image.\n *\n * Mirrors `client.objects.generateMotion()` — the creature motion route reuses\n * the entity-agnostic object motion helpers server-side. The route hardcodes\n * the attach column to `motion_clips` — callers supply `attachToCreatureId` +\n * `attachName` only.\n *\n * `sourceImageUrl` is REQUIRED — image-to-video needs a source frame and the\n * route has no fallback (the studio path supplies the canonical creature-shot\n * URL explicitly).\n *\n * Defaults vs location:\n * - `provider` defaults to `\"kling-turbo\"` (not location's `\"kling\"`)\n * - `aspectRatio` defaults to `\"1:1\"` server-side via\n * `resolveObjectAspectRatio({ assetType: \"motion\" })` — creatures use\n * centered reference framing, not cinematic establishing shots.\n *\n * When the studio path is set (`attachToCreatureId` + `attachName`), the\n * worker appends `{ name: attachName, url: <result> }` to the creature row's\n * `motion_clips` JSONB column on completion.\n */\nexport interface GenerateCreatureMotionInput extends GenerationSessionParams {\n motionPrompt: string\n sourceImageUrl: string\n provider?: string\n name: string\n /** Source clip URL — when set, worker routes to video-to-video refine. */\n refineFromVideoUrl?: string\n category?: string\n style?: \"realistic\" | \"anime\" | \"3d-pixar\" | \"illustration\"\n canonicalDescription?: string\n /** Parameter-picker prompt-fragment pass-through. */\n seedPromptHint?: string\n attachToCreatureId?: string\n attachName?: string\n /**\n * Optional aspect ratio override. Defaults to 1:1 server-side. One of the\n * 5-value `CreatureAspectRatio` union (1:1 / 3:4 / 16:9 / 9:16 / 4:3) — the\n * creature route reuses the object aspect enum.\n */\n aspectRatio?: ObjectAspectRatio\n /**\n * Optional clip duration in seconds. Validated server-side against the chosen\n * provider's allowed durations (e.g. kling 5/10, wan-i2v 5/10/15); omitted →\n * the model's own default (no behavior change). Mirrors generate-video's\n * per-model i2v duration lever.\n */\n duration?: number\n}\n\nexport interface GenerateCreatureMotionResult {\n jobId: string\n}\n\nexport interface ApproveCreatureMainImageResult {\n sourceImageUrl: string\n /**\n * LLM-authored caption. `null` when the LLM caption sub-failed — the wire\n * sends `\"\"`, normalized to `null` here so consumers see the same\n * `string | null` semantics as characters. The main image is still set; call\n * `recaption()` to retry.\n */\n canonicalDescription: string | null\n}\n\nexport interface RecaptionCreatureResult {\n canonicalDescription: string\n}\n\nexport class CreaturesResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * List the caller's creatures. By default returns active creatures only;\n * pass `archived: true` to fetch soft-deleted rows for an \"archive\" view.\n * Optional `projectId` scopes the result to a single project; `q` keeps the\n * creatures whose name or description contains it.\n */\n list(params: ListCreaturesParams = {}): Promise<{ creatures: Creature[]; nextCursor?: string | null }> {\n const query: Record<string, string | undefined> = {}\n if (params.archived) query.archived = \"true\"\n if (params.projectId) query.projectId = params.projectId\n if (params.q) query.q = params.q\n if (params.limit !== undefined) query.limit = String(params.limit)\n if (params.cursor) query.cursor = params.cursor\n return this.client.request(\"GET\", \"/v1/creatures\", { query })\n }\n\n /**\n * Convenience wrapper for `list({ archived: true })`. Returns soft-deleted\n * rows so callers can drive a UI \"Archived\" tab without re-encoding the\n * query param.\n *\n * `archived` is omitted from the param type — it's always set to `true` here.\n */\n listArchived(params: Omit<ListCreaturesParams, \"archived\"> = {}): Promise<{ creatures: Creature[]; nextCursor?: string | null }> {\n return this.list({ ...params, archived: true })\n }\n\n /**\n * Fetch a single creature including in-flight asset job state. Soft-deleted\n * (archived) rows are NOT returned by id — the route enforces\n * `deleted_at IS NULL` so archived creatures 404 (uniform \"not_found\" — does\n * not leak the deleted vs non-existent distinction).\n */\n async get(id: string): Promise<CreatureDetail> {\n const res = await this.client.request<CreatureDetail>(\n \"GET\",\n `/v1/creatures/${encodeURIComponent(id)}`,\n )\n // Normalize the wire `\"\"` caption (DB null / LLM sub-failure) → null so\n // consumers see the same `string | null` semantics as characters. New\n // object — never mutate the response.\n return { ...res, canonicalDescription: res.canonicalDescription || null }\n }\n\n /**\n * Create a new creature. `name` + `nodeId` are required — the route 400s\n * otherwise. Returns the new row's id.\n *\n * Note: the underlying route is the same `POST /v1/creatures` upsert that\n * powers `update()`. This convenience wrapper enforces the INSERT-required\n * fields at the type level and never sends an `id`.\n */\n create(data: CreateCreatureInput): Promise<{ id: string }> {\n return this.client.request(\"POST\", \"/v1/creatures\", { body: data })\n }\n\n /**\n * Update a creature. Only the fields you pass are written — undefined keys\n * are NOT touched on the row. Worker-owned asset buckets are intentionally\n * not exposed on this surface (see `UpdateCreatureInput` for the rationale).\n *\n * Optimistic-concurrency: pass `expectedUpdatedAt` to require the row's\n * `updated_at` still matches; on mismatch the route returns 409\n * `concurrent_modification` carrying the fresh `updatedAt`. The SDK\n * surfaces that as a generic `NodaroError` with the same code.\n */\n update(id: string, data: UpdateCreatureInput): Promise<UpdateCreatureResult> {\n return this.client.request(\"POST\", \"/v1/creatures\", {\n body: { id, ...data },\n })\n }\n\n /**\n * Soft-delete (archive) a creature. The row is hidden from `list()` by\n * default but recoverable via `restore(id)` or visible under\n * `listArchived()`. Idempotent — repeating a delete on an already-archived\n * row is a no-op.\n */\n delete(id: string): Promise<{ success: true; archived: true }> {\n return this.client.request(\"DELETE\", `/v1/creatures/${encodeURIComponent(id)}`)\n }\n\n /**\n * Hard-delete (permanent) a creature — the row + every R2 asset it\n * references. Archived rows ONLY: active creatures return 400 `not_archived`.\n * Call `delete()` first to archive, then `permanentDelete()` to destroy.\n *\n * Mirrors the `app_runs` permanent-delete pattern (archive-first) so a\n * stray SDK / curl caller cannot bypass the studio's archive-first UI\n * flow.\n */\n permanentDelete(id: string): Promise<{ success: true; permanent: true }> {\n return this.client.request(\"DELETE\", `/v1/creatures/${encodeURIComponent(id)}`, {\n query: { permanent: \"true\" },\n })\n }\n\n /**\n * Un-archive a creature. If the original name now collides (case-\n * insensitive) with an active row, the server auto-suffixes \"(restored)\"\n * and returns the effective name.\n */\n restore(id: string): Promise<{ id: string; name: string }> {\n return this.client.request(\"POST\", `/v1/creatures/${encodeURIComponent(id)}/restore`)\n }\n\n /**\n * Admin only: put one of your own creatures on the shared Nodaro Keepers\n * shelf (`client.keepers.catalog()`), or take it off. A first-party session\n * or your personal token; `forbidden` for anyone who is not a platform\n * admin, `not_found` for a row that is not yours.\n */\n setCatalog(id: string, input: SetKeeperCatalogInput): Promise<SetKeeperCatalogResult> {\n return this.client.request(\"PUT\", `/v1/creatures/${encodeURIComponent(id)}/catalog`, { body: input })\n }\n\n /**\n * Fire `POST /v1/generate-creature` to produce one or more candidate main\n * images. With `count > 1`, all jobs are reserved up-front before any\n * is enqueued — mid-batch failures roll back atomically.\n *\n * When `attachToCreatureId` is set AND `count === 1`, the worker writes\n * the result directly to the row's `source_image_url`; otherwise you must\n * call `approveMainImage()` after picking a candidate.\n */\n async generate(data: GenerateCreatureInput): Promise<GenerateCreatureResult> {\n const res = await this.client.request<{ jobId?: string; jobIds?: string[] }>(\n \"POST\", \"/v1/generate-creature\", { body: data },\n )\n // Tolerate the legacy `{ jobId }`-only shape (older server): synthesize jobIds.\n const jobIds = res.jobIds ?? (res.jobId ? [res.jobId] : [])\n return res.jobId ? { jobIds, jobId: res.jobId } : { jobIds }\n }\n\n /**\n * Fire `POST /v1/generate-creature-asset` to produce a single variant.\n * When the studio path is set (`attachToCreatureId` + `attachToColumn` +\n * `attachName`), the worker appends `{ name: attachName, url: <result> }`\n * to the named JSONB array column on completion.\n *\n * Note: `attachToColumn` is REQUIRED for `assetType === \"custom\"` — the\n * worker can't infer the bucket from the asset type. For canonical asset\n * types (`angles` / `poses` / `variations`), the column is derived\n * automatically by the route.\n */\n generateAsset(\n data: GenerateCreatureAssetInput,\n ): Promise<GenerateCreatureAssetResult> {\n return this.client.request(\"POST\", \"/v1/generate-creature-asset\", { body: data })\n }\n\n /**\n * Fire `POST /v1/generate-creature-motion` to animate the creature's main\n * image into a motion clip. Image-to-video, single clip per call; the\n * attach column is hardcoded to `motion_clips` server-side (creatures have a\n * single motion bucket so the caller doesn't supply `attachToColumn`).\n * When the studio path is set (`attachToCreatureId` + `attachName`), the\n * worker appends `{ name: attachName, url: <result> }` to the row's\n * `motion_clips` column on completion.\n *\n * Defaults: `provider` → `\"kling-turbo\"`, `aspectRatio` → `\"1:1\"` (set\n * server-side via `resolveObjectAspectRatio({ assetType: \"motion\" })`).\n */\n generateMotion(\n data: GenerateCreatureMotionInput,\n ): Promise<GenerateCreatureMotionResult> {\n return this.client.request(\"POST\", \"/v1/generate-creature-motion\", { body: data })\n }\n\n /**\n * Approve a completed `generate-creature` job as the creature's main image.\n * Sets `source_image_url` and fires the LLM caption (Claude Sonnet vision)\n * inline. Returns the new main-image URL plus the caption.\n *\n * Caption-failure semantics: the route still sends `\"\"` on LLM sub-failure,\n * but the SDK normalizes `\"\"` → `null` here so `canonicalDescription` carries\n * the same `string | null` semantics as characters. The main image is still\n * set; call `recaption()` to retry.\n *\n * Optimistic-concurrency: pass `expectedUpdatedAt` to gate the update on\n * the row's current `updated_at`; on mismatch the route returns 409\n * `concurrent_modification` carrying the fresh token.\n */\n async approveMainImage(\n id: string,\n candidateJobId: string,\n expectedUpdatedAt?: string,\n ): Promise<ApproveCreatureMainImageResult> {\n const res = await this.client.request<{ sourceImageUrl: string; canonicalDescription: string | null }>(\n \"POST\",\n `/v1/creatures/${encodeURIComponent(id)}/approve-main-image`,\n { body: { candidateJobId, expectedUpdatedAt } },\n )\n // Normalize the wire `\"\"` (LLM sub-failure) → null; build a new object\n // rather than mutating the response.\n return { sourceImageUrl: res.sourceImageUrl, canonicalDescription: res.canonicalDescription || null }\n }\n\n /**\n * Re-fire the LLM caption against the creature's current main image. 502s\n * on LLM failure (unlike `approveMainImage` which preserves the side-effect\n * and returns \"\"); returns 400 `main_image_required` if no main image is\n * set yet.\n *\n * The route is a pure idempotent retry — it does NOT accept an\n * `expectedUpdatedAt` token (backend route is idempotent retry, not gated on\n * optimistic-concurrency).\n */\n recaption(id: string): Promise<RecaptionCreatureResult> {\n return this.client.request(\n \"POST\",\n `/v1/creatures/${encodeURIComponent(id)}/llm-caption`,\n )\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/resources/creatures.ts"],"names":[],"mappings":";;;AA0DO,IAAM,oBAAA,GAAuB,CAAC,QAAA,EAAU,OAAA,EAAS,cAAc,QAAQ;AAuYvE,IAAM,oBAAN,MAAwB;AAAA,EAC7B,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQpB,IAAA,CAAK,MAAA,GAA8B,EAAC,EAAmE;AACrG,IAAA,MAAM,QAA4C,EAAC;AACnD,IAAA,IAAI,MAAA,CAAO,QAAA,EAAU,KAAA,CAAM,QAAA,GAAW,MAAA;AACtC,IAAA,IAAI,MAAA,CAAO,SAAA,EAAW,KAAA,CAAM,SAAA,GAAY,MAAA,CAAO,SAAA;AAC/C,IAAA,IAAI,MAAA,CAAO,CAAA,EAAG,KAAA,CAAM,CAAA,GAAI,MAAA,CAAO,CAAA;AAC/B,IAAA,IAAI,OAAO,KAAA,KAAU,MAAA,QAAiB,KAAA,GAAQ,MAAA,CAAO,OAAO,KAAK,CAAA;AACjE,IAAA,IAAI,MAAA,CAAO,MAAA,EAAQ,KAAA,CAAM,MAAA,GAAS,MAAA,CAAO,MAAA;AACzC,IAAA,OAAO,KAAK,MAAA,CAAO,OAAA,CAAQ,OAAO,eAAA,EAAiB,EA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sProvider } from \"@nodaro/shared/models\"\nexport type { CreatureAttachColumn, ObjectAspectRatio as CreatureAspectRatio } from \"@nodaro/shared/entities\"\nexport { CREATURE_ATTACH_COLUMNS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS } from \"@nodaro/shared/entities\"\nimport type { NodaroClientCore } from \"../core.js\"\nimport type { GenerationSessionParams, Subject } from \"./nodes.js\"\nimport type { SetKeeperCatalogInput, SetKeeperCatalogResult } from \"./keepers.js\"\n\n/**\n * Creature voice — IDENTICAL shape + semantics to `Character[\"voice\"]` (the\n * \"talking creature\" stack reuses the character voice plumbing verbatim).\n * Render speech via `client.nodes.run(\"text-to-speech\", { text, voice:\n * voiceId, provider: ttsProvider, voiceType })`, then feed the audio + the\n * creature's `sourceImageUrl` to `client.nodes.run(\"lip-sync\", …)` (or\n * speech-to-video) for a talking-creature clip.\n */\nexport interface CreatureVoice {\n voiceId: string\n voiceName: string\n traits: string\n voiceType?: \"premade\" | \"library\" | \"custom\"\n /** Playable preview sample (client-played only). */\n previewUrl?: string\n /** Recommended TTS provider — send as `provider` on text-to-speech. */\n ttsProvider?: TtsProvider\n}\n\n/**\n * Re-export the shared `CreatureAttachColumn` union + its runtime tuple so SDK\n * consumers don't have to add `@nodaro/shared` as a second dependency just to\n * typecheck the `attachToColumn` field. Single source of truth lives in\n * `@nodaro/shared/entity-prompts` (`CREATURE_ATTACH_COLUMNS`).\n *\n * `CreatureAspectRatio` is re-exported as an alias of the shared\n * `ObjectAspectRatio` — `generateMotion`'s `aspectRatio` field is the 5-value\n * object enum (1:1 / 3:4 / 16:9 / 9:16 / 4:3). The creature motion route\n * deliberately REUSES `OBJECT_ASPECT_OPTIONS` server-side (a creature reference\n * clip is centered product-showcase framing, not cinematic 16:9), so the SDK\n * surfaces the same enum under a creature-friendly name. The runtime tuple is\n * re-exported as `CREATURE_ASPECT_OPTIONS` / `CREATURE_ASPECT_DEFAULTS` aliases.\n */\n\n/**\n * Creature asset-type enum — the kinds of variant a user can generate off a\n * creature's anchor main image. Mirrors the literal accepted by\n * `POST /v1/generate-creature-asset` (`backend/src/routes/generate-creature-asset.ts`).\n *\n * Delta vs `ObjectAssetType`: object's `materials` becomes `poses` (a creature\n * has poses, not materials), and there is NO `motion` value — creature motion\n * variants flow through the dedicated `/v1/generate-creature-motion` endpoint\n * (worker-side a different BullMQ job type). `custom` is the free-form bucket;\n * callers must supply `attachToColumn` explicitly since the worker can't infer\n * the destination from the asset type.\n *\n * The shared `@nodaro/shared` package does NOT export a `CREATURE_ASSET_TYPES`\n * tuple (the route validates an inline Zod enum), so the SDK defines its own\n * single-source-of-truth tuple here.\n */\nexport const CREATURE_ASSET_TYPES = [\"angles\", \"poses\", \"variations\", \"custom\"] as const\nexport type CreatureAssetType = (typeof CREATURE_ASSET_TYPES)[number]\n\n/**\n * Reference-photo kind discriminator — the mood-board roles a user can attach\n * to a creature. Mirrors the `reference_photos.kind` field accepted by\n * `backend/src/routes/creatures.ts` (the route accepts open strings; this SDK\n * type narrows to the 6 canonical roles surfaced by the Studio). `other` is\n * the free-form bucket.\n */\nexport type CreatureReferencePhotoKind =\n | \"front\"\n | \"side\"\n | \"detail\"\n | \"context\"\n | \"moodBoard\"\n | \"other\"\n\nexport interface CreatureReferencePhoto {\n url: string\n kind: CreatureReferencePhotoKind\n}\n\n/**\n * A creature record returned by Nodaro's REST API. Mirrors the camelCase\n * shape produced by `backend/src/routes/creatures.ts::toCamel()`.\n *\n * Asset buckets (`angles`, `poses`, `variations`, `motionClips`) are\n * independent JSONB arrays keyed by a human-readable variant name (e.g.\n * `\"front\"`, `\"walking\"`, `\"scarred\"`). Each entry's `url` points at an\n * R2-hosted asset.\n *\n * Creature delta vs object:\n * - `species` — free-text creature type (e.g. `\"dragon\"`, `\"wolf\"`). This is\n * the subject of the establishing-shot prompt and the primary creature\n * differentiator (object has no equivalent).\n * - `poses` (where object has `materials`) — the pose-variant asset bucket.\n * - `category` is free-text (NOT object's fixed 10-value enum) — a creature\n * can be any animal/type.\n *\n * Identity-foundation fields:\n * - `referencePhotos` — caller-supplied mood-board refs (cap 20).\n * - `canonicalDescription` — ~80–120-word LLM-authored visual caption,\n * populated by `approveMainImage()` / `recaption()`. The wire still sends\n * `\"\"` on caption sub-failure, but `get()` normalizes `\"\"` → `null` so\n * consumers see the same `string | null` semantics as characters.\n * - `styleLock` — whether asset gens should anchor to the canonical style\n * captured at approval time. Defaults to `true` on new rows.\n */\nexport interface Creature {\n id: string\n userId: string\n nodeId: string\n projectId: string | null\n name: string\n description: string | null\n /** Free-text creature type/species (e.g. \"dragon\", \"wolf\") — the creature\n * delta vs object. `null` when unset. */\n species: string | null\n category: string | null\n style: string | null\n sourceImageUrl: string | null\n /** MODEL_CATALOG image-model id the main image was generated with (or `null`).\n * Set on create + editable via the update route. */\n imageProvider: string | null\n angles: Array<{ name: string; url: string }>\n poses: Array<{ name: string; url: string }>\n variations: Array<{ name: string; url: string }>\n motionClips: Array<{ name: string; url: string }>\n /** Named Creature Boards — dense reference sheets, one per variant/mood\n * (the `generate-image/creature-board` factory preset rendered from the\n * creature's images). A first-class bucket: community publish snapshots it\n * and clone hands the consumer their own copy to extend. Defaults to `[]`.\n * `type` marks an image-collage `\"identity\"` sheet vs a plain `\"looks\"`\n * board; `sourceImages` are the R2 URLs it was collaged from. Both optional\n * + backward-compatible (legacy boards have neither). */\n boards?: Array<{ name: string; url: string; type?: \"looks\" | \"identity\"; sourceImages?: string[] }> | null\n /** The creature's voice (the \"talking creature\" stack) — same shape and\n * flow as `Character[\"voice\"]`. `null` when no voice is selected. */\n voice?: CreatureVoice | null\n referencePhotos: CreatureReferencePhoto[]\n /** `null` when no caption is set (or the LLM caption sub-failed) — the wire\n * sends `\"\"`, normalized to `null` in `get()` to match character semantics. */\n canonicalDescription: string | null\n styleLock: boolean\n /** The user's chosen DEFAULT asset take per variant (Studio version history).\n * OPAQUE map: key `\"<bucket>:<variant>\"` (e.g. `\"angles:front\"`) → the chosen\n * asset URL (one already present in that bucket). Stored verbatim — keys are\n * NOT normalized; soft-capped server-side at 200 keys / 2048-char values\n * (overflow dropped silently). Defaults to `{}`. */\n selectedAssetByVariant?: Record<string, string> | null\n /** Nodaro Keepers: whether this row is on the shared shelf (`client.keepers`).\n * Admin-set through `setCatalog`; `false` on everyone else's rows and on\n * every copy. Optional on the read surface for older servers. */\n catalog?: boolean\n /** The shelf order (lowest first); `0` when never set. */\n catalogSort?: number\n /** The shelf heading, or `null`. */\n catalogCategory?: string | null\n deletedAt: string | null\n createdAt: string\n updatedAt: string\n}\n\n/**\n * GET /v1/creatures/:id may append a `pendingJobs` bucket the studio uses to\n * rehydrate spinners after a reload. Optional on the SDK surface — it doesn't\n * appear on `list()` rows.\n */\nexport interface CreatureDetail extends Creature {\n pendingJobs?: Array<{\n jobId: string\n assetType: string\n name: string\n status: string\n }>\n}\n\n/**\n * Body for `client.creatures.create()`. Mirrors the INSERT branch of\n * `upsertCreatureBody` in `backend/src/routes/creatures.ts`. `name` + `nodeId`\n * are required on create.\n */\nexport interface CreateCreatureInput {\n nodeId: string\n name: string\n description?: string\n /** Free-text creature type/species (the creature delta vs object). */\n species?: string\n /** Free-text category (NOT object's fixed enum — a creature can be anything). */\n category?: string\n style?: string\n workflowId?: string\n projectId?: string\n sourceImageUrl?: string\n /** Persistent image-model id (a MODEL_CATALOG image model). Validated\n * server-side — unknown / non-image / \"\" is stored as `null`. */\n imageProvider?: string | null\n referencePhotos?: CreatureReferencePhoto[]\n canonicalDescription?: string\n styleLock?: boolean\n /** The user's chosen DEFAULT asset take per variant. OPAQUE\n * `\"<bucket>:<variant>\"` → chosen-URL map; a write REPLACES the whole map.\n * Keys stored verbatim; soft-capped server-side at 200 keys / 2048-char values. */\n selectedAssetByVariant?: Record<string, string>\n /** Initial voice selection (see `CreatureVoice`). Omit for a voiceless creature. */\n voice?: CreatureVoice | null\n}\n\n/**\n * Body for `client.creatures.update()`. Mirrors the UPDATE branch of\n * `upsertCreatureBody` in `backend/src/routes/creatures.ts`.\n *\n * Worker-owned asset buckets (`angles` / `poses` / `variations` /\n * `motionClips`) are deliberately omitted — the route drops them on UPDATE\n * so a Studio auto-save with a stale snapshot cannot clobber the worker's\n * atomic `append_creature_asset()` writes.\n *\n * `expectedUpdatedAt` is the optimistic-concurrency token: when present, the\n * UPDATE only succeeds if the row's `updated_at` still matches; on mismatch\n * the route returns 409 so the studio can re-fetch + merge.\n */\nexport interface UpdateCreatureInput {\n name?: string\n description?: string\n /** Free-text creature type/species (the creature delta vs object). */\n species?: string\n category?: string\n style?: string\n sourceImageUrl?: string\n /** Persistent image-model id (a MODEL_CATALOG image model). Validated\n * server-side — unknown / non-image / \"\" is stored as `null`. */\n imageProvider?: string | null\n referencePhotos?: CreatureReferencePhoto[]\n canonicalDescription?: string\n styleLock?: boolean\n /** The user's chosen DEFAULT asset take per variant. OPAQUE\n * `\"<bucket>:<variant>\"` → chosen-URL map; a write REPLACES the whole map\n * (omit to leave untouched). Keys stored verbatim; soft-capped server-side\n * at 200 keys / 2048-char values. */\n selectedAssetByVariant?: Record<string, string>\n /** Named Creature Boards (see `Creature.boards`) — whole-array replace,\n * USER-owned (unlike the worker-owned buckets it flows through UPDATE).\n * Server caps: 24 boards, 200-char names, 30 sourceImages per board. */\n boards?: Array<{ name: string; url: string; type?: \"looks\" | \"identity\"; sourceImages?: string[] }>\n /** Voice selection (see `CreatureVoice`) — whole-object replace; pass\n * `null` to clear the voice, omit to leave untouched. */\n voice?: CreatureVoice | null\n expectedUpdatedAt?: string\n}\n\nexport interface UpdateCreatureResult {\n id: string\n updatedAt: string\n}\n\n/**\n * Combined create + update body (parameter for both branches). Exported for\n * callers that want to drive a single `upsert` flow without picking between\n * `Create*` and `Update*`. Mirrors the `upsertCreatureBody` Zod schema in\n * `backend/src/routes/creatures.ts`. `nodeId` + `name` are required on INSERT;\n * `id` flips the route into UPDATE mode.\n */\nexport interface UpsertCreatureInput extends CreateCreatureInput {\n id?: string\n expectedUpdatedAt?: string\n}\n\nexport type UpsertCreatureResult = { id: string } | UpdateCreatureResult\n\nexport interface ListCreaturesParams {\n /** When true, return archived creatures instead of active ones. */\n archived?: boolean\n /** Optional project filter — server-scoped to the caller's user. */\n projectId?: string\n /**\n * Search words: only the creatures whose name or description contains\n * every word (split on spaces, the first 5), in any order, ignoring case.\n * Each word is matched as written (`%`, `_` and `*` are not wildcards;\n * punctuation is kept); blank means no search; up to 200 characters.\n * Combines with the other filters and with `cursor` paging.\n */\n q?: string\n /**\n * Max rows to return (cap 500). OPT-IN: omitted, the server returns the\n * full legacy listing with no `nextCursor`; supplied, the response is one\n * page plus `nextCursor` — keep passing it back until it is `null`.\n */\n limit?: number\n /** Opaque cursor from a prior page's `nextCursor` (fetches the next page). */\n cursor?: string\n}\n\n/**\n * Input for `client.creatures.generate()` — fires the\n * `POST /v1/generate-creature` route. Produces 1–10 candidate\n * main images; each lands as one `jobs` row in `pending` state and is then\n * enqueued for the worker.\n *\n * When `attachToCreatureId` is set AND `count === 1`, the worker writes the\n * resulting URL directly to `creatures.source_image_url` on completion —\n * caller doesn't need a separate `approveMainImage` call. Multi-candidate\n * batches MUST go through explicit approval so the user picks the winner.\n *\n * `seedPromptHint` flows the parameter-picker's prompt fragment through to the\n * worker so a catalog selection (e.g. \"armored frost dragon\") gets appended to\n * the generated prompt context.\n */\nexport interface GenerateCreatureInput extends GenerationSessionParams {\n name: string\n description?: string\n userPrompt?: string\n /** Free-text creature type/species (the creature delta vs object). */\n species?: string\n category?: string\n style?: \"realistic\" | \"anime\" | \"3d-pixar\" | \"illustration\"\n sourceImageUrl?: string\n provider?: string\n /** Number of candidate images to generate (1–10; server-validated). */\n count?: number\n /** Auto-attach the result to this creature row (single-candidate only). */\n attachToCreatureId?: string\n /** Parameter-picker prompt-fragment pass-through. */\n seedPromptHint?: string\n /**\n * What the creature is, as picker-catalog ids ({@link Subject} — `animal`\n * above all; the same type and bounds as `generateImage`'s). The platform\n * writes the wording and folds it into the prompt after `description`, so\n * send ids rather than phrasing a pick yourself.\n */\n subject?: Subject\n /** Optional name to set on the attached row alongside the main image. */\n attachName?: string\n /** Optimistic-concurrency token for the single-candidate auto-attach path. */\n expectedUpdatedAt?: string\n}\n\n/**\n * `generate()` response — `jobIds` is ALWAYS present (the harmonized contract,\n * matching characters). `jobId` is a deprecated back-compat alias populated only\n * on `count === 1`; prefer `jobIds`. (Will be removed on the next major.)\n */\nexport interface GenerateCreatureResult {\n jobIds: string[]\n /** @deprecated count===1 back-compat alias — use `jobIds`. */\n jobId?: string\n}\n\n/**\n * Input for `client.creatures.generateAsset()` — fires the\n * `POST /v1/generate-creature-asset` route. Produces a single\n * angles / poses / variations / custom variant.\n *\n * When all three studio-path fields are set (`attachToCreatureId` +\n * `attachToColumn` + `attachName`), the worker appends\n * `{ name: attachName, url: <result> }` to the named JSONB array column on\n * the user's creature row on completion. `attachToColumn` is REQUIRED for\n * `assetType === \"custom\"` — the worker can't infer the bucket from the\n * asset type.\n */\nexport interface GenerateCreatureAssetInput extends GenerationSessionParams {\n assetType: CreatureAssetType\n variant: string\n name: string\n description?: string\n userPrompt?: string\n category?: string\n style?: string\n sourceImageUrl?: string\n provider?: string\n attachToCreatureId?: string\n attachToColumn?: CreatureAttachColumn\n attachName?: string\n /** Parameter-picker prompt-fragment pass-through. */\n seedPromptHint?: string\n}\n\nexport interface GenerateCreatureAssetResult {\n jobId: string\n}\n\n/**\n * Input for `client.creatures.generateMotion()` — fires the\n * `POST /v1/generate-creature-motion` route. Produces a single motion clip\n * (idle, prowl, attack, etc.) animated FROM a static creature-shot image.\n *\n * Mirrors `client.objects.generateMotion()` — the creature motion route reuses\n * the entity-agnostic object motion helpers server-side. The route hardcodes\n * the attach column to `motion_clips` — callers supply `attachToCreatureId` +\n * `attachName` only.\n *\n * `sourceImageUrl` is REQUIRED — image-to-video needs a source frame and the\n * route has no fallback (the studio path supplies the canonical creature-shot\n * URL explicitly).\n *\n * Defaults vs location:\n * - `provider` defaults to `\"kling-turbo\"` (not location's `\"kling\"`)\n * - `aspectRatio` defaults to `\"1:1\"` server-side via\n * `resolveObjectAspectRatio({ assetType: \"motion\" })` — creatures use\n * centered reference framing, not cinematic establishing shots.\n *\n * When the studio path is set (`attachToCreatureId` + `attachName`), the\n * worker appends `{ name: attachName, url: <result> }` to the creature row's\n * `motion_clips` JSONB column on completion.\n */\nexport interface GenerateCreatureMotionInput extends GenerationSessionParams {\n motionPrompt: string\n sourceImageUrl: string\n provider?: string\n name: string\n category?: string\n style?: \"realistic\" | \"anime\" | \"3d-pixar\" | \"illustration\"\n canonicalDescription?: string\n /** Parameter-picker prompt-fragment pass-through. */\n seedPromptHint?: string\n attachToCreatureId?: string\n attachName?: string\n /**\n * Optional aspect ratio override. Defaults to 1:1 server-side. One of the\n * 5-value `CreatureAspectRatio` union (1:1 / 3:4 / 16:9 / 9:16 / 4:3) — the\n * creature route reuses the object aspect enum.\n */\n aspectRatio?: ObjectAspectRatio\n /**\n * Optional clip duration in seconds. Validated server-side against the chosen\n * provider's allowed durations (e.g. kling 5/10, wan-i2v 5/10/15); omitted →\n * the model's own default (no behavior change). Mirrors generate-video's\n * per-model i2v duration lever.\n */\n duration?: number\n}\n\nexport interface GenerateCreatureMotionResult {\n jobId: string\n}\n\nexport interface ApproveCreatureMainImageResult {\n sourceImageUrl: string\n /**\n * LLM-authored caption. `null` when the LLM caption sub-failed — the wire\n * sends `\"\"`, normalized to `null` here so consumers see the same\n * `string | null` semantics as characters. The main image is still set; call\n * `recaption()` to retry.\n */\n canonicalDescription: string | null\n}\n\nexport interface RecaptionCreatureResult {\n canonicalDescription: string\n}\n\nexport class CreaturesResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * List the caller's creatures. By default returns active creatures only;\n * pass `archived: true` to fetch soft-deleted rows for an \"archive\" view.\n * Optional `projectId` scopes the result to a single project; `q` keeps the\n * creatures whose name or description contains it.\n */\n list(params: ListCreaturesParams = {}): Promise<{ creatures: Creature[]; nextCursor?: string | null }> {\n const query: Record<string, string | undefined> = {}\n if (params.archived) query.archived = \"true\"\n if (params.projectId) query.projectId = params.projectId\n if (params.q) query.q = params.q\n if (params.limit !== undefined) query.limit = String(params.limit)\n if (params.cursor) query.cursor = params.cursor\n return this.client.request(\"GET\", \"/v1/creatures\", { query })\n }\n\n /**\n * Convenience wrapper for `list({ archived: true })`. Returns soft-deleted\n * rows so callers can drive a UI \"Archived\" tab without re-encoding the\n * query param.\n *\n * `archived` is omitted from the param type — it's always set to `true` here.\n */\n listArchived(params: Omit<ListCreaturesParams, \"archived\"> = {}): Promise<{ creatures: Creature[]; nextCursor?: string | null }> {\n return this.list({ ...params, archived: true })\n }\n\n /**\n * Fetch a single creature including in-flight asset job state. Soft-deleted\n * (archived) rows are NOT returned by id — the route enforces\n * `deleted_at IS NULL` so archived creatures 404 (uniform \"not_found\" — does\n * not leak the deleted vs non-existent distinction).\n */\n async get(id: string): Promise<CreatureDetail> {\n const res = await this.client.request<CreatureDetail>(\n \"GET\",\n `/v1/creatures/${encodeURIComponent(id)}`,\n )\n // Normalize the wire `\"\"` caption (DB null / LLM sub-failure) → null so\n // consumers see the same `string | null` semantics as characters. New\n // object — never mutate the response.\n return { ...res, canonicalDescription: res.canonicalDescription || null }\n }\n\n /**\n * Create a new creature. `name` + `nodeId` are required — the route 400s\n * otherwise. Returns the new row's id.\n *\n * Note: the underlying route is the same `POST /v1/creatures` upsert that\n * powers `update()`. This convenience wrapper enforces the INSERT-required\n * fields at the type level and never sends an `id`.\n */\n create(data: CreateCreatureInput): Promise<{ id: string }> {\n return this.client.request(\"POST\", \"/v1/creatures\", { body: data })\n }\n\n /**\n * Update a creature. Only the fields you pass are written — undefined keys\n * are NOT touched on the row. Worker-owned asset buckets are intentionally\n * not exposed on this surface (see `UpdateCreatureInput` for the rationale).\n *\n * Optimistic-concurrency: pass `expectedUpdatedAt` to require the row's\n * `updated_at` still matches; on mismatch the route returns 409\n * `concurrent_modification` carrying the fresh `updatedAt`. The SDK\n * surfaces that as a generic `NodaroError` with the same code.\n */\n update(id: string, data: UpdateCreatureInput): Promise<UpdateCreatureResult> {\n return this.client.request(\"POST\", \"/v1/creatures\", {\n body: { id, ...data },\n })\n }\n\n /**\n * Soft-delete (archive) a creature. The row is hidden from `list()` by\n * default but recoverable via `restore(id)` or visible under\n * `listArchived()`. Idempotent — repeating a delete on an already-archived\n * row is a no-op.\n */\n delete(id: string): Promise<{ success: true; archived: true }> {\n return this.client.request(\"DELETE\", `/v1/creatures/${encodeURIComponent(id)}`)\n }\n\n /**\n * Hard-delete (permanent) a creature — the row + every R2 asset it\n * references. Archived rows ONLY: active creatures return 400 `not_archived`.\n * Call `delete()` first to archive, then `permanentDelete()` to destroy.\n *\n * Mirrors the `app_runs` permanent-delete pattern (archive-first) so a\n * stray SDK / curl caller cannot bypass the studio's archive-first UI\n * flow.\n */\n permanentDelete(id: string): Promise<{ success: true; permanent: true }> {\n return this.client.request(\"DELETE\", `/v1/creatures/${encodeURIComponent(id)}`, {\n query: { permanent: \"true\" },\n })\n }\n\n /**\n * Un-archive a creature. If the original name now collides (case-\n * insensitive) with an active row, the server auto-suffixes \"(restored)\"\n * and returns the effective name.\n */\n restore(id: string): Promise<{ id: string; name: string }> {\n return this.client.request(\"POST\", `/v1/creatures/${encodeURIComponent(id)}/restore`)\n }\n\n /**\n * Admin only: put one of your own creatures on the shared Nodaro Keepers\n * shelf (`client.keepers.catalog()`), or take it off. A first-party session\n * or your personal token; `forbidden` for anyone who is not a platform\n * admin, `not_found` for a row that is not yours.\n */\n setCatalog(id: string, input: SetKeeperCatalogInput): Promise<SetKeeperCatalogResult> {\n return this.client.request(\"PUT\", `/v1/creatures/${encodeURIComponent(id)}/catalog`, { body: input })\n }\n\n /**\n * Fire `POST /v1/generate-creature` to produce one or more candidate main\n * images. With `count > 1`, all jobs are reserved up-front before any\n * is enqueued — mid-batch failures roll back atomically.\n *\n * When `attachToCreatureId` is set AND `count === 1`, the worker writes\n * the result directly to the row's `source_image_url`; otherwise you must\n * call `approveMainImage()` after picking a candidate.\n */\n async generate(data: GenerateCreatureInput): Promise<GenerateCreatureResult> {\n const res = await this.client.request<{ jobId?: string; jobIds?: string[] }>(\n \"POST\", \"/v1/generate-creature\", { body: data },\n )\n // Tolerate the legacy `{ jobId }`-only shape (older server): synthesize jobIds.\n const jobIds = res.jobIds ?? (res.jobId ? [res.jobId] : [])\n return res.jobId ? { jobIds, jobId: res.jobId } : { jobIds }\n }\n\n /**\n * Fire `POST /v1/generate-creature-asset` to produce a single variant.\n * When the studio path is set (`attachToCreatureId` + `attachToColumn` +\n * `attachName`), the worker appends `{ name: attachName, url: <result> }`\n * to the named JSONB array column on completion.\n *\n * Note: `attachToColumn` is REQUIRED for `assetType === \"custom\"` — the\n * worker can't infer the bucket from the asset type. For canonical asset\n * types (`angles` / `poses` / `variations`), the column is derived\n * automatically by the route.\n */\n generateAsset(\n data: GenerateCreatureAssetInput,\n ): Promise<GenerateCreatureAssetResult> {\n return this.client.request(\"POST\", \"/v1/generate-creature-asset\", { body: data })\n }\n\n /**\n * Fire `POST /v1/generate-creature-motion` to animate the creature's main\n * image into a motion clip. Image-to-video, single clip per call; the\n * attach column is hardcoded to `motion_clips` server-side (creatures have a\n * single motion bucket so the caller doesn't supply `attachToColumn`).\n * When the studio path is set (`attachToCreatureId` + `attachName`), the\n * worker appends `{ name: attachName, url: <result> }` to the row's\n * `motion_clips` column on completion.\n *\n * Defaults: `provider` → `\"kling-turbo\"`, `aspectRatio` → `\"1:1\"` (set\n * server-side via `resolveObjectAspectRatio({ assetType: \"motion\" })`).\n */\n generateMotion(\n data: GenerateCreatureMotionInput,\n ): Promise<GenerateCreatureMotionResult> {\n return this.client.request(\"POST\", \"/v1/generate-creature-motion\", { body: data })\n }\n\n /**\n * Approve a completed `generate-creature` job as the creature's main image.\n * Sets `source_image_url` and fires the LLM caption (Claude Sonnet vision)\n * inline. Returns the new main-image URL plus the caption.\n *\n * Caption-failure semantics: the route still sends `\"\"` on LLM sub-failure,\n * but the SDK normalizes `\"\"` → `null` here so `canonicalDescription` carries\n * the same `string | null` semantics as characters. The main image is still\n * set; call `recaption()` to retry.\n *\n * Optimistic-concurrency: pass `expectedUpdatedAt` to gate the update on\n * the row's current `updated_at`; on mismatch the route returns 409\n * `concurrent_modification` carrying the fresh token.\n */\n async approveMainImage(\n id: string,\n candidateJobId: string,\n expectedUpdatedAt?: string,\n ): Promise<ApproveCreatureMainImageResult> {\n const res = await this.client.request<{ sourceImageUrl: string; canonicalDescription: string | null }>(\n \"POST\",\n `/v1/creatures/${encodeURIComponent(id)}/approve-main-image`,\n { body: { candidateJobId, expectedUpdatedAt } },\n )\n // Normalize the wire `\"\"` (LLM sub-failure) → null; build a new object\n // rather than mutating the response.\n return { sourceImageUrl: res.sourceImageUrl, canonicalDescription: res.canonicalDescription || null }\n }\n\n /**\n * Re-fire the LLM caption against the creature's current main image. 502s\n * on LLM failure (unlike `approveMainImage` which preserves the side-effect\n * and returns \"\"); returns 400 `main_image_required` if no main image is\n * set yet.\n *\n * The route is a pure idempotent retry — it does NOT accept an\n * `expectedUpdatedAt` token (backend route is idempotent retry, not gated on\n * optimistic-concurrency).\n */\n recaption(id: string): Promise<RecaptionCreatureResult> {\n return this.client.request(\n \"POST\",\n `/v1/creatures/${encodeURIComponent(id)}/llm-caption`,\n )\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var nodes = require('@nodaro/shared/nodes');
4
+
5
+ // src/entries/nodes.ts
6
+
7
+ // src/resources/nodes-video-params.ts
8
+ function isVideoToVideoRemakeQuote(result) {
9
+ return !!result && typeof result === "object" && result.quoteOnly === true && "videoRemake" in result;
10
+ }
11
+
12
+ Object.defineProperty(exports, "PROMPT_PREFIX_KEY", {
13
+ enumerable: true,
14
+ get: function () { return nodes.PROMPT_PREFIX_KEY; }
15
+ });
16
+ Object.defineProperty(exports, "PROMPT_SUFFIX_KEY", {
17
+ enumerable: true,
18
+ get: function () { return nodes.PROMPT_SUFFIX_KEY; }
19
+ });
20
+ exports.isVideoToVideoRemakeQuote = isVideoToVideoRemakeQuote;
21
+ //# sourceMappingURL=chunk-5QNCWXKG.cjs.map
22
+ //# sourceMappingURL=chunk-5QNCWXKG.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resources/nodes-video-params.ts"],"names":[],"mappings":";;;;;;;AAyIO,SAAS,0BAA0B,MAAA,EAAoD;AAC5F,EAAA,OAAO,CAAC,CAAC,MAAA,IAAU,OAAO,WAAW,QAAA,IAAa,MAAA,CAAmC,SAAA,KAAc,IAAA,IAAQ,aAAA,IAAiB,MAAA;AAC9H","file":"chunk-5QNCWXKG.cjs","sourcesContent":["import type { VideoToVideoNodeProvider } from \"@nodaro/shared/models\"\nimport type { GenerationSessionParams } from \"./nodes.js\"\nimport type { VideoRemakeEngine, VideoRemakeEstimate, VideoRemakeParams } from \"./cast-swap.js\"\n\n/**\n * Typed request body for `nodes.run(\"video-to-video\", …)` / `runAndWait` /\n * `quote` — `POST /v1/video-to-video`: edit an existing clip by instruction.\n * Video Remake (`client.videoRemake`, Nodaro Cloud) is the recommended way to\n * edit, modify, restyle or transfer the motion of a clip: it keeps the clip's\n * motion, camera and timing and changes what you ask. Its two engines are\n * named choices here too ({@link VideoToVideoRemakeParams}), which answer its\n * quote and start nothing. Mirrors the route's body; fields a model does not\n * use are ignored by that model.\n */\nexport interface VideoToVideoParams extends GenerationSessionParams {\n /** The clip to change. */\n videoUrl: string\n /** What to change. On `seedance-2-5` it is an edit instruction (\"make it\n * black and white\"); the platform frames it as an edit of the clip. */\n prompt?: string\n /** The person's own words, kept for the record when `prompt` was rewritten. */\n userPrompt?: string\n /** Default `\"seedance-2-5\"`, which edits the whole clip by instruction (it\n * needs a `prompt` and a 4–30 s clip) and is priced by the clip's length\n * (see `nodes.quote`). `wan` / `wan-flash` do not edit the clip: they make a\n * new clip featuring its subject. The platform tells Seedance the run is\n * an edit when every clip (`videoUrl` and `referenceVideoUrls`) is 4–30 s\n * long (a draft included), so this lane takes no `referenceTaskType` of its own. */\n provider?: VideoToVideoNodeProvider\n /** Wan / Wan Flash. A Seedance edit ignores it: the result keeps the source\n * clip's own length. */\n duration?: \"5\" | \"10\"\n /** `480p` is Seedance only. A request naming neither a `provider` nor a\n * `resolution` renders at 480p; one naming `seedance-2-5` and no resolution\n * renders at 720p. */\n resolution?: \"480p\" | \"720p\" | \"1080p\"\n /** Native audio: Wan Flash's audio track, Seedance's generated sound. */\n audio?: boolean\n /** Wan Flash multi-shot. */\n multiShots?: boolean\n /** Runway Aleph output ratio. */\n aspectRatio?: \"16:9\" | \"9:16\" | \"4:3\" | \"3:4\" | \"1:1\" | \"21:9\"\n seed?: number\n /** One image the edit can refer to (Seedance: `@image_1`). */\n referenceImageUrl?: string\n negativePrompt?: string\n /** Wan Video Edit: seconds of the source to edit (`\"0\"` = the whole clip). */\n videoEditDuration?: \"0\" | \"5\" | \"10\"\n /** Wan Video Edit: keep the source audio (`\"origin\"`) or let the model decide. */\n audioSetting?: \"auto\" | \"origin\"\n promptExtend?: boolean\n /** Seedance 2.5 only: a 480p draft, finalized later with `video-upscale`. */\n draft?: boolean\n /**\n * Seedance edit only (refused on other models): more images the edit can use.\n * They follow `referenceImageUrl` when it is sent, so with it they are\n * `{image:2}`, `{image:3}`, …, without it `{image:1}`, `{image:2}`, ….\n * The model's cap applies (30 images on `seedance-2-5`, 10 on `seedance-2-5-flash`, where a request over the cap is refused).\n */\n referenceImageUrls?: string[]\n /**\n * Seedance edit only (refused on other models): extra clips the edit can use.\n * Do not repeat `videoUrl` here: the source clip is `{video:1}`, these are\n * `{video:2}`, `{video:3}`, …. The source counts toward the model's cap\n * (10 clips on `seedance-2-5`, 5 on `seedance-2-5-flash`), and every clip's length is priced.\n */\n referenceVideoUrls?: string[]\n /**\n * Seedance edit only (refused on other models): audio the edit can use,\n * `{audio:1}`, `{audio:2}`, …. The model's cap applies (10 on `seedance-2-5`, 5 on `seedance-2-5-flash`).\n */\n referenceAudioUrls?: string[]\n [k: string]: unknown\n}\n\n/**\n * `nodes.run(\"video-to-video\", …)` / `nodes.quote` with a Video Remake engine\n * as the `provider` (`\"nodaro-prism\"`, `\"nodaro-pulse\"`; Nodaro Cloud). The\n * route starts NOTHING for these two: `run` resolves a\n * {@link VideoToVideoRemakeQuote}, Video Remake's price for the clip and the\n * instruction, with the request that runs it on `client.videoRemake.run`.\n *\n * Video Remake reads `videoUrl`, `prompt` (its instruction, the run's\n * `postPrompt`), `resolution` and `draft`. Every other Video to Video lever\n * (`duration`, `aspectRatio`, `seed`, `audio`, `multiShots`, …) does not apply\n * and is dropped; a reference list (`referenceImageUrl`, `referenceImageUrls`,\n * `referenceVideoUrls`, `referenceAudioUrls`) is refused with a 400: Video\n * Remake takes pictures as roles and fixed references on its own route.\n * Refusals: 404 `not_available` (a deployment without Video Remake), 403\n * `node_not_available` / `model_not_available`, 503 `engine_unavailable`, and\n * Video Remake's own (a clip outside 4–30 s, and the rest of its estimate's).\n */\nexport interface VideoToVideoRemakeParams {\n /** The clip to change, 4–30 seconds. */\n videoUrl: string\n /** What to change, in your own words. Required. */\n prompt: string\n /** The Video Remake engine, by its public id. */\n provider: VideoRemakeEngine\n /** Nodaro Prism: 480p (its default), 720p or 1080p. Nodaro Pulse: 720p (its default) or 1080p. */\n resolution?: \"480p\" | \"720p\" | \"1080p\"\n /** Nodaro Prism only: a 480p draft that Full Quality can finish at 1080p. */\n draft?: boolean\n [k: string]: unknown\n}\n\n/** The `client.videoRemake.run` body that runs a {@link VideoToVideoRemakeQuote}: the clip, the instruction, no role. */\nexport type VideoToVideoRemakeRun = Pick<VideoRemakeParams, \"videoUrl\" | \"roles\" | \"postPrompt\" | \"resolution\" | \"draft\"> & {\n roles: []\n postPrompt: string\n engine: VideoRemakeEngine\n}\n\n/**\n * What `POST /v1/video-to-video` answers for a Video Remake engine: a QUOTE,\n * never a started job. There is no `jobId`; `quoteOnly` is always `true`.\n * Nothing was held or charged. To run it:\n * `client.videoRemake.run(result.videoRemake.run.body)`.\n */\nexport interface VideoToVideoRemakeQuote {\n readonly quoteOnly: true\n /** The same, in words. */\n readonly message: string\n readonly videoRemake: {\n /** Video Remake's quote for this clip and instruction: `totalCredits` is the hold, `expectedCredits` the expected charge. */\n readonly quote: Omit<VideoRemakeEstimate, \"engine\" | \"maskingCredits\"> & {\n readonly engine: VideoRemakeEngine\n /** The engine's name, as people read it (\"Nodaro Prism\", \"Nodaro Pulse\"). */\n readonly engineName: string\n }\n /** The request that runs it. */\n readonly run: { readonly method: \"POST\"; readonly path: \"/v1/video-remake\"; readonly body: VideoToVideoRemakeRun }\n }\n readonly jobId?: never\n}\n\n/** Whether a `nodes.run(\"video-to-video\", …)` answer is a Video Remake quote (nothing started) rather than a job. */\nexport function isVideoToVideoRemakeQuote(result: unknown): result is VideoToVideoRemakeQuote {\n return !!result && typeof result === \"object\" && (result as { quoteOnly?: unknown }).quoteOnly === true && \"videoRemake\" in result\n}\n\n/** One way the platform shaped the price — shown so a client can explain it. */\nexport interface QuoteAdjustment {\n /** Stable code, e.g. `ref_video_length`, `extra_reference_images`,\n * `loop_trim_addon`, `voiced_audio_addon`, `params_adjusted`,\n * `output_size` (priced by the output's size), `max_images` (priced as the\n * most images the run can return). */\n readonly code: string\n readonly message: string\n /** Credits this adjustment adds to `reserve`, when it is a separate amount. */\n readonly credits?: number\n}\n\n/** Something the caller should know before running. */\nexport interface QuoteWarning {\n /** Stable code, e.g. `ref_video_unmeasured`, `image_size_unmeasured`,\n * `settles_to_actual` (`reserve` is the most the run can cost: it is\n * charged for what it delivers and the rest is refunded). */\n readonly code: string\n readonly message: string\n}\n\n/**\n * The price of a run before it starts — `POST /v1/quote`. Computed by the same\n * code the run route reserves with, on the same body: nothing is started and\n * nothing is charged.\n */\nexport interface NodeQuote {\n /** The price id the run is charged under. */\n readonly identifier: string\n /** Credits the run reserves when it starts. */\n readonly reserve: number\n /**\n * Credits the run is expected to cost, when that differs from `reserve` and\n * can be worked out from the measured inputs (a Seedance edit renders the\n * source clip's length, not the longest tier). The run settles to what was\n * actually generated and never above `reserve`.\n */\n readonly expected?: number\n readonly adjustments: readonly QuoteAdjustment[]\n readonly warnings: readonly QuoteWarning[]\n}\n"]}
@@ -34,12 +34,63 @@ var VideoRemakeResource = class {
34
34
  * art style alone is refused, and one with a pre or post prompt runs as any
35
35
  * other art-style run. Its `preciseArtStyle` says, per engine, whether a
36
36
  * Precise run takes an art style there too, and its `preciseArtStyleAlone`
37
- * whether that art style alone is the run's change.
37
+ * whether that art style alone is the run's change. Its `customStyle` says,
38
+ * per engine, whether a run takes the style in your own words there
39
+ * (`direction: { customStyle }`, and {@link describeStyle}).
38
40
  * Public (no sign-in needed); the answer may be up to a minute old.
39
41
  */
40
42
  styleChoice() {
41
43
  return this.client.request("GET", "/v1/video-remake/style-choice");
42
44
  }
45
+ /**
46
+ * Whether the Video Remake page shows its Advanced options
47
+ * (`GET /v1/video-remake/advanced`): `show` is `true` where the page offers
48
+ * `prepareReferences` and `prePrompt`, and `false` until Nodaro turns them
49
+ * on. One answer for the whole page, whatever the engine, so an app built
50
+ * on the SDK can show or hide the same options. It describes the page only:
51
+ * {@link run} and {@link estimate} take both fields as sent, whatever it
52
+ * answers.
53
+ * Public (no sign-in needed); the answer may be up to a minute old.
54
+ */
55
+ advanced() {
56
+ return this.client.request("GET", "/v1/video-remake/advanced");
57
+ }
58
+ /**
59
+ * Put an image's visual style into words
60
+ * (`POST /v1/video-remake/describe-style`): `text` describes how the image
61
+ * is made and how it looks (the medium, line, colour, lighting and
62
+ * texture), never who or what it shows, ready to show, edit and send as a
63
+ * run's `direction: { customStyle: text }`. With `note`, a wish about the
64
+ * style is folded in ("like this, but darker"). Free: it starts no job and
65
+ * charges nothing, and nothing of the image is kept. Needs a signed-in
66
+ * account, and is limited to 10 calls a minute per account. Only where
67
+ * {@link styleChoice} answers `customStyle` true (403
68
+ * `custom_style_not_available` elsewhere). Refusals:
69
+ * {@link VideoRemakeCustomStyleRefusalCode}.
70
+ */
71
+ describeStyle(params) {
72
+ const body = { imageUrl: params.imageUrl, ...params.note !== void 0 ? { note: params.note } : {} };
73
+ return this.client.request("POST", "/v1/video-remake/describe-style", { body });
74
+ }
75
+ /**
76
+ * The art styles Video Remake's art style picker offers
77
+ * (`GET /v1/video-remake/art-styles`), in the picker's order: each with its
78
+ * `id` (a run's `direction.style`), its name in `locale` (a Nodaro language
79
+ * id such as `"he"`, `"ja"`, `"ko"` or `"pt-BR"`; English when left out,
80
+ * for a language Nodaro does not have, and for a style the language does
81
+ * not name) and its preview, a clip and a still cut from it. The list is
82
+ * empty where there is nothing to offer: a deployment that does not show
83
+ * Nodaro's previews, or one without Video Remake or its art styles. It
84
+ * lists what the picker shows; whether a run takes an art style on an
85
+ * engine is {@link styleChoice}'s to say.
86
+ * Public (no sign-in needed); the answer may be up to five minutes old.
87
+ */
88
+ async artStyles(params = {}) {
89
+ const query = {};
90
+ if (params.locale) query.locale = params.locale;
91
+ const res = await this.client.request("GET", "/v1/video-remake/art-styles", { query });
92
+ return res.data;
93
+ }
43
94
  /** Quote a run before starting it (`POST /v1/video-remake/estimate`); spends nothing. */
44
95
  async estimate(params) {
45
96
  const quote = await this.client.request("POST", "/v1/video-remake/estimate", { body: params });
@@ -78,5 +129,5 @@ var CastSwapResource = VideoRemakeResource;
78
129
 
79
130
  exports.CastSwapResource = CastSwapResource;
80
131
  exports.VideoRemakeResource = VideoRemakeResource;
81
- //# sourceMappingURL=chunk-IO7NEEZZ.cjs.map
82
- //# sourceMappingURL=chunk-IO7NEEZZ.cjs.map
132
+ //# sourceMappingURL=chunk-6BPQYCUG.cjs.map
133
+ //# sourceMappingURL=chunk-6BPQYCUG.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resources/cast-swap.ts"],"names":["nodaroMotionEngineFrom"],"mappings":";;;;;AA6uBO,IAAM,sBAAN,MAA0B;AAAA,EAC/B,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;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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-6BPQYCUG.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 * A custom style: `{ customStyle: \"<text>\" }` in place of `{ style }` gives\n * the style in your own words (see {@link VideoRemakeCustomStyleDirection}),\n * only where {@link VideoRemakeResource.styleChoice} answers `customStyle`\n * true for the engine. It goes wherever a catalog art style goes and counts\n * as the run's change wherever one does. Never both: send one of the two.\n */\n direction?: VideoRemakeArtStyleDirection | VideoRemakeCustomStyleDirection\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. */\n/** A run's art style from the catalog: a `style` picker id (see {@link VideoRemakeParams}'s `direction`). */\nexport interface VideoRemakeArtStyleDirection {\n style: string\n customStyle?: never\n}\n\n/**\n * A run's custom style: the visual style in your own words, in place of a\n * catalog art style. Describe the look only: the medium (drawn, 3D-rendered\n * or filmed), line, colour, lighting and texture; not who or what is in the\n * video. At most 600 characters, never blank. The words are used as written;\n * the run itself works out whether the style is drawn, rendered or filmed, at\n * no extra charge (the estimate is the same as for a catalog art style). The\n * job records the text as sent in `input_data.direction.customStyle`.\n * {@link VideoRemakeResource.describeStyle} writes such a text from an image.\n *\n * Nodaro Prism only, on a direct run, and only where\n * {@link VideoRemakeResource.styleChoice} answers `customStyle` true for the\n * engine. Refusals: {@link VideoRemakeCustomStyleRefusalCode}.\n */\nexport interface VideoRemakeCustomStyleDirection {\n customStyle: string\n style?: never\n}\n\n/**\n * The `code` of a refusal that concerns a custom style (`NodaroError.code`),\n * all before anything is charged.\n *\n * On {@link VideoRemakeResource.run} and {@link VideoRemakeResource.estimate}:\n * - `custom_style_with_art_style` (400): `direction` carries both `style` and\n * `customStyle`; send one;\n * - `custom_style_empty` (400): the text is blank, or nothing is left of it\n * once its curly braces are taken out;\n * - `custom_style_too_long` (400): more than 600 characters;\n * - `custom_style_not_available` (403): a custom style is not offered here\n * (see {@link VideoRemakeStyleChoice.customStyle}); choose a catalog art\n * style instead;\n * - `raw_reference_token` (400): the text holds `{image:…}`, `{video:…}` or\n * `{audio:…}`;\n * - `art_style_needs_prism` / `art_style_needs_flex` (400): where a catalog\n * art style could not go either (Nodaro Pulse, a trend run).\n *\n * On {@link VideoRemakeResource.describeStyle}:\n * - `unauthorized` (401): no authenticated user;\n * - `validation_error` (400), `unsafe_url` (400): the body, or an address that\n * is not a public http(s) one;\n * - `custom_style_not_available` (403): as above;\n * - `image_unreadable` (400): the image could not be fetched, is larger than\n * 10 MB, or is not a PNG, JPEG, WebP or GIF;\n * - `describe_style_failed` (502): the image could not be described just now;\n * try again;\n * - `style_not_described` (422): no style could be described from this image;\n * try another, or write the style yourself;\n * - `rate_limit_exceeded` (429): too many calls in a minute for this account.\n *\n * Open-ended: a code not listed here may still arrive.\n */\nexport type VideoRemakeCustomStyleRefusalCode =\n | \"custom_style_with_art_style\"\n | \"custom_style_empty\"\n | \"custom_style_too_long\"\n | \"custom_style_not_available\"\n | \"raw_reference_token\"\n | \"art_style_needs_prism\"\n | \"art_style_needs_flex\"\n | \"unauthorized\"\n | \"validation_error\"\n | \"unsafe_url\"\n | \"image_unreadable\"\n | \"describe_style_failed\"\n | \"style_not_described\"\n | \"rate_limit_exceeded\"\n | (string & {})\n\n/** What {@link VideoRemakeResource.describeStyle} takes. */\nexport interface VideoRemakeDescribeStyleParams {\n /** A public http(s) image (PNG, JPEG, WebP or GIF, at most 10 MB) whose visual style is put into words. */\n imageUrl: string\n /** A wish about the style, at most 600 characters (\"like this, but darker\"). */\n note?: string\n}\n\n/** The medium a described style reads as: drawn or painted, computer-rendered or modelled, or filmed. */\nexport type VideoRemakeStyleMedium = \"2d\" | \"3d\" | \"photo\"\n\n/** The tones a described style reads as. */\nexport type VideoRemakeStyleTones = \"colour\" | \"black-and-white\" | \"one-colour\"\n\n/** What {@link VideoRemakeResource.describeStyle} answers. */\nexport interface VideoRemakeDescribedStyle {\n /** The image's visual style in words (never its content), at most 600 characters: ready to edit and send as `direction.customStyle`. */\n text: string\n /** How the description reads, a hint for an interface only: a run works out its style's medium itself, from the words it is sent. */\n medium?: VideoRemakeStyleMedium\n /** As `medium`. */\n tones?: VideoRemakeStyleTones\n}\n\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 * Per engine, whether a direct run takes a custom style there: the style in\n * your own words (`direction: { customStyle }`, see\n * {@link VideoRemakeCustomStyleDirection}) in place of a catalog art style,\n * and {@link VideoRemakeResource.describeStyle} with it. `true` only where\n * the engine takes one and Nodaro offers it on this deployment. Nodaro\n * Pulse is always `false` (it takes no art style). Absent from an older\n * server, and an engine missing from it: `false` (offer the catalog's art\n * styles alone; a custom style sent anyway is refused).\n */\n customStyle?: 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\n/**\n * One art style of {@link VideoRemakeResource.artStyles}: a style Video\n * Remake's art style picker offers, with its preview.\n */\nexport interface VideoRemakeArtStyle {\n /** The style's id: what a run takes as `direction.style` (an id of the `style` picker catalog). */\n id: string\n /** The style's name in the language asked for; English where that language does not name it. */\n label: string\n /** A short clip of real footage wiping into the style (an absolute https address). */\n clipUrl: string\n /** A still frame cut from that clip (an absolute https address). */\n stillUrl: string\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. Its `customStyle` says,\n * per engine, whether a run takes the style in your own words there\n * (`direction: { customStyle }`, and {@link describeStyle}).\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 /**\n * Put an image's visual style into words\n * (`POST /v1/video-remake/describe-style`): `text` describes how the image\n * is made and how it looks (the medium, line, colour, lighting and\n * texture), never who or what it shows, ready to show, edit and send as a\n * run's `direction: { customStyle: text }`. With `note`, a wish about the\n * style is folded in (\"like this, but darker\"). Free: it starts no job and\n * charges nothing, and nothing of the image is kept. Needs a signed-in\n * account, and is limited to 10 calls a minute per account. Only where\n * {@link styleChoice} answers `customStyle` true (403\n * `custom_style_not_available` elsewhere). Refusals:\n * {@link VideoRemakeCustomStyleRefusalCode}.\n */\n describeStyle(params: VideoRemakeDescribeStyleParams): Promise<VideoRemakeDescribedStyle> {\n const body = { imageUrl: params.imageUrl, ...(params.note !== undefined ? { note: params.note } : {}) }\n return this.client.request(\"POST\", \"/v1/video-remake/describe-style\", { body })\n }\n\n /**\n * The art styles Video Remake's art style picker offers\n * (`GET /v1/video-remake/art-styles`), in the picker's order: each with its\n * `id` (a run's `direction.style`), its name in `locale` (a Nodaro language\n * id such as `\"he\"`, `\"ja\"`, `\"ko\"` or `\"pt-BR\"`; English when left out,\n * for a language Nodaro does not have, and for a style the language does\n * not name) and its preview, a clip and a still cut from it. The list is\n * empty where there is nothing to offer: a deployment that does not show\n * Nodaro's previews, or one without Video Remake or its art styles. It\n * lists what the picker shows; whether a run takes an art style on an\n * engine is {@link styleChoice}'s to say.\n * Public (no sign-in needed); the answer may be up to five minutes old.\n */\n async artStyles(params: { locale?: string } = {}): Promise<VideoRemakeArtStyle[]> {\n const query: Record<string, string> = {}\n if (params.locale) query.locale = params.locale\n const res = await this.client.request<{ data: VideoRemakeArtStyle[] }>(\"GET\", \"/v1/video-remake/art-styles\", { query })\n return res.data\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"]}
@@ -32,12 +32,63 @@ var VideoRemakeResource = class {
32
32
  * art style alone is refused, and one with a pre or post prompt runs as any
33
33
  * other art-style run. Its `preciseArtStyle` says, per engine, whether a
34
34
  * Precise run takes an art style there too, and its `preciseArtStyleAlone`
35
- * whether that art style alone is the run's change.
35
+ * whether that art style alone is the run's change. Its `customStyle` says,
36
+ * per engine, whether a run takes the style in your own words there
37
+ * (`direction: { customStyle }`, and {@link describeStyle}).
36
38
  * Public (no sign-in needed); the answer may be up to a minute old.
37
39
  */
38
40
  styleChoice() {
39
41
  return this.client.request("GET", "/v1/video-remake/style-choice");
40
42
  }
43
+ /**
44
+ * Whether the Video Remake page shows its Advanced options
45
+ * (`GET /v1/video-remake/advanced`): `show` is `true` where the page offers
46
+ * `prepareReferences` and `prePrompt`, and `false` until Nodaro turns them
47
+ * on. One answer for the whole page, whatever the engine, so an app built
48
+ * on the SDK can show or hide the same options. It describes the page only:
49
+ * {@link run} and {@link estimate} take both fields as sent, whatever it
50
+ * answers.
51
+ * Public (no sign-in needed); the answer may be up to a minute old.
52
+ */
53
+ advanced() {
54
+ return this.client.request("GET", "/v1/video-remake/advanced");
55
+ }
56
+ /**
57
+ * Put an image's visual style into words
58
+ * (`POST /v1/video-remake/describe-style`): `text` describes how the image
59
+ * is made and how it looks (the medium, line, colour, lighting and
60
+ * texture), never who or what it shows, ready to show, edit and send as a
61
+ * run's `direction: { customStyle: text }`. With `note`, a wish about the
62
+ * style is folded in ("like this, but darker"). Free: it starts no job and
63
+ * charges nothing, and nothing of the image is kept. Needs a signed-in
64
+ * account, and is limited to 10 calls a minute per account. Only where
65
+ * {@link styleChoice} answers `customStyle` true (403
66
+ * `custom_style_not_available` elsewhere). Refusals:
67
+ * {@link VideoRemakeCustomStyleRefusalCode}.
68
+ */
69
+ describeStyle(params) {
70
+ const body = { imageUrl: params.imageUrl, ...params.note !== void 0 ? { note: params.note } : {} };
71
+ return this.client.request("POST", "/v1/video-remake/describe-style", { body });
72
+ }
73
+ /**
74
+ * The art styles Video Remake's art style picker offers
75
+ * (`GET /v1/video-remake/art-styles`), in the picker's order: each with its
76
+ * `id` (a run's `direction.style`), its name in `locale` (a Nodaro language
77
+ * id such as `"he"`, `"ja"`, `"ko"` or `"pt-BR"`; English when left out,
78
+ * for a language Nodaro does not have, and for a style the language does
79
+ * not name) and its preview, a clip and a still cut from it. The list is
80
+ * empty where there is nothing to offer: a deployment that does not show
81
+ * Nodaro's previews, or one without Video Remake or its art styles. It
82
+ * lists what the picker shows; whether a run takes an art style on an
83
+ * engine is {@link styleChoice}'s to say.
84
+ * Public (no sign-in needed); the answer may be up to five minutes old.
85
+ */
86
+ async artStyles(params = {}) {
87
+ const query = {};
88
+ if (params.locale) query.locale = params.locale;
89
+ const res = await this.client.request("GET", "/v1/video-remake/art-styles", { query });
90
+ return res.data;
91
+ }
41
92
  /** Quote a run before starting it (`POST /v1/video-remake/estimate`); spends nothing. */
42
93
  async estimate(params) {
43
94
  const quote = await this.client.request("POST", "/v1/video-remake/estimate", { body: params });
@@ -75,5 +126,5 @@ var VideoRemakeResource = class {
75
126
  var CastSwapResource = VideoRemakeResource;
76
127
 
77
128
  export { CastSwapResource, VideoRemakeResource };
78
- //# sourceMappingURL=chunk-TZFZDEWI.js.map
79
- //# sourceMappingURL=chunk-TZFZDEWI.js.map
129
+ //# sourceMappingURL=chunk-6ZKW7767.js.map
130
+ //# sourceMappingURL=chunk-6ZKW7767.js.map