@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 +1 -1
- package/dist/cli.cjs +166 -38
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +166 -38
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +166 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +166 -38
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1453,6 +1453,49 @@ async function filmApi(ctx, method, path, body) {
|
|
|
1453
1453
|
const data = await res.json().catch(() => ({}));
|
|
1454
1454
|
return { status: res.status, data };
|
|
1455
1455
|
}
|
|
1456
|
+
async function applyCast(ctx, filmId, cast) {
|
|
1457
|
+
let charged = false;
|
|
1458
|
+
const lines = await Promise.all(cast.map(async (c) => {
|
|
1459
|
+
const r = await filmApi(
|
|
1460
|
+
ctx,
|
|
1461
|
+
"POST",
|
|
1462
|
+
`/api/films/${filmId}/cast`,
|
|
1463
|
+
{
|
|
1464
|
+
role: c.name,
|
|
1465
|
+
...c.character_id ? { characterId: c.character_id } : {},
|
|
1466
|
+
...c.image_urls ? { imageUrls: c.image_urls } : {},
|
|
1467
|
+
...c.prompt ? { prompt: c.prompt } : {},
|
|
1468
|
+
...c.replace ? { replace: true } : {},
|
|
1469
|
+
...c.remove ? { remove: true } : {}
|
|
1470
|
+
}
|
|
1471
|
+
);
|
|
1472
|
+
if (r.data.creditCost) charged = true;
|
|
1473
|
+
if (r.status !== 200) {
|
|
1474
|
+
const where2 = r.data.code === "cast-rendered" ? ` Storyboard: ${ctx.baseUrl}/film-studio/${filmId}` : "";
|
|
1475
|
+
return `Could not ${c.remove ? "remove" : c.replace ? "replace" : "cast"} ${c.name}: ${r.data.error ?? r.status}${where2}`;
|
|
1476
|
+
}
|
|
1477
|
+
if (r.data.removed) return `Removed ${c.name} from the film and every shot.`;
|
|
1478
|
+
if (r.data.alreadyCast) {
|
|
1479
|
+
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.`;
|
|
1480
|
+
}
|
|
1481
|
+
const cost = r.data.creditCost ? ` (portrait, ${r.data.creditCost} credits)` : "";
|
|
1482
|
+
const where = r.data.boundShots ? `, in ${r.data.boundShots} shot(s)` : "";
|
|
1483
|
+
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}.`;
|
|
1484
|
+
}));
|
|
1485
|
+
return { lines, charged };
|
|
1486
|
+
}
|
|
1487
|
+
async function uncastRolesOf(ctx, filmId) {
|
|
1488
|
+
const r = await filmApi(ctx, "GET", `/api/films/${filmId}/cast`);
|
|
1489
|
+
return r.data.uncastRoles ?? [];
|
|
1490
|
+
}
|
|
1491
|
+
function castNeededText(filmId, roles) {
|
|
1492
|
+
const example = roles.map((r) => ({ name: r.name, prompt: r.suggestedPrompt || `describe ${r.name}` }));
|
|
1493
|
+
return [
|
|
1494
|
+
`Cast these characters before production (every named character needs a cast member so faces, ages and species hold in every shot):`,
|
|
1495
|
+
...roles.map((r) => ` ${r.name}${r.suggestedPrompt ? `: ${r.suggestedPrompt}` : ""}`),
|
|
1496
|
+
`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.`
|
|
1497
|
+
].join("\n");
|
|
1498
|
+
}
|
|
1456
1499
|
function progressLine(f) {
|
|
1457
1500
|
const all = shots(f);
|
|
1458
1501
|
const frames = all.filter((sh) => ["frame-ready", "approved", "clip-generating", "clip-ready"].includes(sh.status) || sh.frameUrl).length;
|
|
@@ -1526,32 +1569,44 @@ async function plan(input, ctx) {
|
|
|
1526
1569
|
});
|
|
1527
1570
|
if (!created.data.film) return { kind: "text", text: `Could not create the film: ${created.data.error ?? created.status}` };
|
|
1528
1571
|
const id = created.data.film.id;
|
|
1572
|
+
const castStarted = Date.now();
|
|
1573
|
+
const cast = input.cast?.length ? await applyCast(ctx, id, input.cast) : { lines: [], charged: false };
|
|
1574
|
+
const pollBudget = Math.max(0, PLANNER_MAX_POLLS - Math.ceil((Date.now() - castStarted) / PLANNER_POLL_MS));
|
|
1575
|
+
const reply = (text) => ({
|
|
1576
|
+
kind: "text",
|
|
1577
|
+
text: [
|
|
1578
|
+
...cast.lines,
|
|
1579
|
+
cast.charged ? text.replace(/Nothing has been charged( yet)?\./g, "Only the cast portraits above have been charged.") : text
|
|
1580
|
+
].join("\n")
|
|
1581
|
+
});
|
|
1529
1582
|
let planned;
|
|
1530
1583
|
if (music) {
|
|
1531
1584
|
const brief = [input.idea?.trim() || input.script.trim(), input.lyrics?.trim() ? `Lyrics:
|
|
1532
1585
|
${input.lyrics.trim()}` : ""].filter(Boolean).join("\n\n");
|
|
1533
|
-
planned = await runPlanner(ctx, id, `/api/films/${id}/plan`, { script: brief });
|
|
1586
|
+
planned = await runPlanner(ctx, id, `/api/films/${id}/plan`, { script: brief }, pollBudget);
|
|
1534
1587
|
} else {
|
|
1535
1588
|
let script = input.script?.trim() ?? "";
|
|
1536
1589
|
if (!script) {
|
|
1537
|
-
const wrote = await runPlanner(ctx, id, `/api/films/${id}/script`, { idea: input.idea.trim() });
|
|
1538
|
-
if ("pending" in wrote) return
|
|
1539
|
-
if ("error" in wrote) return
|
|
1590
|
+
const wrote = await runPlanner(ctx, id, `/api/films/${id}/script`, { idea: input.idea.trim() }, pollBudget);
|
|
1591
|
+
if ("pending" in wrote) return reply(stillPlanningText(id, "script"));
|
|
1592
|
+
if ("error" in wrote) return reply(`Script writing failed: ${wrote.error}`);
|
|
1540
1593
|
script = wrote.film.script ?? "";
|
|
1541
|
-
if (!script) return
|
|
1594
|
+
if (!script) return reply("Script writing failed: the studio returned an empty script.");
|
|
1542
1595
|
}
|
|
1543
1596
|
planned = await runPlanner(ctx, id, `/api/films/${id}/plan`, { script });
|
|
1544
1597
|
}
|
|
1545
|
-
if ("pending" in planned) return
|
|
1546
|
-
if ("error" in planned) return
|
|
1598
|
+
if ("pending" in planned) return reply(stillPlanningText(id));
|
|
1599
|
+
if ("error" in planned) return reply(`Shot planning failed: ${planned.error}`);
|
|
1547
1600
|
const film = planned.film;
|
|
1548
1601
|
if (needsSlice(film)) {
|
|
1549
1602
|
const err = await sliceSong(ctx, film);
|
|
1550
|
-
if (err) return
|
|
1603
|
+
if (err) return reply(`${plannedText(film, ctx)}
|
|
1551
1604
|
|
|
1552
|
-
${err} Call action "status" to retry the cut.`
|
|
1605
|
+
${err} Call action "status" to retry the cut.`);
|
|
1553
1606
|
}
|
|
1554
|
-
|
|
1607
|
+
const uncast = await uncastRolesOf(ctx, id);
|
|
1608
|
+
return reply([plannedText(film, ctx), uncast.length ? `
|
|
1609
|
+
${castNeededText(id, uncast)}` : ""].filter(Boolean).join("\n"));
|
|
1555
1610
|
}
|
|
1556
1611
|
async function resumePlanning(film, ctx) {
|
|
1557
1612
|
if (film.scenes.length > 0 && film.llmJob?.status !== "running") return null;
|
|
@@ -1578,6 +1633,8 @@ async function produce(filmId, ctx) {
|
|
|
1578
1633
|
if (!data.film) return { kind: "text", text: `Film not found: ${data.error ?? filmId}` };
|
|
1579
1634
|
const planning = await resumePlanning(data.film, ctx);
|
|
1580
1635
|
if (planning) return planning;
|
|
1636
|
+
const uncast = await uncastRolesOf(ctx, filmId);
|
|
1637
|
+
if (uncast.length) return { kind: "text", text: `Nothing was charged. ${castNeededText(filmId, uncast)}` };
|
|
1581
1638
|
const pending = shots(data.film).filter((sh) => sh.status === "idle" || sh.status === "failed" && !sh.frameUrl);
|
|
1582
1639
|
let fired = 0;
|
|
1583
1640
|
for (const sh of pending.slice(0, 6)) {
|
|
@@ -1651,19 +1708,27 @@ It is saved in the Library folder "Film: ${film.title}".`
|
|
|
1651
1708
|
if (shots(film).length > 0 && shots(film).every((sh) => sh.status === "idle")) {
|
|
1652
1709
|
return { kind: "text", text: plannedText(film, ctx) };
|
|
1653
1710
|
}
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1711
|
+
let started = 0;
|
|
1712
|
+
const resent = /* @__PURE__ */ new Set();
|
|
1713
|
+
const dispatch = async (sh, kind) => {
|
|
1714
|
+
const r = await filmApi(ctx, "POST", `/api/films/${filmId}/shots/${sh.id}/generate`, { kind });
|
|
1715
|
+
if (r.status !== 200) return;
|
|
1716
|
+
started += 1;
|
|
1717
|
+
if (sh.status === "failed") resent.add(sh.id);
|
|
1718
|
+
};
|
|
1719
|
+
const pendingFrames = all.filter((sh) => sh.status === "idle" || sh.status === "failed" && !sh.frameUrl && !isRefused(sh));
|
|
1720
|
+
if (pendingFrames.length > 0) {
|
|
1721
|
+
const uncast = await uncastRolesOf(ctx, filmId);
|
|
1722
|
+
if (uncast.length) return { kind: "text", text: castNeededText(filmId, uncast) };
|
|
1723
|
+
}
|
|
1724
|
+
for (const sh of pendingFrames.slice(0, 6)) await dispatch(sh, "frame");
|
|
1725
|
+
const framesDone = all.every(frameDone);
|
|
1726
|
+
if (all.some((sh) => frameDone(sh) && needsSave(sh.frameUrl))) {
|
|
1660
1727
|
await filmApi(ctx, "POST", `/api/films/${filmId}/save`, { kind: "frame" });
|
|
1661
1728
|
}
|
|
1662
1729
|
const inFlight = count(film, (sh) => sh.status === "clip-generating");
|
|
1663
|
-
const clipQueue = all.filter((sh) =>
|
|
1664
|
-
for (const sh of clipQueue.slice(0, Math.max(0, 4 - inFlight)))
|
|
1665
|
-
await filmApi(ctx, "POST", `/api/films/${filmId}/shots/${sh.id}/generate`, { kind: "clip" });
|
|
1666
|
-
}
|
|
1730
|
+
const clipQueue = framesDone ? all.filter((sh) => sh.status === "frame-ready" || sh.status === "failed" && frameDone(sh) && !isRefused(sh)) : [];
|
|
1731
|
+
for (const sh of clipQueue.slice(0, Math.max(0, 4 - inFlight))) await dispatch(sh, "clip");
|
|
1667
1732
|
const clipsDone = all.length > 0 && all.every((sh) => sh.status === "clip-ready");
|
|
1668
1733
|
if (clipsDone) {
|
|
1669
1734
|
if (all.some((sh) => needsSave(sh.videoUrl))) {
|
|
@@ -1686,30 +1751,53 @@ It is saved in the Library folder "Film: ${film.title}".`
|
|
|
1686
1751
|
return { kind: "text", text: `Score still composing. Poll again in ~20s with {"film_id": "${filmId}", "action": "status", "music_job_id": "${musicJobId}"}.` };
|
|
1687
1752
|
}
|
|
1688
1753
|
const body = soundtrack === "scene-synced" ? buildScorePlanBody(film) : buildFlatMusicBody(film, all);
|
|
1689
|
-
const
|
|
1690
|
-
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": "${
|
|
1754
|
+
const dispatch2 = await ctx.client.run("text-to-music", body);
|
|
1755
|
+
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}"}.` };
|
|
1691
1756
|
}
|
|
1692
1757
|
await filmApi(ctx, "POST", `/api/films/${filmId}/export`, {});
|
|
1693
1758
|
return { kind: "text", text: `All clips ready \u2014 export started (${progressLine(film)}). Poll again in ~60s with action "status" for the finished film URL.` };
|
|
1694
1759
|
}
|
|
1695
1760
|
const failed = all.filter((sh) => sh.status === "failed");
|
|
1761
|
+
const refused = failed.filter(isRefused);
|
|
1762
|
+
const retrying = failed.filter((sh) => !isRefused(sh));
|
|
1763
|
+
const sentAgain = retrying.filter((sh) => resent.has(sh.id)).length;
|
|
1764
|
+
const paused = refused.length > 0 && started === 0 && !all.some((sh) => sh.status === "frame-generating" || sh.status === "clip-generating");
|
|
1765
|
+
const labels = new Map(film.scenes.flatMap((s, si) => s.shots.map((sh, i) => [sh.id, `${si + 1}.${i + 1}`])));
|
|
1766
|
+
const reason = (sh) => {
|
|
1767
|
+
const text = (sh.errorMessage ?? "no reason given").replace(/\s*Retry (?:the shot|it)\.\s*$/i, "");
|
|
1768
|
+
return text.length > 300 ? `${text.slice(0, 297)}...` : text;
|
|
1769
|
+
};
|
|
1770
|
+
const one = refused.length === 1;
|
|
1696
1771
|
return {
|
|
1697
1772
|
kind: "text",
|
|
1698
1773
|
text: [
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1774
|
+
`${paused ? "Paused" : "In progress"}: ${progressLine(film)}.`,
|
|
1775
|
+
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}.` : "",
|
|
1776
|
+
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"}.` : "",
|
|
1777
|
+
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"}.`
|
|
1702
1778
|
].filter(Boolean).join("\n")
|
|
1703
1779
|
};
|
|
1704
1780
|
}
|
|
1705
1781
|
async function run8(input, ctx) {
|
|
1706
|
-
const action = input.action === "plan" && input.film_id ? "status" : input.action;
|
|
1782
|
+
const action = input.action === "plan" && input.film_id ? input.cast?.length ? "cast" : "status" : input.action;
|
|
1707
1783
|
if (action === "plan") return plan(input, ctx);
|
|
1708
|
-
if (!input.film_id) return { kind: "text", text: "produce/status need the film_id returned by the plan step." };
|
|
1784
|
+
if (!input.film_id) return { kind: "text", text: "produce/status/cast need the film_id returned by the plan step." };
|
|
1785
|
+
if (action === "cast") {
|
|
1786
|
+
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)." };
|
|
1787
|
+
const { lines } = await applyCast(ctx, input.film_id, input.cast);
|
|
1788
|
+
const uncast = await uncastRolesOf(ctx, input.film_id);
|
|
1789
|
+
return {
|
|
1790
|
+
kind: "text",
|
|
1791
|
+
text: [
|
|
1792
|
+
...lines,
|
|
1793
|
+
uncast.length ? castNeededText(input.film_id, uncast) : `Everyone is cast. Call pixeldojo_film with {"film_id": "${input.film_id}", "action": "produce"} to start production.`
|
|
1794
|
+
].join("\n")
|
|
1795
|
+
};
|
|
1796
|
+
}
|
|
1709
1797
|
if (action === "produce") return produce(input.film_id, ctx);
|
|
1710
1798
|
return advance(input.film_id, input.soundtrack, input.music_job_id, ctx);
|
|
1711
1799
|
}
|
|
1712
|
-
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;
|
|
1800
|
+
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;
|
|
1713
1801
|
var init_film = __esm({
|
|
1714
1802
|
"src/skills/film.ts"() {
|
|
1715
1803
|
init_upload_helpers();
|
|
@@ -1727,8 +1815,18 @@ var init_film = __esm({
|
|
|
1727
1815
|
lyrics: z.string().max(1e4).optional().describe("Music video mode: the song lyrics, so shots land on the right lines. Optional."),
|
|
1728
1816
|
aspect: z.enum(["16:9", "9:16"]).default("16:9"),
|
|
1729
1817
|
length: z.enum(["30s", "60s", "2-3min", "5min"]).default("60s").describe("Target length; drives the shot count (~6/12/24/60 shots)."),
|
|
1730
|
-
film_id: z.string().max(40).optional().describe("Existing film id (from a previous call) for produce/status."),
|
|
1731
|
-
action: 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."),
|
|
1818
|
+
film_id: z.string().max(40).optional().describe("Existing film id (from a previous call) for produce/status/cast."),
|
|
1819
|
+
action: 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."),
|
|
1820
|
+
cast: z.array(
|
|
1821
|
+
z.object({
|
|
1822
|
+
name: z.string().trim().min(1).max(60),
|
|
1823
|
+
image_urls: z.array(z.string().url().startsWith("https://").max(2048)).min(1).max(8).optional(),
|
|
1824
|
+
prompt: z.string().trim().min(1).max(600).optional(),
|
|
1825
|
+
character_id: z.string().max(40).optional(),
|
|
1826
|
+
replace: z.boolean().optional(),
|
|
1827
|
+
remove: z.boolean().optional()
|
|
1828
|
+
})
|
|
1829
|
+
).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."),
|
|
1732
1830
|
soundtrack: 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."),
|
|
1733
1831
|
music_job_id: 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.")
|
|
1734
1832
|
});
|
|
@@ -1756,8 +1854,34 @@ var init_film = __esm({
|
|
|
1756
1854
|
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".' },
|
|
1757
1855
|
action: {
|
|
1758
1856
|
type: "string",
|
|
1759
|
-
enum: ["plan", "produce", "status"],
|
|
1760
|
-
description: "plan (default, free): writes the script and plans shots, returns film_id
|
|
1857
|
+
enum: ["plan", "produce", "status", "cast"],
|
|
1858
|
+
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."
|
|
1859
|
+
},
|
|
1860
|
+
cast: {
|
|
1861
|
+
type: "array",
|
|
1862
|
+
maxItems: 8,
|
|
1863
|
+
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.',
|
|
1864
|
+
items: {
|
|
1865
|
+
type: "object",
|
|
1866
|
+
properties: {
|
|
1867
|
+
name: { type: "string", description: 'The character name as the film uses it (e.g. "Harlan").' },
|
|
1868
|
+
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." },
|
|
1869
|
+
prompt: {
|
|
1870
|
+
type: "string",
|
|
1871
|
+
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").'
|
|
1872
|
+
},
|
|
1873
|
+
character_id: { type: "string", description: "A Character Studio character id." },
|
|
1874
|
+
replace: {
|
|
1875
|
+
type: "boolean",
|
|
1876
|
+
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."
|
|
1877
|
+
},
|
|
1878
|
+
remove: {
|
|
1879
|
+
type: "boolean",
|
|
1880
|
+
description: "Take whoever plays this name off the film and every shot (free), before their shots are rendered. Give only the name."
|
|
1881
|
+
}
|
|
1882
|
+
},
|
|
1883
|
+
required: ["name"]
|
|
1884
|
+
}
|
|
1761
1885
|
},
|
|
1762
1886
|
soundtrack: {
|
|
1763
1887
|
type: "string",
|
|
@@ -1772,6 +1896,10 @@ var init_film = __esm({
|
|
|
1772
1896
|
};
|
|
1773
1897
|
shots = (f) => f.scenes.flatMap((s) => s.shots);
|
|
1774
1898
|
count = (f, pred) => shots(f).filter(pred).length;
|
|
1899
|
+
frameDone = (sh) => Boolean(sh.frameUrl) && sh.status !== "idle" && sh.status !== "frame-generating";
|
|
1900
|
+
RETRY_CLEARS = /automatic audio check flagged|output audio\b[\s\S]*?sensitive information|temporarily unavailable/i;
|
|
1901
|
+
REFUSED = /copyright|infringement|content filter|safety filter|moderation|blocked|flagged|sensitive|real (?:person|human)|nsfw|content policy|policy violation|inappropriate/i;
|
|
1902
|
+
isRefused = (sh) => sh.status === "failed" && Boolean(sh.errorMessage) && !RETRY_CLEARS.test(sh.errorMessage) && REFUSED.test(sh.errorMessage);
|
|
1775
1903
|
PLANNER_POLL_MS = 3e3;
|
|
1776
1904
|
PLANNER_MAX_POLLS = 8;
|
|
1777
1905
|
isMusicVideo = (f) => f.musicVideoMode === true;
|
|
@@ -1797,8 +1925,8 @@ var init_film = __esm({
|
|
|
1797
1925
|
};
|
|
1798
1926
|
filmSkill = {
|
|
1799
1927
|
name: "pixeldojo_film",
|
|
1800
|
-
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).",
|
|
1801
|
-
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).",
|
|
1928
|
+
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).",
|
|
1929
|
+
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).",
|
|
1802
1930
|
inputZod: InputSchema8,
|
|
1803
1931
|
inputJsonSchema: InputJsonSchema8,
|
|
1804
1932
|
allowedModels: [],
|
|
@@ -2232,7 +2360,7 @@ async function produce2(id, ctx) {
|
|
|
2232
2360
|
if (saved.status !== 200 || !url) {
|
|
2233
2361
|
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")}` };
|
|
2234
2362
|
}
|
|
2235
|
-
return { kind: "text", text: `"${ep.title}" is finished and saved to
|
|
2363
|
+
return { kind: "text", text: `"${ep.title}" is finished and saved to your Library: ${url}` };
|
|
2236
2364
|
}
|
|
2237
2365
|
const started = await episodeApi(ctx, "POST", `/${id}/export`, {});
|
|
2238
2366
|
if (started.status !== 202) {
|
|
@@ -2303,7 +2431,7 @@ var init_episode = __esm({
|
|
|
2303
2431
|
stillPlanning = (id) => `The script is still being written (episode_id: ${id}). Nothing has been charged. ${next(id, "status", "~30s")}`;
|
|
2304
2432
|
episodeSkill = {
|
|
2305
2433
|
name: "pixeldojo_episode",
|
|
2306
|
-
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
|
|
2434
|
+
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.",
|
|
2307
2435
|
inputZod: InputSchema10,
|
|
2308
2436
|
inputJsonSchema: InputJsonSchema10,
|
|
2309
2437
|
allowedModels: [],
|
|
@@ -2853,7 +2981,7 @@ var init_library = __esm({
|
|
|
2853
2981
|
};
|
|
2854
2982
|
librarySkill = {
|
|
2855
2983
|
name: "pixeldojo_library",
|
|
2856
|
-
description: "Search your
|
|
2984
|
+
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.",
|
|
2857
2985
|
inputZod: InputSchema16,
|
|
2858
2986
|
inputJsonSchema: InputJsonSchema16,
|
|
2859
2987
|
allowedModels: [],
|
|
@@ -3275,7 +3403,7 @@ function makeRedactedLogger(target = console) {
|
|
|
3275
3403
|
}
|
|
3276
3404
|
|
|
3277
3405
|
// src/server.ts
|
|
3278
|
-
var PACKAGE_VERSION = "0.
|
|
3406
|
+
var PACKAGE_VERSION = "0.18.0" ;
|
|
3279
3407
|
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.";
|
|
3280
3408
|
function buildServer(options) {
|
|
3281
3409
|
if (!options.apiKey) {
|