@pixeldojo/mcp 0.16.3 → 0.18.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
@@ -56,7 +56,7 @@ Restart your agent. You'll see 19 new tools.
56
56
  | `pixeldojo_ad` | Marketing Studio: a product video ad from a URL or product images. |
57
57
  | `pixeldojo_upscale` | Enhance any image (up to 16×) or video (up to 4K). |
58
58
  | `pixeldojo_audio` | Full audio scenes: dialogue + effects + music in one clip (Seed Audio 1.0). Reference clips are hosted URLs; local audio files are not accepted. |
59
- | `pixeldojo_library` | Search your media library: saved My Media + recent generations. |
59
+ | `pixeldojo_library` | Search your media library: saved Library items + recent generations. |
60
60
  | `pixeldojo_save_workflow` / `run_workflow` / `list_workflows` | Save a multi-step chain once, run it by name from any chat. |
61
61
  | `pixeldojo_upload` | Local file → 24h temp URL, for reference inputs. |
62
62
  | `pixeldojo_from_url` | Product page URL → structured product info. Free. |
package/dist/cli.cjs CHANGED
@@ -1455,6 +1455,49 @@ async function filmApi(ctx, method, path, body) {
1455
1455
  const data = await res.json().catch(() => ({}));
1456
1456
  return { status: res.status, data };
1457
1457
  }
1458
+ async function applyCast(ctx, filmId, cast) {
1459
+ let charged = false;
1460
+ const lines = await Promise.all(cast.map(async (c) => {
1461
+ const r = await filmApi(
1462
+ ctx,
1463
+ "POST",
1464
+ `/api/films/${filmId}/cast`,
1465
+ {
1466
+ role: c.name,
1467
+ ...c.character_id ? { characterId: c.character_id } : {},
1468
+ ...c.image_urls ? { imageUrls: c.image_urls } : {},
1469
+ ...c.prompt ? { prompt: c.prompt } : {},
1470
+ ...c.replace ? { replace: true } : {},
1471
+ ...c.remove ? { remove: true } : {}
1472
+ }
1473
+ );
1474
+ if (r.data.creditCost) charged = true;
1475
+ if (r.status !== 200) {
1476
+ const where2 = r.data.code === "cast-rendered" ? ` Storyboard: ${ctx.baseUrl}/film-studio/${filmId}` : "";
1477
+ return `Could not ${c.remove ? "remove" : c.replace ? "replace" : "cast"} ${c.name}: ${r.data.error ?? r.status}${where2}`;
1478
+ }
1479
+ if (r.data.removed) return `Removed ${c.name} from the film and every shot.`;
1480
+ if (r.data.alreadyCast) {
1481
+ return c.replace ? `${c.name} is already played by that character; nothing changed.` : `${c.name} is already cast; nothing changed. To swap who plays ${c.name}, send the entry again with replace: true.`;
1482
+ }
1483
+ const cost = r.data.creditCost ? ` (portrait, ${r.data.creditCost} credits)` : "";
1484
+ const where = r.data.boundShots ? `, in ${r.data.boundShots} shot(s)` : "";
1485
+ return r.data.replaced ? `Replaced ${r.data.replaced.name} with ${r.data.character?.name ?? "the new cast member"}${r.data.character?.id ? ` (character_id ${r.data.character.id})` : ""} as ${c.name}${cost}${where}.` : `Cast ${c.name}${cost}${where}.`;
1486
+ }));
1487
+ return { lines, charged };
1488
+ }
1489
+ async function uncastRolesOf(ctx, filmId) {
1490
+ const r = await filmApi(ctx, "GET", `/api/films/${filmId}/cast`);
1491
+ return r.data.uncastRoles ?? [];
1492
+ }
1493
+ function castNeededText(filmId, roles) {
1494
+ const example = roles.map((r) => ({ name: r.name, prompt: r.suggestedPrompt || `describe ${r.name}` }));
1495
+ return [
1496
+ `Cast these characters before production (every named character needs a cast member so faces, ages and species hold in every shot):`,
1497
+ ...roles.map((r) => ` ${r.name}${r.suggestedPrompt ? `: ${r.suggestedPrompt}` : ""}`),
1498
+ `Call pixeldojo_film with {"film_id": "${filmId}", "action": "cast", "cast": ${JSON.stringify(example)}}, giving each one a prompt (a portrait is generated, charged), image_urls of your own photos, or a character_id from Character Studio.`
1499
+ ].join("\n");
1500
+ }
1458
1501
  function progressLine(f) {
1459
1502
  const all = shots(f);
1460
1503
  const frames = all.filter((sh) => ["frame-ready", "approved", "clip-generating", "clip-ready"].includes(sh.status) || sh.frameUrl).length;
@@ -1528,32 +1571,44 @@ async function plan(input, ctx) {
1528
1571
  });
1529
1572
  if (!created.data.film) return { kind: "text", text: `Could not create the film: ${created.data.error ?? created.status}` };
1530
1573
  const id = created.data.film.id;
1574
+ const castStarted = Date.now();
1575
+ const cast = input.cast?.length ? await applyCast(ctx, id, input.cast) : { lines: [], charged: false };
1576
+ const pollBudget = Math.max(0, PLANNER_MAX_POLLS - Math.ceil((Date.now() - castStarted) / PLANNER_POLL_MS));
1577
+ const reply = (text) => ({
1578
+ kind: "text",
1579
+ text: [
1580
+ ...cast.lines,
1581
+ cast.charged ? text.replace(/Nothing has been charged( yet)?\./g, "Only the cast portraits above have been charged.") : text
1582
+ ].join("\n")
1583
+ });
1531
1584
  let planned;
1532
1585
  if (music) {
1533
1586
  const brief = [input.idea?.trim() || input.script.trim(), input.lyrics?.trim() ? `Lyrics:
1534
1587
  ${input.lyrics.trim()}` : ""].filter(Boolean).join("\n\n");
1535
- planned = await runPlanner(ctx, id, `/api/films/${id}/plan`, { script: brief });
1588
+ planned = await runPlanner(ctx, id, `/api/films/${id}/plan`, { script: brief }, pollBudget);
1536
1589
  } else {
1537
1590
  let script = input.script?.trim() ?? "";
1538
1591
  if (!script) {
1539
- const wrote = await runPlanner(ctx, id, `/api/films/${id}/script`, { idea: input.idea.trim() });
1540
- if ("pending" in wrote) return { kind: "text", text: stillPlanningText(id, "script") };
1541
- if ("error" in wrote) return { kind: "text", text: `Script writing failed: ${wrote.error}` };
1592
+ const wrote = await runPlanner(ctx, id, `/api/films/${id}/script`, { idea: input.idea.trim() }, pollBudget);
1593
+ if ("pending" in wrote) return reply(stillPlanningText(id, "script"));
1594
+ if ("error" in wrote) return reply(`Script writing failed: ${wrote.error}`);
1542
1595
  script = wrote.film.script ?? "";
1543
- if (!script) return { kind: "text", text: "Script writing failed: the studio returned an empty script." };
1596
+ if (!script) return reply("Script writing failed: the studio returned an empty script.");
1544
1597
  }
1545
1598
  planned = await runPlanner(ctx, id, `/api/films/${id}/plan`, { script });
1546
1599
  }
1547
- if ("pending" in planned) return { kind: "text", text: stillPlanningText(id) };
1548
- if ("error" in planned) return { kind: "text", text: `Shot planning failed: ${planned.error}` };
1600
+ if ("pending" in planned) return reply(stillPlanningText(id));
1601
+ if ("error" in planned) return reply(`Shot planning failed: ${planned.error}`);
1549
1602
  const film = planned.film;
1550
1603
  if (needsSlice(film)) {
1551
1604
  const err = await sliceSong(ctx, film);
1552
- if (err) return { kind: "text", text: `${plannedText(film, ctx)}
1605
+ if (err) return reply(`${plannedText(film, ctx)}
1553
1606
 
1554
- ${err} Call action "status" to retry the cut.` };
1607
+ ${err} Call action "status" to retry the cut.`);
1555
1608
  }
1556
- return { kind: "text", text: plannedText(film, ctx) };
1609
+ const uncast = await uncastRolesOf(ctx, id);
1610
+ return reply([plannedText(film, ctx), uncast.length ? `
1611
+ ${castNeededText(id, uncast)}` : ""].filter(Boolean).join("\n"));
1557
1612
  }
1558
1613
  async function resumePlanning(film, ctx) {
1559
1614
  if (film.scenes.length > 0 && film.llmJob?.status !== "running") return null;
@@ -1580,6 +1635,8 @@ async function produce(filmId, ctx) {
1580
1635
  if (!data.film) return { kind: "text", text: `Film not found: ${data.error ?? filmId}` };
1581
1636
  const planning = await resumePlanning(data.film, ctx);
1582
1637
  if (planning) return planning;
1638
+ const uncast = await uncastRolesOf(ctx, filmId);
1639
+ if (uncast.length) return { kind: "text", text: `Nothing was charged. ${castNeededText(filmId, uncast)}` };
1583
1640
  const pending = shots(data.film).filter((sh) => sh.status === "idle" || sh.status === "failed" && !sh.frameUrl);
1584
1641
  let fired = 0;
1585
1642
  for (const sh of pending.slice(0, 6)) {
@@ -1653,19 +1710,27 @@ It is saved in the Library folder "Film: ${film.title}".`
1653
1710
  if (shots(film).length > 0 && shots(film).every((sh) => sh.status === "idle")) {
1654
1711
  return { kind: "text", text: plannedText(film, ctx) };
1655
1712
  }
1656
- const idleFrames = all.filter((sh) => sh.status === "idle");
1657
- for (const sh of idleFrames.slice(0, 6)) {
1658
- await filmApi(ctx, "POST", `/api/films/${filmId}/shots/${sh.id}/generate`, { kind: "frame" });
1659
- }
1660
- const framesDone = all.every((sh) => ["frame-ready", "clip-generating", "clip-ready"].includes(sh.status));
1661
- if (framesDone && all.some((sh) => sh.status === "frame-ready" && needsSave(sh.frameUrl))) {
1713
+ let started = 0;
1714
+ const resent = /* @__PURE__ */ new Set();
1715
+ const dispatch = async (sh, kind) => {
1716
+ const r = await filmApi(ctx, "POST", `/api/films/${filmId}/shots/${sh.id}/generate`, { kind });
1717
+ if (r.status !== 200) return;
1718
+ started += 1;
1719
+ if (sh.status === "failed") resent.add(sh.id);
1720
+ };
1721
+ const pendingFrames = all.filter((sh) => sh.status === "idle" || sh.status === "failed" && !sh.frameUrl && !isRefused(sh));
1722
+ if (pendingFrames.length > 0) {
1723
+ const uncast = await uncastRolesOf(ctx, filmId);
1724
+ if (uncast.length) return { kind: "text", text: castNeededText(filmId, uncast) };
1725
+ }
1726
+ for (const sh of pendingFrames.slice(0, 6)) await dispatch(sh, "frame");
1727
+ const framesDone = all.every(frameDone);
1728
+ if (all.some((sh) => frameDone(sh) && needsSave(sh.frameUrl))) {
1662
1729
  await filmApi(ctx, "POST", `/api/films/${filmId}/save`, { kind: "frame" });
1663
1730
  }
1664
1731
  const inFlight = count(film, (sh) => sh.status === "clip-generating");
1665
- const clipQueue = all.filter((sh) => (sh.status === "frame-ready" || sh.status === "failed" && Boolean(sh.frameUrl)) && framesDone);
1666
- for (const sh of clipQueue.slice(0, Math.max(0, 4 - inFlight))) {
1667
- await filmApi(ctx, "POST", `/api/films/${filmId}/shots/${sh.id}/generate`, { kind: "clip" });
1668
- }
1732
+ const clipQueue = framesDone ? all.filter((sh) => sh.status === "frame-ready" || sh.status === "failed" && frameDone(sh) && !isRefused(sh)) : [];
1733
+ for (const sh of clipQueue.slice(0, Math.max(0, 4 - inFlight))) await dispatch(sh, "clip");
1669
1734
  const clipsDone = all.length > 0 && all.every((sh) => sh.status === "clip-ready");
1670
1735
  if (clipsDone) {
1671
1736
  if (all.some((sh) => needsSave(sh.videoUrl))) {
@@ -1688,30 +1753,53 @@ It is saved in the Library folder "Film: ${film.title}".`
1688
1753
  return { kind: "text", text: `Score still composing. Poll again in ~20s with {"film_id": "${filmId}", "action": "status", "music_job_id": "${musicJobId}"}.` };
1689
1754
  }
1690
1755
  const body = soundtrack === "scene-synced" ? buildScorePlanBody(film) : buildFlatMusicBody(film, all);
1691
- const dispatch = await ctx.client.run("text-to-music", body);
1692
- return { kind: "text", text: `All ${all.length} clips ready \u2014 the ${soundtrack} score is composing (charged like any music generation). Poll again in ~20s with {"film_id": "${filmId}", "action": "status", "music_job_id": "${dispatch.jobId}"}.` };
1756
+ const dispatch2 = await ctx.client.run("text-to-music", body);
1757
+ return { kind: "text", text: `All ${all.length} clips ready \u2014 the ${soundtrack} score is composing (charged like any music generation). Poll again in ~20s with {"film_id": "${filmId}", "action": "status", "music_job_id": "${dispatch2.jobId}"}.` };
1693
1758
  }
1694
1759
  await filmApi(ctx, "POST", `/api/films/${filmId}/export`, {});
1695
1760
  return { kind: "text", text: `All clips ready \u2014 export started (${progressLine(film)}). Poll again in ~60s with action "status" for the finished film URL.` };
1696
1761
  }
1697
1762
  const failed = all.filter((sh) => sh.status === "failed");
1763
+ const refused = failed.filter(isRefused);
1764
+ const retrying = failed.filter((sh) => !isRefused(sh));
1765
+ const sentAgain = retrying.filter((sh) => resent.has(sh.id)).length;
1766
+ const paused = refused.length > 0 && started === 0 && !all.some((sh) => sh.status === "frame-generating" || sh.status === "clip-generating");
1767
+ const labels = new Map(film.scenes.flatMap((s, si) => s.shots.map((sh, i) => [sh.id, `${si + 1}.${i + 1}`])));
1768
+ const reason = (sh) => {
1769
+ const text = (sh.errorMessage ?? "no reason given").replace(/\s*Retry (?:the shot|it)\.\s*$/i, "");
1770
+ return text.length > 300 ? `${text.slice(0, 297)}...` : text;
1771
+ };
1772
+ const one = refused.length === 1;
1698
1773
  return {
1699
1774
  kind: "text",
1700
1775
  text: [
1701
- `In progress: ${progressLine(film)}.`,
1702
- failed.length > 0 ? `${failed.length} shot(s) failed and were re-queued (${failed[0]?.errorMessage?.slice(0, 100) ?? ""}).` : "",
1703
- `Poll again in ~30s with {"film_id": "${filmId}", "action": "status"}.`
1776
+ `${paused ? "Paused" : "In progress"}: ${progressLine(film)}.`,
1777
+ refused.length > 0 ? `${one ? "Shot" : "Shots"} ${refused.map((sh) => labels.get(sh.id)).join(", ")} need${one ? "s" : ""} a new frame or prompt. The provider refused ${one ? "it" : "them"} (${reason(refused[0])}) and usually refuses the same input again, so status does not resend ${one ? "it" : "them"}: every retry is a charged render. Change ${one ? "it" : "them"} and render again at ${ctx.baseUrl}/film-studio/${filmId}.` : "",
1778
+ retrying.length > 0 ? `${retrying.length} shot(s) failed (${reason(retrying[0])}): ${sentAgain === retrying.length ? "sent again" : sentAgain > 0 ? `${sentAgain} sent again, the rest on a later poll` : "sent again on a later poll"}.` : "",
1779
+ paused ? `Nothing else is rendering. Once the shot${one ? "" : "s"} render${one ? "s" : ""} again, call pixeldojo_film with {"film_id": "${filmId}", "action": "status"} to carry on.` : `Poll again in ~30s with {"film_id": "${filmId}", "action": "status"}.`
1704
1780
  ].filter(Boolean).join("\n")
1705
1781
  };
1706
1782
  }
1707
1783
  async function run8(input, ctx) {
1708
- const action = input.action === "plan" && input.film_id ? "status" : input.action;
1784
+ const action = input.action === "plan" && input.film_id ? input.cast?.length ? "cast" : "status" : input.action;
1709
1785
  if (action === "plan") return plan(input, ctx);
1710
- if (!input.film_id) return { kind: "text", text: "produce/status need the film_id returned by the plan step." };
1786
+ if (!input.film_id) return { kind: "text", text: "produce/status/cast need the film_id returned by the plan step." };
1787
+ if (action === "cast") {
1788
+ if (!input.cast?.length) return { kind: "text", text: "Pass cast: [{ name, prompt | image_urls | character_id }] to cast characters (add replace: true to swap someone already cast, or remove: true to take them off)." };
1789
+ const { lines } = await applyCast(ctx, input.film_id, input.cast);
1790
+ const uncast = await uncastRolesOf(ctx, input.film_id);
1791
+ return {
1792
+ kind: "text",
1793
+ text: [
1794
+ ...lines,
1795
+ uncast.length ? castNeededText(input.film_id, uncast) : `Everyone is cast. Call pixeldojo_film with {"film_id": "${input.film_id}", "action": "produce"} to start production.`
1796
+ ].join("\n")
1797
+ };
1798
+ }
1711
1799
  if (action === "produce") return produce(input.film_id, ctx);
1712
1800
  return advance(input.film_id, input.soundtrack, input.music_job_id, ctx);
1713
1801
  }
1714
- var STORY_LOOKS, MUSIC_VIDEO_LOOKS, LOOKS, MUSIC_CLIP_ENGINE_ID, InputSchema8, InputJsonSchema8, shots, count, PLANNER_POLL_MS, PLANNER_MAX_POLLS, isMusicVideo, needsSlice, stillPlanningText, LOOK_MUSIC, ARC, filmSkill;
1802
+ var STORY_LOOKS, MUSIC_VIDEO_LOOKS, LOOKS, MUSIC_CLIP_ENGINE_ID, InputSchema8, InputJsonSchema8, shots, count, frameDone, RETRY_CLEARS, REFUSED, isRefused, PLANNER_POLL_MS, PLANNER_MAX_POLLS, isMusicVideo, needsSlice, stillPlanningText, LOOK_MUSIC, ARC, filmSkill;
1715
1803
  var init_film = __esm({
1716
1804
  "src/skills/film.ts"() {
1717
1805
  init_upload_helpers();
@@ -1729,8 +1817,18 @@ var init_film = __esm({
1729
1817
  lyrics: zod.z.string().max(1e4).optional().describe("Music video mode: the song lyrics, so shots land on the right lines. Optional."),
1730
1818
  aspect: zod.z.enum(["16:9", "9:16"]).default("16:9"),
1731
1819
  length: zod.z.enum(["30s", "60s", "2-3min", "5min"]).default("60s").describe("Target length; drives the shot count (~6/12/24/60 shots)."),
1732
- film_id: zod.z.string().max(40).optional().describe("Existing film id (from a previous call) for produce/status."),
1733
- action: zod.z.enum(["plan", "produce", "status"]).default("plan").describe("'plan' creates + storyboards (free). 'produce' starts charged generation. 'status' advances production and reports progress; poll it every ~30s until it returns the finished film."),
1820
+ film_id: zod.z.string().max(40).optional().describe("Existing film id (from a previous call) for produce/status/cast."),
1821
+ action: zod.z.enum(["plan", "produce", "status", "cast"]).default("plan").describe("'plan' creates + storyboards (free). 'cast' casts, replaces or removes characters on an existing film. 'produce' starts charged generation. 'status' advances production and reports progress; poll it every ~30s until it returns the finished film."),
1822
+ cast: zod.z.array(
1823
+ zod.z.object({
1824
+ name: zod.z.string().trim().min(1).max(60),
1825
+ image_urls: zod.z.array(zod.z.string().url().startsWith("https://").max(2048)).min(1).max(8).optional(),
1826
+ prompt: zod.z.string().trim().min(1).max(600).optional(),
1827
+ character_id: zod.z.string().max(40).optional(),
1828
+ replace: zod.z.boolean().optional(),
1829
+ remove: zod.z.boolean().optional()
1830
+ })
1831
+ ).max(8).optional().describe("Cast members, one per named character. Each gives image_urls (your own photos), a prompt (a portrait is generated, charged), or a character_id (a Character Studio character); with none of these the Character Studio character of that name is used. replace: true swaps out whoever already plays that name; remove: true takes them off the film."),
1734
1832
  soundtrack: zod.z.enum(["scene-synced", "flat", "none"]).default("scene-synced").describe("scene-synced composes one musical section per scene, pinned to the scene lengths (default). flat is a single cohesive bed. none skips music."),
1735
1833
  music_job_id: zod.z.string().max(80).optional().describe("The music_job_id from the previous status reply while the score is composing, so that score is attached. A status call without it, once all clips are ready and no score is attached, starts and charges for a new score.")
1736
1834
  });
@@ -1758,8 +1856,34 @@ var init_film = __esm({
1758
1856
  film_id: { type: "string", description: 'The film_id returned by the plan step. Required for produce and status; with it, action "plan" is treated as "status".' },
1759
1857
  action: {
1760
1858
  type: "string",
1761
- enum: ["plan", "produce", "status"],
1762
- description: "plan (default, free): writes the script and plans shots, returns film_id and a cost estimate. produce (charged): starts rendering frames. status: advances production one step and reports progress; call it every ~30s until it returns the finished film URL."
1859
+ enum: ["plan", "produce", "status", "cast"],
1860
+ description: "plan (default, free): writes the script and plans shots, returns film_id, a cost estimate, and any characters still to cast. cast: casts, replaces or removes characters on an existing film (pass film_id and cast). produce (charged): starts rendering frames; refused until every named character is cast. status: advances production one step and reports progress; call it every ~30s until it returns the finished film URL."
1861
+ },
1862
+ cast: {
1863
+ type: "array",
1864
+ maxItems: 8,
1865
+ description: 'Cast members, one per named character. Every named character must be cast before frames render, so faces, ages and species hold in every shot. Pass them on the plan call (the script then stars them by name) or later with action "cast" using the names the plan reports. Each entry: name, plus ONE of image_urls (your own photos of an adult, made into a character), prompt (a portrait is generated from it, charged like any image), or character_id (a Character Studio character). An entry with only a name uses your Character Studio character of that name. A name that is already cast is left alone unless the entry sets replace: true, which hands that part (every shot, outfit and voice) to the new cast member. remove: true with only the name takes that cast member off the film; the part then needs a new cast member before frames render. replace and remove work until the shots of that cast member are rendered; after that, recast on the storyboard, where the frames that show them can be redone.',
1866
+ items: {
1867
+ type: "object",
1868
+ properties: {
1869
+ name: { type: "string", description: 'The character name as the film uses it (e.g. "Harlan").' },
1870
+ image_urls: { type: "array", items: { type: "string" }, description: "Your own https photos of the character (1-8). PixelDojo uploads work; they are copied to permanent storage." },
1871
+ prompt: {
1872
+ type: "string",
1873
+ description: 'A description to generate the portrait from: species if not human, gender, adult age, look and outfit (e.g. "man in his late 50s, grey mustache, sunburnt, red windbreaker").'
1874
+ },
1875
+ character_id: { type: "string", description: "A Character Studio character id." },
1876
+ replace: {
1877
+ type: "boolean",
1878
+ description: "Swap out whoever already plays this name for the image_urls, prompt or character_id given here, before their shots are rendered. Without it, an already-cast name is left unchanged."
1879
+ },
1880
+ remove: {
1881
+ type: "boolean",
1882
+ description: "Take whoever plays this name off the film and every shot (free), before their shots are rendered. Give only the name."
1883
+ }
1884
+ },
1885
+ required: ["name"]
1886
+ }
1763
1887
  },
1764
1888
  soundtrack: {
1765
1889
  type: "string",
@@ -1774,6 +1898,10 @@ var init_film = __esm({
1774
1898
  };
1775
1899
  shots = (f) => f.scenes.flatMap((s) => s.shots);
1776
1900
  count = (f, pred) => shots(f).filter(pred).length;
1901
+ frameDone = (sh) => Boolean(sh.frameUrl) && sh.status !== "idle" && sh.status !== "frame-generating";
1902
+ RETRY_CLEARS = /automatic audio check flagged|output audio\b[\s\S]*?sensitive information|temporarily unavailable/i;
1903
+ REFUSED = /copyright|infringement|content filter|safety filter|moderation|blocked|flagged|sensitive|real (?:person|human)|nsfw|content policy|policy violation|inappropriate/i;
1904
+ isRefused = (sh) => sh.status === "failed" && Boolean(sh.errorMessage) && !RETRY_CLEARS.test(sh.errorMessage) && REFUSED.test(sh.errorMessage);
1777
1905
  PLANNER_POLL_MS = 3e3;
1778
1906
  PLANNER_MAX_POLLS = 8;
1779
1907
  isMusicVideo = (f) => f.musicVideoMode === true;
@@ -1799,8 +1927,8 @@ var init_film = __esm({
1799
1927
  };
1800
1928
  filmSkill = {
1801
1929
  name: "pixeldojo_film",
1802
- description: "Make a finished short film from one idea: screenplay, storyboard frames (AI-reviewed), video clips with spoken dialogue, scene-synced soundtrack, stitched export. Or a music video: pass song_path (a local file) or song_url (your own PixelDojo upload from pixeldojo_upload, never a third-party link) with optional lyrics; the film is cut to that song, each clip lip-synced to its slice on the studio music video engine, and no score is composed: the export plays the song. Phased: plan is free; produce starts charged generation; status advances production (poll every ~30s).",
1803
- hostedDescription: "Make a finished short film from one idea: screenplay, storyboard frames (AI-reviewed), video clips with spoken dialogue, scene-synced soundtrack, stitched export. Or a music video: pass song_url (your own PixelDojo upload made with POST /api/v1/upload, never a third-party link) with optional lyrics; the film is cut to that song, each clip lip-synced to its slice on the studio music video engine, and no score is composed: the export plays the song. Phased: plan is free; produce starts charged generation; status advances production (poll every ~30s).",
1930
+ description: "Make a finished short film from one idea: screenplay, storyboard frames (AI-reviewed), video clips with spoken dialogue, scene-synced soundtrack, stitched export. Or a music video: pass song_path (a local file) or song_url (your own PixelDojo upload from pixeldojo_upload, never a third-party link) with optional lyrics; the film is cut to that song, each clip lip-synced to its slice on the studio music video engine, and no score is composed: the export plays the song. Every named character must be cast (cast: your own images, a portrait prompt, or a Character Studio character) before frames render; cast entries can also replace or remove someone. Phased: plan is free; cast; produce starts charged generation; status advances production (poll every ~30s).",
1931
+ hostedDescription: "Make a finished short film from one idea: screenplay, storyboard frames (AI-reviewed), video clips with spoken dialogue, scene-synced soundtrack, stitched export. Or a music video: pass song_url (your own PixelDojo upload made with POST /api/v1/upload, never a third-party link) with optional lyrics; the film is cut to that song, each clip lip-synced to its slice on the studio music video engine, and no score is composed: the export plays the song. Every named character must be cast (cast: your own images, a portrait prompt, or a Character Studio character) before frames render; cast entries can also replace or remove someone. Phased: plan is free; cast; produce starts charged generation; status advances production (poll every ~30s).",
1804
1932
  inputZod: InputSchema8,
1805
1933
  inputJsonSchema: InputJsonSchema8,
1806
1934
  allowedModels: [],
@@ -2234,7 +2362,7 @@ async function produce2(id, ctx) {
2234
2362
  if (saved.status !== 200 || !url) {
2235
2363
  return { kind: "text", text: `The export is ready but could not be saved: ${saved.data.error ?? saved.status}. The draft (kept 24h): ${exp.url}. ${next(id, "produce", "~30s")}` };
2236
2364
  }
2237
- return { kind: "text", text: `"${ep.title}" is finished and saved to My Media: ${url}` };
2365
+ return { kind: "text", text: `"${ep.title}" is finished and saved to your Library: ${url}` };
2238
2366
  }
2239
2367
  const started = await episodeApi(ctx, "POST", `/${id}/export`, {});
2240
2368
  if (started.status !== 202) {
@@ -2305,7 +2433,7 @@ var init_episode = __esm({
2305
2433
  stillPlanning = (id) => `The script is still being written (episode_id: ${id}). Nothing has been charged. ${next(id, "status", "~30s")}`;
2306
2434
  episodeSkill = {
2307
2435
  name: "pixeldojo_episode",
2308
- description: "Make a finished narrated faceless video (explainer, history, kids story) from one topic: script, scene visuals, AI narration, music bed, stitched export saved to My Media. Phased: create is free and returns a credit quote; produce is charged and advances one step per call (poll every ~30s until it returns the video URL); status is free.",
2436
+ description: "Make a finished narrated faceless video (explainer, history, kids story) from one topic: script, scene visuals, AI narration, music bed, stitched export saved to the Library. Phased: create is free and returns a credit quote; produce is charged and advances one step per call (poll every ~30s until it returns the video URL); status is free.",
2309
2437
  inputZod: InputSchema10,
2310
2438
  inputJsonSchema: InputJsonSchema10,
2311
2439
  allowedModels: [],
@@ -2855,7 +2983,7 @@ var init_library = __esm({
2855
2983
  };
2856
2984
  librarySkill = {
2857
2985
  name: "pixeldojo_library",
2858
- description: "Search your media library: saved My Media items (permanent) and recent API/MCP generations (deleted 1 hour after they finish), newest first. Returns asset URLs to reuse as reference inputs.",
2986
+ description: "Search your Library: saved media (permanent) and recent API/MCP generations (deleted 1 hour after they finish), newest first. Returns asset URLs to reuse as reference inputs.",
2859
2987
  inputZod: InputSchema16,
2860
2988
  inputJsonSchema: InputJsonSchema16,
2861
2989
  allowedModels: [],
@@ -3277,7 +3405,7 @@ function makeRedactedLogger(target = console) {
3277
3405
  }
3278
3406
 
3279
3407
  // src/server.ts
3280
- var PACKAGE_VERSION = "0.16.3" ;
3408
+ var PACKAGE_VERSION = "0.18.0" ;
3281
3409
  var SERVER_INSTRUCTIONS = "PixelDojo generates images, video, audio and short films across 100+ models, billed in credits from the connected PixelDojo account. A job that runs past the 30-second wait returns a jobId to check later; check it rather than submitting again, since every new submission is charged. Generated asset URLs are deleted one hour after they are created, so download anything the user wants to keep. Finished films are the exception and stay in the account library.";
3282
3410
  function buildServer(options) {
3283
3411
  if (!options.apiKey) {