@pixeldojo/mcp 0.15.0 → 0.15.1

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/dist/cli.js CHANGED
@@ -1408,13 +1408,13 @@ function progressLine(f) {
1408
1408
  const rendering = all.filter((sh) => sh.status === "clip-generating").length;
1409
1409
  return `frames ${frames}/${all.length}, clips ${clips}/${all.length}${rendering > 0 ? ` (${rendering} rendering)` : ""}`;
1410
1410
  }
1411
- async function runPlanner(ctx, filmId, path, body) {
1411
+ async function runPlanner(ctx, filmId, path, body, maxPolls = PLANNER_MAX_POLLS) {
1412
1412
  const submit = await filmApi(ctx, "POST", path, body);
1413
1413
  if (submit.data.film) return { film: submit.data.film };
1414
1414
  const jobId = submit.data.jobId;
1415
1415
  if (!jobId) return { error: submit.data.error ?? `HTTP ${submit.status}` };
1416
1416
  const sleep = ctx.pollOverrides?.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
1417
- for (let i = 0; i < PLANNER_MAX_POLLS; i += 1) {
1417
+ for (let i = 0; i < maxPolls; i += 1) {
1418
1418
  await sleep(PLANNER_POLL_MS);
1419
1419
  const { data } = await filmApi(ctx, "GET", `/api/films/${filmId}`);
1420
1420
  const job = data.film?.llmJob;
@@ -1483,7 +1483,7 @@ ${input.lyrics.trim()}` : ""].filter(Boolean).join("\n\n");
1483
1483
  let script = input.script?.trim() ?? "";
1484
1484
  if (!script) {
1485
1485
  const wrote = await runPlanner(ctx, id, `/api/films/${id}/script`, { idea: input.idea.trim() });
1486
- if ("pending" in wrote) return { kind: "text", text: stillPlanningText(id) };
1486
+ if ("pending" in wrote) return { kind: "text", text: stillPlanningText(id, "script") };
1487
1487
  if ("error" in wrote) return { kind: "text", text: `Script writing failed: ${wrote.error}` };
1488
1488
  script = wrote.film.script ?? "";
1489
1489
  if (!script) return { kind: "text", text: "Script writing failed: the studio returned an empty script." };
@@ -1503,12 +1503,14 @@ ${err} Call action "status" to retry the cut.` };
1503
1503
  }
1504
1504
  async function resumePlanning(film, ctx) {
1505
1505
  if (film.scenes.length > 0 && film.llmJob?.status !== "running") return null;
1506
- if (film.llmJob?.status === "running") return { kind: "text", text: stillPlanningText(film.id) };
1506
+ if (film.llmJob?.status === "running") {
1507
+ return { kind: "text", text: stillPlanningText(film.id, film.llmJob.kind === "script" ? "script" : "plan") };
1508
+ }
1507
1509
  const prior = film.llmJob?.status === "error" ? `The last planning run failed (${film.llmJob.error ?? "unknown"}). ` : "";
1508
1510
  if (!film.script?.trim()) {
1509
1511
  return { kind: "text", text: `${prior}This film has nothing to plan from. Start a new one with action "plan".` };
1510
1512
  }
1511
- const planned = await runPlanner(ctx, film.id, `/api/films/${film.id}/plan`, { script: film.script });
1513
+ const planned = await runPlanner(ctx, film.id, `/api/films/${film.id}/plan`, { script: film.script }, 0);
1512
1514
  if ("pending" in planned) return { kind: "text", text: `${prior}${stillPlanningText(film.id)}` };
1513
1515
  if ("error" in planned) return { kind: "text", text: `Shot planning failed: ${planned.error} Call action "status" to retry.` };
1514
1516
  if (needsSlice(planned.film)) {
@@ -1594,6 +1596,9 @@ It is saved in the Library folder "Film: ${film.title}".`
1594
1596
  if (err) return { kind: "text", text: `${err} Poll again with action "status" to retry.` };
1595
1597
  return { kind: "text", text: `Song cut into one slice per shot. Poll again with {"film_id": "${filmId}", "action": "status"} to keep production moving.` };
1596
1598
  }
1599
+ if (shots(film).length > 0 && shots(film).every((sh) => sh.status === "idle")) {
1600
+ return { kind: "text", text: plannedText(film, ctx) };
1601
+ }
1597
1602
  const idleFrames = all.filter((sh) => sh.status === "idle");
1598
1603
  for (const sh of idleFrames.slice(0, 6)) {
1599
1604
  await filmApi(ctx, "POST", `/api/films/${filmId}/shots/${sh.id}/generate`, { kind: "frame" });
@@ -1719,7 +1724,7 @@ var init_film = __esm({
1719
1724
  PLANNER_MAX_POLLS = 8;
1720
1725
  isMusicVideo = (f) => f.musicVideoMode === true;
1721
1726
  needsSlice = (f) => isMusicVideo(f) && shots(f).length > 0 && !shots(f).some((sh) => sh.musicChunkUrl);
1722
- stillPlanningText = (filmId) => `Planning is still running (film_id: ${filmId}). Nothing has been charged. Call pixeldojo_film with {"film_id": "${filmId}", "action": "status"} in ~30s; it returns the plan once it is ready.`;
1727
+ stillPlanningText = (filmId, stage = "plan") => `${stage === "script" ? "Still writing the script" : "Still planning the shots"} for film_id ${filmId}. Nothing has been charged. Call pixeldojo_film with {"film_id": "${filmId}", "action": "status"} in ~30s; it returns the plan once it is ready.`;
1723
1728
  LOOK_MUSIC = {
1724
1729
  "live-action": "modern cinematic underscore, warm strings and soft felt piano, subtle rhythmic pulse, slow emotional build",
1725
1730
  anime: "sweeping anime film score, lush strings and piano, taiko drum accents, soaring heartfelt theme",
@@ -3183,7 +3188,7 @@ function makeRedactedLogger(target = console) {
3183
3188
  }
3184
3189
 
3185
3190
  // src/server.ts
3186
- var PACKAGE_VERSION = "0.14.0" ;
3191
+ var PACKAGE_VERSION = "0.15.1" ;
3187
3192
  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.";
3188
3193
  function buildServer(options) {
3189
3194
  if (!options.apiKey) {