@kinetune/cli 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,6 +42,18 @@ kinetune videos download VIDEO_ID
42
42
 
43
43
  `kinetune create …` never spends credits without asking: pass `--yes`, or `--max-credits N` to refuse anything pricier.
44
44
 
45
+ ## The song's own lyrics
46
+
47
+ Every song is transcribed, and a transcription can mishear a word. Give the song its lyrics (plain text, Suno
48
+ `[Verse]`/`[Chorus]` tags are fine, or an `.srt`, `.vtt` or `.lrc` file) and videos spell every word your way and
49
+ break lines where you do; the timing still comes from the audio.
50
+
51
+ ```bash
52
+ kinetune songs create --artist-id ARTIST_ID --title "Midnight Drive" --audio ./midnight-drive.wav --cover-art ./cover.jpg --lyrics-file ./midnight-drive.txt
53
+ kinetune songs set-lyrics SONG_ID --lyrics-file ./midnight-drive.srt # add or replace them later
54
+ kinetune songs clear-lyrics SONG_ID # back to the transcribed words
55
+ ```
56
+
45
57
  ## Find artists and songs
46
58
 
47
59
  Lists return 50 per page, sorted by name; search with `--q` and page with `--limit` (1-100) and `--offset`.
package/dist/kinetune.mjs CHANGED
@@ -15769,7 +15769,7 @@ function extractDefs(ctx, schema) {
15769
15769
  return;
15770
15770
  }
15771
15771
  const seen = entry[1];
15772
- const { ref, defId } = makeURI(entry);
15772
+ const { ref: ref2, defId } = makeURI(entry);
15773
15773
  seen.def = { ...seen.schema };
15774
15774
  if (defId)
15775
15775
  seen.defId = defId;
@@ -15777,7 +15777,7 @@ function extractDefs(ctx, schema) {
15777
15777
  for (const key in schema2) {
15778
15778
  delete schema2[key];
15779
15779
  }
15780
- schema2.$ref = ref;
15780
+ schema2.$ref = ref2;
15781
15781
  };
15782
15782
  if (ctx.cycles === "throw") {
15783
15783
  for (const entry of ctx.seen.entries()) {
@@ -15938,11 +15938,11 @@ function finalize(ctx, schema) {
15938
15938
  return;
15939
15939
  const schema2 = seen.def ?? seen.schema;
15940
15940
  const _cached = { ...schema2 };
15941
- const ref = seen.ref;
15941
+ const ref2 = seen.ref;
15942
15942
  seen.ref = null;
15943
- if (ref) {
15944
- flattenRef(ref);
15945
- const refSeen = ctx.seen.get(ref);
15943
+ if (ref2) {
15944
+ flattenRef(ref2);
15945
+ const refSeen = ctx.seen.get(ref2);
15946
15946
  const refSchema = refSeen.schema;
15947
15947
  if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
15948
15948
  schema2.allOf = schema2.allOf ?? [];
@@ -15951,7 +15951,7 @@ function finalize(ctx, schema) {
15951
15951
  assignProps(schema2, refSchema);
15952
15952
  }
15953
15953
  assignProps(schema2, _cached);
15954
- const isParentRef = zodSchema._zod.parent === ref;
15954
+ const isParentRef = zodSchema._zod.parent === ref2;
15955
15955
  if (isParentRef) {
15956
15956
  for (const key in schema2) {
15957
15957
  if (key === "$ref" || key === "allOf")
@@ -15972,7 +15972,7 @@ function finalize(ctx, schema) {
15972
15972
  }
15973
15973
  }
15974
15974
  const parent = zodSchema._zod.parent;
15975
- if (parent && parent !== ref) {
15975
+ if (parent && parent !== ref2) {
15976
15976
  flattenRef(parent);
15977
15977
  const parentSeen = ctx.seen.get(parent);
15978
15978
  if (parentSeen?.schema.$ref) {
@@ -18870,11 +18870,11 @@ function applyMinItems(items, minItems) {
18870
18870
  function decodeJSONPointerSegment(segment) {
18871
18871
  return segment.replace(/~1/g, "/").replace(/~0/g, "~");
18872
18872
  }
18873
- function resolveRef(ref, ctx) {
18874
- if (!ref.startsWith("#")) {
18873
+ function resolveRef(ref2, ctx) {
18874
+ if (!ref2.startsWith("#")) {
18875
18875
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
18876
18876
  }
18877
- const path4 = ref.slice(1).split("/").filter(Boolean);
18877
+ const path4 = ref2.slice(1).split("/").filter(Boolean);
18878
18878
  if (path4.length === 0) {
18879
18879
  return ctx.rootSchema;
18880
18880
  }
@@ -18882,11 +18882,11 @@ function resolveRef(ref, ctx) {
18882
18882
  if (path4[0] === defsKey) {
18883
18883
  const key = path4[1] === void 0 ? void 0 : decodeJSONPointerSegment(path4[1]);
18884
18884
  if (!key || !ctx.defs[key]) {
18885
- throw new Error(`Reference not found: ${ref}`);
18885
+ throw new Error(`Reference not found: ${ref2}`);
18886
18886
  }
18887
18887
  return ctx.defs[key];
18888
18888
  }
18889
- throw new Error(`Reference not found: ${ref}`);
18889
+ throw new Error(`Reference not found: ${ref2}`);
18890
18890
  }
18891
18891
  function checkObjectGuards(objectSchema, guards) {
18892
18892
  const guard = z.transform((value) => value).check((payload) => {
@@ -20370,15 +20370,15 @@ var MEDIA_BACKGROUND_SOURCES = ["ai-image", "ai-video", "stock-photo", "stock-vi
20370
20370
  var BACKGROUND_SOURCES2 = {
20371
20371
  "ai-image": { label: "AI image", description: "An image made for this Look, moving slowly across the song.", kind: "image", source: "generated" },
20372
20372
  "ai-video": { label: "AI video loop", description: "An AI image brought to life as a seamless loop.", kind: "video", source: "generated" },
20373
- "stock-photo": { label: "Stock photo", description: "A Pexels photo, picked by the director or by you.", kind: "image", source: "stock" },
20374
- "stock-video": { label: "Stock video", description: "A Pexels clip made into a seamless loop.", kind: "video", source: "stock" },
20373
+ "stock-photo": { label: "Stock photo", description: "A stock photo, picked by the director or by you.", kind: "image", source: "stock" },
20374
+ "stock-video": { label: "Stock video", description: "A stock clip made into a seamless loop.", kind: "video", source: "stock" },
20375
20375
  "upload-photo": { label: "Your photo", description: "A photo you upload, moving slowly across the song.", kind: "image", source: "upload" },
20376
20376
  "upload-video": { label: "Your video", description: "A clip you upload, made into a seamless loop.", kind: "video", source: "upload" },
20377
20377
  designed: { label: "Designed", description: "A drawn gradient or pattern.", kind: null, source: null }
20378
20378
  };
20379
20379
  var MAX_BACKGROUND_SCENES = 4;
20380
20380
  var SINGLE_SCENE_STYLES = ["behind", "screen"];
20381
- var StockIdSchema = external_exports.string().regex(/^\d{1,20}$/, "A Pexels photo or video id (digits)");
20381
+ var StockIdSchema = external_exports.string().regex(/^\d{1,20}$/, "A stock photo or video id (digits)");
20382
20382
  var BackgroundRequestSchema = external_exports.object({
20383
20383
  source: external_exports.enum(BACKGROUND_SOURCE_IDS).optional(),
20384
20384
  quality: external_exports.enum(BACKGROUND_TIERS).default("high"),
@@ -20386,7 +20386,7 @@ var BackgroundRequestSchema = external_exports.object({
20386
20386
  upload_id: external_exports.string().min(1).max(120).optional(),
20387
20387
  /** How many scenes an AI image background has (1 by default). */
20388
20388
  scenes: external_exports.number().int().min(1).max(MAX_BACKGROUND_SCENES).optional(),
20389
- /** The Pexels photo or video (GET /stock) for the stock-photo and stock-video sources; omitted, the director searches and picks. */
20389
+ /** The stock photo or video (GET /stock) for the stock-photo and stock-video sources; omitted, the director searches and picks. */
20390
20390
  stock_id: StockIdSchema.optional()
20391
20391
  }).strict();
20392
20392
  var BACKGROUND_UPLOAD_LIMITS = {
@@ -20459,8 +20459,8 @@ var CANVAS_SOURCE_IDS = ["ai-video", "ai-image", "stock-photo", "stock-video"];
20459
20459
  var CANVAS_SOURCES = {
20460
20460
  "ai-video": { label: "AI video", description: "An image made from your cover\u2019s world, brought to life by a video model.", kind: "video", source: "generated" },
20461
20461
  "ai-image": { label: "AI image", description: "An image made from your cover\u2019s world, moved by our motion engine.", kind: "image", source: "generated" },
20462
- "stock-photo": { label: "Stock photo", description: "A Pexels photo moved by our motion engine.", kind: "image", source: "stock" },
20463
- "stock-video": { label: "Stock video", description: "A Pexels clip cut into a seamless loop.", kind: "video", source: "stock" }
20462
+ "stock-photo": { label: "Stock photo", description: "A stock photo moved by our motion engine.", kind: "image", source: "stock" },
20463
+ "stock-video": { label: "Stock video", description: "A stock clip cut into a seamless loop.", kind: "video", source: "stock" }
20464
20464
  };
20465
20465
  var CANVAS_QUALITIES = ["standard", "high"];
20466
20466
  var CANVAS_RESOLUTIONS = ["720p", "1080p"];
@@ -20475,7 +20475,7 @@ var CanvasRequestSchema = external_exports.object({
20475
20475
  direction: external_exports.string().trim().max(2e3).optional(),
20476
20476
  feature_artist: external_exports.enum(CANVAS_FEATURE_ARTIST_MODES).default("auto"),
20477
20477
  seconds: external_exports.number().int().min(CANVAS_MIN_SECONDS).max(CANVAS_MAX_SECONDS).default(CANVAS_MAX_SECONDS),
20478
- /** The Pexels photo or video (GET /stock) for the stock sources; omitted, the director searches and picks. */
20478
+ /** The stock photo or video (GET /stock) for the stock sources; omitted, the director searches and picks. */
20479
20479
  stock_id: StockIdSchema.optional()
20480
20480
  }).strict().superRefine((value, ctx) => {
20481
20481
  if (value.feature_artist === "always" && CANVAS_SOURCES[value.source].source === "stock")
@@ -20508,6 +20508,7 @@ var search = (q) => ({
20508
20508
  offset: external_exports.number().int().min(0).optional().describe("How many results to skip")
20509
20509
  });
20510
20510
  var httpsUrl = (what) => external_exports.string().url().max(2e3).describe(`A public https URL of ${what}`);
20511
+ 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. 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";
20511
20512
  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.";
20512
20513
  var { type: _lyricType, quote_id: _lyricQuote, ...lyricShape } = LyricVideoRequestSchema.shape;
20513
20514
  var { type: _canvasType, quote_id: _canvasQuote, ...canvasShape } = CanvasRequestSchema.shape;
@@ -20519,7 +20520,7 @@ var lyricInput = external_exports.object({
20519
20520
  song_id: songId,
20520
20521
  callback_url: CALLBACK,
20521
20522
  metadata: METADATA,
20522
- look: lyricShape.look.describe(`{"mode":"existing","id":"look_\u2026"} to reuse a saved Look (add "lyric_style" to render it in another lyric style, at no extra cost), or {"mode":"new","category":"\u2026","lyric_style":"\u2026","background":{"source":"ai-image","quality":"high"},"visibility":"private","direction":"\u2026"} to have one designed (background.source "upload-photo"/"upload-video" with background.upload_id from upload_background designs it around your own media; such a Look stays private. "stock-photo"/"stock-video" with background.stock_id from search_stock uses that Pexels item instead of the director's pick). lyric_style (optional, from get_options) sets how the lyrics are presented and animated: block-stack, punch, player, neon, terminal, cinematic\u2026 Omit it and the director picks one. background.scenes (2\u20134, AI image only) makes that many shots of the same world that cut on the song's sections, each priced like the first. The singer is left out unless asked: feature_artist "always" (default "never") makes them the subject of the background, recognizable from their artist photos (add_artist_photos); it needs an AI image or AI video background, a private Look and display.cover false (the cover would hide them), and that Look then only serves this artist's songs. A saved Look that shows an artist (featured_artist) only serves that artist's songs, also with display.cover false`),
20523
+ look: lyricShape.look.describe(`{"mode":"existing","id":"look_\u2026"} to reuse a saved Look (add "lyric_style" to render it in another lyric style, at no extra cost), or {"mode":"new","category":"\u2026","lyric_style":"\u2026","background":{"source":"ai-image","quality":"high"},"visibility":"private","direction":"\u2026"} to have one designed (background.source "upload-photo"/"upload-video" with background.upload_id from upload_background designs it around your own media; such a Look stays private. "stock-photo"/"stock-video" with background.stock_id from search_stock uses that stock photo or clip instead of the director's pick). lyric_style (optional, from get_options) sets how the lyrics are presented and animated: block-stack, punch, player, neon, terminal, cinematic\u2026 Omit it and the director picks one. background.scenes (2\u20134, AI image only) makes that many shots of the same world that cut on the song's sections, each priced like the first. The singer is left out unless asked: feature_artist "always" (default "never") makes them the subject of the background, recognizable from their artist photos (add_artist_photos); it needs an AI image or AI video background, a private Look and display.cover false (the cover would hide them), and that Look then only serves this artist's songs. A saved Look that shows an artist (featured_artist) only serves that artist's songs, also with display.cover false`),
20523
20524
  aspect_ratios: lyricShape.aspect_ratios.describe('Formats to render, each its own file: "9:16" (vertical), "16:9" (wide), "1:1" (square)'),
20524
20525
  display: lyricShape.display.describe("Which elements show (title, artist, cover, lyrics, badges, headline) and their sizes. cover must be false to show the artist in the background"),
20525
20526
  trim: lyricShape.trim.describe("Render only this section of the song (at least 8 seconds)"),
@@ -20531,7 +20532,7 @@ var canvasInput = external_exports.object({
20531
20532
  callback_url: CALLBACK,
20532
20533
  metadata: METADATA,
20533
20534
  source: canvasShape.source.describe("ai-video (default), ai-image, stock-photo or stock-video"),
20534
- stock_id: canvasShape.stock_id.describe("With a stock source: the Pexels photo or video (search_stock with seconds) to use instead of the director's pick"),
20535
+ stock_id: canvasShape.stock_id.describe("With a stock source: the stock photo or video (search_stock with seconds) to use instead of the director's pick"),
20535
20536
  quality: canvasShape.quality.describe("AI video model tier: standard or high"),
20536
20537
  resolution: canvasShape.resolution.describe("1080p (1080\xD71920) or 720p"),
20537
20538
  style: canvasShape.style.describe("Optional visual style"),
@@ -20541,6 +20542,43 @@ var canvasInput = external_exports.object({
20541
20542
  variations: canvasShape.variations.describe("1\u20134 different Canvases")
20542
20543
  });
20543
20544
  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.";
20545
+ var VideoOutputSchema = external_exports.looseObject({
20546
+ aspect_ratio: external_exports.enum(["9:16", "16:9", "1:1"]).describe("The format of this file"),
20547
+ url: external_exports.string().optional().describe("The full-quality file"),
20548
+ download_url: external_exports.string().optional().describe("The full-quality file, saved under a readable name"),
20549
+ web_url: external_exports.string().optional().describe("A 720p copy, for playback"),
20550
+ poster_url: external_exports.string().optional().describe("A still of the video: for a lyric video one whole lyric line on screen (the hook when it can be), for a Canvas its first frame"),
20551
+ poster_seconds: external_exports.number().nullable().describe("Where poster_url was cut, in seconds from the start of this file (a trimmed clip counts from its own start): the cover frame offset for a post that takes one instead of an image (TikTok). Null for videos made before it was kept"),
20552
+ url_expires_in_seconds: external_exports.number().int().optional().describe("How long the links stay valid"),
20553
+ duration_seconds: external_exports.number().nullable().optional(),
20554
+ size_bytes: external_exports.number().int().nullable().optional(),
20555
+ bitrate_kbps: external_exports.number().int().nullable().optional(),
20556
+ web_size_bytes: external_exports.number().int().nullable().optional()
20557
+ });
20558
+ var VideoSchema = external_exports.looseObject({
20559
+ id: external_exports.string(),
20560
+ type: external_exports.enum(["lyric-video", "canvas"]),
20561
+ variation: external_exports.number().int(),
20562
+ variation_count: external_exports.number().int(),
20563
+ quote_id: external_exports.string().nullable(),
20564
+ status: external_exports.enum(["queued", "processing", "completed", "failed", "cancelled"]),
20565
+ stage: external_exports.string().describe("The step it is at while it is made"),
20566
+ progress: external_exports.number().describe("0\u2013100"),
20567
+ outputs: external_exports.array(VideoOutputSchema).describe("One file per format, once delivered"),
20568
+ song: external_exports.object({ id: external_exports.string().nullable(), title: external_exports.string().nullable(), artist_name: external_exports.string().nullable() }),
20569
+ request: external_exports.record(external_exports.string(), external_exports.unknown()).describe("What the video was made from, with your metadata"),
20570
+ look_id: external_exports.string().nullable(),
20571
+ look: external_exports.record(external_exports.string(), external_exports.unknown()).nullable(),
20572
+ canvas: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().optional().describe("A Canvas: its design and, for stock, the credit to show"),
20573
+ quoted_credits: external_exports.number().nullable(),
20574
+ charged_credits: external_exports.number().nullable(),
20575
+ error: external_exports.string().nullable(),
20576
+ error_code: external_exports.string().nullable(),
20577
+ retry_of_job_id: external_exports.string().nullable(),
20578
+ created_at: external_exports.string(),
20579
+ updated_at: external_exports.string()
20580
+ });
20581
+ var CALLBACK_EVENTS = ["video.completed", "video.failed", "video.cancelled"];
20544
20582
  var OPERATIONS = [
20545
20583
  /* Account */
20546
20584
  {
@@ -20548,7 +20586,7 @@ var OPERATIONS = [
20548
20586
  group: "account",
20549
20587
  title: "Get the account",
20550
20588
  summary: "Who you are signed in as, the organization and its credit balance",
20551
- description: "Returns the organization the credentials act for, how they authenticate and their scopes, and the credit balance (available, monthly, top-ups). Check it before creating videos.",
20589
+ description: "Returns the organization the credentials act for, how they authenticate and their scopes, the credit balance (available, monthly, top-ups) and its plan, if any (where it is billed, when the period ends, and a downgrade or interval switch waiting for the renewal as scheduled_change). Check it before creating videos.",
20552
20590
  method: "GET",
20553
20591
  path: "/api/v1/account",
20554
20592
  scopes: ["videos:read", "music:read", "library:read"],
@@ -20792,7 +20830,7 @@ var OPERATIONS = [
20792
20830
  group: "songs",
20793
20831
  title: "Upload a song",
20794
20832
  summary: "Add a song: master audio and square cover art",
20795
- 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.',
20833
+ 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.',
20796
20834
  method: "POST",
20797
20835
  path: "/api/v1/songs",
20798
20836
  scopes: ["music:write", "videos:write"],
@@ -20801,12 +20839,14 @@ var OPERATIONS = [
20801
20839
  title: external_exports.string().trim().min(1).max(300).describe("The song title"),
20802
20840
  language: external_exports.string().regex(/^[a-z]{2,3}$/).optional().describe('Lyrics language (ISO 639-1, e.g. "en"); detected when omitted'),
20803
20841
  audio_url: httpsUrl("the master audio").optional(),
20804
- cover_art_url: httpsUrl("the square cover art").optional()
20842
+ cover_art_url: httpsUrl("the square cover art").optional(),
20843
+ lyrics: external_exports.string().max(1e5).optional().describe(`Optional. ${LYRICS} once the song is analyzed (get_song: analysis.lyrics.status "mismatch")`)
20805
20844
  }),
20806
20845
  files: [
20807
20846
  { field: "audio", urlField: "audio_url", accept: ["audio/mpeg", "audio/wav", "audio/mp4"], description: "Master audio (MP3, WAV or M4A)" },
20808
20847
  { field: "cover_art", urlField: "cover_art_url", accept: ["image/jpeg", "image/png"], description: "Square cover art (JPEG or PNG)" }
20809
20848
  ],
20849
+ textFiles: ["lyrics"],
20810
20850
  readOnly: false,
20811
20851
  destructive: false,
20812
20852
  idempotent: false,
@@ -20818,7 +20858,7 @@ var OPERATIONS = [
20818
20858
  group: "songs",
20819
20859
  title: "Get a song",
20820
20860
  summary: "One song and its analysis status",
20821
- description: COVER_SIZES,
20861
+ description: `${COVER_SIZES} analysis.lyrics.status says whose words its videos show: "transcribed" (as heard), "checked" (your lyrics, timed from the audio; corrected, added and kept count what checking did), "waiting" (your lyrics, checked once the analysis finishes) or "mismatch" (your lyrics didn\u2019t match what\u2019s sung, so the transcription is used).`,
20822
20862
  method: "GET",
20823
20863
  path: "/api/v1/songs/{song_id}",
20824
20864
  scopes: ["music:read", "videos:read"],
@@ -20866,7 +20906,7 @@ var OPERATIONS = [
20866
20906
  group: "songs",
20867
20907
  title: "Get a song\u2019s analysis",
20868
20908
  summary: "Word-timed lyrics, tempo, beats, sections and hook",
20869
- description: "Use the section times to choose a trim for a lyric video.",
20909
+ description: "Use the section times to choose a trim for a lyric video. lyrics.text is the song\u2019s lyrics to edit: yours as you gave them, or the transcription a line per phrase (lyrics.yours says which).",
20870
20910
  method: "GET",
20871
20911
  path: "/api/v1/songs/{song_id}/analysis",
20872
20912
  scopes: ["music:read", "videos:read"],
@@ -20893,6 +20933,39 @@ var OPERATIONS = [
20893
20933
  cli: ["songs", "reanalyze"],
20894
20934
  mcp: "reanalyze_song"
20895
20935
  },
20936
+ {
20937
+ id: "songs.set_lyrics",
20938
+ group: "songs",
20939
+ title: "Set a song\u2019s lyrics",
20940
+ summary: "Give a song its own lyrics, or replace them",
20941
+ description: `${LYRICS} (409, the song unchanged). They are checked right away (analysis.lyrics in the answer says what changed), or once the analysis finishes if it hasn\u2019t (202). Videos made from then on use them; videos already made stay as they are.`,
20942
+ method: "POST",
20943
+ path: "/api/v1/songs/{song_id}/lyrics",
20944
+ scopes: ["music:write", "videos:write"],
20945
+ input: external_exports.object({ song_id: songId, lyrics: external_exports.string().min(1).max(1e5).describe("The lyrics: text, or an SRT, WebVTT or LRC file\u2019s contents") }),
20946
+ textFiles: ["lyrics"],
20947
+ readOnly: false,
20948
+ destructive: false,
20949
+ idempotent: true,
20950
+ cli: ["songs", "set-lyrics"],
20951
+ mcp: "set_song_lyrics"
20952
+ },
20953
+ {
20954
+ id: "songs.clear_lyrics",
20955
+ group: "songs",
20956
+ title: "Remove a song\u2019s lyrics",
20957
+ summary: "Go back to the transcribed words",
20958
+ description: "Videos made from then on show the words as transcribed.",
20959
+ method: "DELETE",
20960
+ path: "/api/v1/songs/{song_id}/lyrics",
20961
+ scopes: ["music:write", "videos:write"],
20962
+ input: external_exports.object({ song_id: songId }),
20963
+ readOnly: false,
20964
+ destructive: true,
20965
+ idempotent: true,
20966
+ cli: ["songs", "clear-lyrics"],
20967
+ mcp: "clear_song_lyrics"
20968
+ },
20896
20969
  /* Looks */
20897
20970
  {
20898
20971
  id: "looks.list",
@@ -21004,7 +21077,7 @@ var OPERATIONS = [
21004
21077
  id: "stock.search",
21005
21078
  group: "looks",
21006
21079
  title: "Search stock media",
21007
- summary: "Find Pexels photos or clips to use as a stock background",
21080
+ summary: "Find stock photos or clips to use as a background",
21008
21081
  description: `24 results a page. Pass an item's id as look.background.stock_id (source "stock-photo" or "stock-video") or as a Canvas's stock_id to use it instead of the director's pick, and credit the photographer (credit) wherever you show it. orientation: portrait for 9:16 and 1:1, landscape when 16:9 is among the formats (a Canvas is portrait). Clips too short for the loop are left out: pass seconds for a Canvas. thumbnail_url is a 480 px still, preview_url a 1280 px one (the photo, or the clip's poster), preview_video_url a small MP4 of a clip.`,
21009
21082
  method: "GET",
21010
21083
  path: "/api/v1/stock",
@@ -21099,7 +21172,7 @@ var OPERATIONS = [
21099
21172
  group: "videos",
21100
21173
  title: "List videos",
21101
21174
  summary: "Videos, newest first, with status and thumbnails",
21102
- description: "",
21175
+ description: "Each video's outputs carry aspect_ratio, poster_url, poster_seconds and web_url (for thumbnails and previews); get_video has the download links.",
21103
21176
  method: "GET",
21104
21177
  path: "/api/v1/videos",
21105
21178
  scopes: ["videos:read"],
@@ -21115,7 +21188,7 @@ var OPERATIONS = [
21115
21188
  group: "videos",
21116
21189
  title: "Get a video",
21117
21190
  summary: "Status, progress, credits and, when completed, the download links",
21118
- description: "status is queued, processing, completed, failed or cancelled. Completed videos have outputs with download_url (full quality), web_url (720p) and poster_url, signed for 7 days.",
21191
+ description: "status is queued, processing, completed, failed or cancelled. Completed videos have outputs with download_url (full quality), web_url (720p) and poster_url, signed for 7 days. A lyric video's poster is a frame with one whole lyric line on screen (the hook when it can be), ready to set as the thumbnail where you post it; a Canvas's is its first frame. poster_seconds says where in that file the poster was cut, for posts that take a cover frame offset instead of an image (TikTok); null on videos made before it was kept. Failed videos have error and error_code; AI_VIDEO_UNAVAILABLE means the AI video couldn\u2019t be made for a reason on our side, so make it again later.",
21119
21192
  method: "GET",
21120
21193
  path: "/api/v1/videos/{video_id}",
21121
21194
  scopes: ["videos:read"],
@@ -21124,7 +21197,8 @@ var OPERATIONS = [
21124
21197
  destructive: false,
21125
21198
  idempotent: true,
21126
21199
  cli: ["videos", "get"],
21127
- mcp: "get_video"
21200
+ mcp: "get_video",
21201
+ output: { name: "Video", schema: VideoSchema }
21128
21202
  },
21129
21203
  {
21130
21204
  id: "videos.cancel",
@@ -21147,7 +21221,7 @@ var OPERATIONS = [
21147
21221
  group: "videos",
21148
21222
  title: "Make a video again",
21149
21223
  summary: "Run a finished, failed or cancelled video again (new charge)",
21150
- description: "Reuses its Look, background media and loops, so nothing already made is paid for again.",
21224
+ description: "Reuses the Look it made, with its background media and loops, so nothing already made is paid for again. A video that failed before its Look was saved is designed afresh.",
21151
21225
  method: "POST",
21152
21226
  path: "/api/v1/videos/{video_id}/retry",
21153
21227
  scopes: ["videos:write"],
@@ -21199,8 +21273,13 @@ function buildRequest(op, input2, baseUrl) {
21199
21273
  function inputJsonSchema(op) {
21200
21274
  return external_exports.toJSONSchema(op.input, { io: "input", unrepresentable: "any" });
21201
21275
  }
21276
+ function outputJsonSchema(schema) {
21277
+ const { $schema: _, ...rest } = external_exports.toJSONSchema(schema, { io: "output", unrepresentable: "any" });
21278
+ return rest;
21279
+ }
21202
21280
  function openApiDocument(input2) {
21203
21281
  const paths = {};
21282
+ const schemas = { Video: outputJsonSchema(VideoSchema) };
21204
21283
  const groups = /* @__PURE__ */ new Map();
21205
21284
  for (const op of OPERATIONS) {
21206
21285
  const key = `${op.method} ${op.path}`;
@@ -21233,6 +21312,7 @@ function openApiDocument(input2) {
21233
21312
  "application/json": { schema: variants.length > 1 ? { oneOf: variants.map(bodyOf) } : bodyOf(variants[0]) },
21234
21313
  ...first.files ? { "multipart/form-data": { schema: { type: "object", properties: Object.fromEntries(first.files.map((f) => [f.field, f.multiple ? { type: "array", items: { type: "string", format: "binary" } } : { type: "string", format: "binary" }])) } } } : {}
21235
21314
  } } } : {};
21315
+ if (first.output) schemas[first.output.name] ??= outputJsonSchema(first.output.schema);
21236
21316
  (paths[first.path] ??= {})[first.method.toLowerCase()] = {
21237
21317
  operationId: variants.length > 1 ? `${first.id.split(".")[0]}.create` : first.id,
21238
21318
  summary: variants.length > 1 ? variants.map((v) => v.op.title).join(" or ") : first.title,
@@ -21243,7 +21323,7 @@ function openApiDocument(input2) {
21243
21323
  security: [{ bearer: [] }, { oauth2: [...first.scopes] }],
21244
21324
  "x-operations": variants.map((v) => ({ id: v.op.id, mcpTool: v.op.mcp, cli: `kinetune ${v.op.cli.join(" ")}` })),
21245
21325
  responses: {
21246
- "200": { description: "OK" },
21326
+ "200": first.output ? { description: "OK", content: { "application/json": { schema: ref(first.output.name) } } } : { description: "OK" },
21247
21327
  "201": { description: "Created" },
21248
21328
  "400": { description: "Invalid request" },
21249
21329
  "401": { description: "Missing or invalid credentials" },
@@ -21251,7 +21331,8 @@ function openApiDocument(input2) {
21251
21331
  "403": { description: "Missing scope" },
21252
21332
  "404": { description: "Not found" },
21253
21333
  "409": { description: "Conflict" },
21254
- "422": { description: "Unprocessable" }
21334
+ "422": { description: "Unprocessable" },
21335
+ "503": { description: "Temporarily unavailable (AI video): nothing was held; try again after Retry-After seconds" }
21255
21336
  }
21256
21337
  };
21257
21338
  }
@@ -21266,10 +21347,24 @@ function openApiDocument(input2) {
21266
21347
  tokenUrl: `${input2.authorizationServer}/api/auth/oauth2/token`,
21267
21348
  scopes: SCOPE_DESCRIPTIONS
21268
21349
  } } } } : {}
21269
- } },
21270
- paths
21271
- };
21272
- }
21350
+ }, schemas },
21351
+ paths,
21352
+ webhooks: { video: { post: {
21353
+ operationId: "videos.callback",
21354
+ summary: "A video is finished",
21355
+ tags: ["videos"],
21356
+ description: `POSTed to the request's callback_url once the video is completed, failed or cancelled: the video as get_video returns it. Kinetune-Signature is t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<body>"> with your callback secret. Answer with any 2xx within 10 seconds; anything else is retried after 30 s, 2 min, 10 min, 30 min and 2 h.`,
21357
+ parameters: [
21358
+ { name: "Kinetune-Event", in: "header", required: true, schema: { type: "string", enum: [...CALLBACK_EVENTS] } },
21359
+ { name: "Kinetune-Delivery", in: "header", required: true, description: "A new id for every attempt", schema: { type: "string", format: "uuid" } },
21360
+ { name: "Kinetune-Signature", in: "header", required: true, schema: { type: "string" } }
21361
+ ],
21362
+ requestBody: { required: true, content: { "application/json": { schema: ref("Video") } } },
21363
+ responses: { "2XX": { description: "Received" } }
21364
+ } } }
21365
+ };
21366
+ }
21367
+ var ref = (name) => ({ $ref: `#/components/schemas/${name}` });
21273
21368
 
21274
21369
  // ../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
21275
21370
  var CommanderError = class extends Error {
@@ -24796,7 +24891,7 @@ async function revoke(config2) {
24796
24891
  // package.json
24797
24892
  var package_default = {
24798
24893
  name: "@kinetune/cli",
24799
- version: "0.5.0",
24894
+ version: "0.6.0",
24800
24895
  description: "Command line for Kinetune: lyric videos and Spotify Canvas loops from your songs, for people and AI agents.",
24801
24896
  license: "MIT",
24802
24897
  homepage: "https://kinetune.com/developers#cli",
@@ -24905,12 +25000,13 @@ async function call(op, input2, files = []) {
24905
25000
  if (!response.ok) throw new ApiError(response.status, data);
24906
25001
  return response.status === 204 ? { done: true } : data;
24907
25002
  }
25003
+ var readText = (source) => source === "-" ? new Promise((resolve) => {
25004
+ let s = "";
25005
+ process.stdin.on("data", (d) => s += d).on("end", () => resolve(s));
25006
+ }) : readFile2(source, "utf8");
24908
25007
  async function readInput(source) {
24909
25008
  if (!source) return {};
24910
- const text = source === "-" ? await new Promise((resolve) => {
24911
- let s = "";
24912
- process.stdin.on("data", (d) => s += d).on("end", () => resolve(s));
24913
- }) : await readFile2(source, "utf8");
25009
+ const text = await readText(source);
24914
25010
  try {
24915
25011
  return JSON.parse(text);
24916
25012
  } catch {
@@ -24957,6 +25053,7 @@ MCP tool: ${op.mcp} REST: ${op.method} ${op.path}`);
24957
25053
  }));
24958
25054
  else cmd.addOption(new Option(`--${kebab(name)} <value>`, desc));
24959
25055
  }
25056
+ for (const name of op.textFiles ?? []) cmd.option(`--${kebab(name)}-file <file>`, `${props[name]?.description ?? name}: read from a file (or - for stdin)`);
24960
25057
  cmd.option("--input <file>", "The whole input as JSON (a file, or - for stdin); flags override it");
24961
25058
  const creates = op.id.startsWith("videos.create_");
24962
25059
  if (creates) {
@@ -24984,6 +25081,10 @@ MCP tool: ${op.mcp} REST: ${op.method} ${op.path}`);
24984
25081
  if (value !== void 0) input2[name] = value;
24985
25082
  }
24986
25083
  if (files.length) for (const f of op.files ?? []) delete input2[f.urlField];
25084
+ for (const name of op.textFiles ?? []) {
25085
+ const source = options[camel(name) + "File"];
25086
+ if (source !== void 0 && input2[name] === void 0) input2[name] = await readText(source);
25087
+ }
24987
25088
  if (creates && !input2.quote_id) {
24988
25089
  const quoteOp = operation(op.id.replace("videos.create_", "quotes."));
24989
25090
  const { callback_url: _c, ...quoteInput } = input2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinetune/cli",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Command line for Kinetune: lyric videos and Spotify Canvas loops from your songs, for people and AI agents.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://kinetune.com/developers#cli",