@kinetune/cli 2.3.0 → 2.8.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 (3) hide show
  1. package/README.md +92 -10
  2. package/dist/kinetune.mjs +639 -97
  3. package/package.json +1 -1
package/dist/kinetune.mjs CHANGED
@@ -20431,7 +20431,13 @@ var OutroDisplaySchema = DisplaySchema.omit({ lyrics: true, headline: true });
20431
20431
 
20432
20432
  // ../video-types/src/kit.ts
20433
20433
  var KIT_KINDS = ["outfit", "place", "prop"];
20434
+ var KIT_ANGLES = ["three-quarter", "side", "low"];
20434
20435
  var KIT_HANDLE = /^[a-z0-9][a-z0-9-]{0,39}$/;
20436
+ var SHOT_SIZES = ["close", "medium", "wide"];
20437
+ var SHOT_ANGLES = ["front", "three-quarter", "side", "low", "high", "over-shoulder", "back"];
20438
+ var SHOT_MOVES = ["push-in", "pull-out", "arc", "tilt", "dolly", "handheld", "locked-off"];
20439
+ var CHARACTER_DESCRIPTION_MIN = 10;
20440
+ var CHARACTER_DESCRIPTION_MAX = 600;
20435
20441
 
20436
20442
  // ../video-types/src/model-guide.ts
20437
20443
  var AA_T2V = { board: "Artificial Analysis \xB7 Text to video with audio", source: "Artificial Analysis Video Arena", url: "https://artificialanalysis.ai/video/leaderboard/text-to-video" };
@@ -20490,6 +20496,82 @@ var MUSIC_VIDEO_MODEL_GUIDES = {
20490
20496
  }
20491
20497
  };
20492
20498
 
20499
+ // ../video-types/src/visual-styles.ts
20500
+ var MUSIC_VIDEO_STYLE_IDS = [
20501
+ "natural",
20502
+ "film",
20503
+ "golden-hour",
20504
+ "neon-night",
20505
+ "noir",
20506
+ "vintage",
20507
+ "dreamy",
20508
+ "super-8",
20509
+ "vhs",
20510
+ "documentary",
20511
+ "glossy-pop",
20512
+ "indie",
20513
+ "cyberpunk",
20514
+ "y2k",
20515
+ "lofi",
20516
+ "painterly",
20517
+ "anime",
20518
+ "clay"
20519
+ ];
20520
+
20521
+ // ../video-types/src/cover-art.ts
20522
+ var COVER_STYLE_IDS = ["auto", "portrait", "snapshot", "film-still", "object", "place", "painted", "illustrated", "cartoon", "anime", "collage", "3d", "graphic", "type"];
20523
+ var COVER_VIBE_IDS = ["dark", "sad", "romantic", "aggressive", "luxury", "aesthetic", "urban", "hood", "space", "surreal", "vintage"];
20524
+ var COVER_VIBES_MAX = 2;
20525
+ var COVER_WORDS = ["none", "title", "artist_title"];
20526
+ var COVER_ARTIST_MODES = ["auto", "always", "never"];
20527
+ var COVER_COUNT = { min: 1, max: 4, default: 1 };
20528
+ var COVER_IDEA_MAX = 500;
20529
+ var COVER_NOTE_MAX = 500;
20530
+ var COVER_FONTS = {
20531
+ anton: "Anton",
20532
+ "bebas-neue": "Bebas Neue",
20533
+ "archivo-black": "Archivo Black",
20534
+ "big-shoulders-display": "Big Shoulders",
20535
+ oswald: "Oswald",
20536
+ "barlow-condensed": "Barlow Condensed",
20537
+ inter: "Inter",
20538
+ montserrat: "Montserrat",
20539
+ syne: "Syne",
20540
+ unbounded: "Unbounded",
20541
+ "dm-serif-display": "DM Serif Display",
20542
+ "playfair-display": "Playfair Display",
20543
+ "instrument-serif": "Instrument Serif",
20544
+ "bodoni-moda": "Bodoni Moda",
20545
+ fraunces: "Fraunces",
20546
+ "abril-fatface": "Abril Fatface",
20547
+ "cormorant-garamond": "Cormorant Garamond",
20548
+ "permanent-marker": "Permanent Marker",
20549
+ caveat: "Caveat",
20550
+ "space-mono": "Space Mono",
20551
+ righteous: "Righteous",
20552
+ shrikhand: "Shrikhand",
20553
+ "rubik-mono-one": "Rubik Mono One",
20554
+ monoton: "Monoton"
20555
+ };
20556
+ var COVER_FONT_IDS = Object.keys(COVER_FONTS);
20557
+ var CoverLookSchema = external_exports.object({
20558
+ colors: external_exports.array(external_exports.string().regex(/^#[0-9a-fA-F]{6}$/)).min(1).max(3),
20559
+ font: external_exports.string().min(1).max(40).refine((f) => f in COVER_FONTS, "font is one of the cover typefaces (GET /options: cover_art.fonts)")
20560
+ }).strict();
20561
+ var CoverRequestSchema = external_exports.object({
20562
+ song_id: external_exports.string().min(1),
20563
+ count: external_exports.number().int().min(COVER_COUNT.min).max(COVER_COUNT.max).default(COVER_COUNT.default),
20564
+ style: external_exports.enum(COVER_STYLE_IDS).default("auto"),
20565
+ vibes: external_exports.array(external_exports.enum(COVER_VIBE_IDS)).max(COVER_VIBES_MAX).default([]).refine((v) => new Set(v).size === v.length, "vibes repeat"),
20566
+ artist: external_exports.enum(COVER_ARTIST_MODES).default("auto"),
20567
+ idea: external_exports.string().trim().max(COVER_IDEA_MAX).optional(),
20568
+ words: external_exports.enum(COVER_WORDS).default("none"),
20569
+ /** Overrides the artist's look for this round (it becomes theirs when a cover from it is used). */
20570
+ look: CoverLookSchema.optional(),
20571
+ credits: external_exports.number().int().positive()
20572
+ }).strict().refine((r) => r.style !== "type" || r.words !== "none", { message: "The Type style needs words: title, or artist and title", path: ["words"] });
20573
+ var CoverRedrawSchema = external_exports.object({ cover_id: external_exports.string().min(1), note: external_exports.string().trim().min(1).max(COVER_NOTE_MAX), credits: external_exports.number().int().positive() }).strict();
20574
+
20493
20575
  // ../video-types/src/index.ts
20494
20576
  var MAX_VARIATIONS = 4;
20495
20577
  var variations = external_exports.number().int().min(1).max(MAX_VARIATIONS).default(1);
@@ -20531,6 +20613,13 @@ var BACKGROUND_UPLOAD_LIMITS = {
20531
20613
  image: { maxBytes: 25 * 1024 * 1024, minShortSide: 720, types: ["image/jpeg", "image/png", "image/webp"] },
20532
20614
  video: { maxBytes: 300 * 1024 * 1024, minShortSide: 720, minSeconds: 4, maxSeconds: 180, types: ["video/mp4", "video/quicktime", "video/webm"] }
20533
20615
  };
20616
+ var UPLOAD_CONTENT_TYPES = ["audio/mpeg", "audio/wav", "audio/mp4", "image/jpeg", "image/png", "image/webp", "video/mp4", "video/quicktime", "video/webm"];
20617
+ var UPLOAD_MAX_BYTES = 300 * 1024 * 1024;
20618
+ var UploadCreateSchema = external_exports.object({
20619
+ filename: external_exports.string().trim().min(1).max(200).regex(/^[^/\\\u0000-\u001f]+$/, "A file name, without folders"),
20620
+ content_type: external_exports.enum(UPLOAD_CONTENT_TYPES),
20621
+ size_bytes: external_exports.number().int().min(1).max(UPLOAD_MAX_BYTES)
20622
+ }).strict();
20534
20623
  var isUploadSource = (source) => BACKGROUND_SOURCES2[source].source === "upload";
20535
20624
  var backgroundSourcesFor = (category) => categoryUsesImages(category) ? [...MEDIA_BACKGROUND_SOURCES, "designed"] : ["designed", ...MEDIA_BACKGROUND_SOURCES];
20536
20625
  var backgroundSourceFor = (category, background) => background.source ?? backgroundSourcesFor(category)[0];
@@ -20616,7 +20705,7 @@ var CanvasRequestSchema = external_exports.object({
20616
20705
  resolution: external_exports.enum(CANVAS_RESOLUTIONS).default("1080p"),
20617
20706
  style: external_exports.enum(CANVAS_STYLES).optional(),
20618
20707
  direction: external_exports.string().trim().max(2e3).optional(),
20619
- inspiration: external_exports.enum(CANVAS_INSPIRATIONS).default("cover"),
20708
+ inspiration: external_exports.enum(CANVAS_INSPIRATIONS).default("song"),
20620
20709
  feature_artist: external_exports.enum(CANVAS_FEATURE_ARTIST_MODES).default("auto"),
20621
20710
  // Who may appear (feature_artist auto or always): a character of a Creator workspace's cast, whose projects have none of their
20622
20711
  // own. Omitted: the song's artist's character.
@@ -20673,26 +20762,6 @@ var MUSIC_VIDEO_CATEGORIES = {
20673
20762
  band: { label: "Band", description: "The whole band performs the song together.", needs: { ability: "ensemble" } },
20674
20763
  action: { label: "Action", description: "A chase toward one goal, cut fast to the song, the performer singing between.", needs: { ability: "action" } }
20675
20764
  };
20676
- var MUSIC_VIDEO_STYLE_IDS = [
20677
- "natural",
20678
- "film",
20679
- "golden-hour",
20680
- "neon-night",
20681
- "noir",
20682
- "vintage",
20683
- "dreamy",
20684
- "super-8",
20685
- "vhs",
20686
- "documentary",
20687
- "glossy-pop",
20688
- "indie",
20689
- "cyberpunk",
20690
- "y2k",
20691
- "lofi",
20692
- "painterly",
20693
- "anime",
20694
- "clay"
20695
- ];
20696
20765
  var MUSIC_VIDEO_STYLES = {
20697
20766
  natural: { label: "Natural", description: "True-to-life color and light." },
20698
20767
  film: { label: "Film", description: "35 mm film: grain, soft contrast and rich color." },
@@ -20777,6 +20846,7 @@ var MUSIC_VIDEO_MODELS = {
20777
20846
  };
20778
20847
  var MusicVideoPlanIdSchema = external_exports.string().regex(/^plan_[0-9a-f-]{36}$/, "A music video plan id (plan_\u2026)");
20779
20848
  var LookbookIdSchema = external_exports.string().regex(/^lookbook_[0-9a-f-]{36}$/, "A lookbook id (lookbook_\u2026)");
20849
+ var CastingIdSchema = external_exports.string().regex(/^casting_[0-9a-f-]{36}$/, "A casting id (casting_\u2026)");
20780
20850
  var MusicVideoLookIdSchema = external_exports.string().regex(/^mvlook_[0-9a-f-]{36}$/, "A music video Look id (mvlook_\u2026)");
20781
20851
  var MusicVideoCastSchema = external_exports.object({ outfit_kit: external_exports.string().regex(/^[a-z0-9-]{1,40}$/, "A kit outfit\u2019s handle").optional() }).strict();
20782
20852
  var MUSIC_VIDEO_SCENE_MODES = ["invent", "stock"];
@@ -20799,9 +20869,30 @@ var KitItemUpdateSchema = external_exports.object({
20799
20869
  /** A character only: it shows an AI-made person (looks like no real person) or a real one. */
20800
20870
  ai_made: external_exports.boolean().optional(),
20801
20871
  /** Offered to every other artist's studio too (true), or only its own artist's (false). */
20802
- shared: external_exports.boolean().optional()
20872
+ shared: external_exports.boolean().optional(),
20873
+ /** Another angle of a place, waiting (pending): keep it in the kit. Leaving it out is deleting it. */
20874
+ kept: external_exports.literal(true).optional()
20803
20875
  }).strict().refine((v) => Object.keys(v).length > 0, { message: "Nothing to change" });
20804
20876
  var MusicVideoPersonSchema = external_exports.object({ character: KitHandleSchema, does: external_exports.string().trim().min(1).max(300).optional(), outfit: KitHandleSchema.optional() }).strict();
20877
+ var MUSIC_VIDEO_CAST_MODES = ["exact", "director"];
20878
+ var castModeOf = (brief) => brief.cast_mode ?? "director";
20879
+ var CASTING_MAX_PEOPLE = 3;
20880
+ var CastingPersonSchema = external_exports.object({
20881
+ name: external_exports.string().trim().min(1).max(30),
20882
+ role: external_exports.string().trim().min(1).max(80),
20883
+ does: external_exports.string().trim().min(1).max(300),
20884
+ description: external_exports.string().trim().min(CHARACTER_DESCRIPTION_MIN).max(CHARACTER_DESCRIPTION_MAX),
20885
+ shots: external_exports.number().int().min(1).max(200)
20886
+ }).strict();
20887
+ var CastingDrawSchema = external_exports.object({
20888
+ credits: external_exports.number().int().min(0),
20889
+ people: external_exports.array(external_exports.object({
20890
+ index: external_exports.number().int().min(1).max(CASTING_MAX_PEOPLE),
20891
+ name: external_exports.string().trim().min(1).max(30).optional(),
20892
+ description: external_exports.string().trim().min(CHARACTER_DESCRIPTION_MIN).max(CHARACTER_DESCRIPTION_MAX).optional(),
20893
+ character: KitHandleSchema.optional()
20894
+ }).strict()).max(CASTING_MAX_PEOPLE).refine((list) => new Set(list.map((p) => p.index)).size === list.length, { message: "Each person once" })
20895
+ }).strict();
20805
20896
  var musicVideoBrief = {
20806
20897
  model: external_exports.enum(MUSIC_VIDEO_MODEL_IDS).default(DEFAULT_MUSIC_VIDEO_MODEL),
20807
20898
  category: external_exports.enum(MUSIC_VIDEO_CATEGORY_IDS).default("performance"),
@@ -20820,6 +20911,8 @@ var musicVideoBrief = {
20820
20911
  // The people besides the performer (one entry a character, in the shots' room for people), each with what they do if the artist
20821
20912
  // says; the director decides the rest. direction may mention them too.
20822
20913
  people: external_exports.array(MusicVideoPersonSchema).max(8).refine((list) => new Set(list.map((p) => p.character)).size === list.length, { message: "Each person once" }).optional(),
20914
+ // Who else may be on screen: only the people given (exact), or the director may cast more (director; omitted: director).
20915
+ cast_mode: external_exports.enum(MUSIC_VIDEO_CAST_MODES).optional(),
20823
20916
  scenes: MusicVideoScenesSchema.default({ mode: "invent" }),
20824
20917
  // The lookbook whose kept pieces the video uses, like the kit pieces the direction mentions.
20825
20918
  lookbook_id: LookbookIdSchema.optional(),
@@ -20829,7 +20922,10 @@ var musicVideoBrief = {
20829
20922
  // Whether the artist sings on camera: the director decides, or never (the song plays over every shot).
20830
20923
  lipsync: external_exports.enum(MUSIC_VIDEO_LIPSYNC).default("auto"),
20831
20924
  // A music video Look (made public by someone, or the workspace's own) whose direction, places and props the video follows.
20832
- look_id: MusicVideoLookIdSchema.optional()
20925
+ look_id: MusicVideoLookIdSchema.optional(),
20926
+ // Only what the kit's pictures show: no other place, prop, person or lighting change (kitOnlyOf). Omitted: on when the brief
20927
+ // mentions a kit piece.
20928
+ kit_only: external_exports.boolean().optional()
20833
20929
  };
20834
20930
  var MUSIC_VIDEO_BRIEF_FIELDS = Object.keys(musicVideoBrief);
20835
20931
  var onScreenOf = (brief) => brief.on_screen ?? MUSIC_VIDEO_CATEGORIES[brief.category]?.needs?.onScreen ?? "artist";
@@ -20837,7 +20933,7 @@ var fitsModel = (value, ctx) => {
20837
20933
  const model = MUSIC_VIDEO_MODELS[value.model];
20838
20934
  const issue2 = (path4, message) => ctx.addIssue({ code: "custom", path: [path4], message });
20839
20935
  if (!model.categories.includes(value.category)) issue2("category", `${model.label} doesn\u2019t make ${MUSIC_VIDEO_CATEGORIES[value.category].label} videos`);
20840
- if (value.style && !model.styles.includes(value.style)) issue2("style", `${model.label} doesn\u2019t make the ${MUSIC_VIDEO_STYLES[value.style].label} look`);
20936
+ if (value.style && !model.styles.includes(value.style)) issue2("style", `${model.label} doesn\u2019t make the ${MUSIC_VIDEO_STYLES[value.style].label} visual style`);
20841
20937
  if (!model.formats.includes(value.aspect_ratio)) issue2("aspect_ratio", `${model.label} makes ${model.formats.join(", ")}`);
20842
20938
  if (value.trim && value.trim.end_seconds - value.trim.start_seconds > MUSIC_VIDEO_LENGTH_BOUNDS.max + 1e-6) issue2("trim", `A music video is at most ${MUSIC_VIDEO_LENGTH_BOUNDS.max / 60} minutes: pick a shorter section`);
20843
20939
  if (value.trim && value.trim.end_seconds - value.trim.start_seconds < MUSIC_VIDEO_LENGTH_BOUNDS.min - 1e-6) issue2("trim", `A music video is at least ${MUSIC_VIDEO_LENGTH_BOUNDS.min} seconds: pick a longer section`);
@@ -20848,6 +20944,7 @@ var fitsModel = (value, ctx) => {
20848
20944
  if (on !== "artist" && value.performer) issue2("performer", `Nobody performs in a video ${on === "cast" ? "with a cast (mention its characters in direction)" : "with no one on screen"}: leave performer out`);
20849
20945
  if (value.takes === "continuous" && !(model.keyframes.start && model.keyframes.end)) issue2("takes", `${model.label} makes no continuous takes`);
20850
20946
  if (value.people?.length && on === "none") issue2("people", "Nobody is on screen in this video: leave people out, or put a cast on screen");
20947
+ if (value.cast_mode === "exact" && on === "cast" && !value.people?.length) issue2("people", "Pick the people in it, or let the director cast (cast_mode director)");
20851
20948
  if (value.lipsync === "never" && MUSIC_VIDEO_CATEGORIES[value.category].needs?.sings) issue2("lipsync", `A ${MUSIC_VIDEO_CATEGORIES[value.category].label} video is sung on camera: choose another kind, or let the director decide`);
20852
20949
  };
20853
20950
  var MusicVideoPlanRequestSchema = external_exports.object({
@@ -20855,11 +20952,16 @@ var MusicVideoPlanRequestSchema = external_exports.object({
20855
20952
  ...musicVideoBrief,
20856
20953
  revise: external_exports.object({ plan_id: MusicVideoPlanIdSchema, note: external_exports.string().trim().min(1).max(1e3) }).strict().optional()
20857
20954
  }).strict().superRefine(fitsModel);
20955
+ var { lookbook_id: _lookbook, ...castingBrief } = musicVideoBrief;
20956
+ var MusicVideoCastingRequestSchema = external_exports.object({ song_id: common.song_id, ...castingBrief }).strict().superRefine(fitsModel);
20858
20957
  var MusicVideoRequestSchema = external_exports.object({
20859
20958
  type: external_exports.literal("music-video"),
20860
20959
  ...common,
20861
20960
  ...musicVideoBrief,
20862
20961
  plan_id: MusicVideoPlanIdSchema.optional(),
20962
+ // Ordered without a plan: the director's casting (POST /music-video-castings) the person said yes to: its proposed people are drawn
20963
+ // inside the order (priced in its quote), kept in the song artist's kit and added to the brief's people.
20964
+ casting_id: CastingIdSchema.optional(),
20863
20965
  // How sharp it is made; not part of the plan (the treatment and shots are the same in every quality).
20864
20966
  // Omitted: the model's default quality (MUSIC_VIDEO_MODELS[].defaultQuality), filled in below, so a parsed request always has one:
20865
20967
  // optional when parsed, typed as always there.
@@ -20872,12 +20974,19 @@ var MusicVideoRequestSchema = external_exports.object({
20872
20974
  // of the plan.
20873
20975
  outro: external_exports.object({ display: OutroDisplaySchema, look_id: external_exports.string().min(1).max(120).optional() }).strict().optional(),
20874
20976
  // Finishing a delivered music video again (its kept, un-outro'd master), only its outro changed: no shot is made, no plan.
20875
- refinish: external_exports.object({ video_id: external_exports.string().uuid() }).strict().optional()
20977
+ refinish: external_exports.object({ video_id: external_exports.string().uuid() }).strict().optional(),
20978
+ // A test of a plan before the whole video: only its test shots (the chorus's first, about 20 seconds), at TEST_QUALITY whatever
20979
+ // quality is sent, with the plan's seeds and pictures. An ordinary video marked as a test: never revised, no outro.
20980
+ test: external_exports.boolean().optional()
20876
20981
  }).strict().overwrite((value) => ({ ...value, quality: value.quality ?? MUSIC_VIDEO_MODELS[value.model].defaultQuality })).superRefine(fitsModel).superRefine((value, ctx) => {
20877
20982
  const model = MUSIC_VIDEO_MODELS[value.model];
20878
20983
  if (value.quality && !model.qualities.includes(value.quality)) ctx.addIssue({ code: "custom", path: ["quality"], message: `${model.label} is made in ${model.qualities.map((q) => MUSIC_VIDEO_QUALITIES[q].label).join(", ")}` });
20879
20984
  if (value.design_shoot && (value.plan_id || value.lookbook_id)) ctx.addIssue({ code: "custom", path: ["design_shoot"], message: "A plan or a lookbook already has its shoot: leave design_shoot out" });
20880
20985
  if (value.refinish && (value.plan_id || value.design_shoot || value.variations > 1)) ctx.addIssue({ code: "custom", path: ["refinish"], message: "Finishing a video again takes only its song_id, its outro and one variation" });
20986
+ if (value.casting_id && (value.plan_id || value.refinish)) ctx.addIssue({ code: "custom", path: ["casting_id"], message: "A plan already has its people: leave casting_id out" });
20987
+ if (value.casting_id && castModeOf(value) === "exact") ctx.addIssue({ code: "custom", path: ["casting_id"], message: "Only who you picked is in it (cast_mode exact): leave casting_id out" });
20988
+ if (value.test && !value.plan_id) ctx.addIssue({ code: "custom", path: ["test"], message: "A test is made from a plan: send its plan_id" });
20989
+ if (value.test && (value.outro || value.refinish || value.variations > 1)) ctx.addIssue({ code: "custom", path: ["test"], message: "A test is one video without an outro: leave outro, refinish and variations out" });
20881
20990
  });
20882
20991
  var VideoRequestSchema = external_exports.discriminatedUnion("type", [LyricVideoRequestSchema, CanvasRequestSchema, MusicVideoRequestSchema]);
20883
20992
 
@@ -20916,13 +21025,22 @@ var search = (q) => ({
20916
21025
  limit: external_exports.number().int().min(1).max(100).optional().describe("Results per page, 1-100 (default 50)"),
20917
21026
  offset: external_exports.number().int().min(0).optional().describe("How many results to skip")
20918
21027
  });
20919
- var httpsUrl = (what) => external_exports.string().url().max(2e3).describe(`A public https URL of ${what}`);
21028
+ var httpsUrl = (what) => external_exports.string().url().max(2e3).describe(`A public https URL of ${what} (a file on your computer: create_upload, then its file_url)`);
21029
+ var UploadSchema = external_exports.looseObject({
21030
+ upload_url: external_exports.string().describe("PUT the file's bytes here, with the headers below, within the hour"),
21031
+ method: external_exports.literal("PUT"),
21032
+ headers: external_exports.record(external_exports.string(), external_exports.string()).describe("Send these with the PUT (content-type); content-length must be size_bytes"),
21033
+ file_url: external_exports.string().describe("Once the file is sent: pass it in the *_url field (audio_url, cover_art_url, file_url, photo_urls, image_url) within a day"),
21034
+ upload_expires_at: external_exports.string(),
21035
+ file_expires_at: external_exports.string(),
21036
+ uploads_per_day: external_exports.number().int()
21037
+ });
20920
21038
  var LYRICS = "The song\u2019s lyrics as text: plain (Suno-style [Verse]/[Chorus] tags and (x2) marks are fine), or the contents of an SRT, WebVTT or LRC file. Every word is still timed from the audio: your text fixes misheard words and sets where lines break in videos, and its section tags set the song\u2019s sections (a chorus sung once is still a chorus). A part sung again (a chorus) can be written once; lyrics that don\u2019t match what\u2019s sung, or cover only part of it, are refused";
20921
21039
  var KIT_ABOUT = "The kit is what a music video is made from besides the artist\u2019s character: outfits, places and props. Each is in one artist\u2019s kit (owner_artist_id, a project in a Creator workspace; an outfit\u2019s is its artist_id) and serves their songs; shared true offers it to every other artist\u2019s songs too (owner_name says whose it is). Each has a name and an @handle unique in the workspace; a music video brief (direction) that mentions @handle uses that piece exactly as it is, and the director designs the rest.";
20922
21040
  var NEEDS_PLAN = "Needs an active plan (402 plan_required without one; get_account: plan.active) and room in its storage (402 storage_full when it would not fit; get_account: storage).";
20923
21041
  var PICTURE_CROP = external_exports.object({ x: external_exports.number().min(0).max(1), y: external_exports.number().min(0).max(1), size: external_exports.number().min(0.1).max(1) }).optional();
20924
- var IMAGE_FALLBACK = "image_url is the picture uploaded for it (null without one); while it has none, image_fallback is the cover of its newest song still there (song_id, preview_url 640 px and thumbnail_url 160 px WebP), to show in its place, or null without a song. It is read-only, never saved as the picture, and follows the newest song (a new song or an archived one changes it).";
20925
- var COVER_SIZES = "cover_art.url is the cover at up to 1536 px (JPEG; width and height describe it), preview_url a 640 px and thumbnail_url a 160 px WebP. Image links are signed for 7 days and stay the same all day, so they can be cached.";
21042
+ var IMAGE_FALLBACK = "image_url is the picture uploaded for it (null without one); while it has none, image_fallback is the cover of its newest song still there that has one (song_id, preview_url 640 px and thumbnail_url 160 px WebP), to show in its place, or null without such a song. It is read-only, never saved as the picture, and follows the newest song (a new song or an archived one changes it).";
21043
+ var COVER_SIZES = "cover_art.url is the cover at up to 1536 px (JPEG; width and height describe it), preview_url a 640 px and thumbnail_url a 160 px WebP; cover_art is null for a song without cover art (it is optional). Image links are signed for 7 days and stay the same all day, so they can be cached.";
20926
21044
  var { type: _lyricType, quote_id: _lyricQuote, ...lyricShape } = LyricVideoRequestSchema.shape;
20927
21045
  var { type: _canvasType, quote_id: _canvasQuote, ...canvasShape } = CanvasRequestSchema.shape;
20928
21046
  var { type: _musicType, quote_id: _musicQuote, ...musicShape } = MusicVideoRequestSchema.shape;
@@ -20954,15 +21072,18 @@ var canvasInput = external_exports.object({
20954
21072
  resolution: canvasShape.resolution.describe("1080p (1080\xD71920) or 720p"),
20955
21073
  style: canvasShape.style.describe("Optional visual style"),
20956
21074
  direction: canvasShape.direction.describe("Optional mood, motifs or references"),
20957
- inspiration: canvasShape.inspiration.describe("Where the idea comes from: cover (default; the cover art's world, colors and motifs, brought to life) or song (its words, story and sound lead, the colors kept close to the cover so the two sit together in the player)"),
21075
+ inspiration: canvasShape.inspiration.describe("Where the idea comes from: song (default; what the song means and how it sounds lead, the colors kept close to the cover, when there is one, so the two sit together in the player) or cover (the cover art's world, colors and motifs, brought to life; a song without a cover always uses song)"),
20958
21076
  performer: canvasShape.performer.describe("A Creator workspace only: the character (list_characters with for_artist_id: one in the song's project's kit or one another project shared) who may appear, with feature_artist auto or always on an AI source. Omitted: the song's artist's character"),
20959
21077
  feature_artist: canvasShape.feature_artist.describe(`Whether the Canvas shows the artist: auto (the director decides), always or never (AI sources; "always" needs the artist's character: list_characters, start_character makes one)`),
20960
21078
  seconds: canvasShape.seconds.describe("Canvas length in whole seconds, 5\u20138 (default 8). Spotify loops it, so no part of the song is chosen"),
20961
21079
  variations: canvasShape.variations.describe("1\u20134 different Canvases")
20962
21080
  });
20963
- var DIRECTION = `Optional notes for the director (a place, an era, a story idea, a mood). Mention kit pieces by @handle (list_kit): "@nina-kazora in the @blue-set on the @rooftop, the @chrome-mic in hand"; a mentioned piece is used exactly as it is and the director designs the rest. Mention characters by @handle (list_characters) to put them in the shots beside the performer (those in the song's artist's kit and those other artists shared, list_characters with for_artist_id; the song's artist's own too when another character performs; in a story with a cast, they are the cast): "@mia-torres dances behind her in the last chorus". An unknown handle, or another artist's piece they haven't shared, answers 400`;
21081
+ var DIRECTION = `Optional notes for the director (a place, an era, a story idea, a mood). Mention kit pieces by @handle (list_kit): "@nina-kazora in the @blue-set on the @rooftop, the @chrome-mic in hand"; a mentioned piece is used exactly as it is and the director designs the rest. Mention characters by @handle (list_characters) to put them in the shots beside the performer (those in the song's artist's kit and those other artists shared, list_characters with for_artist_id; the song's artist's own too when another character performs; in a story with a cast, they are the cast): "@mia-torres dances behind her in the last chorus". An unknown handle, or another artist's piece they haven't shared, answers 400. Pin a change to a moment with a sentence that says on "<words sung>" (on every "\u2026" for each time they are sung) or at m:ss (the song's time), for example: On "Drop it" cut to @rooftop-club. / @grandma appears on "She said yes". / At 1:05 the lights go out. A shot starts exactly there (the plan has one more shot when the usual cut runs over it), set in the first kit place the sentence names, with the characters it names appearing in it (and not in the shot before); shots[].cue shows it. Words the section doesn't sing, or two moments under 2 seconds apart, answer 400`;
20964
21082
  var LOOK_ID = "A music video Look (list_music_video_looks: one made public, or the workspace's own) the video follows: its treatment leads the director and its places and props join the kit. Send its category, style, takes and lipsync too (or your own)";
20965
21083
  var LIPSYNC = '"auto" (default: the director has the artist sing the important lines on camera) or "never" (nobody sings on camera; the song plays over every shot). A kind sung on camera (lyric-led) refuses "never"; an instrumental song never lip-syncs';
21084
+ var KIT_ONLY = "Only what the kit's pictures show: no place, prop, person or lighting change beyond them (every shot in one of the kit's places, lit as in its picture; only the props and the people the brief names). Omitted: on when the brief mentions a kit piece by @handle (an outfit, a place or a prop), off otherwise; send false to let the director add to the kit";
21085
+ var CAST_MODE = `Who else may be on screen besides the performer and people: "director" (default when left out: the director may cast up to 3 more, each drawn as a character sheet only after the user says yes: cast_music_video) or "exact" (only who was picked; the song's other people are carried by the scene, an empty chair or a coat left out, never shown). Nobody appears on screen without a character sheet; with nobody cast, crowds and dancers are faceless. A cast-story video with "exact" needs people`;
21086
+ var CASTING_ID = `Ordered without a plan: a casting (cast_music_video) the user said yes to in full. Its people still proposed are drawn inside the order (the quote's "New cast" line, at the character sheet price each; only those drawn are charged), kept in the song artist's kit as AI-made and added to people. Not with plan_id or cast_mode exact`;
20966
21087
  var LOOKBOOK_ID = "A lookbook (design_music_video_shoot) whose kept, drawn pieces the video uses like the kit pieces the direction mentions; its idea leads the director";
20967
21088
  var musicVideoInput = external_exports.object({
20968
21089
  ...musicShape,
@@ -20972,7 +21093,7 @@ var musicVideoInput = external_exports.object({
20972
21093
  model: musicShape.model.describe("The music video model: one-take (default; MiniMax H3 Max), seedance-2-0, seedance-2-0-fast, seedance-2-0-mini or seedance-2-5. get_options lists the models offered to you with the categories, styles, formats, takes and length each makes, and guide: what each is best for, its strengths, weaknesses and public benchmark scores. When the person hasn't named a model, suggest the kind's recommended_model (get_options music_video.categories) with its best_for line and the price difference between models from quotes, and let them choose any"),
20973
21094
  scenes: musicShape.scenes.describe(`Where it is set besides the places the direction mentions from the kit: {"mode":"invent"} (default: the director imagines the others) or {"mode":"stock"} (it finds a real stock photo of each place it writes, empty of people, and the artist is put into it), up to the model's kit.places in all`),
20974
21095
  category: musicShape.category.describe("performance (default: sings to camera in one place), intercut (performance cut against the artist living the song's story), cinematic (a moving camera through a location), story (acts out the song's story) or surreal (the world transforms with the song). get_options lists the ones each model makes"),
20975
- style: musicShape.style.describe("Optional look: natural, film, golden-hour, neon-night, noir, vintage or dreamy. Omit it and the director picks one from the cover"),
21096
+ style: musicShape.style.describe("Optional visual style, how it is rendered: natural, film, golden-hour, neon-night, noir, vintage, dreamy, super-8, vhs, documentary, glossy-pop, indie, cyberpunk, y2k, lofi, painterly, anime or clay (get_options lists the ones each model makes). Omit it and the director picks one from the cover"),
20976
21097
  aspect_ratio: musicShape.aspect_ratio.describe('The one format of the file: "9:16" (default, vertical), "16:9" (wide) or "1:1" (square)'),
20977
21098
  takes: musicShape.takes.describe(`How the shots meet: "cuts" (default: shots meet with a cut between the song's lines, like an edit) or "continuous" (the director may carry a shot on into the next through a picture drawn of the moment they meet, priced per picture; the quote before a plan counts every join, the plan's quote only the ones it draws)`),
20978
21099
  trim: musicShape.trim.describe("Perform only this section of the song (15 seconds to 10 minutes); omitted, the whole song (15 seconds to 10 minutes long). The price follows its length. Best: a part from get_song_analysis (parts[]: its start and end never cut a word)"),
@@ -20980,14 +21101,18 @@ var musicVideoInput = external_exports.object({
20980
21101
  lookbook_id: musicShape.lookbook_id.describe(LOOKBOOK_ID),
20981
21102
  look_id: musicShape.look_id.describe(LOOK_ID),
20982
21103
  lipsync: musicShape.lipsync.describe(LIPSYNC),
21104
+ kit_only: musicShape.kit_only.describe(KIT_ONLY),
20983
21105
  on_screen: musicShape.on_screen.describe(ON_SCREEN_DESCRIPTION),
20984
21106
  performer: musicShape.performer.describe(PERFORMER),
20985
21107
  cast: musicShape.cast.describe(CAST_DESCRIPTION),
20986
- plan_id: musicShape.plan_id.describe("Make the video from this plan (plan_music_video): its brief (model, kind, look, format, section\u2026) replaces the one sent, so send song_id and plan_id; quality left out is the plan's model's default. Omitted, the director plans it while it is made"),
21108
+ cast_mode: musicShape.cast_mode.describe(CAST_MODE),
21109
+ casting_id: musicShape.casting_id.describe(CASTING_ID),
21110
+ plan_id: musicShape.plan_id.describe("Make the video from this plan (plan_music_video): its brief (model, kind, visual style, format, section\u2026) replaces the one sent, so send song_id and plan_id; quality left out is the plan's model's default. Omitted, the director plans it while it is made"),
20987
21111
  quality: musicShape.quality.describe("The resolution it is made at: one of the qualities get_options lists for the model (left out, the model's default_quality: 768p for MiniMax H3 Max, 720p for Seedance; a sharper one is the same video for more credits); not part of the plan, so a plan is made in any quality. get_options lists each model's qualities with about how long each takes; credits.music_video.models has a minute by model and quality"),
20988
21112
  variations: musicShape.variations.describe("1\u20134 different music videos"),
20989
21113
  outro: musicShape.outro.describe("Optional: end on a release card after the last shot, the song playing on under it (the delivered video is up to 5 seconds longer; the director designs it for the video, or look_id: a lyric video Look from list_looks whose card is used as it is). display: title, artist, cover, badges (true/false) and optional cover_scale, text_scale, artist_scale, spacing_scale. Free with the video"),
20990
- refinish: musicShape.refinish.describe("Finish a delivered music video again with another outro, or none (send song_id, refinish.video_id and outro or not; one variation): no shot is made again, only setup and delivery are charged. Needs the video's revisable_until ahead"),
21114
+ refinish: musicShape.refinish.describe("Finish a delivered music video again with another outro, or none (send song_id, refinish.video_id and outro or not; one variation): no shot is made again (its kept shots are joined again under the song), only setup and delivery are charged. Needs the video's revisable_until ahead"),
21115
+ test: musicShape.test.describe("With plan_id: test the plan before the whole video. Only its test shots are made (the first chorus, else the sung section with the most lead words; whole shots, about 20 seconds at most), at 480p whatever quality is sent, with the plan's seeds and pictures, for a fraction of the price. The quote and get_video say which shots and seconds (test). It is an ordinary video marked as a test: no outro, one variation, never revised. Then order the whole video from the same plan_id without test"),
20991
21116
  design_shoot: musicShape.design_shoot.describe("Without a plan: the director first designs the shoot (the outfits, places and props the brief leaves open) and draws each as a picture every shot is given. The quote counts the most pictures it may draw; only those drawn are charged")
20992
21117
  });
20993
21118
  var musicVideoPlanInput = external_exports.object({
@@ -20996,7 +21121,7 @@ var musicVideoPlanInput = external_exports.object({
20996
21121
  model: musicShape.model.describe("The music video model: one-take (default; MiniMax H3 Max), seedance-2-0, seedance-2-0-fast, seedance-2-0-mini or seedance-2-5. get_options lists the models offered to you with the categories, styles, formats, takes and length each makes, and guide: what each is best for, its strengths, weaknesses and public benchmark scores. When the person hasn't named a model, suggest the kind's recommended_model (get_options music_video.categories) with its best_for line and the price difference between models from quotes, and let them choose any"),
20997
21122
  scenes: musicShape.scenes.describe(`Where it is set besides the places the direction mentions from the kit: {"mode":"invent"} (default: the director imagines the others) or {"mode":"stock"} (it finds a real stock photo of each place it writes, empty of people, and the artist is put into it), up to the model's kit.places in all`),
20998
21123
  category: musicShape.category.describe("performance (default), intercut, cinematic, story or surreal"),
20999
- style: musicShape.style.describe("Optional look: natural, film, golden-hour, neon-night, noir, vintage or dreamy; omitted, the director picks one from the cover"),
21124
+ style: musicShape.style.describe("Optional visual style (get_options: music_video.styles); omitted, the director picks one from the cover"),
21000
21125
  aspect_ratio: musicShape.aspect_ratio.describe('"9:16" (default), "16:9" or "1:1"'),
21001
21126
  takes: musicShape.takes.describe(`How the shots meet: "cuts" (default: shots meet with a cut between the song's lines, like an edit) or "continuous" (the director may carry a shot on into the next through a picture drawn of the moment they meet, priced per picture; the quote before a plan counts every join, the plan's quote only the ones it draws)`),
21002
21127
  trim: musicShape.trim.describe("Only this section of the song (15 seconds to 10 minutes); omitted, the whole song (15 seconds to 10 minutes long). Best: a part from get_song_analysis (parts[]: its start and end never cut a word)"),
@@ -21004,10 +21129,12 @@ var musicVideoPlanInput = external_exports.object({
21004
21129
  lookbook_id: musicShape.lookbook_id.describe(LOOKBOOK_ID),
21005
21130
  look_id: musicShape.look_id.describe(LOOK_ID),
21006
21131
  lipsync: musicShape.lipsync.describe(LIPSYNC),
21132
+ kit_only: musicShape.kit_only.describe(KIT_ONLY),
21007
21133
  on_screen: musicShape.on_screen.describe(ON_SCREEN_DESCRIPTION),
21008
21134
  performer: musicShape.performer.describe(PERFORMER),
21009
21135
  cast: musicShape.cast.describe(CAST_DESCRIPTION),
21010
- revise: MusicVideoPlanRequestSchema.shape.revise.describe('Rewrite an earlier plan of this song: {"plan_id":"plan_\u2026","note":"what to change"} (the next draft)')
21136
+ cast_mode: musicShape.cast_mode.describe(CAST_MODE),
21137
+ revise: MusicVideoPlanRequestSchema.shape.revise.describe(`Rewrite an earlier plan of this song: {"plan_id":"plan_\u2026","note":"what to change"} (the next draft). It keeps that plan's brief (model, format, style, direction, people, section\u2026): send song_id and revise alone, or with only the brief fields to change`)
21011
21138
  });
21012
21139
  var MusicVideoPlanSchema = external_exports.looseObject({
21013
21140
  id: external_exports.string(),
@@ -21029,7 +21156,7 @@ var MusicVideoPlanSchema = external_exports.looseObject({
21029
21156
  outfit: external_exports.object({ id: external_exports.string(), name: external_exports.string(), handle: external_exports.string() }).nullable().optional().describe("The kit outfit they wear throughout (drawn on their sheet by the lookbook, or picked in the brief); null: the director dresses them")
21030
21157
  })).optional().describe("The other characters in its shots (mentioned by @handle in direction: the artist's own and those other artists shared), each in one outfit throughout"),
21031
21158
  on_screen: external_exports.enum(["artist", "cast", "none"]).optional().describe("Who is on screen: the artist, a cast or no one"),
21032
- revision: external_exports.object({ video_id: external_exports.string(), shots: external_exports.array(external_exports.number().int()) }).nullable().describe("A revision of a delivered music video (revise_music_video_shot): that video, and the shots made again (the others are reused as they were); null for a plan of a new video"),
21159
+ revision: external_exports.object({ video_id: external_exports.string(), shots: external_exports.array(external_exports.number().int()), asked: external_exports.array(external_exports.number().int()).optional().describe("The shots the artist asked to change, each rewritten from its note (shots adds those carried straight on from them)") }).nullable().describe("A revision of a delivered music video (revise_music_video_shot): that video, and the shots made again (the others are reused as they were); null for a plan of a new video"),
21033
21160
  world: external_exports.object({ setting: external_exports.string(), wardrobe: external_exports.string(), light: external_exports.string() }).describe("What every shot keeps"),
21034
21161
  places: external_exports.array(external_exports.object({
21035
21162
  index: external_exports.number().int(),
@@ -21054,8 +21181,11 @@ var MusicVideoPlanSchema = external_exports.looseObject({
21054
21181
  continues: external_exports.boolean().describe("It carries straight on from the shot before (a continuous take), with no cut"),
21055
21182
  performance: external_exports.enum(MUSIC_VIDEO_PERFORMANCES).describe("sings: the artist sings it on camera (lip-synced); plays: they play an instrument to it; over: the song plays over the shot and nobody sings on camera. New values may be added"),
21056
21183
  on_screen: external_exports.enum(MUSIC_VIDEO_ON_SCREEN).describe("Who is in the shot: the artist, a cast (other people), or nobody. New values may be added"),
21057
- framing: external_exports.enum(["close", "wide"]).describe("close: the artist sings it on camera, face and mouth large in frame; wide: the song plays over them (dancing, walking, the place). New values may be added")
21184
+ framing: external_exports.enum(["close", "wide"]).describe("close: the artist sings it on camera, face and mouth large in frame; wide: the song plays over them (dancing, walking, the place). New values may be added"),
21185
+ cue: external_exports.object({ said: external_exports.string().nullable().describe("The words sung where it starts"), note: external_exports.string().describe("The direction's sentence: what changes") }).nullable().optional().describe('The moment the direction pinned a change to (on "\u2026" or at m:ss) that this shot starts on; null when none'),
21186
+ camera: external_exports.object({ size: external_exports.enum(SHOT_SIZES), angle: external_exports.enum(SHOT_ANGLES), move: external_exports.enum(SHOT_MOVES) }).nullable().optional().describe("How the director framed its (first) shot: size (close, medium, wide), angle (front, three-quarter, side, low, high, over-shoulder, back) and move (push-in, pull-out, arc, tilt, dolly, handheld, locked-off). Null for plans made before it. New values may be added")
21058
21187
  })),
21188
+ outro: external_exports.looseObject({}).nullable().optional().describe("The release card the director designed for this video: used only when the video is ordered with outro (create_music_video outro); no outro is added otherwise. null before outros"),
21059
21189
  created_at: external_exports.string()
21060
21190
  });
21061
21191
  var QUOTE_FIRST = "Always quote first and tell the user the credits before creating; credits are reserved at creation and charged only when the video is delivered.";
@@ -21121,7 +21251,25 @@ var VideoSchema = external_exports.looseObject({
21121
21251
  clips: external_exports.number().int().describe("How many clips it is generated in"),
21122
21252
  on_screen: external_exports.enum(["artist", "cast", "none"]).optional().describe("Who is on screen: the artist, a cast or no one"),
21123
21253
  world: external_exports.object({ setting: external_exports.string(), wardrobe: external_exports.string(), light: external_exports.string() }),
21124
- shots: external_exports.array(external_exports.object({ index: external_exports.number().int(), start_seconds: external_exports.number(), end_seconds: external_exports.number(), section: external_exports.string().nullable(), lyrics: external_exports.string(), summary: external_exports.string() })).describe("Each clip's beat, timed from the start of the video")
21254
+ shots: external_exports.array(external_exports.object({
21255
+ index: external_exports.number().int(),
21256
+ start_seconds: external_exports.number(),
21257
+ end_seconds: external_exports.number(),
21258
+ section: external_exports.string().nullable(),
21259
+ lyrics: external_exports.string(),
21260
+ summary: external_exports.string(),
21261
+ frame_url: external_exports.string().nullable().optional().describe("Delivered: a picture of the shot as it came out (from its middle; signed, 7 days); null for a video delivered before these pictures")
21262
+ })).describe("Each clip's beat, timed from the start of the video"),
21263
+ review: external_exports.array(external_exports.object({
21264
+ shot: external_exports.number().int().min(1).describe("The shot (its index in shots)"),
21265
+ verdict: external_exports.enum(["fix", "better"]).describe("fix: needs a fix; better: could be better"),
21266
+ finding: external_exports.string().describe("What is wrong, in one plain line"),
21267
+ note: external_exports.string().describe("A revision note written from the finding, to send as the shot's note to revise_music_video_shot (edit it freely)"),
21268
+ at_seconds: external_exports.number().describe("Where it starts, in seconds from the start of the video"),
21269
+ check: external_exports.enum(["faces", "mouth_backing", "mouth_silence", "lip_sync", "unasked"]).describe("What found it: faces (more faces than the shot has people), mouth_backing / mouth_silence (lips moving where only backing vocals, or nobody, sing), lip_sync, unasked (text, a logo or a prop nobody asked for)")
21270
+ })).nullable().optional().describe("Delivered: the director's look at every shot once they were joined, one item per shot that needs a fix or could be better (an empty list: every shot passed; null: not looked at, a video delivered before it). Nothing is made again on its own: revising is the artist's choice (revise_music_video_shot, priced by price_music_video_revision)"),
21271
+ lip_sync: external_exports.array(external_exports.object({ shot: external_exports.number().int().min(1), offset_seconds: external_exports.number().describe("How far the lips were off the lead vocal (positive: late), now lined up") })).optional().describe("Delivered: the sung shots whose picture was moved so the lips land on the lead vocal (measured on the faces, free)"),
21272
+ test: external_exports.object({ shots: external_exports.array(external_exports.number().int()).describe("The plan's shots it makes (their index in the plan)"), start_seconds: external_exports.number(), end_seconds: external_exports.number() }).nullable().optional().describe("A test of a plan (ordered with test: true): the plan's shots it made and their seconds in the song; null for a whole video")
21125
21273
  }).nullable().optional().describe("A music video's plan, once the director made it (null before)"),
21126
21274
  quoted_credits: external_exports.number().nullable(),
21127
21275
  charged_credits: external_exports.number().nullable(),
@@ -21140,7 +21288,7 @@ var OPERATIONS = [
21140
21288
  group: "account",
21141
21289
  title: "Get the account",
21142
21290
  summary: "Who you are signed in as, the organization (workspace) and its credit balance",
21143
- description: "Returns the organization the credentials act for (the workspace, as the app calls it; type artist holds one artist, label a roster, creator projects), how they authenticate and their scopes, the credit balance (available, monthly, top-ups) and its plan, if any: active says whether it lets the workspace create (without an active plan, creating answers 402 plan_required: tell the person to choose a plan in the app), storage (used_bytes against limit_bytes, what the plan allows: an upload or new video that does not fit answers 402 storage_full, and deleting videos or archiving songs frees space at once), where it is billed, when the period ends, and a downgrade or interval switch waiting for the renewal as scheduled_change. Without a plan, free_song says where the person's one free song stands (signed in as them, never with an API key, where it is null, as it is with a plan): available (upload one song now, with create_song; it plays in the Looks, and nothing is made from it until there is a plan), unverified (they confirm their email first), used (its song_id and title) or taken (it went to another workspace or account). Monthly credits reset every month; top-ups never expire. On the organization, " + IMAGE_FALLBACK + " Check it before creating anything.",
21291
+ description: "Returns the organization the credentials act for (the workspace, as the app calls it; type artist holds one artist, label a roster, creator projects), how they authenticate and their scopes, the credit balance (available, monthly, top-ups) and its plan, if any: active says whether it lets the workspace create (without an active plan, creating answers 402 plan_required), storage (used_bytes against limit_bytes: an upload or new video that does not fit answers 402 storage_full, and deleting videos or archiving songs frees space at once), where it is billed, when the period ends, and a downgrade or interval switch waiting for the renewal as scheduled_change. Without a plan, free_song says where the person's one free song stands (signed in as them, never with an API key, where it is null, as it is with a plan): available (upload one song now, with create_song; it plays in the Looks), unverified (they confirm their email first), used (its song_id and title, and video: available true while its one free video is still to make, video_id once it is) or taken (it went to another workspace or account). The free video is a lyric video of the free song with an existing Look (look.mode existing) in one aspect ratio, quoted and created as usual: it holds no credits; anything else answers 402 plan_required. Monthly credits reset every month; top-ups never expire. On the organization, " + IMAGE_FALLBACK + " Check it before creating anything.",
21144
21292
  method: "GET",
21145
21293
  path: "/api/v1/account",
21146
21294
  scopes: ["videos:read", "music:read", "library:read"],
@@ -21151,12 +21299,34 @@ var OPERATIONS = [
21151
21299
  cli: ["account"],
21152
21300
  mcp: "get_account"
21153
21301
  },
21302
+ {
21303
+ id: "uploads.create",
21304
+ group: "account",
21305
+ title: "Send a file from your computer",
21306
+ summary: "A signed upload URL for a local file, and the file_url to use it",
21307
+ description: `For an agent that has a file on the person's computer but can only pass URLs (the CLI sends files itself): returns upload_url, where you PUT the file's bytes within an hour with the headers given, e.g. curl -X PUT -H "content-type: image/png" --upload-file desk.png "<upload_url>"; then pass file_url in any *_url field within a day: create_song (audio_url, cover_art_url), add_kit_piece (file_url), start_character (photo_urls), upload_background (file_url), set_artist_image (image_url). That field checks the file like an upload (format, size, rights) and keeps its own copy; this one is deleted after a day. size_bytes must be the file's exact size (up to ${UPLOAD_MAX_BYTES / 1024 / 1024} MB), content_type its type. Up to 100 files a day; without a plan, only a free song's audio and cover.`,
21308
+ method: "POST",
21309
+ path: "/api/v1/uploads",
21310
+ scopes: ["music:write", "videos:write"],
21311
+ input: UploadCreateSchema.extend({
21312
+ filename: UploadCreateSchema.shape.filename.describe("The file's name, e.g. desk.png (kept on the stored copy)"),
21313
+ content_type: UploadCreateSchema.shape.content_type.describe("Its type: audio/mpeg, audio/wav, audio/mp4, image/jpeg, image/png, image/webp, video/mp4, video/quicktime or video/webm"),
21314
+ size_bytes: UploadCreateSchema.shape.size_bytes.describe("Its exact size in bytes (the upload must match it)")
21315
+ }),
21316
+ readOnly: false,
21317
+ destructive: false,
21318
+ idempotent: false,
21319
+ cli: ["uploads", "create"],
21320
+ mcp: "create_upload",
21321
+ output: { name: "Upload", schema: UploadSchema },
21322
+ example: { filename: "desk.png", content_type: "image/png", size_bytes: 1834201 }
21323
+ },
21154
21324
  {
21155
21325
  id: "options.get",
21156
21326
  group: "account",
21157
21327
  title: "List the options",
21158
21328
  summary: "Video types, Look categories, background sources, formats and the current credit prices",
21159
- description: "Everything a request can choose from, with the credit table, and what's on sale (plans: each plan's monthly and yearly price in cents, monthly credits, limits and features, the recommended one marked highlighted, and shelf: everyday for lyric videos, Canvas and some AI music videos, studio for AI music videos every month; credit_packs: each pack's credits and price in cents; music_video.categories and music_video.styles: each kind and look, with demos, the real music videos of it Kinetune chose: one per model (model: its id) and a fallback (model null) for a model without its own; each with sound in video_url, a few silent seconds from its poster moment hover_seconds in hover_url, its poster in still_url, made_with: the model and quality it was made with, and story: its brief, the director's idea and its shots; signed for about a week. Show the one for the model in hand, else the fallback; demo is the fallback alone, as before). music_video.models[].guide: what each model is best for (best_for), its strengths and weaknesses, the kinds it suits, its sharpest resolution (max_quality), public benchmark scores (board, entry, score, source, url, date) and page_url, the page comparing them; music_video.categories[].recommended_model: the offered model to suggest for that kind when the person hasn't named one. The catalog is set by Kinetune's admins and can change; a subscription keeps what it was bought with. Use it to pick a category or source and to explain prices.",
21329
+ description: "Everything a request can choose from, with the credit table (plans and credit_packs: the plan catalog the app shows, each plan's monthly credits, limits, features and shelf, its prices in cents and the app's highlighted one, and each pack's credits and price; reference only, nothing is bought through the API; music_video.categories: each kind, with demos, the real music videos of it Kinetune chose: one per model (model: its id) and a fallback (model null) for a model without its own; each with sound in video_url, a few silent seconds from its poster moment hover_seconds in hover_url, its poster in still_url, made_with: the model and quality it was made with, and story: its brief, the director's idea and its shots; signed for about a week. Show the one for the model in hand, else the fallback; demo is the fallback alone, as before. music_video.styles: each visual style (how the video is rendered), with its one picture: image_url (512 px square WebP) and thumbnail_url (160 px); its demo and demos are deprecated (still given until 2027-05-05: use image_url). music_video.models[].guide: what each model is best for (best_for), its strengths and weaknesses, the kinds it suits, its sharpest resolution (max_quality), public benchmark scores (board, entry, score, source, url, date) and page_url, the page comparing them; music_video.categories[].recommended_model: the offered model to suggest for that kind when the person hasn't named one. The catalog is set by Kinetune's admins and can change; a subscription keeps what it was bought with. credits.character_sheet: what drawing one character sheet costs now (draw_character_sheet). Use it to pick a category or source and to explain prices.",
21160
21330
  method: "GET",
21161
21331
  path: "/api/v1/options",
21162
21332
  scopes: ["videos:read", "music:read", "library:read"],
@@ -21188,7 +21358,7 @@ var OPERATIONS = [
21188
21358
  group: "account",
21189
21359
  title: "Create an organization",
21190
21360
  summary: "A new organization owned by you, with its own music, videos, Looks and credits",
21191
- description: "Creates an empty organization (a workspace, in the app) with the signed-in person as its owner; with an API key, the member who created the key (the key needs organizations:write). type artist is for one artist (add that artist next with create_artist; its songs then need no artist_id), label for a roster. It starts with no plan and no credits: the owner chooses a plan in the app before anything can be created in it. These credentials keep acting for their current organization: to work in the new one, sign in again and pick it, or create an API key in it.",
21361
+ description: "Creates an empty organization (a workspace, in the app) with the signed-in person as its owner; with an API key, the member who created the key (the key needs organizations:write). type artist is for one artist (add that artist next with create_artist; its songs then need no artist_id), label for a roster. It starts with no plan and no credits, so nothing can be created in it until it has one. These credentials keep acting for their current organization: to work in the new one, sign in again and pick it, or create an API key in it.",
21192
21362
  method: "POST",
21193
21363
  path: "/api/v1/organizations",
21194
21364
  scopes: ["organizations:write"],
@@ -21310,18 +21480,18 @@ var OPERATIONS = [
21310
21480
  group: "artists",
21311
21481
  title: "Set the artist image",
21312
21482
  summary: "Upload or replace the artist\u2019s image, their picture on the artist page and in lists",
21313
- description: "The artist image (image_url on the artist) is kept as a 512 px square: upload the file (or a public https image_url, JPEG, PNG or WebP, at least 512 px on the short side, up to 15 MB) and, optionally, crop: the square to keep in fractions of the upright image (x/y the top-left corner, size the side relative to the image\u2019s short side); left out, it is centered. It replaces the current image; the uploaded file itself is not kept. It is only a display picture: never shown to a model (videos keep the artist from their character: list_characters). Works without a plan.",
21483
+ description: "The artist image (image_url on the artist) is kept as a 512 px square: upload the file (or a public https image_url, JPEG, PNG or WebP, at least 512 px on the short side, up to 15 MB) and, optionally, crop: the square to keep in fractions of the upright image (x/y the top-left corner, size the side relative to the image\u2019s short side); left out, it is centered. It replaces the current image, which can\u2019t be brought back; the uploaded file itself is not kept. It is only a display picture: never shown to a model (videos keep the artist from their character: list_characters). Works without a plan.",
21314
21484
  method: "POST",
21315
21485
  path: "/api/v1/artists/{artist_id}/image",
21316
21486
  scopes: ["music:write", "videos:write"],
21317
21487
  input: external_exports.object({
21318
21488
  artist_id: artistId,
21319
- image_url: httpsUrl("the image").optional().describe("A public https URL of the image (or upload the file with the CLI)"),
21489
+ image_url: httpsUrl("the image").optional().describe("A public https URL of the image (a file on your computer: create_upload's file_url, or upload it with the CLI)"),
21320
21490
  crop: PICTURE_CROP.describe("The square to keep, in fractions of the image; centered when omitted")
21321
21491
  }),
21322
21492
  files: [{ field: "image", urlField: "image_url", accept: ["image/jpeg", "image/png", "image/webp"], description: "The artist image" }],
21323
21493
  readOnly: false,
21324
- destructive: false,
21494
+ destructive: true,
21325
21495
  idempotent: true,
21326
21496
  cli: ["artists", "image", "set"],
21327
21497
  mcp: "set_artist_image",
@@ -21385,7 +21555,7 @@ var OPERATIONS = [
21385
21555
  group: "artists",
21386
21556
  title: "Start a face check",
21387
21557
  summary: "The page where the person proves, live on camera, that the face is theirs",
21388
- description: "Only the person shown on the character can pass it, on a phone with a camera: give them the link (good for 30 minutes), then get_face_check until passed. consent: they agreed to Kinetune checking their face and keeping it to match their pictures in this model's videos (kinetune.com/privacy, Face checks); ask them first, never assume it. A failed check is started again.",
21558
+ description: "Returns only a link (url, good for 30 minutes) to Kinetune's own face check page: this tool takes and returns no image, video or face data, and nothing about a face passes through the conversation. Only the person shown on the character can pass it, on that page, on a phone with a camera; then get_face_check says passed or failed. consent: the person said, in their own words, that they agree to Kinetune checking their face on that page and keeping the result to match their pictures in this model's videos (kinetune.com/privacy, Face checks); ask them first, never assume it or set it for them. They can delete it any time with withdraw_face_check. A failed check is started again.",
21389
21559
  method: "POST",
21390
21560
  path: "/api/v1/characters/{character_id}/face-check",
21391
21561
  scopes: ["music:write", "videos:write"],
@@ -21420,15 +21590,16 @@ var OPERATIONS = [
21420
21590
  id: "character_requests.create",
21421
21591
  group: "artists",
21422
21592
  title: "Start a character",
21423
- summary: "Photos of a person to draw a sheet from, or a finished sheet to add",
21424
- description: `mode generate: 1 to 5 photos of one person (any angles); they are read (a clear face is needed, someone else is set aside) and given a base outfit line, which can be edited before drawing (draw_character_sheet, priced in credits). mode add: one finished sheet, read (one person, a clear face, the views it shows, any text on it) and kept as it is, free. Only with the rights to use these images (rights_confirmed). Uploads are kept until the character is kept (keep_character), or a day; a sheet drawn and paid for, 30 days (list_character_requests finds it). ${NEEDS_PLAN}`,
21593
+ summary: "Photos of a person to draw a sheet from, a finished sheet to add, the camera's six shots, or a made-up person described in words",
21594
+ description: `mode generate: 1 to 6 photos of one person (any angles); they are read (a clear face is needed, someone else is set aside) and given a base outfit line, which can be edited before drawing (draw_character_sheet, priced in credits). mode add: one finished sheet, read (one person, a clear face, the views it shows, any text on it) and kept as it is, free. mode camera: the six shots of Take from camera, in its order (the face from the front, the head turned left and right, the whole body from the front, the side and the back), or the three head shots when the body is skipped, each cut out and laid out as the standard sheet, which then goes the way of mode add (free; the shots themselves are not kept). mode describe: a made-up person from a description (description: looks, age, build, hair, style; no photos), read first (one adult, made up: never a real or famous person, 422 otherwise) and given a base outfit line, then drawn like photos (draw_character_sheet, priced in credits) and kept as AI-made. Photos, sheets and shots only with the rights to use these images (rights_confirmed). Uploads are kept until the character is kept (keep_character), or a day; a sheet drawn and paid for, 30 days (list_character_requests finds it). modes generate and describe need an active plan (402 plan_required without one; get_account: plan.active); modes add and camera work without one. A workspace starts at most 30 characters an hour and 50 a day (6 and 10 without a plan; 429 past them). Both need room in storage (402 storage_full when it would not fit; get_account: storage).`,
21425
21595
  method: "POST",
21426
21596
  path: "/api/v1/character-requests",
21427
21597
  scopes: ["music:write", "videos:write"],
21428
21598
  input: external_exports.object({
21429
- mode: external_exports.enum(["generate", "add"]).optional().describe("generate (default): draw a sheet from photos; add: a finished sheet"),
21430
- photo_urls: external_exports.array(httpsUrl("a photo")).min(1).max(5).optional().describe("Public https URLs of the photos, or of the one sheet (or upload files with the CLI)"),
21431
- rights_confirmed: external_exports.literal(true).describe("You have the rights to use these images of this person")
21599
+ mode: external_exports.enum(["generate", "add", "camera", "describe"]).optional().describe("generate (default): draw a sheet from photos; add: a finished sheet; camera: the camera shots in order (six, or the three head shots); describe: a made-up person from description"),
21600
+ description: external_exports.string().trim().min(CHARACTER_DESCRIPTION_MIN).max(CHARACTER_DESCRIPTION_MAX).optional().describe("mode describe: who they are, in words (looks, age, build, hair, style); a made-up adult, never a real or famous person"),
21601
+ photo_urls: external_exports.array(httpsUrl("a photo")).min(1).max(6).optional().describe("Public https URLs of the photos, or of the one sheet (files on your computer: create_upload's file_url for each, or upload them with the CLI)"),
21602
+ rights_confirmed: external_exports.literal(true).optional().describe("You have the rights to use these images of this person (needed with photos, a sheet or camera shots; not for describe)")
21432
21603
  }),
21433
21604
  files: [{ field: "photos", urlField: "photo_urls", multiple: true, accept: ["image/jpeg", "image/png", "image/webp"], description: "Photos of the person, or the one sheet" }],
21434
21605
  readOnly: false,
@@ -21441,8 +21612,8 @@ var OPERATIONS = [
21441
21612
  id: "character_requests.list",
21442
21613
  group: "artists",
21443
21614
  title: "List sheets waiting to be kept",
21444
- summary: "Character sheets being drawn, or drawn and paid for but not kept yet",
21445
- description: "Newest first. A sheet drawn and paid for waits 30 days to be kept (keep_character), then is deleted; one being drawn shows status drawing.",
21615
+ summary: "Photos read and ready to draw, character sheets being drawn, or drawn and paid for but not kept yet",
21616
+ description: "Newest first. Photos read and ready to draw (status analyzed, nothing charged yet) wait a day; a sheet drawn and paid for waits 30 days to be kept (keep_character), then is deleted; one being drawn shows status drawing.",
21446
21617
  method: "GET",
21447
21618
  path: "/api/v1/character-requests",
21448
21619
  scopes: ["music:read", "videos:read"],
@@ -21474,7 +21645,7 @@ var OPERATIONS = [
21474
21645
  group: "artists",
21475
21646
  title: "Draw a character sheet",
21476
21647
  summary: "Draws the sheet for the credits shown (again with a note to redraw)",
21477
- description: 'From photos, or an added sheet drawn again as a plain base sheet (nothing worn or held beyond one plain outfit). credits must be price.credits from get_character_request: tell the user first. outfit: the base outfit line as the user left it (always drawn plain: one top and fitted trousers or skirt, solid colours, barefoot, no jewellery). note: what to change when drawing again ("her hair is shorter"). Charged only once the sheet passes its check (one person, a clear face, no text); a failed check is redrawn once at no charge.',
21648
+ description: 'From photos, a description (mode describe), or an added sheet drawn again as a plain base sheet (nothing worn or held beyond one plain outfit). credits must be price.credits from get_character_request: tell the user first. outfit: the base outfit line as the user left it (always drawn plain: one top and fitted trousers or skirt, solid colours, barefoot, no jewellery). note: what to change when drawing again ("her hair is shorter"). Charged only once the sheet passes its check (one person, a clear face, no text); a failed check is redrawn once at no charge. Needs an active plan (402 plan_required without one; get_account: plan.active).',
21478
21649
  method: "POST",
21479
21650
  path: "/api/v1/character-requests/{request_id}/draw",
21480
21651
  scopes: ["music:write", "videos:write"],
@@ -21495,7 +21666,7 @@ var OPERATIONS = [
21495
21666
  group: "artists",
21496
21667
  title: "Keep a character",
21497
21668
  summary: "Keeps the sheet in the kit, as an artist or as named cast",
21498
- description: "artist_id: it is that artist (one each, in their own kit; replace true takes the place of theirs); or name: cast, with an @handle from the name (or handle), in owner_artist_id's kit (left out: the workspace's only artist, else its first, shared). shared true offers them to every other artist's videos too (default false). ai_made: ask the user whether this is an AI-made person who looks like no real person, or a real person (false: a model that needs a face check shows them once they pass it); never guess it. Left out, they count as real. The uploads are deleted.",
21669
+ description: "artist_id: it is that artist (one each, in their own kit; replace true takes the place of theirs); or name: cast, with an @handle from the name (or handle), in owner_artist_id's kit (left out: the workspace's only artist, else its first, shared). shared true offers them to every other artist's videos too (default false). ai_made: ask the user whether this is an AI-made person who looks like no real person, or a real person (false: a model that needs a face check shows them once they pass it); never guess it. Left out, they count as real. The uploads are deleted, and replace true deletes the artist's current character for good.",
21499
21670
  method: "POST",
21500
21671
  path: "/api/v1/character-requests/{request_id}/keep",
21501
21672
  scopes: ["music:write", "videos:write"],
@@ -21510,7 +21681,7 @@ var OPERATIONS = [
21510
21681
  ai_made: external_exports.boolean().optional().describe("An AI-made person who looks like no real person (true), or a real person (false)")
21511
21682
  }),
21512
21683
  readOnly: false,
21513
- destructive: false,
21684
+ destructive: true,
21514
21685
  idempotent: false,
21515
21686
  cli: ["characters", "keep"],
21516
21687
  mcp: "keep_character"
@@ -21572,7 +21743,7 @@ var OPERATIONS = [
21572
21743
  handle: KitHandleSchema.optional().describe("Its @handle (default: from the name)"),
21573
21744
  description: external_exports.string().trim().max(300).optional().describe("What it is, for the director (a stock photo\u2019s caption by default)"),
21574
21745
  crop: CropRectSchema.optional().describe('The rectangle to keep, in fractions of the image: {"x","y","w","h"}; the whole image when omitted'),
21575
- file_url: httpsUrl("the image").optional().describe("A public https URL of the image (or upload a file with the CLI)"),
21746
+ file_url: httpsUrl("the image").optional().describe("A public https URL of the image (a file on your computer: create_upload's file_url, or upload it with the CLI)"),
21576
21747
  stock_id: StockIdSchema.optional().describe("A stock photo id from search_stock instead of an image"),
21577
21748
  rights_confirmed: external_exports.literal(true).optional().describe("You have the rights to use the image (needed for an upload or file_url)")
21578
21749
  }),
@@ -21605,7 +21776,7 @@ var OPERATIONS = [
21605
21776
  group: "artists",
21606
21777
  title: "Change a kit piece",
21607
21778
  summary: "Rename it, change its handle or description, crop it again, or share it",
21608
- description: "crop is cut again from the image the piece was added from. shared: offer it (a character too) to every other artist's songs (true), or keep it to its own artist's (false); it stays in its own artist's kit either way. ai_made, on a character only: an AI-made person who looks like no real person (true), or a real one (false); a person who passed a face check is real (withdraw it first). Plans already made keep the pieces as they were planned.",
21779
+ description: "crop is cut again from the image the piece was added from. kept true keeps another angle of a place that is pending (a brief can mention it then). shared: offer it (a character too) to every other artist's songs (true), or keep it to its own artist's (false); it stays in its own artist's kit either way. ai_made, on a character only: an AI-made person who looks like no real person (true), or a real one (false); a person who passed a face check is real (withdraw it first). Plans already made keep the pieces as they were planned.",
21609
21780
  method: "PATCH",
21610
21781
  path: "/api/v1/kit/{kit_id}",
21611
21782
  scopes: ["music:write", "videos:write"],
@@ -21616,7 +21787,8 @@ var OPERATIONS = [
21616
21787
  description: external_exports.string().trim().max(300).nullable().optional(),
21617
21788
  crop: CropRectSchema.optional().describe("The new rectangle, in fractions of the source image"),
21618
21789
  ai_made: external_exports.boolean().optional().describe("A character only: an AI-made person (true) or a real one (false)"),
21619
- shared: external_exports.boolean().optional().describe("Offer it to every other artist\u2019s songs too (true), or only its own artist\u2019s (false)")
21790
+ shared: external_exports.boolean().optional().describe("Offer it to every other artist\u2019s songs too (true), or only its own artist\u2019s (false)"),
21791
+ kept: external_exports.literal(true).optional().describe("Another angle of a place that is pending (draw_place_angles): keep it in the kit. To leave it out, delete it")
21620
21792
  }),
21621
21793
  readOnly: false,
21622
21794
  destructive: false,
@@ -21640,6 +21812,28 @@ var OPERATIONS = [
21640
21812
  cli: ["kit", "delete"],
21641
21813
  mcp: "delete_kit_piece"
21642
21814
  },
21815
+ {
21816
+ id: "kit.angles",
21817
+ group: "artists",
21818
+ title: "Draw other angles of a place",
21819
+ summary: "The same set from three-quarter, side or low, each a new place (spends credits)",
21820
+ description: `A place only. Without confirm: the price (credits per angle and the total), nothing drawn; tell the user, then send confirm true after their go (and credits: the total shown; a different price answers 409 with the current quote). Each angle is one picture of the same place, its layout, props, colours and light, from another side, empty of people, drawn in about a minute; it comes back as a new place in the same artist's kit (owned and shared like the place), named "<place> \xB7 side", with angle_of (the first place of its set) and angle. A new angle is pending: the user keeps it (update_kit_piece with kept true) or leaves it out (delete_kit_piece); a brief can mention it once kept. A brief that mentions places of one set gets them as one set: the director cuts between the angles. Credits are held, then charged for each picture drawn (failed lists any that couldn't be, not charged). ${NEEDS_PLAN}`,
21821
+ method: "POST",
21822
+ path: "/api/v1/kit/{kit_id}/angles",
21823
+ scopes: ["videos:write"],
21824
+ input: external_exports.object({
21825
+ kit_id: id("place (kit piece)"),
21826
+ angles: external_exports.array(external_exports.enum(KIT_ANGLES)).min(1).max(3).optional().describe("Which sides: three-quarter, side, low (default: all three)"),
21827
+ confirm: external_exports.boolean().optional().describe("true: draw them (spends credits); left out: only the price"),
21828
+ credits: external_exports.number().int().positive().optional().describe("With confirm: the total price shown, so a changed price is refused")
21829
+ }),
21830
+ readOnly: false,
21831
+ destructive: false,
21832
+ idempotent: false,
21833
+ cli: ["kit", "angles"],
21834
+ mcp: "draw_place_angles",
21835
+ example: { angles: ["three-quarter", "side", "low"], confirm: true, credits: 54 }
21836
+ },
21643
21837
  /* Songs */
21644
21838
  {
21645
21839
  id: "songs.list",
@@ -21666,8 +21860,8 @@ var OPERATIONS = [
21666
21860
  id: "songs.create",
21667
21861
  group: "songs",
21668
21862
  title: "Upload a song",
21669
- summary: "Add a song: master audio and square cover art",
21670
- description: `Audio: MP3, WAV or M4A up to 250 MB. Cover: a square JPEG or PNG, 1000\u20136000 px (3000\xD73000 recommended), up to 20 MB; it is kept at 1536, 640 and 160 px, not as uploaded. The song is analyzed next (lyrics, beats, sections): poll get_song until analysis.status is "ready", usually about a minute. Pass lyrics (or set them later with set_song_lyrics) to have the videos spell every word right. ${NEEDS_PLAN}`,
21863
+ summary: "Add a song: master audio, and square cover art if it has one",
21864
+ description: `Audio: MP3, WAV or M4A up to 250 MB. Cover (optional): a square JPEG or PNG, 1000\u20136000 px (3000\xD73000 recommended), up to 20 MB; it is kept at 1536, 640 and 160 px, not as uploaded. Without one the song has no cover (cover_art null) and every video still works; set_song_cover adds one later. The song is analyzed next (lyrics, beats, sections): poll get_song until analysis.status is "ready", usually about a minute. Pass lyrics (or set them later with set_song_lyrics) to have the videos spell every word right. ${NEEDS_PLAN}`,
21671
21865
  method: "POST",
21672
21866
  path: "/api/v1/songs",
21673
21867
  scopes: ["music:write", "videos:write"],
@@ -21676,13 +21870,13 @@ var OPERATIONS = [
21676
21870
  title: external_exports.string().trim().min(1).max(300).describe("The song title"),
21677
21871
  language: external_exports.string().regex(/^[a-z]{2,3}$/).optional().describe('Lyrics language (ISO 639-1, e.g. "en"); detected when omitted'),
21678
21872
  audio_url: httpsUrl("the master audio").optional(),
21679
- cover_art_url: httpsUrl("the square cover art").optional(),
21873
+ cover_art_url: httpsUrl("the square cover art").optional().describe("Optional: a public https URL of the square cover art (a file on your computer: create_upload's file_url, or upload it with the CLI). Leave it out for a song without cover art"),
21680
21874
  lyrics: external_exports.string().max(1e5).optional().describe(`Optional. ${LYRICS} once the song is analyzed (get_song: analysis.lyrics.status "mismatch")`),
21681
21875
  instrumental: external_exports.boolean().optional().meta({ deprecated: true, "x-sunset": "2027-04-30" }).describe("Deprecated: the analysis hears whether a song has vocals (get_song: instrumental). true still skips transcription: lyric videos have no words and music videos never lip-sync (no lyrics with it). Stops working on 2027-04-30.")
21682
21876
  }),
21683
21877
  files: [
21684
21878
  { field: "audio", urlField: "audio_url", accept: ["audio/mpeg", "audio/wav", "audio/mp4"], description: "Master audio (MP3, WAV or M4A)" },
21685
- { field: "cover_art", urlField: "cover_art_url", accept: ["image/jpeg", "image/png"], description: "Square cover art (JPEG or PNG)" }
21879
+ { field: "cover_art", urlField: "cover_art_url", accept: ["image/jpeg", "image/png"], description: "Square cover art (JPEG or PNG), optional" }
21686
21880
  ],
21687
21881
  textFiles: ["lyrics"],
21688
21882
  readOnly: false,
@@ -21712,7 +21906,7 @@ var OPERATIONS = [
21712
21906
  group: "songs",
21713
21907
  title: "Rename a song",
21714
21908
  summary: "Change a song\u2019s title",
21715
- description: `instrumental is deprecated: the analysis hears whether a song has vocals. Switching it still analyzes the song again (an instrumental isn't transcribed, and its lyrics go): poll get_song until analysis.status is "ready".`,
21909
+ description: `A new title changes nothing else. instrumental is deprecated: the analysis hears whether a song has vocals. Switching it still analyzes the song again and replaces the analysis (an instrumental isn't transcribed, and its lyrics, including any set with set_song_lyrics, are deleted): poll get_song until analysis.status is "ready". Leave it out unless the user asks.`,
21716
21910
  method: "PATCH",
21717
21911
  path: "/api/v1/songs/{song_id}",
21718
21912
  scopes: ["music:write", "videos:write"],
@@ -21722,11 +21916,157 @@ var OPERATIONS = [
21722
21916
  instrumental: external_exports.boolean().optional().meta({ deprecated: true, "x-sunset": "2027-04-30" }).describe("Deprecated: the analysis hears whether a song has vocals. true: a song without vocals (never transcribed, never lip-synced). Stops working on 2027-04-30.")
21723
21917
  }),
21724
21918
  readOnly: false,
21725
- destructive: false,
21919
+ destructive: true,
21726
21920
  idempotent: true,
21727
21921
  cli: ["songs", "rename"],
21728
21922
  mcp: "rename_song"
21729
21923
  },
21924
+ {
21925
+ id: "songs.set_cover",
21926
+ group: "songs",
21927
+ title: "Change a song\u2019s cover",
21928
+ summary: "Replace a song\u2019s cover art, or add one",
21929
+ description: "Adds cover art to a song without one, or replaces it. The new cover is checked like an upload\u2019s (a square JPEG or PNG, 1000\u20136000 px, up to 20 MB) and kept at its full size and at 1536, 640 and 160 px; the cover before stays on the song (list_song_covers) and can be put back in use (use_cover). Videos already made keep the cover they had; quotes, Looks, Canvas loops, music video plans and videos made from then on use the new one. Refused (409, code song_busy) while a video of the song is being made: try again once it is done.",
21930
+ method: "POST",
21931
+ path: "/api/v1/songs/{song_id}/cover",
21932
+ scopes: ["music:write", "videos:write"],
21933
+ input: external_exports.object({ song_id: songId, cover_art_url: httpsUrl("the square cover art").optional().describe("A public https URL of the new cover (or upload the file with the CLI)") }),
21934
+ files: [{ field: "cover_art", urlField: "cover_art_url", accept: ["image/jpeg", "image/png"], description: "Square cover art (JPEG or PNG)" }],
21935
+ readOnly: false,
21936
+ destructive: true,
21937
+ idempotent: true,
21938
+ cli: ["songs", "set-cover"],
21939
+ mcp: "set_song_cover",
21940
+ example: { song_id: "song_\u2026", cover_art_url: "https://example.com/cover-3000.jpg" }
21941
+ },
21942
+ {
21943
+ id: "covers.list",
21944
+ group: "songs",
21945
+ title: "List a song\u2019s covers",
21946
+ summary: "Every cover the song has had, made or uploaded, the one in use marked, and what making more costs",
21947
+ description: "Newest first; each cover is kept until deleted (delete_cover). in_use is the cover the song uses; any other can be put back in use (use_cover). A made cover (source made, ai_made true) has the idea it came from (title, pitch, style, director_pick). download_url saves its full size (full_size px square: 3000 for a made cover). rounds: covers being made now (make_cover), and the newest round if it failed. can.plan: making covers needs a paid plan; can.ready: the song is analysed; can.artist: the artist can be on a cover (they have a character). price.counts: the credits for 1 to 4 covers; price.redraw: redrawing one with a note. artist_look: the colours and typeface the artist's covers keep, once their first made cover is used.",
21948
+ method: "GET",
21949
+ path: "/api/v1/songs/{song_id}/covers",
21950
+ scopes: ["music:read", "videos:read"],
21951
+ input: external_exports.object({ song_id: songId }),
21952
+ readOnly: true,
21953
+ destructive: false,
21954
+ idempotent: true,
21955
+ cli: ["covers", "list"],
21956
+ mcp: "list_song_covers"
21957
+ },
21958
+ {
21959
+ id: "covers.quote",
21960
+ group: "songs",
21961
+ title: "Price covers",
21962
+ summary: "What a round of 1 to 4 covers costs, and a redraw",
21963
+ description: "credits: what a round of count covers costs now (the direction once, each cover on top); redraw_credits: redrawing one cover with a note. Tell the user before make_cover or redraw_cover, and send the same credits.",
21964
+ method: "GET",
21965
+ path: "/api/v1/cover-requests/quote",
21966
+ scopes: ["music:read", "videos:read"],
21967
+ input: external_exports.object({ count: external_exports.number().int().min(COVER_COUNT.min).max(COVER_COUNT.max).optional().describe("How many covers (1 to 4, default 1)") }),
21968
+ readOnly: true,
21969
+ destructive: false,
21970
+ idempotent: true,
21971
+ cli: ["covers", "quote"],
21972
+ mcp: "quote_cover"
21973
+ },
21974
+ {
21975
+ id: "covers.make",
21976
+ group: "songs",
21977
+ title: "Make covers",
21978
+ summary: "Kinetune\u2019s cover art director makes 1 to 4 covers for a song, each a different idea",
21979
+ description: `The director reads the song (its meaning, never a lyric drawn literally), the user's choices and the artist's character, and the image model draws each cover; each is checked (no letters in the picture, reads as a thumbnail) and kept on the song (list_song_covers) as it is drawn, in about a minute. Only covers that pass are charged; the song keeps its cover until the user picks one (use_cover). style: how it is made (auto: the director picks); vibes: up to ${COVER_VIBES_MAX} moods (dark, sad, hood, luxury\u2026); artist: auto (the director decides), always (needs their character), never; idea: the user's own words; words: none, title, or artist_title, set by Kinetune in real type, always spelled as the song (the type style needs words); look: overrides the artist's colours and typeface. Ask the user for their choices rather than guessing, and quote first (quote_cover): credits must match. Needs a paid plan (402 plan_required) and an analysed song (409 song_not_ready); one round per song at a time (409 covers_in_progress).`,
21980
+ method: "POST",
21981
+ path: "/api/v1/cover-requests",
21982
+ scopes: ["music:write", "videos:write"],
21983
+ input: external_exports.object({
21984
+ song_id: songId,
21985
+ count: external_exports.number().int().min(COVER_COUNT.min).max(COVER_COUNT.max).optional().describe("How many covers, each a different idea (1 to 4, default 1)"),
21986
+ style: external_exports.enum(COVER_STYLE_IDS).optional().describe("How it is made (default auto: the director picks)"),
21987
+ vibes: external_exports.array(external_exports.enum(COVER_VIBE_IDS)).max(COVER_VIBES_MAX).optional().describe("Up to two moods or worlds"),
21988
+ artist: external_exports.enum(COVER_ARTIST_MODES).optional().describe("Who is on it: auto (the director decides), always (the artist), never"),
21989
+ idea: external_exports.string().trim().max(COVER_IDEA_MAX).optional().describe("The user's idea, in their words"),
21990
+ words: external_exports.enum(COVER_WORDS).optional().describe("Words on the cover, set in real type: none (default), title, artist_title"),
21991
+ look: CoverLookSchema.optional().describe("The artist's colours (hex) and typeface for this round"),
21992
+ credits: external_exports.number().int().positive().describe("credits from quote_cover for this count, as shown to the user")
21993
+ }),
21994
+ readOnly: false,
21995
+ destructive: false,
21996
+ idempotent: false,
21997
+ cli: ["covers", "make"],
21998
+ mcp: "make_cover",
21999
+ example: { song_id: "song_\u2026", count: 2, style: "auto", vibes: ["sad"], words: "none", credits: 190 }
22000
+ },
22001
+ {
22002
+ id: "covers.get",
22003
+ group: "songs",
22004
+ title: "Get a round of covers",
22005
+ summary: "Each idea with its cover once drawn",
22006
+ description: "status: queued, drawing (covers appear as they are drawn), drawn, or failed (nothing charged; error says why). covers[].status: drawing, ready (cover: the cover kept on the song) or failed (it failed its check twice; not charged). credits: what the round cost.",
22007
+ method: "GET",
22008
+ path: "/api/v1/cover-requests/{request_id}",
22009
+ scopes: ["music:read", "videos:read"],
22010
+ input: external_exports.object({ request_id: external_exports.string().min(1).describe("The round id (coverreq_\u2026)") }),
22011
+ readOnly: true,
22012
+ destructive: false,
22013
+ idempotent: true,
22014
+ cli: ["covers", "get"],
22015
+ mcp: "get_cover_request"
22016
+ },
22017
+ {
22018
+ id: "covers.redraw",
22019
+ group: "songs",
22020
+ title: "Redraw a cover",
22021
+ summary: "Draws one cover of a round again with the user\u2019s note",
22022
+ description: 'Keeps the idea and changes what the note asks ("warmer, the moon bigger"). A new round of one cover; the cover it came from stays on the song. credits: redraw_credits from quote_cover, as shown to the user. Needs a paid plan.',
22023
+ method: "POST",
22024
+ path: "/api/v1/cover-requests/{request_id}/draw",
22025
+ scopes: ["music:write", "videos:write"],
22026
+ input: external_exports.object({
22027
+ request_id: external_exports.string().min(1).describe("The round the cover came from (coverreq_\u2026)"),
22028
+ cover_id: external_exports.string().min(1).describe("The cover to redraw (cover_\u2026)"),
22029
+ note: external_exports.string().trim().min(1).max(COVER_NOTE_MAX).describe("What to change, in the user's words"),
22030
+ credits: external_exports.number().int().positive().describe("redraw_credits from quote_cover")
22031
+ }),
22032
+ readOnly: false,
22033
+ destructive: false,
22034
+ idempotent: false,
22035
+ cli: ["covers", "redraw"],
22036
+ mcp: "redraw_cover"
22037
+ },
22038
+ {
22039
+ id: "covers.use",
22040
+ group: "songs",
22041
+ title: "Use a cover",
22042
+ summary: "Puts one of the song\u2019s covers in use",
22043
+ description: "Everything made from now on uses it; videos already made keep theirs. A made cover's colours and typeface become the artist's look for their next covers. Refused (409 song_busy) while a video of the song is being made. No plan needed.",
22044
+ method: "POST",
22045
+ path: "/api/v1/songs/{song_id}/covers/{cover_id}/use",
22046
+ scopes: ["music:write", "videos:write"],
22047
+ input: external_exports.object({ song_id: songId, cover_id: external_exports.string().min(1).describe("The cover id (cover_\u2026)") }),
22048
+ readOnly: false,
22049
+ destructive: false,
22050
+ idempotent: true,
22051
+ cli: ["covers", "use"],
22052
+ mcp: "use_cover"
22053
+ },
22054
+ {
22055
+ id: "covers.delete",
22056
+ group: "songs",
22057
+ title: "Delete a cover",
22058
+ summary: "Deletes one of the song\u2019s covers for good",
22059
+ description: "Its files go too. Deleting the cover in use leaves the song without one (409 song_busy while a video of the song is being made). Ask the user first.",
22060
+ method: "DELETE",
22061
+ path: "/api/v1/songs/{song_id}/covers/{cover_id}",
22062
+ scopes: ["music:write", "videos:write"],
22063
+ input: external_exports.object({ song_id: songId, cover_id: external_exports.string().min(1).describe("The cover id (cover_\u2026)") }),
22064
+ readOnly: false,
22065
+ destructive: true,
22066
+ idempotent: true,
22067
+ cli: ["covers", "delete"],
22068
+ mcp: "delete_cover"
22069
+ },
21730
22070
  {
21731
22071
  id: "songs.archive",
21732
22072
  group: "songs",
@@ -21948,7 +22288,7 @@ var OPERATIONS = [
21948
22288
  group: "videos",
21949
22289
  title: "Quote a lyric video",
21950
22290
  summary: "The exact credits for a lyric video, before anything is charged",
21951
- description: `Returns quote_id, credits (total), credits_per_video and a breakdown. ${QUOTE_FIRST} A quote is valid for 30 minutes.`,
22291
+ description: `Returns quote_id, credits (total), credits_per_video and a breakdown, and free: true when, without a plan, it is the free song's free video (create_video then holds no credits). ${QUOTE_FIRST} A quote is valid for 30 minutes.`,
21952
22292
  method: "POST",
21953
22293
  path: "/api/v1/quotes",
21954
22294
  scopes: ["videos:write", "videos:read"],
@@ -22014,6 +22354,76 @@ var OPERATIONS = [
22014
22354
  mcp: "swap_music_video_place",
22015
22355
  output: { name: "MusicVideoPlan", schema: MusicVideoPlanSchema }
22016
22356
  },
22357
+ /* Casting */
22358
+ {
22359
+ id: "music_video_castings.create",
22360
+ group: "videos",
22361
+ title: "Cast a music video",
22362
+ summary: "The director proposes who else is in it: up to 3 new people, each drawn as a character sheet only after a yes",
22363
+ description: `Optional, after the idea and before the lookbook and the shot list (nobody appears on screen without a character sheet). Free (a limited number an hour), a few seconds: returns a casting whose people (at most ${CASTING_MAX_PEOPLE}, never more than the model's room in a shot beside the performer and the people already given) each have a role, a first name, what they do (does), a description their sheet is drawn from, and about how many shots they are in. With cast_mode exact, nobody on screen or no room, it proposes nobody (status ready, people []), without a director call. Show each person with price.per_person (price.credits for all); the user may drop anyone, edit a description, or put a kit character in that role instead; then draw_music_video_cast after their yes, or order the video with casting_id to draw them inside the order. Same brief as plan_music_video. Needs an active plan (402 plan_required without one; get_account: plan.active).`,
22364
+ method: "POST",
22365
+ path: "/api/v1/music-video-castings",
22366
+ scopes: ["videos:write"],
22367
+ input: musicVideoPlanInput.omit({ revise: true, lookbook_id: true }),
22368
+ readOnly: false,
22369
+ destructive: false,
22370
+ idempotent: false,
22371
+ cli: ["casting", "propose"],
22372
+ mcp: "cast_music_video",
22373
+ example: { song_id: "song_\u2026", category: "story", direction: "She leaves him at the station" }
22374
+ },
22375
+ {
22376
+ id: "music_video_castings.get",
22377
+ group: "videos",
22378
+ title: "Get a casting",
22379
+ summary: "A casting's people as proposed, then as drawn",
22380
+ description: "status: proposed (not drawn), drawing (their sheets are drawn: check back in about a minute), ready or failed. Each person: index, name, role, does, description, shots, state (proposed, declined, drawing, kept: drawn and in the song artist's kit; chosen: a kit character in that role; failed, with error) and character once kept or chosen. price.per_person is a sheet's price; charged is what was spent. people_for_brief, once ready: the {character, does} entries to add to people in plan_music_video, design_music_video_shoot and create_music_video.",
22381
+ method: "GET",
22382
+ path: "/api/v1/music-video-castings/{casting_id}",
22383
+ scopes: ["videos:read"],
22384
+ input: external_exports.object({ casting_id: CastingIdSchema.describe("The casting id (casting_\u2026)") }),
22385
+ readOnly: true,
22386
+ destructive: false,
22387
+ idempotent: true,
22388
+ cli: ["casting", "get"],
22389
+ mcp: "get_music_video_casting"
22390
+ },
22391
+ {
22392
+ id: "music_video_castings.draw",
22393
+ group: "videos",
22394
+ title: "Draw a music video's cast",
22395
+ summary: "Draws the people the user kept as character sheets (spends credits)",
22396
+ description: `Only after the user's yes to the people and the price. people: the ones kept, by index (the others are declined), each with an edited name or description if the user changed it, or character: a kit character's handle (list_characters) in that role instead, free. An empty list keeps it to the artist (nobody else is cast). credits must be price.per_person times the people drawn (0 when none is); another price answers 409 with the current one. Each description is read first like start_character's describe mode (one made-up adult, never a real or famous person: 422 naming the person's index). One hold for all; each sheet is drawn plain (base clothes, the person only: the video dresses them later), charged once it passes its check, and kept in the song artist's kit as AI-made, not shared. Poll get_music_video_casting until ready, then add people_for_brief to people. Needs an active plan (402 plan_required without one; get_account: plan.active).`,
22397
+ method: "POST",
22398
+ path: "/api/v1/music-video-castings/{casting_id}/draw",
22399
+ scopes: ["videos:write"],
22400
+ input: external_exports.object({
22401
+ casting_id: CastingIdSchema.describe("The casting id"),
22402
+ credits: CastingDrawSchema.shape.credits.describe("The price shown: price.per_person \xD7 the people drawn"),
22403
+ people: CastingDrawSchema.shape.people.describe('The people kept: [{"index":1},{"index":2,"description":"\u2026"},{"index":3,"character":"mia-torres"}]; [] keeps it to the artist')
22404
+ }),
22405
+ readOnly: false,
22406
+ destructive: false,
22407
+ idempotent: false,
22408
+ cli: ["casting", "draw"],
22409
+ mcp: "draw_music_video_cast"
22410
+ },
22411
+ {
22412
+ id: "music_video_castings.delete",
22413
+ group: "videos",
22414
+ title: "Delete a casting",
22415
+ summary: "Deletes a casting; the people already kept stay in the kit",
22416
+ description: "Not while its people are drawn (409).",
22417
+ method: "DELETE",
22418
+ path: "/api/v1/music-video-castings/{casting_id}",
22419
+ scopes: ["videos:write"],
22420
+ input: external_exports.object({ casting_id: CastingIdSchema.describe("The casting id (casting_\u2026)") }),
22421
+ readOnly: false,
22422
+ destructive: true,
22423
+ idempotent: true,
22424
+ cli: ["casting", "delete"],
22425
+ mcp: "delete_music_video_casting"
22426
+ },
22017
22427
  /* The lookbook */
22018
22428
  {
22019
22429
  id: "music_video_lookbooks.create",
@@ -22220,7 +22630,7 @@ var OPERATIONS = [
22220
22630
  group: "videos",
22221
22631
  title: "Draw an opening frame",
22222
22632
  summary: "Draws the picture a planned shot opens on (spends credits)",
22223
- description: `Paid per picture: tell the user the price (list_music_video_frames: price.credits) and draw only after their go, then show them the picture (image_url). Drawing a shot again replaces its frame for the same price. Good for the shots that matter most (the opening, the hook); the others are made from their references as usual. credits is the price the user agreed to; another price answers 409 with the current one. Takes about a minute; nothing is charged if it fails. 400 with the reason for a shot that can't have one (list_music_video_frames: unavailable). Then quote_music_video and create_music_video with the plan_id as usual. ${NEEDS_PLAN}`,
22633
+ description: `Paid per picture: tell the user the price (list_music_video_frames: price.credits) and draw only after their go, then show them the picture (image_url). Drawing a shot again replaces its frame (the earlier picture is gone) for the same price. Good for the shots that matter most (the opening, the hook); the others are made from their references as usual. credits is the price the user agreed to; another price answers 409 with the current one. Takes about a minute; nothing is charged if it fails. 400 with the reason for a shot that can't have one (list_music_video_frames: unavailable). Then quote_music_video and create_music_video with the plan_id as usual. ${NEEDS_PLAN}`,
22224
22634
  method: "POST",
22225
22635
  path: "/api/v1/music-video-plans/{plan_id}/frames",
22226
22636
  scopes: ["videos:write"],
@@ -22230,7 +22640,7 @@ var OPERATIONS = [
22230
22640
  credits: external_exports.number().int().positive().describe("The price shown (list_music_video_frames: price.credits)")
22231
22641
  }),
22232
22642
  readOnly: false,
22233
- destructive: false,
22643
+ destructive: true,
22234
22644
  idempotent: false,
22235
22645
  cli: ["plans", "draw-frame"],
22236
22646
  mcp: "draw_music_video_frame",
@@ -22241,7 +22651,7 @@ var OPERATIONS = [
22241
22651
  group: "videos",
22242
22652
  title: "Quote a music video",
22243
22653
  summary: "The exact credits for an AI music video, before anything is charged",
22244
- description: `Returns quote_id, credits and a breakdown; the price follows the section's length (clips of about 15 seconds). The song's artist performs it, so the artist needs their character (start_character). ${QUOTE_FIRST}`,
22654
+ description: `Returns quote_id, credits and a breakdown; the price follows the section's length (clips of about 15 seconds). The song's artist performs it, so the artist needs their character (start_character). With a plan_id, test: true prices testing the plan first (its chorus's shots at 480p; test in the answer says which shots and seconds): offer it beside the whole video's quote. ${QUOTE_FIRST}`,
22245
22655
  method: "POST",
22246
22656
  path: "/api/v1/quotes",
22247
22657
  scopes: ["videos:write", "videos:read"],
@@ -22362,16 +22772,37 @@ var OPERATIONS = [
22362
22772
  cli: ["videos", "cancel"],
22363
22773
  mcp: "cancel_video"
22364
22774
  },
22775
+ {
22776
+ id: "videos.revision_prices",
22777
+ group: "videos",
22778
+ title: "Price a music video revision",
22779
+ summary: "What revising each shot of a delivered music video costs, before anything is rewritten",
22780
+ description: "For a music video whose revisable_until (get_video) is still ahead. shots: each shot's credits (its rewrite and the shots it makes again, remakes: a shot that the next one carries straight on from makes that one again too); base_credits: the revision's setup, paid once whatever is changed; outro_credits: finishing the video again with another outro and no shot made (create_music_video with refinish). A revision of several shots costs base_credits plus theirs; the exact price is the quote of the revision's plan.",
22781
+ method: "GET",
22782
+ path: "/api/v1/videos/{video_id}/revisions",
22783
+ scopes: ["videos:read"],
22784
+ input: external_exports.object({ video_id: videoId }),
22785
+ readOnly: true,
22786
+ destructive: false,
22787
+ idempotent: true,
22788
+ cli: ["videos", "revision-prices"],
22789
+ mcp: "price_music_video_revision"
22790
+ },
22365
22791
  {
22366
22792
  id: "videos.revise_shot",
22367
22793
  group: "videos",
22368
22794
  title: "Revise a music video shot",
22369
- summary: "The director rewrites one shot of a delivered music video from a note (free)",
22370
- description: "For a music video whose revisable_until (get_video) is still ahead. Free (counted with the plans an hour), about half a minute. Returns a plan whose revision names the video and the shots made again: the shot asked, and the next one when it carries straight on from it. Show the rewritten shot, then quote_music_video with song_id, plan_id and the video's quality: only the shots made again are charged, the others are reused. create_music_video makes the revision as a new video; the original never changes.",
22795
+ summary: "The director rewrites one shot of a delivered music video from a note, or several shots each from its own note (free)",
22796
+ description: "For a music video whose revisable_until (get_video) is still ahead. Free (counted with the plans an hour), about half a minute. Several shots go in one call as shots (up to 12), each with its own note: one plan, one new version. Returns a plan whose revision names the video, the shots asked (asked) and the shots made again (shots): those asked, and each next one when it carries straight on from one of them. Show the rewritten shots, then quote_music_video with song_id, plan_id and the video's quality: only the shots made again are charged, the others are reused. create_music_video makes the revision as a new video; the original never changes.",
22371
22797
  method: "POST",
22372
22798
  path: "/api/v1/videos/{video_id}/revisions",
22373
22799
  scopes: ["videos:write"],
22374
- input: external_exports.object({ video_id: videoId, shot: external_exports.number().int().min(1).describe("The shot to change (its index in the plan's shots)"), note: external_exports.string().trim().min(1).max(1e3).describe("What should change, in the artist's words") }),
22800
+ input: external_exports.object({
22801
+ video_id: videoId,
22802
+ shot: external_exports.number().int().min(1).optional().describe("The shot to change (its index in the plan's shots); with note. Or send shots"),
22803
+ note: external_exports.string().trim().min(1).max(1e3).optional().describe("What should change, in the artist's words"),
22804
+ shots: external_exports.array(external_exports.object({ shot: external_exports.number().int().min(1), note: external_exports.string().trim().min(1).max(1e3) })).min(1).max(12).optional().describe("Several shots, each with its own note (instead of shot and note): all rewritten into one plan, one new version")
22805
+ }),
22375
22806
  readOnly: false,
22376
22807
  destructive: false,
22377
22808
  idempotent: false,
@@ -22423,7 +22854,7 @@ var OPERATIONS = [
22423
22854
  group: "videos",
22424
22855
  title: "Get a music video Look",
22425
22856
  summary: "One music video Look",
22426
- description: "",
22857
+ description: "With the video it was saved from while that video is public in the Showcase: video (its song_title, aspect_ratio, the artist and creator as the Showcase credits them, poster_url, video_url, poster_seconds, duration_seconds) and story (the director's idea as concept, and its shots along the song: section, start_seconds, end_seconds, summary). Both are null while the video isn't public. Never its maker's written brief.",
22427
22858
  method: "GET",
22428
22859
  path: "/api/v1/music-video-looks/{look_id}",
22429
22860
  scopes: ["videos:read"],
@@ -22487,7 +22918,7 @@ var OPERATIONS = [
22487
22918
  group: "videos",
22488
22919
  title: "Make a video public",
22489
22920
  summary: "Show a delivered video in the Community, its Look reusable by anyone",
22490
- description: `Only when the user asks for it, in their own words: ask them first and never make a video public on your own. Public, everyone signed in to Kinetune sees it in the Community, Kinetune may feature it on kinetune.com, and its Look becomes public with it so anyone can reuse it (a music video's concept: its kind, look, edit, places and props, never the artist or anyone else in it; a lyric video's Look unless it shows the artist or is Official); the workspace holds the Look's reward credits while it stays public. rights_confirmed (a music video needs it): the user confirms they have the right to show the artist and everyone in it publicly. socials true: the user also lets Kinetune post it on its socials (TikTok, Instagram, YouTube, X), crediting credit_handle. ${SHARE_CONSENT} Sharing again replaces those choices; a video Kinetune's staff hid stays hidden. Only a delivered (completed) video. unshare_video makes it private again; get_video shows sharing.`,
22921
+ description: `Only when the user asks for it, in their own words: ask them first and never make a video public on your own. Public, everyone signed in to Kinetune sees it in the Community, Kinetune may feature it on kinetune.com, and its Look becomes public with it so anyone can reuse it (a music video's concept: its kind, visual style, edit, places and props, never the artist or anyone else in it; a lyric video's Look unless it shows the artist or is Official); the workspace holds the Look's reward credits while it stays public. rights_confirmed (a music video needs it): the user confirms they have the right to show the artist and everyone in it publicly. socials true: the user also lets Kinetune post it on its socials (TikTok, Instagram, YouTube, X), crediting credit_handle. ${SHARE_CONSENT} Sharing again replaces those choices; a video Kinetune's staff hid stays hidden. Only a delivered (completed) video. unshare_video makes it private again; get_video shows sharing.`,
22491
22922
  method: "POST",
22492
22923
  path: "/api/v1/videos/{video_id}/share",
22493
22924
  scopes: ["videos:write"],
@@ -22656,6 +23087,9 @@ var operation = (opId) => {
22656
23087
  return found;
22657
23088
  };
22658
23089
  var pathFields = (op) => [...op.path.matchAll(/\{(\w+)\}/g)].map((m) => m[1]);
23090
+ function sentInput(parsed, raw) {
23091
+ return Object.fromEntries(Object.entries(parsed).filter(([key]) => raw[key] !== void 0));
23092
+ }
22659
23093
  function buildRequest(op, input2, baseUrl) {
22660
23094
  const used = new Set(pathFields(op));
22661
23095
  const path4 = op.path.replace(/\{(\w+)\}/g, (_, name) => {
@@ -26152,6 +26586,24 @@ import { homedir } from "node:os";
26152
26586
  import path2 from "node:path";
26153
26587
  var DEFAULT_APP_URL = "https://kinetune.com";
26154
26588
  var DEFAULT_API_URL = DEFAULT_APP_URL;
26589
+ function chosenWorkspace(config2, named = process.env.KINETUNE_ORGANIZATION) {
26590
+ const wanted = named?.trim();
26591
+ if (!wanted) return null;
26592
+ const stored = Object.entries(config2.workspaces ?? {});
26593
+ const found = stored.find(([id2]) => id2 === wanted) ?? stored.find(([, w]) => w.name.toLowerCase() === wanted.toLowerCase());
26594
+ if (found) return found[0];
26595
+ throw new WorkspaceNotSignedIn(`Not signed in to ${wanted}${stored.length ? ` (signed in to: ${stored.map(([id2, w]) => `${w.name} ${id2}`).join(", ")})` : ""}. Run \`kinetune auth login --organization ${wanted}\`.`);
26596
+ }
26597
+ var WorkspaceNotSignedIn = class extends Error {
26598
+ };
26599
+ var signInOf = (config2, organization) => organization ? config2.workspaces?.[organization]?.auth : config2.auth;
26600
+ function withSignIn(config2, organization, auth) {
26601
+ const previous = signInOf(config2, organization), same = (other) => Boolean(previous && other && secretOf(other) === secretOf(previous));
26602
+ const workspaces = config2.workspaces && Object.fromEntries(Object.entries(config2.workspaces).map(([id2, w]) => [id2, id2 === organization || same(w.auth) ? { ...w, auth } : w]));
26603
+ return { ...config2, ...workspaces ? { workspaces } : {}, ...organization === null || same(config2.auth) ? { auth } : {} };
26604
+ }
26605
+ var secretOf = (auth) => auth.type === "oauth" ? auth.access_token : auth.api_key;
26606
+ var rememberSignIn = (config2, organization, auth) => ({ ...config2, auth, workspaces: { ...config2.workspaces, [organization.id]: { name: organization.name, auth } } });
26155
26607
  var dir = () => process.env.KINETUNE_CONFIG_DIR || path2.join(process.env.XDG_CONFIG_HOME || path2.join(homedir(), ".config"), "kinetune");
26156
26608
  var configFile = () => path2.join(dir(), "config.json");
26157
26609
  async function loadConfig() {
@@ -26274,8 +26726,8 @@ async function tokenRequest(endpoint, body) {
26274
26726
  }
26275
26727
  var SignInExpired = class extends Error {
26276
26728
  };
26277
- async function accessToken(config2) {
26278
- const auth = config2.auth;
26729
+ async function accessToken(config2, organization = null) {
26730
+ const auth = signInOf(config2, organization);
26279
26731
  if (!auth || auth.type !== "oauth") return null;
26280
26732
  if (!auth.expires_at || auth.expires_at > Date.now() + 6e4 || !auth.refresh_token) return auth.access_token;
26281
26733
  const { app } = urls(config2);
@@ -26285,11 +26737,10 @@ async function accessToken(config2) {
26285
26737
  throw error62;
26286
26738
  });
26287
26739
  const next = { ...auth, ...tokens, refresh_token: tokens.refresh_token ?? auth.refresh_token };
26288
- await saveConfig({ ...config2, auth: next });
26740
+ await saveConfig(withSignIn(config2, organization, next));
26289
26741
  return next.access_token;
26290
26742
  }
26291
- async function revoke(config2) {
26292
- const auth = config2.auth;
26743
+ async function revoke(config2, auth = config2.auth) {
26293
26744
  if (!auth || auth.type !== "oauth") return;
26294
26745
  const meta3 = await discover(urls(config2).app).catch(() => null);
26295
26746
  if (!meta3?.revocation_endpoint) return;
@@ -26303,7 +26754,7 @@ async function revoke(config2) {
26303
26754
  // package.json
26304
26755
  var package_default = {
26305
26756
  name: "@kinetune/cli",
26306
- version: "2.3.0",
26757
+ version: "2.8.0",
26307
26758
  description: "Command line for Kinetune: lyric videos, Spotify Canvas loops and AI music videos from your songs, for people and AI agents.",
26308
26759
  license: "MIT",
26309
26760
  homepage: "https://kinetune.com/developers#cli",
@@ -26381,11 +26832,20 @@ function print(data) {
26381
26832
  }
26382
26833
  process.stdout.write(JSON.stringify(data, null, 2) + "\n");
26383
26834
  }
26835
+ var workspace;
26384
26836
  async function credentials() {
26385
26837
  const config2 = await loadConfig();
26386
26838
  if (process.env.KINETUNE_API_KEY) return { token: process.env.KINETUNE_API_KEY, config: config2 };
26387
- if (config2.auth?.type === "api_key") return { token: config2.auth.api_key, config: config2 };
26388
- const token = await accessToken(config2);
26839
+ let organization;
26840
+ try {
26841
+ organization = chosenWorkspace(config2, workspace ?? process.env.KINETUNE_ORGANIZATION);
26842
+ } catch (error62) {
26843
+ if (error62 instanceof WorkspaceNotSignedIn) throw new UsageError(error62.message);
26844
+ throw error62;
26845
+ }
26846
+ const auth = signInOf(config2, organization);
26847
+ if (auth?.type === "api_key") return { token: auth.api_key, config: config2 };
26848
+ const token = await accessToken(config2, organization);
26389
26849
  if (token) return { token, config: config2 };
26390
26850
  throw new UsageError("Not signed in. Run `kinetune auth login` (or set KINETUNE_API_KEY to a workspace API key).");
26391
26851
  }
@@ -26438,6 +26898,24 @@ async function confirm(question) {
26438
26898
  rl.close();
26439
26899
  }
26440
26900
  }
26901
+ function unwrapNullable(schema) {
26902
+ const members2 = schema.anyOf ?? schema.oneOf;
26903
+ if (!members2 || members2.length !== 2 || !members2.some((m) => m?.type === "null")) return { schema, nullable: false };
26904
+ const value = members2.find((m) => m?.type !== "null");
26905
+ return value?.type ? { schema: { ...value, description: value.description ?? schema.description }, nullable: true } : { schema, nullable: false };
26906
+ }
26907
+ var CLEARED = /* @__PURE__ */ Symbol("null");
26908
+ function nullableFlag(value, numeric) {
26909
+ if (value === "null") return CLEARED;
26910
+ if (numeric) return Number(value);
26911
+ if (/^".*"$/s.test(value)) try {
26912
+ const parsed = JSON.parse(value);
26913
+ if (typeof parsed === "string") return parsed;
26914
+ } catch {
26915
+ }
26916
+ return value;
26917
+ }
26918
+ var WORKSPACE_OPTION = () => new Option("--organization <id>", "Act for this workspace (its id or name), one you signed in to with `kinetune auth login --organization`; default: the last signed in (or KINETUNE_ORGANIZATION)");
26441
26919
  function addOperation(parent, op) {
26442
26920
  const schema = inputJsonSchema(op);
26443
26921
  const props = schema.properties ?? {};
@@ -26449,16 +26927,22 @@ MCP tool: ${op.mcp} REST: ${op.method} ${op.path}`);
26449
26927
  for (const name of positional) cmd.argument(`<${name}>`, props[name]?.description ?? name);
26450
26928
  for (const [name, prop] of Object.entries(props)) {
26451
26929
  if (positional.includes(name)) continue;
26452
- const p = prop;
26453
26930
  const file2 = fileFields.get(name);
26454
26931
  if (file2) {
26455
26932
  cmd.addOption(new Option(`--${kebab(file2.field)} <${file2.multiple ? "files..." : "file"}>`, `${file2.description}: local path${file2.multiple ? "s" : ""} or https URL${file2.multiple ? "s" : ""}`));
26456
26933
  continue;
26457
26934
  }
26935
+ const { schema: p, nullable: nullable2 } = unwrapNullable(prop);
26458
26936
  const type = p.type ?? (p.anyOf || p.oneOf ? "json" : p.const !== void 0 ? "const" : "string");
26459
- const desc = [p.description, p.enum ? `one of: ${p.enum.join(", ")}` : "", p.default !== void 0 ? `default ${JSON.stringify(p.default)}` : ""].filter(Boolean).join("; ");
26460
- if (type === "boolean" || p.const === true) cmd.addOption(new Option(`--${kebab(name)}`, desc || name));
26461
- else if (type === "array" && p.items?.type !== "object") cmd.addOption(new Option(`--${kebab(name)} <values...>`, desc).argParser((v, prev) => [...prev ?? [], ...v.split(",")]));
26937
+ const desc = [p.description ?? prop.description, p.enum ? `one of: ${p.enum.join(", ")}` : "", nullable2 ? "null clears it" : "", p.default !== void 0 ? `default ${JSON.stringify(p.default)}` : ""].filter(Boolean).join("; ");
26938
+ if (nullable2 && type !== "object" && type !== "array" && type !== "json" && type !== "boolean") {
26939
+ cmd.addOption(new Option(`--${kebab(name)} <value>`, desc).argParser((v) => nullableFlag(v, type === "number" || type === "integer")));
26940
+ continue;
26941
+ }
26942
+ if (type === "boolean" || p.const === true) {
26943
+ cmd.addOption(new Option(`--${kebab(name)}`, desc || name));
26944
+ if (type === "boolean" && p.default === void 0) cmd.addOption(new Option(`--no-${kebab(name)}`, `Send ${name} false`));
26945
+ } else if (type === "array" && p.items?.type !== "object") cmd.addOption(new Option(`--${kebab(name)} <values...>`, desc).argParser((v, prev) => [...prev ?? [], ...v.split(",")]));
26462
26946
  else if (type === "number" || type === "integer") cmd.addOption(new Option(`--${kebab(name)} <number>`, desc).argParser(Number));
26463
26947
  else if (type === "object" || type === "json" || type === "array") cmd.addOption(new Option(`--${kebab(name)} <json>`, `${desc} (JSON)`).argParser((v) => {
26464
26948
  try {
@@ -26471,6 +26955,7 @@ MCP tool: ${op.mcp} REST: ${op.method} ${op.path}`);
26471
26955
  }
26472
26956
  for (const name of op.textFiles ?? []) cmd.option(`--${kebab(name)}-file <file>`, `${props[name]?.description ?? name}: read from a file (or - for stdin)`);
26473
26957
  cmd.option("--input <file>", "The whole input as JSON (a file, or - for stdin); flags override it");
26958
+ cmd.addOption(WORKSPACE_OPTION());
26474
26959
  const creates = op.id.startsWith("videos.create_");
26475
26960
  if (creates) {
26476
26961
  cmd.option("-y, --yes", "Create without asking after showing the quote");
@@ -26494,7 +26979,7 @@ MCP tool: ${op.mcp} REST: ${op.method} ${op.path}`);
26494
26979
  continue;
26495
26980
  }
26496
26981
  const value = options[camel(name)];
26497
- if (value !== void 0) input2[name] = value;
26982
+ if (value !== void 0) input2[name] = value === CLEARED ? null : value;
26498
26983
  }
26499
26984
  if (files.length) for (const f of op.files ?? []) delete input2[f.urlField];
26500
26985
  for (const name of op.textFiles ?? []) {
@@ -26516,7 +27001,7 @@ MCP tool: ${op.mcp} REST: ${op.method} ${op.path}`);
26516
27001
  }
26517
27002
  const parsed = op.input.safeParse(input2);
26518
27003
  if (!parsed.success && !files.length) throw new UsageError(parsed.error.issues.slice(0, 6).map((i) => `${i.path.join(".") || "input"}: ${i.message}`).join("\n"));
26519
- print(await call(op, parsed.success ? parsed.data : input2, files));
27004
+ print(await call(op, parsed.success ? sentInput(parsed.data, input2) : input2, files));
26520
27005
  });
26521
27006
  }
26522
27007
  var TERMINAL = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
@@ -26538,10 +27023,12 @@ async function waitFor(videoId2, timeoutSeconds) {
26538
27023
  }
26539
27024
  }
26540
27025
  function program2() {
26541
- const root = new Command("kinetune").version(VERSION).description("Lyric videos, Spotify Canvas loops and AI music videos from your songs. Every command prints JSON for scripts and AI agents.").option("--json", "Always print JSON").hook("preAction", (cmd) => {
27026
+ const root = new Command("kinetune").version(VERSION).description("Lyric videos, Spotify Canvas loops and AI music videos from your songs. Every command prints JSON for scripts and AI agents.").option("--json", "Always print JSON").hook("preAction", (cmd, action) => {
26542
27027
  forceJson = Boolean(cmd.opts().json);
27028
+ workspace = action.parent?.name() === "auth" && action.name() === "login" ? void 0 : action.opts().organization;
26543
27029
  });
26544
27030
  const GROUP_DESCRIPTIONS = {
27031
+ " uploads": "A signed upload URL for a file (for tools that pass URLs; the CLI sends files itself)",
26545
27032
  " artists": "Artists and their image",
26546
27033
  " songs": "Songs: upload, list, analysis",
26547
27034
  " looks": "Looks: reusable lyric-video designs",
@@ -26551,7 +27038,9 @@ function program2() {
26551
27038
  " plan": "Plan a music video before paying: the director's concept and shots, free",
26552
27039
  " plans": "Music video plans made earlier",
26553
27040
  " kit": "The artist kit: outfits, places and props a music video brief mentions by @handle",
26554
- " lookbook": "Design a music video shoot: the director's outfits, places and props as pictures, before the plan"
27041
+ " casting": "Who else is in a music video: the director proposes people, each drawn as a character sheet after your yes",
27042
+ " lookbook": "Design a music video shoot: the director's outfits, places and props as pictures, before the plan",
27043
+ " covers": "Cover art: Kinetune makes covers for a song (quote first), every cover kept; use, redraw or delete one"
26555
27044
  };
26556
27045
  const groups = /* @__PURE__ */ new Map();
26557
27046
  const group = (names) => {
@@ -26571,7 +27060,11 @@ function program2() {
26571
27060
  for (const op of OPERATIONS) addOperation(group(op.cli.slice(0, -1)), op);
26572
27061
  const auth = root.command("auth").description("Sign in with the app (OAuth) or a workspace API key");
26573
27062
  auth.command("login").description("Sign in: opens the browser to sign in with the app, or stores an API key").option("--api-key <key>", "Use a workspace API key instead (created in the app under API keys)").option("--no-browser", "Print the sign-in URL instead of opening the browser").option("--organization <id>", "Preselect this workspace on the consent screen (an id from `kinetune organizations list`)").option("--api-url <url>", "API base URL").option("--app-url <url>", "App base URL").action(async (options) => {
26574
- const config2 = { ...await loadConfig(), ...options.apiUrl ? { api_url: options.apiUrl } : {}, ...options.appUrl ? { app_url: options.appUrl } : {} };
27063
+ let config2 = { ...await loadConfig(), ...options.apiUrl ? { api_url: options.apiUrl } : {}, ...options.appUrl ? { app_url: options.appUrl } : {} };
27064
+ if (config2.auth && !Object.keys(config2.workspaces ?? {}).length && !process.env.KINETUNE_API_KEY) {
27065
+ const before = await call(operation("account.get"), {}).catch(() => null);
27066
+ if (before) config2 = rememberSignIn(config2, before.organization, config2.auth);
27067
+ }
26575
27068
  if (options.apiKey) {
26576
27069
  await saveConfig({ ...config2, auth: { type: "api_key", api_key: options.apiKey } });
26577
27070
  } else {
@@ -26579,22 +27072,46 @@ function program2() {
26579
27072
  await login(config2, { log: say, noBrowser: options.browser === false, organization: options.organization });
26580
27073
  }
26581
27074
  const account = await call(operation("account.get"), {});
27075
+ const signedIn = await loadConfig();
27076
+ if (signedIn.auth) await saveConfig(rememberSignIn(signedIn, account.organization, signedIn.auth));
26582
27077
  const plan = account.plan?.active ? `${account.plan.name} plan, ${account.credits.available} credits` : "no plan yet: choose one in the app to upload and make videos";
26583
27078
  say(`Signed in to ${account.organization.name} (${plan}). Credentials: ${configFile()}`);
26584
27079
  });
26585
- auth.command("status").description("The workspace, its plan, how you are signed in and the credit balance").action(async () => print(await call(operation("account.get"), {})));
26586
- auth.command("token").description("Print the current bearer token (for curl or other tools)").action(async () => {
27080
+ auth.command("list").description("The workspaces you are signed in to; --organization picks one for a command").action(async () => {
27081
+ const config2 = await loadConfig();
27082
+ const active = Object.entries(config2.workspaces ?? {}).find(([, w]) => config2.auth && JSON.stringify(w.auth) === JSON.stringify(config2.auth))?.[0];
27083
+ print({ items: Object.entries(config2.workspaces ?? {}).map(([id2, w]) => ({ id: id2, name: w.name, type: w.auth.type === "oauth" ? "sign-in" : "api key", status: id2 === active ? "default" : "" })) });
27084
+ });
27085
+ auth.command("status").description("The workspace, its plan, how you are signed in and the credit balance").addOption(WORKSPACE_OPTION()).action(async () => print(await call(operation("account.get"), {})));
27086
+ auth.command("token").description("Print the current bearer token (for curl or other tools)").addOption(WORKSPACE_OPTION()).action(async () => {
26587
27087
  process.stdout.write((await credentials()).token + "\n");
26588
27088
  });
26589
- auth.command("logout").description("Forget the stored credentials (and revoke the OAuth token)").action(async () => {
27089
+ auth.command("logout").description("Forget the stored credentials (and revoke the OAuth tokens); --organization: only that workspace's").addOption(WORKSPACE_OPTION()).action(async () => {
26590
27090
  const config2 = await loadConfig();
26591
- await revoke(config2);
27091
+ if (workspace) {
27092
+ let id2;
27093
+ try {
27094
+ id2 = chosenWorkspace(config2, workspace);
27095
+ } catch (error62) {
27096
+ if (error62 instanceof WorkspaceNotSignedIn) throw new UsageError(error62.message);
27097
+ throw error62;
27098
+ }
27099
+ const gone = config2.workspaces[id2];
27100
+ await revoke(config2, gone.auth);
27101
+ const { [id2]: _, ...rest } = config2.workspaces;
27102
+ const isDefault = JSON.stringify(config2.auth) === JSON.stringify(gone.auth);
27103
+ const next = Object.values(rest)[0];
27104
+ await saveConfig({ ...config2, workspaces: rest, ...isDefault ? { auth: next?.auth } : {} });
27105
+ say(`Signed out of ${gone.name}.${isDefault && next ? ` Commands now act for ${next.name}.` : ""}`);
27106
+ return;
27107
+ }
27108
+ for (const auth2 of /* @__PURE__ */ new Set([config2.auth, ...Object.values(config2.workspaces ?? {}).map((w) => w.auth)])) await revoke(config2, auth2);
26592
27109
  await clearConfig();
26593
27110
  say("Signed out.");
26594
27111
  });
26595
27112
  const videos = group(["videos"]);
26596
- videos.command("wait").argument("<video_id>").description("Wait until a video is completed, failed or cancelled, showing its progress").option("--timeout <seconds>", "Give up after this many seconds", Number, 1800).action(async (videoId2, options) => print(await waitFor(videoId2, options.timeout)));
26597
- videos.command("download").argument("<video_id>").description("Download a completed video\u2019s files (one per format)").option("--out <dir>", "Directory to save into", ".").option("--format <ratio>", "Only this format, e.g. 9:16").option("--web", "The 720p web copies instead of the masters").action(async (videoId2, options) => {
27113
+ videos.command("wait").argument("<video_id>").description("Wait until a video is completed, failed or cancelled, showing its progress").addOption(WORKSPACE_OPTION()).option("--timeout <seconds>", "Give up after this many seconds", Number, 1800).action(async (videoId2, options) => print(await waitFor(videoId2, options.timeout)));
27114
+ videos.command("download").argument("<video_id>").description("Download a completed video\u2019s files (one per format)").addOption(WORKSPACE_OPTION()).option("--out <dir>", "Directory to save into", ".").option("--format <ratio>", "Only this format, e.g. 9:16").option("--web", "The 720p web copies instead of the masters").action(async (videoId2, options) => {
26598
27115
  const video = await call(operation("videos.get"), { video_id: videoId2 });
26599
27116
  if (video.status !== "completed") throw new UsageError(`The video is ${video.status}; wait for it first (kinetune videos wait ${videoId2}).`);
26600
27117
  await mkdir2(options.out, { recursive: true });
@@ -26612,6 +27129,29 @@ function program2() {
26612
27129
  }
26613
27130
  print({ files: saved });
26614
27131
  });
27132
+ group(["songs"]).command("download").argument("<song_id>").description("Download a song\u2019s cover art (full size) and its audio file").addOption(WORKSPACE_OPTION()).option("--out <dir>", "Directory to save into", ".").option("--cover", "Only the cover").option("--audio", "Only the audio").action(async (songId2, options) => {
27133
+ const song = await call(operation("songs.get"), { song_id: songId2 });
27134
+ const both = !options.cover && !options.audio;
27135
+ const base = `${song.artist_name ? `${song.artist_name} - ` : ""}${song.title}`.replace(/[\\/:*?"<>|\u0000-\u001f]+/g, " ").trim().slice(0, 120) || songId2;
27136
+ const wanted = [];
27137
+ if (both || options.cover) {
27138
+ if (!song.cover_art?.download_url && options.cover) throw new UsageError("This song has no cover.");
27139
+ wanted.push([`${base}.jpg`, song.cover_art?.download_url]);
27140
+ }
27141
+ if (both || options.audio) wanted.push([`${base}.${song.audio?.content_type === "audio/wav" ? "wav" : song.audio?.content_type === "audio/mp4" ? "m4a" : "mp3"}`, song.audio?.download_url]);
27142
+ await mkdir2(options.out, { recursive: true });
27143
+ const saved = [];
27144
+ for (const [name, url2] of wanted) {
27145
+ if (!url2) continue;
27146
+ const response = await fetch(url2);
27147
+ if (!response.ok) throw new Error(`Download failed (HTTP ${response.status})`);
27148
+ const file2 = path3.join(options.out, name);
27149
+ await writeFile2(file2, Buffer.from(await response.arrayBuffer()));
27150
+ saved.push(file2);
27151
+ say(`Saved ${file2}`);
27152
+ }
27153
+ print({ files: saved });
27154
+ });
26615
27155
  root.command("schema").argument("[command...]", 'A command, e.g. "quote canvas"; all when omitted').description("The JSON input schema of commands (for AI agents)").action((words) => {
26616
27156
  const ops = words.length ? OPERATIONS.filter((o) => o.cli.join(" ") === words.join(" ")) : OPERATIONS;
26617
27157
  if (!ops.length) throw new UsageError(`No command "${words.join(" ")}"`);
@@ -26653,5 +27193,7 @@ if (process.argv[1] && /kinetune(\.mjs)?$|main\.ts$/.test(process.argv[1])) void
26653
27193
  export {
26654
27194
  VERSION,
26655
27195
  main,
26656
- program2 as program
27196
+ nullableFlag,
27197
+ program2 as program,
27198
+ unwrapNullable
26657
27199
  };