@pixeldojo/mcp 0.25.0 → 0.30.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 +4 -1
- package/dist/cli.cjs +1184 -75
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1184 -75
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1184 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1184 -75
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -237,11 +237,11 @@ function nearestAspectFromEnum(requested, allowed) {
|
|
|
237
237
|
}
|
|
238
238
|
async function snapAspectRatio(apiId, requested, client, opts = {}) {
|
|
239
239
|
if (!requested) return void 0;
|
|
240
|
-
const
|
|
241
|
-
if (
|
|
240
|
+
const props2 = await getFieldConstraints(apiId, client);
|
|
241
|
+
if (props2 === null) {
|
|
242
242
|
return opts.onUnknown === "omit" ? void 0 : requested;
|
|
243
243
|
}
|
|
244
|
-
const field =
|
|
244
|
+
const field = props2.aspect_ratio;
|
|
245
245
|
if (!field) return void 0;
|
|
246
246
|
if (!field.enum || field.enum.length === 0) return requested;
|
|
247
247
|
return nearestAspectFromEnum(requested, field.enum);
|
|
@@ -272,11 +272,11 @@ function resolutionHeight(value) {
|
|
|
272
272
|
}
|
|
273
273
|
async function snapResolution(apiId, requested, client, opts = {}) {
|
|
274
274
|
if (!requested) return void 0;
|
|
275
|
-
const
|
|
276
|
-
if (
|
|
275
|
+
const props2 = await getFieldConstraints(apiId, client);
|
|
276
|
+
if (props2 === null) {
|
|
277
277
|
return opts.onUnknown === "omit" ? void 0 : requested;
|
|
278
278
|
}
|
|
279
|
-
const field =
|
|
279
|
+
const field = props2.resolution;
|
|
280
280
|
if (!field) return void 0;
|
|
281
281
|
if (!field.enum || field.enum.length === 0) return requested;
|
|
282
282
|
if (field.enum.includes(requested)) return requested;
|
|
@@ -297,11 +297,11 @@ async function snapResolution(apiId, requested, client, opts = {}) {
|
|
|
297
297
|
}
|
|
298
298
|
async function snapDuration(apiId, requested, client, opts = {}) {
|
|
299
299
|
if (requested === void 0) return void 0;
|
|
300
|
-
const
|
|
301
|
-
if (
|
|
300
|
+
const props2 = await getFieldConstraints(apiId, client);
|
|
301
|
+
if (props2 === null) {
|
|
302
302
|
return opts.onUnknown === "omit" ? void 0 : requested;
|
|
303
303
|
}
|
|
304
|
-
const field =
|
|
304
|
+
const field = props2.duration;
|
|
305
305
|
if (!field) return void 0;
|
|
306
306
|
if (field.enum && field.enum.length > 0) {
|
|
307
307
|
const allowed = field.enum.map(Number).filter((n) => Number.isFinite(n));
|
|
@@ -329,11 +329,11 @@ async function resolveImageRefs(apiId, urls, client) {
|
|
|
329
329
|
if (urls.length === 0) return null;
|
|
330
330
|
const info = await getModelInfo(apiId, client);
|
|
331
331
|
if (info === null) return null;
|
|
332
|
-
const
|
|
333
|
-
const key = info.media ? info.media.image?.key : REF_KEYS.find((k) =>
|
|
332
|
+
const props2 = info.props;
|
|
333
|
+
const key = info.media ? info.media.image?.key : REF_KEYS.find((k) => props2[k] !== void 0);
|
|
334
334
|
if (!key) return null;
|
|
335
335
|
const also = info.media?.image?.also;
|
|
336
|
-
const field =
|
|
336
|
+
const field = props2[key] ?? {};
|
|
337
337
|
if (field.type === "array") {
|
|
338
338
|
const cap = typeof field.maxItems === "number" ? field.maxItems : urls.length;
|
|
339
339
|
const kept = urls.slice(0, Math.max(1, cap));
|
|
@@ -1671,7 +1671,7 @@ function needsSave(url) {
|
|
|
1671
1671
|
return Boolean(url && url.startsWith("https://temp.pixeldojo.ai/"));
|
|
1672
1672
|
}
|
|
1673
1673
|
async function filmApi(ctx, method, path, body) {
|
|
1674
|
-
const res = await fetch(`${ctx.baseUrl}${path}`, {
|
|
1674
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}${path}`, {
|
|
1675
1675
|
method,
|
|
1676
1676
|
headers: {
|
|
1677
1677
|
Authorization: `Bearer ${ctx.apiKey}`,
|
|
@@ -1837,14 +1837,17 @@ async function plan(input, ctx) {
|
|
|
1837
1837
|
look: input.look ?? (music ? MUSIC_VIDEO_LOOKS[0] : "live-action"),
|
|
1838
1838
|
lengthTarget: input.length,
|
|
1839
1839
|
...!music && input.pacing === "trailer" ? { pacing: "trailer" } : {},
|
|
1840
|
+
...input.quality === "final" ? { clipQuality: "final" } : {},
|
|
1840
1841
|
assetIds: [],
|
|
1841
1842
|
...music ? {
|
|
1842
1843
|
// No script step names a music video, so it would stay "Untitled film".
|
|
1843
1844
|
...input.idea?.trim() ? { title: input.idea.trim().slice(0, 80) } : {},
|
|
1844
1845
|
musicVideoMode: true,
|
|
1845
1846
|
musicUrl: input.song_url,
|
|
1846
|
-
...input.song_duration_sec ? { musicDurationSec: input.song_duration_sec } : {}
|
|
1847
|
-
|
|
1847
|
+
...input.song_duration_sec ? { musicDurationSec: input.song_duration_sec } : {}
|
|
1848
|
+
// Engine left on Auto, like the web composer's music mode, so the
|
|
1849
|
+
// planner routes a mature song to H3 and the rest to P-Video 2 Pro
|
|
1850
|
+
// Reference (tests/contracts/mcp-film-music-parity.test.ts).
|
|
1848
1851
|
} : {}
|
|
1849
1852
|
});
|
|
1850
1853
|
if (!created.data.film) return { kind: "text", text: `Could not create the film: ${created.data.error ?? created.status}` };
|
|
@@ -2246,14 +2249,13 @@ async function run10(input, ctx) {
|
|
|
2246
2249
|
if (action === "redo") return redoShots(input, ctx);
|
|
2247
2250
|
return advance(input.film_id, input.soundtrack, input.music_job_id, ctx);
|
|
2248
2251
|
}
|
|
2249
|
-
var STORY_LOOKS, MUSIC_VIDEO_LOOKS, LOOKS,
|
|
2252
|
+
var STORY_LOOKS, MUSIC_VIDEO_LOOKS, LOOKS, InputSchema10, InputJsonSchema10, shots, benignDispatchRefusal, count, frameDone, RETRY_CLEARS, REFUSED, isRefused, PLANNER_POLL_MS, PLANNER_MAX_POLLS, isMusicVideo, needsSlice, stillPlanningText, LOOK_MUSIC, ARC, filmSkill;
|
|
2250
2253
|
var init_film = __esm({
|
|
2251
2254
|
"src/skills/film.ts"() {
|
|
2252
2255
|
init_upload_helpers();
|
|
2253
|
-
STORY_LOOKS = ["live-action", "anime", "3d-animation", "noir", "horror", "sci-fi", "documentary", "western", "romance", "romantic-comedy", "comedy"];
|
|
2256
|
+
STORY_LOOKS = ["live-action", "action", "anime", "3d-animation", "noir", "horror", "sci-fi", "documentary", "western", "romance", "romantic-comedy", "comedy"];
|
|
2254
2257
|
MUSIC_VIDEO_LOOKS = ["rap-video", "neon-club", "stage-performance", "retro-camcorder", "y2k-pop", "moody-rnb", "rock-grit", "dream-pop", "k-pop"];
|
|
2255
2258
|
LOOKS = [...STORY_LOOKS, ...MUSIC_VIDEO_LOOKS];
|
|
2256
|
-
MUSIC_CLIP_ENGINE_ID = "minimax-h3-reference";
|
|
2257
2259
|
InputSchema10 = z.object({
|
|
2258
2260
|
idea: z.string().max(2e3).optional().describe("One-to-three sentence film idea. The studio writes the screenplay (free). Provide idea OR script for planning."),
|
|
2259
2261
|
script: z.string().max(2e4).optional().describe("A full screenplay to plan instead of an idea (sluglines, action lines, dialogue)."),
|
|
@@ -2264,6 +2266,7 @@ var init_film = __esm({
|
|
|
2264
2266
|
lyrics: z.string().max(1e4).optional().describe("Music video mode: the song lyrics, so shots land on the right lines. Optional."),
|
|
2265
2267
|
aspect: z.enum(["16:9", "9:16"]).default("16:9"),
|
|
2266
2268
|
pacing: z.enum(["story", "trailer"]).default("story").describe("'story' (default) plays every shot's action whole. 'trailer' cuts it like a trailer or promo: most shots keep only their first 1.5-3 seconds."),
|
|
2269
|
+
quality: z.enum(["standard", "final"]).default("standard").describe("'standard' (default) renders 720p clips and a 720p film. 'final' renders 1080p clips where the engine supports it and exports the film at 1080p; it costs more per second."),
|
|
2267
2270
|
length: z.enum(["30s", "60s", "2-3min", "5min"]).default("60s").describe("Target length of the finished film."),
|
|
2268
2271
|
film_id: z.string().max(40).optional().describe("Existing film id (from a previous call) for produce/status/cast/redo."),
|
|
2269
2272
|
action: z.enum(["plan", "produce", "status", "cast", "redo"]).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. 'redo' renders a new take of the listed shots (charged), then status re-saves and re-exports."),
|
|
@@ -2303,6 +2306,11 @@ var init_film = __esm({
|
|
|
2303
2306
|
lyrics: { type: "string", description: "Plan step, music video mode (optional): the song lyrics, so shots land on the right lines." },
|
|
2304
2307
|
aspect: { type: "string", enum: ["16:9", "9:16"], description: "Plan step: frame aspect ratio. Default 16:9." },
|
|
2305
2308
|
length: { type: "string", enum: ["30s", "60s", "2-3min", "5min"], description: "Plan step: target length. Default 60s. Ignored for a music video, whose length is the song." },
|
|
2309
|
+
quality: {
|
|
2310
|
+
type: "string",
|
|
2311
|
+
enum: ["standard", "final"],
|
|
2312
|
+
description: "Plan step: 'standard' (default) is 720p. 'final' renders 1080p clips where the engine supports it and exports at 1080p, at a higher price per second."
|
|
2313
|
+
},
|
|
2306
2314
|
pacing: {
|
|
2307
2315
|
type: "string",
|
|
2308
2316
|
enum: ["story", "trailer"],
|
|
@@ -2669,7 +2677,7 @@ var init_video = __esm({
|
|
|
2669
2677
|
}
|
|
2670
2678
|
});
|
|
2671
2679
|
async function episodeApi(ctx, method, path, body) {
|
|
2672
|
-
const res = await fetch(`${ctx.baseUrl}/api/faceless-studio/episodes${path}`, {
|
|
2680
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}/api/faceless-studio/episodes${path}`, {
|
|
2673
2681
|
method,
|
|
2674
2682
|
headers: {
|
|
2675
2683
|
Authorization: `Bearer ${ctx.apiKey}`,
|
|
@@ -2851,7 +2859,7 @@ var init_episode = __esm({
|
|
|
2851
2859
|
"src/skills/episode.ts"() {
|
|
2852
2860
|
STYLES2 = ["editorial-motion", "paper-diorama", "hand-drawn", "storybook", "poster-vector", "soft-3d"];
|
|
2853
2861
|
CATEGORIES = ["education", "history", "kids", "storytelling", "custom"];
|
|
2854
|
-
ENGINES = ["omni-draft", "omni-final", "still-motion"];
|
|
2862
|
+
ENGINES = ["omni-draft", "omni-final", "omni-1080", "still-motion"];
|
|
2855
2863
|
MIN_SECONDS = 60;
|
|
2856
2864
|
MAX_SECONDS = 300;
|
|
2857
2865
|
MAX_IN_FLIGHT = 4;
|
|
@@ -2886,7 +2894,7 @@ var init_episode = __esm({
|
|
|
2886
2894
|
engine: {
|
|
2887
2895
|
type: "string",
|
|
2888
2896
|
enum: [...ENGINES],
|
|
2889
|
-
description: "Create step (optional): render every scene with one engine. omni-draft: fast, cheap motion preview. omni-final: full quality motion with sound. still-motion: one illustration per scene, gently panned, cheapest. Default: the style picks."
|
|
2897
|
+
description: "Create step (optional): render every scene with one engine. omni-draft: fast, cheap motion preview. omni-final: full quality motion with sound (720p). omni-1080: the same at 1080p, and the episode exports at 1080p. still-motion: one illustration per scene, gently panned, cheapest. Default: the style picks."
|
|
2890
2898
|
},
|
|
2891
2899
|
music: { type: "boolean", description: "Create step: add a music bed under the narration. Default true." },
|
|
2892
2900
|
title: { type: "string", description: "Create step (optional): episode title. Defaults to the topic." }
|
|
@@ -2909,6 +2917,479 @@ var init_episode = __esm({
|
|
|
2909
2917
|
};
|
|
2910
2918
|
}
|
|
2911
2919
|
});
|
|
2920
|
+
async function dramaApi(ctx, method, path, body) {
|
|
2921
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}/api/v1/drama${path}`, {
|
|
2922
|
+
method,
|
|
2923
|
+
headers: {
|
|
2924
|
+
Authorization: `Bearer ${ctx.apiKey}`,
|
|
2925
|
+
"Content-Type": "application/json",
|
|
2926
|
+
"x-pixeldojo-source": `mcp/${ctx.mcpVersion}`,
|
|
2927
|
+
"x-pixeldojo-skill": "drama"
|
|
2928
|
+
},
|
|
2929
|
+
...body !== void 0 ? { body: JSON.stringify(body) } : {}
|
|
2930
|
+
});
|
|
2931
|
+
const data = await res.json().catch(() => ({}));
|
|
2932
|
+
return { status: res.status, data };
|
|
2933
|
+
}
|
|
2934
|
+
function describeDrama(v, o = DRAMA_OPTS) {
|
|
2935
|
+
const id = v.id;
|
|
2936
|
+
const stubborn = Array.from(new Set(v.retaken.filter((b, i, all) => all.indexOf(b) !== i)));
|
|
2937
|
+
const simplify = stubborn.length ? `${o.unit[0].toUpperCase()}${o.unit.slice(1)}s ${stubborn.join(", ")} have been filmed three times: suggest simplifying them (drop an action, split a busy shot, change the angle) rather than rewording the note.` : "";
|
|
2938
|
+
const next2 = (action) => `${o.tool} with {"${o.idField}": "${id}", "action": "${action}"}`;
|
|
2939
|
+
const music = o.unit === "section";
|
|
2940
|
+
const what = music ? "music video" : "episode";
|
|
2941
|
+
if (v.status === "failed") return { kind: "text", text: `The ${what} stopped: ${v.error ?? "unknown error"}. Each render that failed was refunded.${v.beats.some((b) => b.url) ? ` Re-film ${o.unit}s with action "redo".` : ""}` };
|
|
2942
|
+
if (v.status === "quote") {
|
|
2943
|
+
const cost = music ? `Filming costs about ${v.estimate_credits} credits (cast portraits and ${v.sections?.length ?? "several"} sections lip-synced to the song).` : `Filming costs about ${v.estimate_credits} credits (cast portraits, 12-second scenes with their dialogue and sound${v.score === false ? ", no music" : ", and one score over the finished edit"}); every scene is checked, and a scene that drops a line or shows a clear fault waits for the user's OK before it is filmed again, at the scene's own price (a render that fails is tried again free).`;
|
|
2944
|
+
return {
|
|
2945
|
+
kind: "text",
|
|
2946
|
+
text: [`Planned (${o.idField}: ${id}), ${v.format === "9:16" ? "vertical 9:16" : "widescreen 16:9"} (to switch, create it again in the other format before producing):`, v.plan ?? "", "", `Nothing has been charged yet. ${cost} Show this to the user and, once they agree, call ${next2("produce")}. (In Sensei: put it in pixeldojo_plan as ONE step with skill "${music ? "music_video" : "drama"}" and params {"${o.idField}": "${id}"}, which prices it from this quote.)`].join("\n")
|
|
2947
|
+
};
|
|
2948
|
+
}
|
|
2949
|
+
if (v.status === "notes") {
|
|
2950
|
+
const flagged = v.beats.filter((b) => b.note && (b.needs_redo ?? true));
|
|
2951
|
+
const other = v.beats.filter((b) => b.note && b.needs_redo === false);
|
|
2952
|
+
return {
|
|
2953
|
+
kind: "text",
|
|
2954
|
+
text: [
|
|
2955
|
+
`Every ${o.unit} is filmed. Before the cut, the review flagged ${o.unit}s ${flagged.map((b) => b.beat).join(", ")}:`,
|
|
2956
|
+
...flagged.map((b) => `- ${o.unit} ${b.beat}: ${b.note}${b.redo_films ? ` The redo films: ${b.redo_films}` : ""}`),
|
|
2957
|
+
other.length ? `Also noted, no redo needed: ${other.map((b) => `${o.unit} ${b.beat}: ${b.note}`).join(" ")}` : "",
|
|
2958
|
+
simplify,
|
|
2959
|
+
`Show these to the user and ask which they want: redo those ${o.unit}s with these notes (${o.tool} with {"${o.idField}": "${id}", "action": "redo", "beats": [${flagged.map((b) => b.beat).join(", ")}], "notes": [the notes, same order]}, each at its own price), or cut it as it is (action "cut", free). Nothing more is filmed until they choose.`
|
|
2960
|
+
].filter(Boolean).join("\n")
|
|
2961
|
+
};
|
|
2962
|
+
}
|
|
2963
|
+
if (v.status === "done" && v.final_url) {
|
|
2964
|
+
const redo = v.beats.filter((b) => (b.note || b.missing_lines.length) && (b.needs_redo ?? true));
|
|
2965
|
+
const notes = redo.map((b) => `${o.unit} ${b.beat}: ${b.note ?? `did not say ${b.missing_lines.map((l) => `"${l}"`).join(", ")}`}${b.redo_films ? ` The redo films: ${b.redo_films}` : ""}`);
|
|
2966
|
+
const other = v.beats.filter((b) => b.note && b.needs_redo === false).map((b) => `${o.unit} ${b.beat}: ${b.note}`);
|
|
2967
|
+
return {
|
|
2968
|
+
kind: "assets",
|
|
2969
|
+
text: [
|
|
2970
|
+
`"${v.title}" is finished and saved to the Library: ${v.final_url}`,
|
|
2971
|
+
v.retaken.length ? `Filmed again: ${o.unit} ${v.retaken.join(", ")}.` : "",
|
|
2972
|
+
notes.length ? `Review notes: ${notes.join("; ")}. Offer a redo of those ${o.unit}s (action "redo" with beats and notes).` : "",
|
|
2973
|
+
other.length ? `Also noted, no redo needed: ${other.join("; ")}.` : "",
|
|
2974
|
+
simplify
|
|
2975
|
+
].filter(Boolean).join("\n"),
|
|
2976
|
+
assetUrls: [v.final_url]
|
|
2977
|
+
};
|
|
2978
|
+
}
|
|
2979
|
+
const doing = music ? { scripting: "listening to the song and writing the plan", shots: "filming the sections", cutting: "cutting it to the song" }[v.status] ?? STEP[v.status] ?? v.status : STEP[v.status] ?? v.status;
|
|
2980
|
+
const ready = v.beats.filter((b) => b.url).length;
|
|
2981
|
+
const total = v.beats.length || (music ? v.sections?.length ?? 0 : 5);
|
|
2982
|
+
const again = v.rendering.map((n) => v.beats.find((b) => b.beat === n)).filter((b) => Boolean(b?.url)).map((b) => `${o.unit} ${b.beat} is being filmed again${b.missing_lines.length ? ` (it dropped the line "${b.missing_lines[0]}")` : b.note ? ` (the review asked: ${b.note.split(/(?<=\.) /)[0]})` : ""}`);
|
|
2983
|
+
return {
|
|
2984
|
+
kind: "text",
|
|
2985
|
+
text: `Still ${doing}${v.status === "shots" ? ` (${ready} of ${total} ${o.unit}s ready${v.rendering.length ? `, filming ${o.unit} ${v.rendering.join(", ")}` : ""})` : ""}.${again.length ? ` ${again.join("; ")}.` : ""} It takes about 10 to 15 minutes in all. Call ${next2("status")} in about a minute.`,
|
|
2986
|
+
followUp: { input: { action: "status", [o.idField]: id }, afterSec: v.status === "scripting" ? 20 : 45 }
|
|
2987
|
+
};
|
|
2988
|
+
}
|
|
2989
|
+
async function waitForPlan2(ctx, id) {
|
|
2990
|
+
const sleep = ctx.pollOverrides?.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
2991
|
+
let last = await dramaApi(ctx, "GET", `/${id}`);
|
|
2992
|
+
for (let i = 0; i < 8 && last.data.status === "scripting"; i += 1) {
|
|
2993
|
+
await sleep(3e3);
|
|
2994
|
+
last = await dramaApi(ctx, "GET", `/${id}`);
|
|
2995
|
+
}
|
|
2996
|
+
return last;
|
|
2997
|
+
}
|
|
2998
|
+
var KINDS, LOOKS2, STORY_TYPES, InputSchema13, InputJsonSchema13, errorText, STEP, DRAMA_OPTS, dramaSkill;
|
|
2999
|
+
var init_drama = __esm({
|
|
3000
|
+
"src/skills/drama.ts"() {
|
|
3001
|
+
KINDS = ["micro-drama", "short-film", "trailer"];
|
|
3002
|
+
LOOKS2 = ["live-action", "action", "anime", "3d-animation", "noir", "horror", "sci-fi", "documentary", "western", "romance", "romantic-comedy", "comedy"];
|
|
3003
|
+
STORY_TYPES = ["billionaire", "werewolf", "mafia", "revenge", "secret-identity", "vampire", "second-chance"];
|
|
3004
|
+
InputSchema13 = z.object({
|
|
3005
|
+
action: z.enum(["create", "produce", "status", "redo", "cut"]).default("create"),
|
|
3006
|
+
idea: z.string().min(8).max(1500).optional(),
|
|
3007
|
+
format: z.enum(["9:16", "16:9"]).default("9:16"),
|
|
3008
|
+
mature: z.boolean().optional(),
|
|
3009
|
+
kind: z.enum(KINDS).default("micro-drama"),
|
|
3010
|
+
look: z.enum(LOOKS2).optional(),
|
|
3011
|
+
story_type: z.enum(STORY_TYPES).optional(),
|
|
3012
|
+
title_card: z.boolean().optional(),
|
|
3013
|
+
name_tags: z.boolean().optional(),
|
|
3014
|
+
end_screen: z.boolean().optional(),
|
|
3015
|
+
end_text: z.string().max(60).optional(),
|
|
3016
|
+
brand_color: z.string().regex(/^#[0-9a-fA-F]{6}$/).optional(),
|
|
3017
|
+
logo_url: z.string().url().optional(),
|
|
3018
|
+
cast: z.array(z.object({ name: z.string().min(1).max(40), image_url: z.string().url() })).max(5).optional(),
|
|
3019
|
+
scenes: z.number().int().min(1).max(15).optional(),
|
|
3020
|
+
score: z.boolean().optional(),
|
|
3021
|
+
drama_id: z.string().max(60).optional(),
|
|
3022
|
+
beats: z.array(z.number().int().min(1).max(15)).min(1).max(15).optional(),
|
|
3023
|
+
notes: z.array(z.string().max(300)).max(15).optional()
|
|
3024
|
+
});
|
|
3025
|
+
InputJsonSchema13 = {
|
|
3026
|
+
type: "object",
|
|
3027
|
+
properties: {
|
|
3028
|
+
action: {
|
|
3029
|
+
type: "string",
|
|
3030
|
+
enum: ["create", "produce", "status", "redo", "cut"],
|
|
3031
|
+
description: "create (default, free): writes the episode plan (5 scenes unless scenes says, cast, lines) and returns drama_id and the price. Show the plan and price to the user and wait for their OK. produce (charged): films it. status (free): progress; call every ~60s until it returns the episode. redo (charged): re-film chosen beats of a finished episode or one waiting at the review, then it cuts again. cut (free): when the review flagged beats and the user wants it as it is, cut it now."
|
|
3032
|
+
},
|
|
3033
|
+
idea: { type: "string", description: "Create: the story in a line or two (who, the conflict, the twist)." },
|
|
3034
|
+
format: { type: "string", enum: ["9:16", "16:9"], description: "Create: vertical 9:16 (default) or widescreen 16:9." },
|
|
3035
|
+
mature: { type: "boolean", description: "Create: true for adult work (the server also detects it from the idea). Runs on the less-restricted engines." },
|
|
3036
|
+
kind: {
|
|
3037
|
+
type: "string",
|
|
3038
|
+
enum: [...KINDS],
|
|
3039
|
+
description: "Create: micro-drama (default: episode one with a hook and a cliffhanger), short-film (a complete 60 s story) or trailer (sells a film that does not exist, never shows the ending)."
|
|
3040
|
+
},
|
|
3041
|
+
look: { type: "string", enum: [...LOOKS2], description: "Create (optional): the visual style and genre. Default live-action (a micro-drama story type brings its own)." },
|
|
3042
|
+
story_type: {
|
|
3043
|
+
type: "string",
|
|
3044
|
+
enum: [...STORY_TYPES],
|
|
3045
|
+
description: "Create (optional, micro-drama only): the genre, which sets its promises (a hidden heir, a fated mate, a debt of blood...). Pick the one the idea fits; omit for anything else."
|
|
3046
|
+
},
|
|
3047
|
+
title_card: { type: "boolean", description: "Create: the episode title over the opening hook. Default on." },
|
|
3048
|
+
name_tags: { type: "boolean", description: "Create: a name and role tag the first time each character speaks. Default on." },
|
|
3049
|
+
end_screen: { type: "boolean", description: 'Create: a 3.5-second "To be continued" end screen after the last line. Default on.' },
|
|
3050
|
+
end_text: { type: "string", description: `Create: the end screen's line, up to 60 characters. Default "Episode 2 coming soon".` },
|
|
3051
|
+
brand_color: { type: "string", description: "Create: accent colour for the graphics, #RRGGBB. Default a warm gold." },
|
|
3052
|
+
logo_url: { type: "string", description: "Create: a logo on the PixelDojo CDN for the end screen." },
|
|
3053
|
+
cast: {
|
|
3054
|
+
type: "array",
|
|
3055
|
+
items: {
|
|
3056
|
+
type: "object",
|
|
3057
|
+
properties: {
|
|
3058
|
+
name: { type: "string", description: "The character's name as the story uses it." },
|
|
3059
|
+
image_url: { type: "string", description: "A clear front-facing portrait on the PixelDojo CDN." }
|
|
3060
|
+
},
|
|
3061
|
+
required: ["name", "image_url"]
|
|
3062
|
+
},
|
|
3063
|
+
description: "Create (optional): up to 5 characters to star (people, animals or creatures), each with a portrait on the PixelDojo CDN (a saved character from pixeldojo_library). Others get a portrait made for them."
|
|
3064
|
+
},
|
|
3065
|
+
scenes: { type: "integer", minimum: 1, maximum: 15, description: "Create (optional): how many 12-second scenes, default 5. Pass it when the user names a count or a length (about 12 s a scene)." },
|
|
3066
|
+
score: { type: "boolean", description: "Create (optional): one score laid over the finished edit, on by default and included in the price. Pass false only when the user wants no music (dialogue and ambience only)." },
|
|
3067
|
+
drama_id: { type: "string", description: "From create. Required for produce, status and redo." },
|
|
3068
|
+
beats: { type: "array", items: { type: "integer", minimum: 1, maximum: 15 }, description: "Redo: the beat numbers to film again." },
|
|
3069
|
+
notes: { type: "array", items: { type: "string" }, description: "Redo (optional): what to fix in each of those beats, in the same order." }
|
|
3070
|
+
}
|
|
3071
|
+
};
|
|
3072
|
+
errorText = (d, status2) => (typeof d.error === "string" ? d.error : d.error?.message) ?? `HTTP ${status2}`;
|
|
3073
|
+
STEP = {
|
|
3074
|
+
scripting: "writing the episode",
|
|
3075
|
+
keyframes: "making the cast portraits and the location",
|
|
3076
|
+
shots: "filming the beats",
|
|
3077
|
+
cutting: "cutting the episode"
|
|
3078
|
+
};
|
|
3079
|
+
DRAMA_OPTS = { tool: "pixeldojo_drama", idField: "drama_id", unit: "beat" };
|
|
3080
|
+
dramaSkill = {
|
|
3081
|
+
name: "pixeldojo_drama",
|
|
3082
|
+
description: "Make a 60-second micro-drama episode (hook, twist, cliffhanger; optionally a classic genre such as billionaire, werewolf or mafia), short film (a complete story) or movie trailer from an idea, vertical 9:16 or 16:9, in any of Film Studio's looks (live-action, anime, 3D animation, noir, horror, sci-fi, western, romance, comedy and more). Five 12-second scenes, each filmed in one pass with several cuts, the cast's faces kept from portraits and every line spoken and lip-synced, cut together with their own sound and one score over the finished edit, with free motion graphics (title card, name tags, end screen; each can be turned off), and saved to the Library. Not for music videos (pixeldojo_music_video) create is free and returns the plan and the exact price (about 380 credits for a regular episode, about 160 for mature work); produce films it; then call status until it is finished (10-15 minutes).",
|
|
3083
|
+
inputZod: InputSchema13,
|
|
3084
|
+
inputJsonSchema: InputJsonSchema13,
|
|
3085
|
+
allowedModels: ["seedance-2-5", "seedream-4"],
|
|
3086
|
+
defaultModel: "seedance-2-5",
|
|
3087
|
+
async run(input, ctx) {
|
|
3088
|
+
if (input.action === "create") {
|
|
3089
|
+
if (!input.idea?.trim()) return { kind: "text", text: "Provide an `idea` (a line or two) to plan an episode." };
|
|
3090
|
+
const created = await dramaApi(ctx, "POST", "", {
|
|
3091
|
+
idea: input.idea.trim(),
|
|
3092
|
+
format: input.format,
|
|
3093
|
+
kind: input.kind,
|
|
3094
|
+
...input.mature ? { mature: true } : {},
|
|
3095
|
+
...input.look ? { look: input.look } : {},
|
|
3096
|
+
...input.story_type ? { story_type: input.story_type } : {},
|
|
3097
|
+
...input.scenes ? { scenes: input.scenes } : {},
|
|
3098
|
+
...input.score === false ? { score: false } : {},
|
|
3099
|
+
...Object.fromEntries(
|
|
3100
|
+
["title_card", "name_tags", "end_screen", "end_text", "brand_color", "logo_url"].filter((k) => input[k] !== void 0).map((k) => [k, input[k]])
|
|
3101
|
+
),
|
|
3102
|
+
...input.cast?.length ? { cast: input.cast } : {},
|
|
3103
|
+
// Stop before the cut when the review flags a scene: the user decides, not the agent.
|
|
3104
|
+
review: true
|
|
3105
|
+
});
|
|
3106
|
+
if (!created.data.id) return { kind: "text", text: `Could not start the episode: ${errorText(created.data, created.status)}` };
|
|
3107
|
+
const planned = await waitForPlan2(ctx, created.data.id);
|
|
3108
|
+
return describeDrama(planned.data);
|
|
3109
|
+
}
|
|
3110
|
+
if (!input.drama_id) return { kind: "text", text: `${input.action} needs drama_id (from create).` };
|
|
3111
|
+
const res = input.action === "status" ? await dramaApi(ctx, "GET", `/${input.drama_id}`) : input.action === "produce" || input.action === "cut" ? await dramaApi(ctx, "POST", `/${input.drama_id}`, { action: input.action }) : input.beats?.length ? await dramaApi(ctx, "POST", `/${input.drama_id}`, { action: "redo", beats: input.beats, ...input.notes?.length ? { notes: input.notes } : {} }) : null;
|
|
3112
|
+
if (!res) return { kind: "text", text: "redo needs beats (the beat numbers to film again)." };
|
|
3113
|
+
if (!res.data.id) return { kind: "text", text: errorText(res.data, res.status) };
|
|
3114
|
+
return describeDrama(res.data);
|
|
3115
|
+
}
|
|
3116
|
+
};
|
|
3117
|
+
}
|
|
3118
|
+
});
|
|
3119
|
+
async function api(ctx, method, path, body) {
|
|
3120
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}/api/v1/music-video${path}`, {
|
|
3121
|
+
method,
|
|
3122
|
+
headers: {
|
|
3123
|
+
Authorization: `Bearer ${ctx.apiKey}`,
|
|
3124
|
+
"Content-Type": "application/json",
|
|
3125
|
+
"x-pixeldojo-source": `mcp/${ctx.mcpVersion}`,
|
|
3126
|
+
"x-pixeldojo-skill": "music_video"
|
|
3127
|
+
},
|
|
3128
|
+
...body !== void 0 ? { body: JSON.stringify(body) } : {}
|
|
3129
|
+
});
|
|
3130
|
+
return { status: res.status, data: await res.json().catch(() => ({})) };
|
|
3131
|
+
}
|
|
3132
|
+
var MUSIC_LOOKS, InputSchema14, InputJsonSchema14, errorText2, describe, musicVideoSkill;
|
|
3133
|
+
var init_music_video = __esm({
|
|
3134
|
+
"src/skills/music-video.ts"() {
|
|
3135
|
+
init_drama();
|
|
3136
|
+
MUSIC_LOOKS = [
|
|
3137
|
+
"live-action",
|
|
3138
|
+
"action",
|
|
3139
|
+
"anime",
|
|
3140
|
+
"3d-animation",
|
|
3141
|
+
"noir",
|
|
3142
|
+
"horror",
|
|
3143
|
+
"sci-fi",
|
|
3144
|
+
"documentary",
|
|
3145
|
+
"western",
|
|
3146
|
+
"romance",
|
|
3147
|
+
"romantic-comedy",
|
|
3148
|
+
"comedy",
|
|
3149
|
+
"rap-video",
|
|
3150
|
+
"neon-club",
|
|
3151
|
+
"stage-performance",
|
|
3152
|
+
"retro-camcorder",
|
|
3153
|
+
"y2k-pop",
|
|
3154
|
+
"moody-rnb",
|
|
3155
|
+
"rock-grit",
|
|
3156
|
+
"dream-pop",
|
|
3157
|
+
"k-pop"
|
|
3158
|
+
];
|
|
3159
|
+
InputSchema14 = z.object({
|
|
3160
|
+
action: z.enum(["create", "produce", "status", "redo"]).default("create"),
|
|
3161
|
+
song_url: z.string().url().optional(),
|
|
3162
|
+
idea: z.string().min(8).max(1500).optional(),
|
|
3163
|
+
format: z.enum(["9:16", "16:9"]).default("9:16"),
|
|
3164
|
+
mature: z.boolean().optional(),
|
|
3165
|
+
look: z.enum(MUSIC_LOOKS).optional(),
|
|
3166
|
+
start_sec: z.number().min(0).optional(),
|
|
3167
|
+
length_sec: z.number().int().min(10).max(60).optional(),
|
|
3168
|
+
artist: z.string().max(60).optional(),
|
|
3169
|
+
song_title: z.string().max(80).optional(),
|
|
3170
|
+
title_card: z.boolean().optional(),
|
|
3171
|
+
end_screen: z.boolean().optional(),
|
|
3172
|
+
end_text: z.string().max(60).optional(),
|
|
3173
|
+
cast: z.array(z.object({ name: z.string().min(1).max(40), image_url: z.string().url() })).max(3).optional(),
|
|
3174
|
+
music_video_id: z.string().max(60).optional(),
|
|
3175
|
+
beats: z.array(z.number().int().min(1).max(12)).min(1).max(12).optional(),
|
|
3176
|
+
notes: z.array(z.string().max(300)).max(12).optional()
|
|
3177
|
+
});
|
|
3178
|
+
InputJsonSchema14 = {
|
|
3179
|
+
type: "object",
|
|
3180
|
+
properties: {
|
|
3181
|
+
action: {
|
|
3182
|
+
type: "string",
|
|
3183
|
+
enum: ["create", "produce", "status", "redo"],
|
|
3184
|
+
description: "create (default, free): hears the song, splits it into sections and writes the plan; returns music_video_id and the price. Show both and wait for the user's OK. produce (charged): films it. status (free): progress; call every ~60s until it returns the video. redo (charged): re-film chosen sections, then it cuts again."
|
|
3185
|
+
},
|
|
3186
|
+
song_url: { type: "string", description: "Create: the song on the PixelDojo CDN (attach or upload it first)." },
|
|
3187
|
+
idea: { type: "string", description: "Create: the story or performance concept in a line or two." },
|
|
3188
|
+
format: { type: "string", enum: ["9:16", "16:9"], description: "Create: vertical 9:16 (default) or widescreen 16:9." },
|
|
3189
|
+
mature: { type: "boolean", description: "Create: true for adult work (the server also detects it from the idea). Runs on the less-restricted engines." },
|
|
3190
|
+
look: { type: "string", enum: [...MUSIC_LOOKS], description: "Create (optional): the visual style, e.g. neon-club, rap-video, stage-performance, retro-camcorder, k-pop." },
|
|
3191
|
+
start_sec: { type: "number", description: "Create (optional): where in the song to start, in seconds. Default 0." },
|
|
3192
|
+
length_sec: { type: "integer", minimum: 10, maximum: 60, description: "Create (optional): seconds of the song to film, 10 to 60. Default 60 or the rest of the song." },
|
|
3193
|
+
artist: { type: "string", description: "Create (optional): the artist name for the title card." },
|
|
3194
|
+
song_title: { type: "string", description: "Create (optional): the song title for the title card." },
|
|
3195
|
+
title_card: { type: "boolean", description: "Create: the song title over the opening. Default on." },
|
|
3196
|
+
end_screen: { type: "boolean", description: "Create: an end screen after the song. Default off." },
|
|
3197
|
+
end_text: { type: "string", description: "Create: the end screen's line, up to 60 characters." },
|
|
3198
|
+
cast: {
|
|
3199
|
+
type: "array",
|
|
3200
|
+
items: {
|
|
3201
|
+
type: "object",
|
|
3202
|
+
properties: {
|
|
3203
|
+
name: { type: "string", description: "The character's name; the first one is the performer." },
|
|
3204
|
+
image_url: { type: "string", description: "A clear front-facing portrait on the PixelDojo CDN." }
|
|
3205
|
+
},
|
|
3206
|
+
required: ["name", "image_url"]
|
|
3207
|
+
},
|
|
3208
|
+
description: "Create (optional): up to 3 characters, the performer first, each with a portrait on the PixelDojo CDN."
|
|
3209
|
+
},
|
|
3210
|
+
music_video_id: { type: "string", description: "From create. Required for produce, status and redo." },
|
|
3211
|
+
beats: { type: "array", items: { type: "integer", minimum: 1 }, description: "Redo: the section numbers to film again." },
|
|
3212
|
+
notes: { type: "array", items: { type: "string" }, description: "Redo (optional): what to fix in each of those sections, in the same order." }
|
|
3213
|
+
}
|
|
3214
|
+
};
|
|
3215
|
+
errorText2 = (d, status2) => (typeof d.error === "string" ? d.error : d.error?.message) ?? `HTTP ${status2}`;
|
|
3216
|
+
describe = (v) => describeDrama(v, { tool: "pixeldojo_music_video", idField: "music_video_id", unit: "section" });
|
|
3217
|
+
musicVideoSkill = {
|
|
3218
|
+
name: "pixeldojo_music_video",
|
|
3219
|
+
description: "Make a music video for the user's song (up to 60 seconds of it), vertical 9:16 or 16:9, in any Film Studio look (neon club, rap video, stage performance, retro camcorder, k-pop, anime and more). The song is split into sections at lyric gaps and each section is filmed in one pass to its own slice of the song, so the performer's lips follow every word, with the cast's faces kept from portraits; then it is cut under the original song with a title card and saved to the Library. create is free and returns the plan and price (about 1.25 credits per second of song plus portraits); produce films it; then call status until it is finished (10-15 minutes).",
|
|
3220
|
+
inputZod: InputSchema14,
|
|
3221
|
+
inputJsonSchema: InputJsonSchema14,
|
|
3222
|
+
allowedModels: ["p-video-2-pro-reference", "seedream-4"],
|
|
3223
|
+
defaultModel: "p-video-2-pro-reference",
|
|
3224
|
+
async run(input, ctx) {
|
|
3225
|
+
if (input.action === "create") {
|
|
3226
|
+
if (!input.song_url || !input.idea?.trim()) return { kind: "text", text: "Provide `song_url` (the song on the PixelDojo CDN) and an `idea` to plan a music video." };
|
|
3227
|
+
const { action: _a, music_video_id: _m, beats: _b, notes: _n, ...rest } = input;
|
|
3228
|
+
const created = await api(ctx, "POST", "", { ...Object.fromEntries(Object.entries(rest).filter(([, v]) => v !== void 0)), idea: input.idea.trim() });
|
|
3229
|
+
if (!created.data.id) return { kind: "text", text: `Could not start the music video: ${errorText2(created.data, created.status)}` };
|
|
3230
|
+
const sleep = ctx.pollOverrides?.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
3231
|
+
let last = await api(ctx, "GET", `/${created.data.id}`);
|
|
3232
|
+
for (let i = 0; i < 8 && last.data.status === "scripting"; i += 1) {
|
|
3233
|
+
await sleep(3e3);
|
|
3234
|
+
last = await api(ctx, "GET", `/${created.data.id}`);
|
|
3235
|
+
}
|
|
3236
|
+
return describe(last.data);
|
|
3237
|
+
}
|
|
3238
|
+
if (!input.music_video_id) return { kind: "text", text: `${input.action} needs music_video_id (from create).` };
|
|
3239
|
+
const id = input.music_video_id;
|
|
3240
|
+
const res = input.action === "status" ? await api(ctx, "GET", `/${id}`) : input.action === "produce" ? await api(ctx, "POST", `/${id}`, { action: "produce" }) : input.beats?.length ? await api(ctx, "POST", `/${id}`, { action: "redo", beats: input.beats, ...input.notes?.length ? { notes: input.notes } : {} }) : null;
|
|
3241
|
+
if (!res) return { kind: "text", text: "redo needs beats (the section numbers to film again)." };
|
|
3242
|
+
if (!res.data.id) return { kind: "text", text: errorText2(res.data, res.status) };
|
|
3243
|
+
return describe(res.data);
|
|
3244
|
+
}
|
|
3245
|
+
};
|
|
3246
|
+
}
|
|
3247
|
+
});
|
|
3248
|
+
async function kataApi(ctx, method, path, body) {
|
|
3249
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}/api/v1/kata${path}`, {
|
|
3250
|
+
method,
|
|
3251
|
+
headers: {
|
|
3252
|
+
Authorization: `Bearer ${ctx.apiKey}`,
|
|
3253
|
+
"Content-Type": "application/json",
|
|
3254
|
+
"x-pixeldojo-source": `mcp/${ctx.mcpVersion}`,
|
|
3255
|
+
"x-pixeldojo-skill": "kata"
|
|
3256
|
+
},
|
|
3257
|
+
...body !== void 0 ? { body: JSON.stringify(body) } : {}
|
|
3258
|
+
});
|
|
3259
|
+
const data = await res.json().catch(() => ({}));
|
|
3260
|
+
return { status: res.status, data };
|
|
3261
|
+
}
|
|
3262
|
+
function describeKata(v) {
|
|
3263
|
+
const next2 = (action) => `pixeldojo_kata with {"kata_id": "${v.id}", "action": "${action}"}`;
|
|
3264
|
+
if (v.status === "failed") return { kind: "text", text: `The Kata stopped: ${v.error ?? "unknown error"}. Anything that failed was refunded.` };
|
|
3265
|
+
if (v.status === "quote") {
|
|
3266
|
+
const scenes = v.scenes.map((s, i) => `${i + 1}. ${KIND[s.kind] ?? s.kind}${s.cast.length ? ` with ${s.cast.join(" and ")}` : ""}${s.prompt ? `: ${s.prompt.slice(0, 140)}` : ""}`);
|
|
3267
|
+
const words = v.shots.filter((s) => s.text).map((s) => `${s.from.toFixed(1)}s "${s.text}"`);
|
|
3268
|
+
return {
|
|
3269
|
+
kind: "text",
|
|
3270
|
+
text: [
|
|
3271
|
+
`Planned "${v.title}" (kata_id: ${v.id}): ${v.duration_sec}s, ${v.format}, ${v.shots.length} cuts kept to the frame, ${v.scenes.length} setups:`,
|
|
3272
|
+
...scenes,
|
|
3273
|
+
words.length ? `On screen: ${words.join(", ")}.` : "",
|
|
3274
|
+
`Price: about ${v.estimate_credits} credits (${(v.quote ?? []).map((l) => `${l.label} ${l.credits}`).join(", ")}); up to ${v.max_credits_with_retakes} if bad takes are made again. Nothing has been charged yet. Show this to the user and, once they agree, call ${next2("produce")}. (In Sensei: put it in pixeldojo_plan as ONE step with skill "kata" and params {"kata_id": "${v.id}"}, which prices it from this quote.)`
|
|
3275
|
+
].filter(Boolean).join("\n")
|
|
3276
|
+
};
|
|
3277
|
+
}
|
|
3278
|
+
if (v.status === "done" && v.final_url) {
|
|
3279
|
+
return { kind: "assets", text: `"${v.title}" is finished and saved to the Library: ${v.final_url}`, assetUrls: [v.final_url] };
|
|
3280
|
+
}
|
|
3281
|
+
return {
|
|
3282
|
+
kind: "text",
|
|
3283
|
+
text: `Still ${STEP2[v.status] ?? v.status}. It takes about 5 to 15 minutes in all. Call ${next2("status")} in about a minute.`,
|
|
3284
|
+
followUp: { input: { action: "status", kata_id: v.id }, afterSec: v.status === "analyzing" || v.status === "scripting" ? 20 : 45 }
|
|
3285
|
+
};
|
|
3286
|
+
}
|
|
3287
|
+
async function waitForPlan3(ctx, id) {
|
|
3288
|
+
const sleep = ctx.pollOverrides?.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
3289
|
+
let last = await kataApi(ctx, "GET", `/${id}`);
|
|
3290
|
+
for (let i = 0; i < 10 && (last.data.status === "analyzing" || last.data.status === "scripting"); i += 1) {
|
|
3291
|
+
await sleep(4e3);
|
|
3292
|
+
last = await kataApi(ctx, "GET", `/${id}`);
|
|
3293
|
+
}
|
|
3294
|
+
return last;
|
|
3295
|
+
}
|
|
3296
|
+
var InputSchema15, InputJsonSchema15, errorText3, STEP2, KIND, kataSkill;
|
|
3297
|
+
var init_kata = __esm({
|
|
3298
|
+
"src/skills/kata.ts"() {
|
|
3299
|
+
InputSchema15 = z.object({
|
|
3300
|
+
action: z.enum(["create", "produce", "status", "presets"]).default("create"),
|
|
3301
|
+
reference_url: z.string().url().optional(),
|
|
3302
|
+
preset: z.string().max(80).optional(),
|
|
3303
|
+
cast: z.array(z.object({ name: z.string().min(1).max(40), image_url: z.string().url().optional(), description: z.string().max(200).optional() })).max(3).optional(),
|
|
3304
|
+
photos: z.array(z.object({ url: z.string().url(), note: z.string().max(80).optional() })).max(4).optional(),
|
|
3305
|
+
instructions: z.string().max(1500).optional(),
|
|
3306
|
+
look: z.string().max(80).optional(),
|
|
3307
|
+
kata_id: z.string().max(60).optional()
|
|
3308
|
+
});
|
|
3309
|
+
InputJsonSchema15 = {
|
|
3310
|
+
type: "object",
|
|
3311
|
+
properties: {
|
|
3312
|
+
action: {
|
|
3313
|
+
type: "string",
|
|
3314
|
+
enum: ["create", "produce", "status", "presets"],
|
|
3315
|
+
description: "create (default, free): reads the reference edit and plans the remake; returns kata_id and the price. Show the plan and price and wait for the user's OK. produce (charged): makes it. status (free): progress; call every ~60s until it returns the edit. presets (free): the Kata library, ready-made edits to recreate."
|
|
3316
|
+
},
|
|
3317
|
+
reference_url: { type: "string", description: "Create: the 4 to 60 second edit to recreate: an upload on the PixelDojo CDN or a direct link to the video file. TikTok, Instagram, YouTube and X posts cannot be fetched: ask the user to save the video from the app and upload it. Or give preset instead." },
|
|
3318
|
+
preset: { type: "string", description: 'Create: a Kata library preset slug (from action "presets") instead of a reference.' },
|
|
3319
|
+
cast: {
|
|
3320
|
+
type: "array",
|
|
3321
|
+
items: {
|
|
3322
|
+
type: "object",
|
|
3323
|
+
properties: {
|
|
3324
|
+
name: { type: "string", description: "Their name. Without image_url, the saved Character Studio character of that name." },
|
|
3325
|
+
image_url: { type: "string", description: "A clear photo of them on the PixelDojo CDN." },
|
|
3326
|
+
description: { type: "string", description: "Optional: who they are, in a few words." }
|
|
3327
|
+
},
|
|
3328
|
+
required: ["name"]
|
|
3329
|
+
},
|
|
3330
|
+
description: 'Create: up to 3 people who replace the people in the edit. Use saved characters by name (pixeldojo_library source "characters").'
|
|
3331
|
+
},
|
|
3332
|
+
photos: {
|
|
3333
|
+
type: "array",
|
|
3334
|
+
items: { type: "object", properties: { url: { type: "string" }, note: { type: "string", description: 'What it is (e.g. "the product").' } }, required: ["url"] },
|
|
3335
|
+
description: "Create: up to 4 products or photos to put in the edit, on the PixelDojo CDN."
|
|
3336
|
+
},
|
|
3337
|
+
instructions: { type: "string", description: "Create (optional): what to change, e.g. the setting, the words on screen, where the product goes." },
|
|
3338
|
+
look: { type: "string", description: 'Create (optional): style transfer, one look for every new shot, e.g. "hand-drawn anime".' },
|
|
3339
|
+
kata_id: { type: "string", description: "From create. Required for produce and status." }
|
|
3340
|
+
}
|
|
3341
|
+
};
|
|
3342
|
+
errorText3 = (d, status2) => d.message ?? (typeof d.error === "string" ? d.error : d.error?.message) ?? `HTTP ${status2}`;
|
|
3343
|
+
STEP2 = {
|
|
3344
|
+
analyzing: "reading the edit cut by cut",
|
|
3345
|
+
scripting: "planning the remake",
|
|
3346
|
+
music: "scoring a new track on the same tempo",
|
|
3347
|
+
beats: "finding the beat",
|
|
3348
|
+
keyframes: "making the keyframes",
|
|
3349
|
+
animating: "filming the shots",
|
|
3350
|
+
cutting: "cutting it where the reference cuts",
|
|
3351
|
+
rendering: "setting the words and transitions",
|
|
3352
|
+
reviewing: "checking the final cut"
|
|
3353
|
+
};
|
|
3354
|
+
KIND = { clip: "new shot", still: "still", swap: "motion transfer", photo: "your photo" };
|
|
3355
|
+
kataSkill = {
|
|
3356
|
+
name: "pixeldojo_kata",
|
|
3357
|
+
description: `Kata: recreate a reference edit (a viral short, an ad, a montage, a trailer, 4 to 60 s) with the user's own characters, products and photos. It keeps the same pacing and cut points to the frame, the transitions, the camera moves, the caption style and the music feel (an original score on the same tempo, never the reference's audio); dance moves come across by motion transfer, and a look can restyle every shot. Start from a reference_url or a Kata library preset (action "presets"). create is free and returns the plan and the price; produce makes it; then call status until it is finished. Saved to the Library.`,
|
|
3358
|
+
inputZod: InputSchema15,
|
|
3359
|
+
inputJsonSchema: InputJsonSchema15,
|
|
3360
|
+
allowedModels: ["seedance-2-5", "google-nano-banana", "kling-motion-control"],
|
|
3361
|
+
defaultModel: "seedance-2-5",
|
|
3362
|
+
async run(input, ctx) {
|
|
3363
|
+
if (input.action === "presets") {
|
|
3364
|
+
const res2 = await kataApi(ctx, "GET", "/presets");
|
|
3365
|
+
const list = res2.data.presets ?? [];
|
|
3366
|
+
if (!list.length) return { kind: "text", text: "The Kata library is empty right now. Recreate any edit with a reference_url." };
|
|
3367
|
+
return {
|
|
3368
|
+
kind: "text",
|
|
3369
|
+
text: ["Kata library (pass the slug as preset):", ...list.map((p) => `- ${p.slug}: ${p.title} (${p.category}, ${Math.round(p.durationSec)}s, ${p.shots} cuts). ${p.blurb}`)].join("\n")
|
|
3370
|
+
};
|
|
3371
|
+
}
|
|
3372
|
+
if (input.action === "create") {
|
|
3373
|
+
if (!input.reference_url && !input.preset) return { kind: "text", text: 'Give a reference_url (the edit to recreate, on the PixelDojo CDN) or a preset from action "presets".' };
|
|
3374
|
+
const created = await kataApi(ctx, "POST", "", {
|
|
3375
|
+
...input.preset ? { preset: input.preset } : { reference_url: input.reference_url },
|
|
3376
|
+
...input.cast?.length ? { cast: input.cast } : {},
|
|
3377
|
+
...input.photos?.length ? { photos: input.photos } : {},
|
|
3378
|
+
...input.instructions ? { instructions: input.instructions } : {},
|
|
3379
|
+
...input.look ? { look: input.look } : {}
|
|
3380
|
+
});
|
|
3381
|
+
if (!created.data.id) return { kind: "text", text: `Could not start the Kata: ${errorText3(created.data, created.status)}` };
|
|
3382
|
+
const planned = await waitForPlan3(ctx, created.data.id);
|
|
3383
|
+
return describeKata(planned.data);
|
|
3384
|
+
}
|
|
3385
|
+
if (!input.kata_id) return { kind: "text", text: `${input.action} needs kata_id (from create).` };
|
|
3386
|
+
const res = input.action === "status" ? await kataApi(ctx, "GET", `/${input.kata_id}`) : await kataApi(ctx, "POST", `/${input.kata_id}`, { action: "produce" });
|
|
3387
|
+
if (!res.data.id) return { kind: "text", text: errorText3(res.data, res.status) };
|
|
3388
|
+
return describeKata(res.data);
|
|
3389
|
+
}
|
|
3390
|
+
};
|
|
3391
|
+
}
|
|
3392
|
+
});
|
|
2912
3393
|
async function run13(input, ctx) {
|
|
2913
3394
|
const productImages = [
|
|
2914
3395
|
...input.product_image_urls ?? [],
|
|
@@ -2933,7 +3414,9 @@ async function run13(input, ctx) {
|
|
|
2933
3414
|
quality: input.quality,
|
|
2934
3415
|
resolution: input.resolution,
|
|
2935
3416
|
aspect_ratio: input.aspect_ratio,
|
|
2936
|
-
duration: input.duration
|
|
3417
|
+
duration: input.duration,
|
|
3418
|
+
reference_video_url: input.reference_video_url,
|
|
3419
|
+
brand_kit: input.brand_kit
|
|
2937
3420
|
};
|
|
2938
3421
|
const client = ctx.client;
|
|
2939
3422
|
const submitted = await client.runAd(body);
|
|
@@ -2949,16 +3432,16 @@ async function run13(input, ctx) {
|
|
|
2949
3432
|
const styleLabel = submitted.ad?.style ?? input.style ?? "ugc-testimonial";
|
|
2950
3433
|
return pollResultToSkillResult(
|
|
2951
3434
|
result,
|
|
2952
|
-
(urls) => urls.length === 0 ? `Ad job ${submitted.jobId} completed but returned no assets.` : `Ad rendered (style: ${styleLabel}${submitted.ad?.product?.name ? `, product: ${submitted.ad.product.name}` : ""}). Video: ${urls[0]}
|
|
3435
|
+
(urls) => urls.length === 0 ? `Ad job ${submitted.jobId} completed but returned no assets.` : `Ad rendered (style: ${styleLabel}${submitted.ad?.product?.name ? `, product: ${submitted.ad.product.name}` : ""}). Video: ${urls[0]} Add the brand end card (logo, tagline, button) with pixeldojo_marketing action end_card and this video_url.`
|
|
2953
3436
|
);
|
|
2954
3437
|
}
|
|
2955
|
-
var
|
|
3438
|
+
var InputSchema16, InputJsonSchema16, adSkill;
|
|
2956
3439
|
var init_ad = __esm({
|
|
2957
3440
|
"src/skills/ad.ts"() {
|
|
2958
3441
|
init_types();
|
|
2959
3442
|
init_poll();
|
|
2960
3443
|
init_upload_helpers();
|
|
2961
|
-
|
|
3444
|
+
InputSchema16 = z.object({
|
|
2962
3445
|
style: z.string().max(80).optional().describe(
|
|
2963
3446
|
"Ad style slug (default ugc-testimonial). Catalog: GET /api/v1/marketing/presets \u2014 e.g. ugc-testimonial, unboxing-reveal, unboxing-asmr, virtual-try-on, street-style, product-showcase, macro-details, crush-test, hyper-motion, before-after, day-in-the-life, the-gift, tv-spot."
|
|
2964
3447
|
),
|
|
@@ -2976,7 +3459,9 @@ var init_ad = __esm({
|
|
|
2976
3459
|
quality: z.enum(["mini", "fast", "high"]).optional(),
|
|
2977
3460
|
resolution: z.enum(["480p", "720p", "1080p", "4k"]).optional().describe('1080p/4k require quality "high".'),
|
|
2978
3461
|
aspect_ratio: z.enum(["16:9", "4:3", "1:1", "3:4", "9:16", "21:9"]).optional(),
|
|
2979
|
-
duration: z.number().int().min(4).max(15).optional()
|
|
3462
|
+
duration: z.number().int().min(4).max(15).optional(),
|
|
3463
|
+
reference_video_url: z.string().url().optional(),
|
|
3464
|
+
brand_kit: z.boolean().optional()
|
|
2980
3465
|
}).refine(
|
|
2981
3466
|
(v) => v.product_url || (v.product_image_urls?.length || v.product_image_paths?.length) && v.product_name,
|
|
2982
3467
|
{
|
|
@@ -2984,7 +3469,7 @@ var init_ad = __esm({
|
|
|
2984
3469
|
path: ["product_url"]
|
|
2985
3470
|
}
|
|
2986
3471
|
);
|
|
2987
|
-
|
|
3472
|
+
InputJsonSchema16 = {
|
|
2988
3473
|
type: "object",
|
|
2989
3474
|
properties: {
|
|
2990
3475
|
style: {
|
|
@@ -3062,6 +3547,15 @@ var init_ad = __esm({
|
|
|
3062
3547
|
minimum: 4,
|
|
3063
3548
|
maximum: 15,
|
|
3064
3549
|
description: "Ad length in seconds. Defaults to the style's length; clamped to what the engine allows."
|
|
3550
|
+
},
|
|
3551
|
+
reference_video_url: {
|
|
3552
|
+
type: "string",
|
|
3553
|
+
format: "uri",
|
|
3554
|
+
description: "Ad multiplier: an ad that already works (https mp4, up to 30 s). The new ad copies its hook, pacing and camera moves with this product and presenter, never its product, people or text."
|
|
3555
|
+
},
|
|
3556
|
+
brand_kit: {
|
|
3557
|
+
type: "boolean",
|
|
3558
|
+
description: "The account's brand kit (palette, voice, selling points; see pixeldojo_brand_kit) rides on every ad. false skips it."
|
|
3065
3559
|
}
|
|
3066
3560
|
}
|
|
3067
3561
|
// "product_url OR product_name+images" is enforced by the server and the
|
|
@@ -3071,8 +3565,8 @@ var init_ad = __esm({
|
|
|
3071
3565
|
name: "pixeldojo_ad",
|
|
3072
3566
|
description: "Marketing Studio: turn a product into a rendered video ad with voiceover. Requires `product_url` (name, description and images are extracted), or `product_name` plus product_image_urls / product_image_paths. Pick a `style` slug (default ugc-testimonial; full catalog at GET https://pixeldojo.ai/api/v1/marketing/presets), and optionally add presenter reference images, a location, a hook, and the exact spoken script. Returns the video URL, or a jobId to check with pixeldojo_status.",
|
|
3073
3567
|
hostedDescription: "Marketing Studio: turn a product into a rendered video ad with voiceover. Requires `product_url` (name, description and images are extracted), or `product_name` plus product_image_urls (public http(s) URLs). Pick a `style` slug (default ugc-testimonial; full catalog at GET https://pixeldojo.ai/api/v1/marketing/presets), and optionally add presenter reference images, a location, a hook, and the exact spoken script. Returns the video URL, or a jobId to check with pixeldojo_status.",
|
|
3074
|
-
inputZod:
|
|
3075
|
-
inputJsonSchema:
|
|
3568
|
+
inputZod: InputSchema16,
|
|
3569
|
+
inputJsonSchema: InputJsonSchema16,
|
|
3076
3570
|
// Composition skill — the server routes to the ad engine internally.
|
|
3077
3571
|
allowedModels: [],
|
|
3078
3572
|
defaultModel: "",
|
|
@@ -3107,10 +3601,10 @@ async function run14(input, ctx) {
|
|
|
3107
3601
|
statusUrl: result.statusUrl ?? ctx.buildStatusUrl(result.campaignId)
|
|
3108
3602
|
};
|
|
3109
3603
|
}
|
|
3110
|
-
var
|
|
3604
|
+
var InputSchema17, InputJsonSchema17, campaignSkill;
|
|
3111
3605
|
var init_campaign = __esm({
|
|
3112
3606
|
"src/skills/campaign.ts"() {
|
|
3113
|
-
|
|
3607
|
+
InputSchema17 = z.object({
|
|
3114
3608
|
productUrl: z.string().url().optional().describe("Product page URL. We extract name + description + images automatically."),
|
|
3115
3609
|
product: z.object({
|
|
3116
3610
|
name: z.string().min(1).max(200),
|
|
@@ -3126,7 +3620,7 @@ var init_campaign = __esm({
|
|
|
3126
3620
|
message: "productUrl or product is required",
|
|
3127
3621
|
path: ["productUrl"]
|
|
3128
3622
|
});
|
|
3129
|
-
|
|
3623
|
+
InputJsonSchema17 = {
|
|
3130
3624
|
type: "object",
|
|
3131
3625
|
properties: {
|
|
3132
3626
|
productUrl: {
|
|
@@ -3177,8 +3671,8 @@ var init_campaign = __esm({
|
|
|
3177
3671
|
campaignSkill = {
|
|
3178
3672
|
name: "pixeldojo_campaign",
|
|
3179
3673
|
description: "Generate a coherent product launch package (hero image + N lifestyle variants + optional vertical video) from one URL or product profile. Composes hero / lifestyle / video models server-side; returns assets in one call or a handoff with campaignId to poll via pixeldojo_campaign_status.",
|
|
3180
|
-
inputZod:
|
|
3181
|
-
inputJsonSchema:
|
|
3674
|
+
inputZod: InputSchema17,
|
|
3675
|
+
inputJsonSchema: InputJsonSchema17,
|
|
3182
3676
|
// Composition skill — internal sub-jobs route to per-tool models, no
|
|
3183
3677
|
// single allowed-models list applies here.
|
|
3184
3678
|
allowedModels: [],
|
|
@@ -3217,13 +3711,13 @@ async function run15(input, ctx) {
|
|
|
3217
3711
|
statusUrl: result.statusUrl ?? ctx.buildStatusUrl(result.campaignId)
|
|
3218
3712
|
};
|
|
3219
3713
|
}
|
|
3220
|
-
var
|
|
3714
|
+
var InputSchema18, InputJsonSchema18, campaignStatusSkill;
|
|
3221
3715
|
var init_campaign_status = __esm({
|
|
3222
3716
|
"src/skills/campaign-status.ts"() {
|
|
3223
|
-
|
|
3717
|
+
InputSchema18 = z.object({
|
|
3224
3718
|
campaignId: z.string().min(1).max(200).describe("Campaign id returned from a prior pixeldojo_campaign handoff.")
|
|
3225
3719
|
});
|
|
3226
|
-
|
|
3720
|
+
InputJsonSchema18 = {
|
|
3227
3721
|
type: "object",
|
|
3228
3722
|
properties: {
|
|
3229
3723
|
campaignId: {
|
|
@@ -3236,8 +3730,8 @@ var init_campaign_status = __esm({
|
|
|
3236
3730
|
campaignStatusSkill = {
|
|
3237
3731
|
name: "pixeldojo_campaign_status",
|
|
3238
3732
|
description: "Poll a campaign by campaignId returned from pixeldojo_campaign. Returns assets when every sub-job is done, or a handoff describing what is still in flight.",
|
|
3239
|
-
inputZod:
|
|
3240
|
-
inputJsonSchema:
|
|
3733
|
+
inputZod: InputSchema18,
|
|
3734
|
+
inputJsonSchema: InputJsonSchema18,
|
|
3241
3735
|
allowedModels: [],
|
|
3242
3736
|
defaultModel: "",
|
|
3243
3737
|
run: run15
|
|
@@ -3260,16 +3754,16 @@ async function run16(input, ctx) {
|
|
|
3260
3754
|
(temp storage; auto-deletes in ~24h. Pass this URL as image_url, video_url for a clip, or song_url on pixeldojo_film for a song, to any pixeldojo tool that takes one.)`
|
|
3261
3755
|
};
|
|
3262
3756
|
}
|
|
3263
|
-
var
|
|
3757
|
+
var InputSchema19, InputJsonSchema19, uploadSkill;
|
|
3264
3758
|
var init_upload = __esm({
|
|
3265
3759
|
"src/skills/upload.ts"() {
|
|
3266
3760
|
init_upload_helpers();
|
|
3267
|
-
|
|
3761
|
+
InputSchema19 = z.object({
|
|
3268
3762
|
path: z.string().min(1).max(4096).describe(
|
|
3269
3763
|
"Absolute local file path to upload. JPEG, PNG, WebP, GIF (\u226450MB), MP4, WebM, MOV (\u2264200MB) or MP3, WAV, M4A, AAC, OGG, FLAC audio (\u226450MB). Returns a public URL on the temp CDN; storage auto-expires after 24 hours."
|
|
3270
3764
|
)
|
|
3271
3765
|
});
|
|
3272
|
-
|
|
3766
|
+
InputJsonSchema19 = {
|
|
3273
3767
|
type: "object",
|
|
3274
3768
|
properties: {
|
|
3275
3769
|
path: {
|
|
@@ -3282,8 +3776,8 @@ var init_upload = __esm({
|
|
|
3282
3776
|
uploadSkill = {
|
|
3283
3777
|
name: "pixeldojo_upload",
|
|
3284
3778
|
description: "Upload a local image, video or audio file (JPEG, PNG, WebP, GIF up to 50MB; MP4, WebM, MOV up to 200MB; MP3, WAV, M4A, AAC, OGG, FLAC up to 50MB) and get back a public URL that expires after 24 hours. Free. Pass an audio URL as song_url to pixeldojo_film for a music video. Pass the URL as image_url (stills) or video_url (clips) to tools that take hosted URLs only, such as pixeldojo_character, pixeldojo_storyboard and pixeldojo_upscale. pixeldojo_generate, pixeldojo_edit and pixeldojo_ad take local paths directly and need no separate upload.",
|
|
3285
|
-
inputZod:
|
|
3286
|
-
inputJsonSchema:
|
|
3779
|
+
inputZod: InputSchema19,
|
|
3780
|
+
inputJsonSchema: InputJsonSchema19,
|
|
3287
3781
|
allowedModels: [],
|
|
3288
3782
|
defaultModel: "",
|
|
3289
3783
|
run: run16
|
|
@@ -3328,14 +3822,14 @@ async function run17(input, ctx) {
|
|
|
3328
3822
|
(urls) => urls.length === 0 ? `Job ${submitted.jobId} completed but returned no assets.` : `Audio ready. Asset: ${urls[0]}`
|
|
3329
3823
|
);
|
|
3330
3824
|
}
|
|
3331
|
-
var ALLOWED4, DEFAULT_MODEL6,
|
|
3825
|
+
var ALLOWED4, DEFAULT_MODEL6, InputSchema20, InputJsonSchema20, audioSkill;
|
|
3332
3826
|
var init_audio = __esm({
|
|
3333
3827
|
"src/skills/audio.ts"() {
|
|
3334
3828
|
init_poll();
|
|
3335
3829
|
init_types();
|
|
3336
3830
|
ALLOWED4 = ["seed-audio", "text-to-speech"];
|
|
3337
3831
|
DEFAULT_MODEL6 = "seed-audio";
|
|
3338
|
-
|
|
3832
|
+
InputSchema20 = z.object({
|
|
3339
3833
|
prompt: z.string().min(1).describe(
|
|
3340
3834
|
"seed-audio: a script to speak, or a scene description (dialogue, sound effects, music), up to 2048 characters; refer to audio_urls clips in order as @Audio1..@Audio3. text-to-speech: the exact text to speak, up to 10,000 characters."
|
|
3341
3835
|
),
|
|
@@ -3345,7 +3839,7 @@ var init_audio = __esm({
|
|
|
3345
3839
|
output_format: z.string().optional().describe("Output format. seed-audio: mp3 (default), wav, pcm, ogg_opus. text-to-speech: mp3 (default), wav, flac, pcm."),
|
|
3346
3840
|
speed: z.number().min(0.5).max(2).optional().describe("Speech speed multiplier, 0.5-2 (default 1). Both models.")
|
|
3347
3841
|
});
|
|
3348
|
-
|
|
3842
|
+
InputJsonSchema20 = {
|
|
3349
3843
|
type: "object",
|
|
3350
3844
|
properties: {
|
|
3351
3845
|
prompt: {
|
|
@@ -3383,8 +3877,8 @@ var init_audio = __esm({
|
|
|
3383
3877
|
audioSkill = {
|
|
3384
3878
|
name: "pixeldojo_audio",
|
|
3385
3879
|
description: "Generate audio: speech, multi-character dialogue, sound effects, and background music from one prompt (Seed Audio 1.0 by default; plain text-to-speech available). Voice cloning takes hosted reference clip URLs in audio_urls; local audio files are not accepted. Returns an audio URL, or a jobId for pixeldojo_status.",
|
|
3386
|
-
inputZod:
|
|
3387
|
-
inputJsonSchema:
|
|
3880
|
+
inputZod: InputSchema20,
|
|
3881
|
+
inputJsonSchema: InputJsonSchema20,
|
|
3388
3882
|
allowedModels: [...ALLOWED4],
|
|
3389
3883
|
defaultModel: DEFAULT_MODEL6,
|
|
3390
3884
|
run: run17
|
|
@@ -3442,17 +3936,17 @@ ${lines.join("\n")}
|
|
|
3442
3936
|
Pass any URL back into pixeldojo_generate, pixeldojo_edit, pixeldojo_character, or pixeldojo_upscale as a reference input.`
|
|
3443
3937
|
};
|
|
3444
3938
|
}
|
|
3445
|
-
var
|
|
3939
|
+
var InputSchema21, InputJsonSchema21, librarySkill;
|
|
3446
3940
|
var init_library = __esm({
|
|
3447
3941
|
"src/skills/library.ts"() {
|
|
3448
|
-
|
|
3942
|
+
InputSchema21 = z.object({
|
|
3449
3943
|
source: z.enum(["media", "characters"]).optional().describe("media (default): saved and recent results. characters: saved Character Studio characters and elements, usable as @Name in prompts."),
|
|
3450
3944
|
q: z.string().optional().describe("Substring match against the prompt that produced the asset."),
|
|
3451
3945
|
model: z.string().optional().describe("Restrict to a single model (apiId)."),
|
|
3452
3946
|
modality: z.enum(["image", "video", "audio"]).optional().describe("Restrict to one output type."),
|
|
3453
3947
|
limit: z.number().int().min(1).max(50).optional().describe("Max results (default 10).")
|
|
3454
3948
|
});
|
|
3455
|
-
|
|
3949
|
+
InputJsonSchema21 = {
|
|
3456
3950
|
type: "object",
|
|
3457
3951
|
properties: {
|
|
3458
3952
|
source: {
|
|
@@ -3477,8 +3971,8 @@ var init_library = __esm({
|
|
|
3477
3971
|
librarySkill = {
|
|
3478
3972
|
name: "pixeldojo_library",
|
|
3479
3973
|
description: "Search your Library, newest first. source=media (default): saved media (permanent) and recent API/MCP generations (deleted 1 hour after they finish), as URLs to reuse as references. source=characters: saved Character Studio characters and elements, each usable as @Name in any prompt.",
|
|
3480
|
-
inputZod:
|
|
3481
|
-
inputJsonSchema:
|
|
3974
|
+
inputZod: InputSchema21,
|
|
3975
|
+
inputJsonSchema: InputJsonSchema21,
|
|
3482
3976
|
allowedModels: [],
|
|
3483
3977
|
defaultModel: "",
|
|
3484
3978
|
run: run18
|
|
@@ -3499,17 +3993,17 @@ async function run19(input, ctx) {
|
|
|
3499
3993
|
It will appear at https://pixeldojo.ai/my-images and in pixeldojo_library searches.`
|
|
3500
3994
|
};
|
|
3501
3995
|
}
|
|
3502
|
-
var
|
|
3996
|
+
var InputSchema22, InputJsonSchema22, saveSkill;
|
|
3503
3997
|
var init_save = __esm({
|
|
3504
3998
|
"src/skills/save.ts"() {
|
|
3505
|
-
|
|
3999
|
+
InputSchema22 = z.object({
|
|
3506
4000
|
url: z.string().url().describe("The asset URL to save (image or video)."),
|
|
3507
4001
|
prompt: z.string().optional().describe("The prompt that produced it \u2014 makes it findable in the library later."),
|
|
3508
4002
|
tool_name: z.string().optional().describe("Tool/model slug that produced it."),
|
|
3509
4003
|
modality: z.enum(["image", "video", "audio"]).optional(),
|
|
3510
4004
|
job_id: z.string().optional().describe("The jobId that produced this asset, when known.")
|
|
3511
4005
|
});
|
|
3512
|
-
|
|
4006
|
+
InputJsonSchema22 = {
|
|
3513
4007
|
type: "object",
|
|
3514
4008
|
properties: {
|
|
3515
4009
|
url: { type: "string", format: "uri", description: "The result URL to keep (image or video from a PixelDojo job)." },
|
|
@@ -3523,8 +4017,8 @@ var init_save = __esm({
|
|
|
3523
4017
|
saveSkill = {
|
|
3524
4018
|
name: "pixeldojo_save",
|
|
3525
4019
|
description: `Save a generated image or video into the user's My Media library permanently ("save this", "keep it"). Results otherwise expire 1 hour after they finish. Pass the result URL; it is safety-checked before it is kept.`,
|
|
3526
|
-
inputZod:
|
|
3527
|
-
inputJsonSchema:
|
|
4020
|
+
inputZod: InputSchema22,
|
|
4021
|
+
inputJsonSchema: InputJsonSchema22,
|
|
3528
4022
|
allowedModels: [],
|
|
3529
4023
|
defaultModel: "",
|
|
3530
4024
|
run: run19
|
|
@@ -3543,21 +4037,21 @@ async function run20(input, ctx) {
|
|
|
3543
4037
|
text: `Saved ${res.kind} "${res.name}" to Character Studio (${res.image_urls.length} image${res.image_urls.length === 1 ? "" : "s"}). Use it in any prompt as ${res.mention}, for example "${res.mention} walking on a beach at sunset". It also appears at https://pixeldojo.ai/characters.`
|
|
3544
4038
|
};
|
|
3545
4039
|
}
|
|
3546
|
-
var
|
|
4040
|
+
var KINDS2, InputSchema23, InputJsonSchema23, saveCharacterSkill;
|
|
3547
4041
|
var init_save_character = __esm({
|
|
3548
4042
|
"src/skills/save-character.ts"() {
|
|
3549
|
-
|
|
3550
|
-
|
|
4043
|
+
KINDS2 = ["character", "product", "outfit", "location", "object", "style"];
|
|
4044
|
+
InputSchema23 = z.object({
|
|
3551
4045
|
name: z.string().min(1).max(60).describe("What to call it. Used as @Name in prompts."),
|
|
3552
|
-
kind: z.enum(
|
|
4046
|
+
kind: z.enum(KINDS2).optional().describe("Default character."),
|
|
3553
4047
|
image_urls: z.array(z.string().url()).max(8).optional().describe("3 to 5 photos from different angles works best for a character."),
|
|
3554
4048
|
description: z.string().max(1500).optional().describe("Appearance notes, or the scene text for an element.")
|
|
3555
4049
|
});
|
|
3556
|
-
|
|
4050
|
+
InputJsonSchema23 = {
|
|
3557
4051
|
type: "object",
|
|
3558
4052
|
properties: {
|
|
3559
4053
|
name: { type: "string", description: "What to call it. Used as @Name in prompts afterwards." },
|
|
3560
|
-
kind: { type: "string", enum:
|
|
4054
|
+
kind: { type: "string", enum: KINDS2, description: "character (default), product, outfit, location, object (a prop) or style." },
|
|
3561
4055
|
image_urls: {
|
|
3562
4056
|
type: "array",
|
|
3563
4057
|
items: { type: "string", format: "uri" },
|
|
@@ -3571,14 +4065,596 @@ var init_save_character = __esm({
|
|
|
3571
4065
|
saveCharacterSkill = {
|
|
3572
4066
|
name: "pixeldojo_save_character",
|
|
3573
4067
|
description: "Save a character (a person, from 3-5 photos) or an element (product, outfit, location, prop, style) to the user's Character Studio library. Afterwards write @Name in any prompt to use it. List saved ones with pixeldojo_library source=characters.",
|
|
3574
|
-
inputZod:
|
|
3575
|
-
inputJsonSchema:
|
|
4068
|
+
inputZod: InputSchema23,
|
|
4069
|
+
inputJsonSchema: InputJsonSchema23,
|
|
3576
4070
|
allowedModels: [],
|
|
3577
4071
|
defaultModel: "",
|
|
3578
4072
|
run: run20
|
|
3579
4073
|
};
|
|
3580
4074
|
}
|
|
3581
4075
|
});
|
|
4076
|
+
function priceOf(e) {
|
|
4077
|
+
if (!e.creditsByEngine) return `${e.credits ?? "?"} credits`;
|
|
4078
|
+
return Object.entries(e.creditsByEngine).map(([engine, c]) => `${engine}${engine === e.defaultEngine ? " (default)" : ""} ${c ?? "?"} credits`).join(" / ");
|
|
4079
|
+
}
|
|
4080
|
+
async function listRun(input, ctx) {
|
|
4081
|
+
const q = new URLSearchParams();
|
|
4082
|
+
for (const [k, v] of Object.entries(input)) if (v !== void 0 && v !== "") q.set(k, String(v));
|
|
4083
|
+
if (!input.limit) q.set("limit", "20");
|
|
4084
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}/api/v1/effects?${q}`, { headers: headers(ctx, "pixeldojo_effects") });
|
|
4085
|
+
const data = await res.json().catch(() => ({}));
|
|
4086
|
+
if (!res.ok) return { kind: "text", text: `Could not list effects: ${data.error ?? `HTTP ${res.status}`}` };
|
|
4087
|
+
const effects = data.effects ?? [];
|
|
4088
|
+
const cats = Object.entries(data.categories ?? {}).map(([fam, list]) => `${fam}: ${list.join(", ")}`);
|
|
4089
|
+
if (!effects.length) {
|
|
4090
|
+
return { kind: "text", text: ["No effects match. Categories:", ...cats].join("\n") };
|
|
4091
|
+
}
|
|
4092
|
+
const lines = effects.map((e) => {
|
|
4093
|
+
const ins = e.inputs.map(
|
|
4094
|
+
(i) => i.kind === "image" ? `photo "${i.label}"${i.optional ? " (optional)" : ""}` : `text "${i.label}"${i.options ? ` [${i.options.join(" | ")}]` : ""}${i.optional ? " (optional)" : ""}`
|
|
4095
|
+
);
|
|
4096
|
+
return `- ${e.slug} (${e.family}, ${e.output}, ${priceOf(e)}): ${e.title}. ${e.tagline} Inputs: ${ins.join(", ")}.`;
|
|
4097
|
+
});
|
|
4098
|
+
const shown = data.total && data.total > effects.length ? `, showing ${effects.length}` : "";
|
|
4099
|
+
return {
|
|
4100
|
+
kind: "text",
|
|
4101
|
+
text: [
|
|
4102
|
+
`${data.total ?? effects.length} effects${shown}. Run one with pixeldojo_effect (slug, image_urls in the order listed, texts for text inputs).`,
|
|
4103
|
+
...lines,
|
|
4104
|
+
...input.search || input.family || input.category ? [] : ["", "Categories:", ...cats]
|
|
4105
|
+
].join("\n")
|
|
4106
|
+
};
|
|
4107
|
+
}
|
|
4108
|
+
async function effectRun(input, ctx) {
|
|
4109
|
+
const images = input.image_paths?.length ? await uploadLocalFiles(input.image_paths, ctx) : input.image_urls ?? [];
|
|
4110
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}/api/v1/effects/${encodeURIComponent(input.slug)}/run`, {
|
|
4111
|
+
method: "POST",
|
|
4112
|
+
headers: headers(ctx, "pixeldojo_effect"),
|
|
4113
|
+
body: JSON.stringify({
|
|
4114
|
+
images,
|
|
4115
|
+
...input.texts ? { texts: input.texts } : {},
|
|
4116
|
+
...input.family ? { family: input.family } : {},
|
|
4117
|
+
...input.engine ? { engine: input.engine } : {}
|
|
4118
|
+
})
|
|
4119
|
+
});
|
|
4120
|
+
const data = await res.json().catch(() => ({}));
|
|
4121
|
+
if (!res.ok || !data.jobId) {
|
|
4122
|
+
return { kind: "text", text: `Effect not started (nothing charged): ${data.error ?? `HTTP ${res.status}`}` };
|
|
4123
|
+
}
|
|
4124
|
+
const result = await pollJobUntilDoneOrHandoff(data.jobId, (id) => ctx.client.getJob(id), ctx.buildStatusUrl, {
|
|
4125
|
+
now: ctx.pollOverrides?.now,
|
|
4126
|
+
sleep: ctx.pollOverrides?.sleep
|
|
4127
|
+
});
|
|
4128
|
+
return pollResultToSkillResult(
|
|
4129
|
+
result,
|
|
4130
|
+
(urls) => urls.length === 0 ? `Job ${data.jobId} completed but returned no assets.` : `Done (${data.creditCost ?? "?"} credits). Asset: ${urls[0]}`
|
|
4131
|
+
);
|
|
4132
|
+
}
|
|
4133
|
+
var FAMILIES, ENGINES2, headers, ListSchema, effectsListSkill, RunSchema, runProperties, effectRunSkill;
|
|
4134
|
+
var init_effects = __esm({
|
|
4135
|
+
"src/skills/effects.ts"() {
|
|
4136
|
+
init_poll();
|
|
4137
|
+
init_upload_helpers();
|
|
4138
|
+
init_types();
|
|
4139
|
+
FAMILIES = ["video-effect", "photo-effect", "tool"];
|
|
4140
|
+
ENGINES2 = ["klein", "qwen"];
|
|
4141
|
+
headers = (ctx, skill) => ({
|
|
4142
|
+
Authorization: `Bearer ${ctx.apiKey}`,
|
|
4143
|
+
"Content-Type": "application/json",
|
|
4144
|
+
"x-pixeldojo-source": `mcp/${ctx.mcpVersion}`,
|
|
4145
|
+
"x-pixeldojo-skill": skill
|
|
4146
|
+
});
|
|
4147
|
+
ListSchema = z.object({
|
|
4148
|
+
search: z.string().max(200).optional(),
|
|
4149
|
+
family: z.enum(FAMILIES).optional(),
|
|
4150
|
+
category: z.string().max(60).optional(),
|
|
4151
|
+
limit: z.number().int().min(1).max(100).optional()
|
|
4152
|
+
});
|
|
4153
|
+
effectsListSkill = {
|
|
4154
|
+
name: "pixeldojo_effects",
|
|
4155
|
+
description: "List PixelDojo's one-click effects: 283 video effects (a photo or two in, a 5 s clip out: AI Hug, Earth Zoom In, AI Dance), 30 photo effects (a photo in, a styled image out: action figure, Ghibli style, sticker, aging filter) and one-job tools (remove a watermark, object or background, headshots, photo restoration, relight, logo, thumbnail and poster makers). Search by words, family or category; each result gives the slug, inputs and credit price. Free. Run one with pixeldojo_effect.",
|
|
4156
|
+
inputZod: ListSchema,
|
|
4157
|
+
inputJsonSchema: {
|
|
4158
|
+
type: "object",
|
|
4159
|
+
properties: {
|
|
4160
|
+
search: { type: "string", description: 'Words like "hug", "action figure", "ghibli", "remove background".' },
|
|
4161
|
+
family: {
|
|
4162
|
+
type: "string",
|
|
4163
|
+
enum: FAMILIES,
|
|
4164
|
+
description: "video-effect = photo to clip, photo-effect = photo to styled image, tool = one-job edit."
|
|
4165
|
+
},
|
|
4166
|
+
category: { type: "string", description: 'A category name from a previous listing, e.g. "Viral", "Toys & 3D".' },
|
|
4167
|
+
limit: { type: "integer", minimum: 1, maximum: 100, description: "Default 20." }
|
|
4168
|
+
}
|
|
4169
|
+
},
|
|
4170
|
+
allowedModels: [],
|
|
4171
|
+
defaultModel: "",
|
|
4172
|
+
run: listRun
|
|
4173
|
+
};
|
|
4174
|
+
RunSchema = z.object({
|
|
4175
|
+
slug: z.string().min(1).max(80),
|
|
4176
|
+
family: z.enum(FAMILIES).optional(),
|
|
4177
|
+
image_urls: z.array(z.string().url()).max(4).optional(),
|
|
4178
|
+
image_paths: z.array(z.string()).max(4).optional(),
|
|
4179
|
+
texts: z.array(z.string().max(200)).max(4).optional(),
|
|
4180
|
+
engine: z.enum(ENGINES2).optional()
|
|
4181
|
+
});
|
|
4182
|
+
runProperties = {
|
|
4183
|
+
slug: { type: "string", description: 'The effect slug from pixeldojo_effects, e.g. "ai-hug", "action-figure", "watermark-remover".' },
|
|
4184
|
+
family: {
|
|
4185
|
+
type: "string",
|
|
4186
|
+
enum: FAMILIES,
|
|
4187
|
+
description: "Needed only for action-figure, comic-book and red-carpet, which are both a video and a photo effect."
|
|
4188
|
+
},
|
|
4189
|
+
image_urls: {
|
|
4190
|
+
type: "array",
|
|
4191
|
+
items: { type: "string", format: "uri" },
|
|
4192
|
+
description: "The photos as https URLs, in the order the listing names them (most take one; duo effects take two)."
|
|
4193
|
+
},
|
|
4194
|
+
image_paths: {
|
|
4195
|
+
type: "array",
|
|
4196
|
+
items: { type: "string" },
|
|
4197
|
+
description: "Absolute local photo paths instead of image_urls; uploaded first (24h temp storage)."
|
|
4198
|
+
},
|
|
4199
|
+
texts: {
|
|
4200
|
+
type: "array",
|
|
4201
|
+
items: { type: "string" },
|
|
4202
|
+
description: "Text inputs in listing order, for entries that list them (object to remove, new background, brand name)."
|
|
4203
|
+
},
|
|
4204
|
+
engine: { type: "string", enum: ENGINES2, description: "Photo effects only: leave out for the default engine." }
|
|
4205
|
+
};
|
|
4206
|
+
effectRunSkill = {
|
|
4207
|
+
name: "pixeldojo_effect",
|
|
4208
|
+
description: "Run one of PixelDojo's one-click effects on your photos: the prompt is built in, so pass only the slug from pixeldojo_effects and the photos (image_urls, or image_paths for local files), plus texts for tools that ask for them. Video effects return a 5 s clip (usually handed off; poll with pixeldojo_status), photo effects and tools an image. Costs the credits the listing shows.",
|
|
4209
|
+
hostedDescription: "Run one of PixelDojo's one-click effects on your photos: the prompt is built in, so pass only the slug from pixeldojo_effects and the photos as https image_urls, plus texts for tools that ask for them. Video effects return a 5 s clip (usually handed off; poll with pixeldojo_status), photo effects and tools an image. Costs the credits the listing shows.",
|
|
4210
|
+
inputZod: RunSchema,
|
|
4211
|
+
inputJsonSchema: { type: "object", required: ["slug"], properties: runProperties },
|
|
4212
|
+
allowedModels: [],
|
|
4213
|
+
defaultModel: "",
|
|
4214
|
+
run: effectRun
|
|
4215
|
+
};
|
|
4216
|
+
}
|
|
4217
|
+
});
|
|
4218
|
+
async function call2(ctx, skill, path, init = {}) {
|
|
4219
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}${path}`, {
|
|
4220
|
+
method: init.method ?? "GET",
|
|
4221
|
+
headers: headers2(ctx, skill),
|
|
4222
|
+
...init.body !== void 0 ? { body: JSON.stringify(init.body) } : {}
|
|
4223
|
+
});
|
|
4224
|
+
const data = await res.json().catch(() => ({}));
|
|
4225
|
+
const err = data.error;
|
|
4226
|
+
return { ok: res.ok, data, error: typeof err === "string" ? err : err?.message ?? `HTTP ${res.status}` };
|
|
4227
|
+
}
|
|
4228
|
+
async function kitRun(input, ctx) {
|
|
4229
|
+
const path = "/api/v1/marketing/brand-kit";
|
|
4230
|
+
if (input.action === "import") {
|
|
4231
|
+
if (!input.url) return { kind: "text", text: "Pass url: the brand's website, like yourbrand.com." };
|
|
4232
|
+
const r2 = await call2(ctx, "pixeldojo_brand_kit", path, { method: "POST", body: { url: input.url, save: input.save } });
|
|
4233
|
+
if (!r2.ok) return { kind: "text", text: `Brand kit not imported: ${r2.error}` };
|
|
4234
|
+
return { kind: "text", text: `${r2.data.saved === false ? "Imported (not saved)." : "Imported and saved."}
|
|
4235
|
+
${describeKit(r2.data.brand_kit)}` };
|
|
4236
|
+
}
|
|
4237
|
+
if (input.action === "update") {
|
|
4238
|
+
const patch = {
|
|
4239
|
+
...input.name !== void 0 ? { name: input.name } : {},
|
|
4240
|
+
...input.tagline !== void 0 ? { tagline: input.tagline } : {},
|
|
4241
|
+
...input.voice !== void 0 ? { voice: input.voice } : {},
|
|
4242
|
+
...input.colors ? { colors: input.colors.map((c) => c.trim().toLowerCase()) } : {},
|
|
4243
|
+
...input.fonts ? { fonts: input.fonts } : {},
|
|
4244
|
+
...input.selling_points ? { sellingPoints: input.selling_points } : {},
|
|
4245
|
+
...input.logo_url ? { logoUrl: input.logo_url } : {}
|
|
4246
|
+
};
|
|
4247
|
+
const r2 = await call2(ctx, "pixeldojo_brand_kit", path, { method: "PATCH", body: patch });
|
|
4248
|
+
if (!r2.ok) return { kind: "text", text: `Brand kit not updated: ${r2.error}` };
|
|
4249
|
+
return { kind: "text", text: `Updated.
|
|
4250
|
+
${describeKit(r2.data.brand_kit)}` };
|
|
4251
|
+
}
|
|
4252
|
+
const r = await call2(ctx, "pixeldojo_brand_kit", path);
|
|
4253
|
+
if (!r.ok) return { kind: "text", text: `Could not read the brand kit: ${r.error}` };
|
|
4254
|
+
return { kind: "text", text: describeKit(r.data.brand_kit ?? null) };
|
|
4255
|
+
}
|
|
4256
|
+
async function templatesRun(input, ctx) {
|
|
4257
|
+
const q = new URLSearchParams();
|
|
4258
|
+
if (input.kind) q.set("kind", input.kind);
|
|
4259
|
+
if (input.category) q.set("category", input.category);
|
|
4260
|
+
const r = await call2(ctx, "pixeldojo_marketing", `/api/v1/marketing/templates?${q}`);
|
|
4261
|
+
if (!r.ok) return { kind: "text", text: `Could not list templates: ${r.error}` };
|
|
4262
|
+
const rows = r.data.templates ?? [];
|
|
4263
|
+
const lines = rows.map((t) => {
|
|
4264
|
+
const how = t.kind === "image" ? "action image" : t.kind === "motion" ? `action motion, fields ${t.fields?.join(", ")}, ${t.credits} credits` : "pixeldojo_ad style";
|
|
4265
|
+
return `- ${t.id} (${t.label}, ${t.category}): ${t.name}. ${how}. Example: ${t.preview ?? "none"}`;
|
|
4266
|
+
});
|
|
4267
|
+
const engines = r.data.image_engines ?? [];
|
|
4268
|
+
return {
|
|
4269
|
+
kind: "text",
|
|
4270
|
+
text: [
|
|
4271
|
+
`${rows.length} templates. Image templates run with action image (template = id), motion templates with action motion, video ad styles with pixeldojo_ad (style = id).`,
|
|
4272
|
+
...lines,
|
|
4273
|
+
"",
|
|
4274
|
+
`Image engines: ${engines.map((e) => `${e.id} ${e.credits_per_image} credits per image (${e.note})`).join("; ")}.`,
|
|
4275
|
+
...r.data.notes ?? []
|
|
4276
|
+
].join("\n")
|
|
4277
|
+
};
|
|
4278
|
+
}
|
|
4279
|
+
async function imageRun(input, ctx) {
|
|
4280
|
+
const local = input.product_image_paths?.length ? await uploadLocalFiles(input.product_image_paths, ctx) : [];
|
|
4281
|
+
const images = [...input.product_image_urls ?? [], ...local];
|
|
4282
|
+
if (!input.product_url && !(input.product_name && images.length)) {
|
|
4283
|
+
return { kind: "text", text: "Pass product_url, or product_name plus product_image_urls (or product_image_paths)." };
|
|
4284
|
+
}
|
|
4285
|
+
const r = await call2(ctx, "pixeldojo_marketing", "/api/v1/marketing/image", {
|
|
4286
|
+
method: "POST",
|
|
4287
|
+
body: {
|
|
4288
|
+
template: input.template,
|
|
4289
|
+
product_url: input.product_url,
|
|
4290
|
+
...!input.product_url ? { product: { name: input.product_name, description: input.product_description, images } } : {},
|
|
4291
|
+
character_images: input.character_image_urls,
|
|
4292
|
+
headline: input.headline,
|
|
4293
|
+
points: input.points,
|
|
4294
|
+
cta: input.cta,
|
|
4295
|
+
direction: input.direction,
|
|
4296
|
+
aspect_ratio: input.aspect_ratio,
|
|
4297
|
+
engine: input.engine,
|
|
4298
|
+
count: input.count,
|
|
4299
|
+
reference_ad_url: input.reference_ad_url,
|
|
4300
|
+
brand_kit: input.brand_kit
|
|
4301
|
+
}
|
|
4302
|
+
});
|
|
4303
|
+
if (!r.ok) return { kind: "text", text: `Images not started: ${r.error}` };
|
|
4304
|
+
const jobs = r.data.jobs ?? [];
|
|
4305
|
+
const polled = await Promise.all(
|
|
4306
|
+
jobs.map(
|
|
4307
|
+
(j) => pollJobUntilDoneOrHandoff(j.jobId, (id) => ctx.client.getJob(id), ctx.buildStatusUrl, {
|
|
4308
|
+
now: ctx.pollOverrides?.now,
|
|
4309
|
+
sleep: ctx.pollOverrides?.sleep
|
|
4310
|
+
})
|
|
4311
|
+
)
|
|
4312
|
+
);
|
|
4313
|
+
const urls = polled.flatMap((p) => p.kind === "completed" ? extractAssetUrls(p.job) : []);
|
|
4314
|
+
const pending = polled.filter((p) => p.kind === "handoff").map((p) => p.jobId);
|
|
4315
|
+
const failed = polled.filter((p) => p.kind === "failed").length;
|
|
4316
|
+
const credits = jobs.reduce((n, j) => n + (j.creditCost ?? 0), 0);
|
|
4317
|
+
const head = `${r.data.template} on ${r.data.engine}: ${urls.length} ready${pending.length ? `, ${pending.length} still rendering` : ""}${failed ? `, ${failed} failed (refunded)` : ""}${credits ? `, ${credits} credits` : ""}.`;
|
|
4318
|
+
if (pending.length === 1 && !urls.length) {
|
|
4319
|
+
return { kind: "handoff", text: `${head} Check it with pixeldojo_status.`, jobId: pending[0], statusUrl: ctx.buildStatusUrl(pending[0]) };
|
|
4320
|
+
}
|
|
4321
|
+
const tail = pending.length ? ` Still rendering: ${pending.join(", ")} (check each with pixeldojo_status).` : "";
|
|
4322
|
+
if (urls.length) return { kind: "assets", text: `${head}${tail}`, assetUrls: urls };
|
|
4323
|
+
return { kind: "text", text: `${head}${tail}` };
|
|
4324
|
+
}
|
|
4325
|
+
async function settleMotion(view, ctx) {
|
|
4326
|
+
const now = ctx.pollOverrides?.now ?? Date.now;
|
|
4327
|
+
const sleep = ctx.pollOverrides?.sleep ?? ((ms) => new Promise((res) => setTimeout(res, ms)));
|
|
4328
|
+
const until = now() + 7e4;
|
|
4329
|
+
let v = view;
|
|
4330
|
+
while (v.status === "processing" && now() < until) {
|
|
4331
|
+
await sleep(5e3);
|
|
4332
|
+
const r = await call2(ctx, "pixeldojo_marketing", `/api/v1/marketing/motion/${encodeURIComponent(v.id)}`);
|
|
4333
|
+
if (r.ok) v = r.data;
|
|
4334
|
+
}
|
|
4335
|
+
if (v.status === "completed" && v.video_url) {
|
|
4336
|
+
return { kind: "assets", text: `${v.template === "end-card" ? "End card added" : "Motion graphic rendered"} (${v.credits ?? "?"} credits). Video: ${v.video_url}`, assetUrls: [v.video_url] };
|
|
4337
|
+
}
|
|
4338
|
+
if (v.status === "failed") return { kind: "text", text: `Render failed, nothing charged: ${v.error}` };
|
|
4339
|
+
return {
|
|
4340
|
+
kind: "text",
|
|
4341
|
+
text: `Still rendering (${v.step}). Check it with pixeldojo_marketing action status motion_id ${v.id} in about 15 seconds.`,
|
|
4342
|
+
followUp: { input: { action: "status", motion_id: v.id }, afterSec: 15 }
|
|
4343
|
+
};
|
|
4344
|
+
}
|
|
4345
|
+
async function motionRun(input, ctx) {
|
|
4346
|
+
if (input.action === "status") {
|
|
4347
|
+
if (!input.motion_id) return { kind: "text", text: "Pass motion_id." };
|
|
4348
|
+
const r2 = await call2(ctx, "pixeldojo_marketing", `/api/v1/marketing/motion/${encodeURIComponent(input.motion_id)}`);
|
|
4349
|
+
if (!r2.ok) return { kind: "text", text: `Could not read that render: ${r2.error}` };
|
|
4350
|
+
return settleMotion(r2.data, ctx);
|
|
4351
|
+
}
|
|
4352
|
+
const endCard = input.action === "end_card";
|
|
4353
|
+
const product = input.product_image_urls?.[0] ?? (input.product_image_paths?.length ? (await uploadLocalFiles(input.product_image_paths.slice(0, 1), ctx))[0] : void 0);
|
|
4354
|
+
const r = await call2(ctx, "pixeldojo_marketing", "/api/v1/marketing/motion", {
|
|
4355
|
+
method: "POST",
|
|
4356
|
+
body: {
|
|
4357
|
+
template: endCard ? "end-card" : input.template,
|
|
4358
|
+
aspect_ratio: input.aspect_ratio === "4:5" ? "9:16" : input.aspect_ratio,
|
|
4359
|
+
headline: input.headline,
|
|
4360
|
+
points: input.points,
|
|
4361
|
+
cta: input.cta,
|
|
4362
|
+
stat: input.stat,
|
|
4363
|
+
stat_label: input.stat_label,
|
|
4364
|
+
price_was: input.price_was,
|
|
4365
|
+
price_now: input.price_now,
|
|
4366
|
+
product_image_url: product,
|
|
4367
|
+
video_url: input.video_url,
|
|
4368
|
+
brand_name: input.brand_name,
|
|
4369
|
+
colors: input.colors?.map((c) => c.trim().toLowerCase()),
|
|
4370
|
+
brand_kit: input.brand_kit
|
|
4371
|
+
}
|
|
4372
|
+
});
|
|
4373
|
+
if (!r.ok) return { kind: "text", text: `Not started: ${r.error}` };
|
|
4374
|
+
return settleMotion(r.data, ctx);
|
|
4375
|
+
}
|
|
4376
|
+
async function marketingRun(input, ctx) {
|
|
4377
|
+
if (input.action === "templates") return templatesRun(input, ctx);
|
|
4378
|
+
if (input.action === "image") return imageRun(input, ctx);
|
|
4379
|
+
return motionRun(input, ctx);
|
|
4380
|
+
}
|
|
4381
|
+
var headers2, KitSchema, describeKit, brandKitSkill, ACTIONS, MOTION, MarketingSchema, props, marketingSkill;
|
|
4382
|
+
var init_marketing = __esm({
|
|
4383
|
+
"src/skills/marketing.ts"() {
|
|
4384
|
+
init_poll();
|
|
4385
|
+
init_upload_helpers();
|
|
4386
|
+
init_types();
|
|
4387
|
+
headers2 = (ctx, skill) => ({
|
|
4388
|
+
Authorization: `Bearer ${ctx.apiKey}`,
|
|
4389
|
+
"Content-Type": "application/json",
|
|
4390
|
+
"x-pixeldojo-source": `mcp/${ctx.mcpVersion}`,
|
|
4391
|
+
"x-pixeldojo-skill": skill
|
|
4392
|
+
});
|
|
4393
|
+
KitSchema = z.object({
|
|
4394
|
+
action: z.enum(["get", "import", "update"]).optional(),
|
|
4395
|
+
url: z.string().max(2048).optional(),
|
|
4396
|
+
save: z.boolean().optional(),
|
|
4397
|
+
name: z.string().max(60).optional(),
|
|
4398
|
+
tagline: z.string().max(80).optional(),
|
|
4399
|
+
voice: z.string().max(240).optional(),
|
|
4400
|
+
colors: z.array(z.string()).max(5).optional(),
|
|
4401
|
+
fonts: z.array(z.string()).max(2).optional(),
|
|
4402
|
+
selling_points: z.array(z.string()).max(5).optional(),
|
|
4403
|
+
logo_url: z.string().url().optional()
|
|
4404
|
+
});
|
|
4405
|
+
describeKit = (k) => !k ? "No brand kit yet. Import one from the website with action import and url." : [
|
|
4406
|
+
`Brand kit: ${k.name || "(no name)"}${k.url ? ` (${k.url})` : ""}`,
|
|
4407
|
+
`Logo: ${k.logoUrl ?? "none (add logo_url, a PixelDojo upload)"}`,
|
|
4408
|
+
`Colors: ${k.colors.join(" ") || "none"}`,
|
|
4409
|
+
`Fonts: ${k.fonts.join(", ") || "none"}`,
|
|
4410
|
+
`Tagline: ${k.tagline || "none"}`,
|
|
4411
|
+
`Voice: ${k.voice || "none"}`,
|
|
4412
|
+
`Selling points: ${k.sellingPoints.join("; ") || "none"}`,
|
|
4413
|
+
"Every ad, campaign, image and motion template uses it unless that call passes brand_kit: false."
|
|
4414
|
+
].join("\n");
|
|
4415
|
+
brandKitSkill = {
|
|
4416
|
+
name: "pixeldojo_brand_kit",
|
|
4417
|
+
description: "The account's brand kit for Marketing Studio: logo, colors, fonts, voice, tagline and selling points. action import + url reads them from the brand's website (logo, palette and fonts from the page, the voice and claims from its words) and saves it; get shows it; update changes fields (colors as #RRGGBB, logo_url must be a PixelDojo upload). Free. Once set, every pixeldojo_ad, pixeldojo_campaign and pixeldojo_marketing call applies it automatically.",
|
|
4418
|
+
inputZod: KitSchema,
|
|
4419
|
+
inputJsonSchema: {
|
|
4420
|
+
type: "object",
|
|
4421
|
+
properties: {
|
|
4422
|
+
action: { type: "string", enum: ["get", "import", "update"], description: "Default get." },
|
|
4423
|
+
url: { type: "string", description: "import: the brand website, e.g. yourbrand.com." },
|
|
4424
|
+
save: { type: "boolean", description: "import: false returns the kit without saving it. Default true." },
|
|
4425
|
+
name: { type: "string" },
|
|
4426
|
+
tagline: { type: "string" },
|
|
4427
|
+
voice: { type: "string", description: "How the brand talks, one or two sentences." },
|
|
4428
|
+
colors: { type: "array", items: { type: "string" }, maxItems: 5, description: "#RRGGBB, lead color first." },
|
|
4429
|
+
fonts: { type: "array", items: { type: "string" }, maxItems: 2 },
|
|
4430
|
+
selling_points: { type: "array", items: { type: "string" }, maxItems: 5, description: "Short product claims, 2-7 words each." },
|
|
4431
|
+
logo_url: { type: "string", format: "uri", description: "A logo on PixelDojo (upload it first); PNG with transparency is best." }
|
|
4432
|
+
}
|
|
4433
|
+
},
|
|
4434
|
+
allowedModels: [],
|
|
4435
|
+
defaultModel: "",
|
|
4436
|
+
run: kitRun
|
|
4437
|
+
};
|
|
4438
|
+
ACTIONS = ["templates", "image", "motion", "end_card", "status"];
|
|
4439
|
+
MOTION = ["kinetic-headline", "feature-callouts", "count-up", "price-drop", "logo-sting"];
|
|
4440
|
+
MarketingSchema = z.object({
|
|
4441
|
+
action: z.enum(ACTIONS),
|
|
4442
|
+
kind: z.enum(["image", "motion", "video"]).optional(),
|
|
4443
|
+
category: z.string().max(40).optional(),
|
|
4444
|
+
template: z.string().max(60).optional(),
|
|
4445
|
+
product_url: z.string().url().optional(),
|
|
4446
|
+
product_name: z.string().max(200).optional(),
|
|
4447
|
+
product_description: z.string().max(2e3).optional(),
|
|
4448
|
+
product_image_urls: z.array(z.string().url()).max(5).optional(),
|
|
4449
|
+
product_image_paths: z.array(z.string()).max(5).optional(),
|
|
4450
|
+
character_image_urls: z.array(z.string().url()).max(2).optional(),
|
|
4451
|
+
headline: z.string().max(80).optional(),
|
|
4452
|
+
points: z.array(z.string().max(70)).max(3).optional(),
|
|
4453
|
+
cta: z.string().max(30).optional(),
|
|
4454
|
+
direction: z.string().max(1500).optional(),
|
|
4455
|
+
aspect_ratio: z.enum(["1:1", "4:5", "9:16", "16:9"]).optional(),
|
|
4456
|
+
engine: z.enum(["nano-banana-pro", "nano-banana-2-1", "ideogram-4-5"]).optional(),
|
|
4457
|
+
count: z.number().int().min(1).max(8).optional(),
|
|
4458
|
+
reference_ad_url: z.string().url().optional(),
|
|
4459
|
+
stat: z.string().max(16).optional(),
|
|
4460
|
+
stat_label: z.string().max(40).optional(),
|
|
4461
|
+
price_was: z.string().max(16).optional(),
|
|
4462
|
+
price_now: z.string().max(16).optional(),
|
|
4463
|
+
video_url: z.string().url().optional(),
|
|
4464
|
+
motion_id: z.string().max(80).optional(),
|
|
4465
|
+
brand_name: z.string().max(60).optional(),
|
|
4466
|
+
colors: z.array(z.string()).max(5).optional(),
|
|
4467
|
+
brand_kit: z.boolean().optional()
|
|
4468
|
+
});
|
|
4469
|
+
props = {
|
|
4470
|
+
action: {
|
|
4471
|
+
type: "string",
|
|
4472
|
+
enum: ACTIONS,
|
|
4473
|
+
description: "templates = free list (filter by kind, category). image = image template on a product. motion = code-rendered motion graphic. end_card = brand end card after a finished ad (video_url). status = check a motion render (motion_id)."
|
|
4474
|
+
},
|
|
4475
|
+
kind: { type: "string", enum: ["image", "motion", "video"], description: "templates: filter." },
|
|
4476
|
+
category: { type: "string", description: "templates: product-shot, motion, ugc, tiktok, ads, posters or marketplace." },
|
|
4477
|
+
template: {
|
|
4478
|
+
type: "string",
|
|
4479
|
+
description: `image: an image template id from templates (e.g. stacked-shout, pure-white, ice-float). motion: ${MOTION.join(", ")}.`
|
|
4480
|
+
},
|
|
4481
|
+
product_url: { type: "string", format: "uri", description: "image: product page; name, description and photos are read from it." },
|
|
4482
|
+
product_name: { type: "string" },
|
|
4483
|
+
product_description: { type: "string" },
|
|
4484
|
+
product_image_urls: { type: "array", items: { type: "string", format: "uri" }, maxItems: 5, description: "Product photos. motion uses the first, cut out automatically." },
|
|
4485
|
+
product_image_paths: { type: "array", items: { type: "string" }, maxItems: 5, description: "Local product photos instead of URLs; uploaded first." },
|
|
4486
|
+
character_image_urls: { type: "array", items: { type: "string", format: "uri" }, maxItems: 2, description: "image: your own character (e.g. from pixeldojo_library source characters) for templates with a person." },
|
|
4487
|
+
headline: { type: "string", description: "Exact words on the ad. Blank uses the brand kit tagline." },
|
|
4488
|
+
points: { type: "array", items: { type: "string" }, maxItems: 3, description: "Selling points on the ad. Blank uses the brand kit." },
|
|
4489
|
+
cta: { type: "string", description: 'Button text. Default "Shop now".' },
|
|
4490
|
+
direction: { type: "string", description: "image: extra art direction added to the template." },
|
|
4491
|
+
aspect_ratio: { type: "string", enum: ["1:1", "4:5", "9:16", "16:9"], description: "Default: the template's own (motion 9:16; 4:5 renders 9:16 there)." },
|
|
4492
|
+
engine: { type: "string", enum: ["nano-banana-pro", "nano-banana-2-1", "ideogram-4-5"], description: "image: default nano-banana-pro (4.5 credits); nano-banana-2-1 is 1.5; ideogram-4-5 2 for poster type." },
|
|
4493
|
+
count: { type: "integer", minimum: 1, maximum: 8, description: "image: how many (each charged)." },
|
|
4494
|
+
reference_ad_url: { type: "string", format: "uri", description: "image ad multiplier: an image ad to rebuild with this product and your words. For a video ad use pixeldojo_ad reference_video_url." },
|
|
4495
|
+
stat: { type: "string", description: 'count-up: the number, e.g. "10,000+", "4.9", "98%".' },
|
|
4496
|
+
stat_label: { type: "string", description: "count-up: what it counts." },
|
|
4497
|
+
price_was: { type: "string", description: 'price-drop: old price, e.g. "$140".' },
|
|
4498
|
+
price_now: { type: "string", description: 'price-drop: new price, e.g. "$98".' },
|
|
4499
|
+
video_url: { type: "string", format: "uri", description: "end_card: the finished ad (a PixelDojo result)." },
|
|
4500
|
+
motion_id: { type: "string", description: "status: the id a motion or end_card call returned." },
|
|
4501
|
+
brand_name: { type: "string", description: "motion: the brand shown when there is no logo. Default: the brand kit." },
|
|
4502
|
+
colors: { type: "array", items: { type: "string" }, maxItems: 5, description: "motion: #RRGGBB, lead color first. Default: the brand kit." },
|
|
4503
|
+
brand_kit: { type: "boolean", description: "false skips the brand kit for this call." }
|
|
4504
|
+
};
|
|
4505
|
+
marketingSkill = {
|
|
4506
|
+
name: "pixeldojo_marketing",
|
|
4507
|
+
description: "Marketing Studio templates beyond video ads. templates lists them free with real example outputs. image applies an image template to a product: static ads, product shots, posters, marketplace listings (pure white for Amazon/Shopify), UGC photos, headline spelled exactly, 1-8 at a time at the engine price; with reference_ad_url it rebuilds an existing ad with this product (ad multiplier). motion renders code-built motion graphics with exact words, brand colors and logo: kinetic-headline, feature-callouts, count-up, price-drop, logo-sting (2 credits each). end_card adds the brand logo, tagline and button after a finished video ad (1 credit per 30 s). The brand kit (pixeldojo_brand_kit) fills colors, logo, headline and selling points unless brand_kit: false.",
|
|
4508
|
+
inputZod: MarketingSchema,
|
|
4509
|
+
inputJsonSchema: { type: "object", required: ["action"], properties: props },
|
|
4510
|
+
allowedModels: [],
|
|
4511
|
+
defaultModel: "",
|
|
4512
|
+
run: marketingRun
|
|
4513
|
+
};
|
|
4514
|
+
}
|
|
4515
|
+
});
|
|
4516
|
+
async function pollToResult(jobId, ctx, successText) {
|
|
4517
|
+
const result = await pollJobUntilDoneOrHandoff(jobId, (id) => ctx.client.getJob(id), ctx.buildStatusUrl, {
|
|
4518
|
+
now: ctx.pollOverrides?.now,
|
|
4519
|
+
sleep: ctx.pollOverrides?.sleep
|
|
4520
|
+
});
|
|
4521
|
+
return pollResultToSkillResult(result, (urls) => urls.length === 0 ? `Job ${jobId} completed but returned no assets.` : successText(urls));
|
|
4522
|
+
}
|
|
4523
|
+
async function buildRun(input, ctx) {
|
|
4524
|
+
const doFetch = ctx.fetch ?? fetch;
|
|
4525
|
+
if (input.action === "traits") {
|
|
4526
|
+
const res2 = await doFetch(`${ctx.baseUrl}/api/v1/characters/build`, { headers: headers3(ctx, "pixeldojo_build_character") });
|
|
4527
|
+
const data2 = await res2.json().catch(() => ({}));
|
|
4528
|
+
if (!res2.ok || !data2.traits) return { kind: "text", text: `Could not list traits: ${data2.error ?? `HTTP ${res2.status}`}` };
|
|
4529
|
+
return {
|
|
4530
|
+
kind: "text",
|
|
4531
|
+
text: [
|
|
4532
|
+
`Build a character: pass picks as {"trait id": "option id"} (an array for traits you can pick several of), or randomize: true to fill the rest. ${data2.takes ?? 4} takes cost ${data2.credits ?? "?"} credits. Free to list.`,
|
|
4533
|
+
...data2.traits.map(
|
|
4534
|
+
(t) => `${t.id} (${t.label}${t.pick_up_to ? `, pick up to ${t.pick_up_to}` : ""}${t.people_only ? ", people only" : ""}): ${t.options.map((o) => o.id).join(", ")}`
|
|
4535
|
+
)
|
|
4536
|
+
].join("\n")
|
|
4537
|
+
};
|
|
4538
|
+
}
|
|
4539
|
+
const res = await doFetch(`${ctx.baseUrl}/api/v1/characters/build`, {
|
|
4540
|
+
method: "POST",
|
|
4541
|
+
headers: headers3(ctx, "pixeldojo_build_character"),
|
|
4542
|
+
body: JSON.stringify({
|
|
4543
|
+
...input.picks ? { picks: input.picks } : {},
|
|
4544
|
+
...input.randomize ? { randomize: true } : {},
|
|
4545
|
+
...input.details ? { details: input.details } : {},
|
|
4546
|
+
...input.takes ? { takes: input.takes } : {}
|
|
4547
|
+
})
|
|
4548
|
+
});
|
|
4549
|
+
const data = await res.json().catch(() => ({}));
|
|
4550
|
+
if (!res.ok || !data.jobId) {
|
|
4551
|
+
const err = typeof data.error === "string" ? data.error : data.error?.message;
|
|
4552
|
+
return { kind: "text", text: `Character not built (nothing charged): ${err ?? `HTTP ${res.status}`}` };
|
|
4553
|
+
}
|
|
4554
|
+
return pollToResult(
|
|
4555
|
+
data.jobId,
|
|
4556
|
+
ctx,
|
|
4557
|
+
(urls) => [
|
|
4558
|
+
`${urls.length} take${urls.length === 1 ? "" : "s"} of ${data.summary ?? "the character"} (${data.creditCost ?? "?"} credits):`,
|
|
4559
|
+
...urls.map((u, i) => `${i + 1}. ${u}`),
|
|
4560
|
+
`Show them to the user. To keep one, call pixeldojo_save_character with a name, image_urls: [that take] and description: "${data.summary ?? ""}" within the hour (outputs expire). It then works as @Name in any prompt and can perform with pixeldojo_perform.`
|
|
4561
|
+
].join("\n")
|
|
4562
|
+
);
|
|
4563
|
+
}
|
|
4564
|
+
async function performRun(input, ctx) {
|
|
4565
|
+
const doFetch = ctx.fetch ?? fetch;
|
|
4566
|
+
if (input.action === "list") {
|
|
4567
|
+
const res2 = await doFetch(`${ctx.baseUrl}/api/v1/characters/perform`, { headers: headers3(ctx, "pixeldojo_perform") });
|
|
4568
|
+
const data2 = await res2.json().catch(() => ({}));
|
|
4569
|
+
if (!res2.ok || !data2.presets) return { kind: "text", text: `Could not list presets: ${data2.error ?? `HTTP ${res2.status}`}` };
|
|
4570
|
+
return {
|
|
4571
|
+
kind: "text",
|
|
4572
|
+
text: [
|
|
4573
|
+
'Perform presets (a 5 s video of a saved character doing it). Run one with action "run", character and preset:',
|
|
4574
|
+
...data2.presets.map((p) => `- ${p.slug} (${p.group}, ${p.credits} credits): ${p.title}. ${p.tagline}`)
|
|
4575
|
+
].join("\n")
|
|
4576
|
+
};
|
|
4577
|
+
}
|
|
4578
|
+
if (!input.character || !input.preset) {
|
|
4579
|
+
return { kind: "text", text: `Pass character (a saved character's name or @Name) and preset (from action "list").` };
|
|
4580
|
+
}
|
|
4581
|
+
const res = await doFetch(`${ctx.baseUrl}/api/v1/characters/perform`, {
|
|
4582
|
+
method: "POST",
|
|
4583
|
+
headers: headers3(ctx, "pixeldojo_perform"),
|
|
4584
|
+
body: JSON.stringify({ character: input.character, preset: input.preset })
|
|
4585
|
+
});
|
|
4586
|
+
const data = await res.json().catch(() => ({}));
|
|
4587
|
+
if (!res.ok || !data.jobId) {
|
|
4588
|
+
const err = typeof data.error === "string" ? data.error : data.error?.message;
|
|
4589
|
+
return { kind: "text", text: `Not started (nothing charged): ${err ?? `HTTP ${res.status}`}` };
|
|
4590
|
+
}
|
|
4591
|
+
return pollToResult(data.jobId, ctx, (urls) => `${input.character} performed ${input.preset} (${data.creditCost ?? "?"} credits). Asset: ${urls[0]}`);
|
|
4592
|
+
}
|
|
4593
|
+
var headers3, BuildSchema, buildCharacterSkill, PerformSchema, performSkill;
|
|
4594
|
+
var init_character_builder = __esm({
|
|
4595
|
+
"src/skills/character-builder.ts"() {
|
|
4596
|
+
init_poll();
|
|
4597
|
+
init_types();
|
|
4598
|
+
headers3 = (ctx, skill) => ({
|
|
4599
|
+
Authorization: `Bearer ${ctx.apiKey}`,
|
|
4600
|
+
"Content-Type": "application/json",
|
|
4601
|
+
"x-pixeldojo-source": `mcp/${ctx.mcpVersion}`,
|
|
4602
|
+
"x-pixeldojo-skill": skill
|
|
4603
|
+
});
|
|
4604
|
+
BuildSchema = z.object({
|
|
4605
|
+
action: z.enum(["traits", "build"]),
|
|
4606
|
+
picks: z.record(z.union([z.string(), z.array(z.string())])).optional(),
|
|
4607
|
+
randomize: z.boolean().optional(),
|
|
4608
|
+
details: z.string().max(200).optional(),
|
|
4609
|
+
takes: z.number().int().min(1).max(4).optional()
|
|
4610
|
+
});
|
|
4611
|
+
buildCharacterSkill = {
|
|
4612
|
+
name: "pixeldojo_build_character",
|
|
4613
|
+
description: `Build an original AI character or influencer from traits instead of photos, like Character Studio's builder: type (realistic, bold or extreme caricature, anime, 3D, cat, dog, fox, frog, insect, robot...), gender, age (adults only), body, height, wild proportions (egg body, long limbs, tiny waist), head shape (gigachad, mega jaw), hair, face features, style and accessories. action "traits" (free) lists every trait and option id; action "build" renders up to 4 takes from picks (and/or randomize). Keep one with pixeldojo_save_character.`,
|
|
4614
|
+
inputZod: BuildSchema,
|
|
4615
|
+
inputJsonSchema: {
|
|
4616
|
+
type: "object",
|
|
4617
|
+
required: ["action"],
|
|
4618
|
+
properties: {
|
|
4619
|
+
action: { type: "string", enum: ["traits", "build"], description: "traits = list trait and option ids (free). build = render the takes (paid)." },
|
|
4620
|
+
picks: {
|
|
4621
|
+
type: "object",
|
|
4622
|
+
additionalProperties: { anyOf: [{ type: "string" }, { type: "array", items: { type: "string" } }] },
|
|
4623
|
+
description: 'build: {"trait id": "option id"}, e.g. {"type": "frog", "hair": "mullet", "hairColor": "blonde", "distinctive": ["gold-grill"], "style": "retro"}. Ids from action "traits"; labels work too.'
|
|
4624
|
+
},
|
|
4625
|
+
randomize: { type: "boolean", description: "build: fill every trait not in picks at random." },
|
|
4626
|
+
details: { type: "string", description: 'build: up to 200 characters of extra look, e.g. "freckles, gold hoops, a vintage denim jacket".' },
|
|
4627
|
+
takes: { type: "integer", minimum: 1, maximum: 4, description: "build: how many takes (default 4)." }
|
|
4628
|
+
}
|
|
4629
|
+
},
|
|
4630
|
+
allowedModels: [],
|
|
4631
|
+
defaultModel: "",
|
|
4632
|
+
run: buildRun
|
|
4633
|
+
};
|
|
4634
|
+
PerformSchema = z.object({
|
|
4635
|
+
action: z.enum(["list", "run"]),
|
|
4636
|
+
character: z.string().max(100).optional(),
|
|
4637
|
+
preset: z.string().max(80).optional()
|
|
4638
|
+
});
|
|
4639
|
+
performSkill = {
|
|
4640
|
+
name: "pixeldojo_perform",
|
|
4641
|
+
description: 'Make a saved Character Studio character perform: a dance, a trend or a star moment (AI Dance, Sassy Dance, Shoulder Shimmy, Hair Flip, Catwalk, Peace Wink, Red Carpet, Award Win...) as a share-ready 5 s video. action "list" (free) gives the presets and prices; action "run" takes character (name or @Name) and preset. Usually handed off; poll with pixeldojo_status.',
|
|
4642
|
+
inputZod: PerformSchema,
|
|
4643
|
+
inputJsonSchema: {
|
|
4644
|
+
type: "object",
|
|
4645
|
+
required: ["action"],
|
|
4646
|
+
properties: {
|
|
4647
|
+
action: { type: "string", enum: ["list", "run"], description: "list = presets with prices (free). run = make the video (paid)." },
|
|
4648
|
+
character: { type: "string", description: "run: the saved character's name or @Name (pixeldojo_library source=characters lists them)." },
|
|
4649
|
+
preset: { type: "string", description: 'run: a preset slug from action "list", e.g. "ai-dance", "shoulder-shimmy", "red-carpet".' }
|
|
4650
|
+
}
|
|
4651
|
+
},
|
|
4652
|
+
allowedModels: [],
|
|
4653
|
+
defaultModel: "",
|
|
4654
|
+
run: performRun
|
|
4655
|
+
};
|
|
4656
|
+
}
|
|
4657
|
+
});
|
|
3582
4658
|
function substitutePlaceholders(args, inputs, prevUrl) {
|
|
3583
4659
|
const missing = [];
|
|
3584
4660
|
const fill = (value) => {
|
|
@@ -3822,20 +4898,29 @@ __export(skills_exports, {
|
|
|
3822
4898
|
TOOL_ANNOTATIONS: () => TOOL_ANNOTATIONS,
|
|
3823
4899
|
adSkill: () => adSkill,
|
|
3824
4900
|
audioSkill: () => audioSkill,
|
|
4901
|
+
brandKitSkill: () => brandKitSkill,
|
|
4902
|
+
buildCharacterSkill: () => buildCharacterSkill,
|
|
3825
4903
|
campaignSkill: () => campaignSkill,
|
|
3826
4904
|
campaignStatusSkill: () => campaignStatusSkill,
|
|
3827
4905
|
captionSkill: () => captionSkill,
|
|
3828
4906
|
characterSkill: () => characterSkill,
|
|
4907
|
+
dramaSkill: () => dramaSkill,
|
|
3829
4908
|
editSkill: () => editSkill,
|
|
4909
|
+
effectRunSkill: () => effectRunSkill,
|
|
4910
|
+
effectsListSkill: () => effectsListSkill,
|
|
3830
4911
|
episodeSkill: () => episodeSkill,
|
|
3831
4912
|
filmSkill: () => filmSkill,
|
|
3832
4913
|
findHostedSkill: () => findHostedSkill,
|
|
3833
4914
|
findSkill: () => findSkill,
|
|
3834
4915
|
fromUrlSkill: () => fromUrlSkill,
|
|
3835
4916
|
generateSkill: () => generateSkill,
|
|
4917
|
+
kataSkill: () => kataSkill,
|
|
3836
4918
|
librarySkill: () => librarySkill,
|
|
3837
4919
|
listWorkflowsSkill: () => listWorkflowsSkill,
|
|
4920
|
+
marketingSkill: () => marketingSkill,
|
|
4921
|
+
musicVideoSkill: () => musicVideoSkill,
|
|
3838
4922
|
overlaySkill: () => overlaySkill,
|
|
4923
|
+
performSkill: () => performSkill,
|
|
3839
4924
|
runWorkflowSkill: () => runWorkflowSkill,
|
|
3840
4925
|
saveCharacterSkill: () => saveCharacterSkill,
|
|
3841
4926
|
saveSkill: () => saveSkill,
|
|
@@ -3880,6 +4965,9 @@ var init_skills = __esm({
|
|
|
3880
4965
|
init_film();
|
|
3881
4966
|
init_video();
|
|
3882
4967
|
init_episode();
|
|
4968
|
+
init_drama();
|
|
4969
|
+
init_music_video();
|
|
4970
|
+
init_kata();
|
|
3883
4971
|
init_ad();
|
|
3884
4972
|
init_campaign();
|
|
3885
4973
|
init_campaign_status();
|
|
@@ -3888,6 +4976,9 @@ var init_skills = __esm({
|
|
|
3888
4976
|
init_library();
|
|
3889
4977
|
init_save();
|
|
3890
4978
|
init_save_character();
|
|
4979
|
+
init_effects();
|
|
4980
|
+
init_marketing();
|
|
4981
|
+
init_character_builder();
|
|
3891
4982
|
init_workflows();
|
|
3892
4983
|
ALL_SKILLS = [
|
|
3893
4984
|
generateSkill,
|
|
@@ -3898,9 +4989,13 @@ var init_skills = __esm({
|
|
|
3898
4989
|
captionSkill,
|
|
3899
4990
|
overlaySkill,
|
|
3900
4991
|
audioSkill,
|
|
4992
|
+
effectsListSkill,
|
|
4993
|
+
effectRunSkill,
|
|
3901
4994
|
librarySkill,
|
|
3902
4995
|
saveSkill,
|
|
3903
4996
|
saveCharacterSkill,
|
|
4997
|
+
buildCharacterSkill,
|
|
4998
|
+
performSkill,
|
|
3904
4999
|
saveWorkflowSkill,
|
|
3905
5000
|
runWorkflowSkill,
|
|
3906
5001
|
listWorkflowsSkill,
|
|
@@ -3908,23 +5003,28 @@ var init_skills = __esm({
|
|
|
3908
5003
|
fromUrlSkill,
|
|
3909
5004
|
uploadSkill,
|
|
3910
5005
|
adSkill,
|
|
5006
|
+
brandKitSkill,
|
|
5007
|
+
marketingSkill,
|
|
3911
5008
|
campaignSkill,
|
|
3912
5009
|
campaignStatusSkill,
|
|
3913
5010
|
filmSkill,
|
|
3914
5011
|
videoSkill,
|
|
3915
|
-
episodeSkill
|
|
5012
|
+
episodeSkill,
|
|
5013
|
+
dramaSkill,
|
|
5014
|
+
musicVideoSkill,
|
|
5015
|
+
kataSkill
|
|
3916
5016
|
];
|
|
3917
5017
|
isLocalPathField = (key) => /_paths?$/.test(key);
|
|
3918
5018
|
HOSTED_SKILLS = ALL_SKILLS.filter(
|
|
3919
5019
|
(s) => s.name !== uploadSkill.name
|
|
3920
5020
|
).map((s) => {
|
|
3921
|
-
const
|
|
5021
|
+
const props2 = s.inputJsonSchema.properties ?? {};
|
|
3922
5022
|
return {
|
|
3923
5023
|
...s,
|
|
3924
5024
|
description: s.hostedDescription ?? s.description,
|
|
3925
5025
|
inputJsonSchema: {
|
|
3926
5026
|
...s.inputJsonSchema,
|
|
3927
|
-
properties: Object.fromEntries(Object.entries(
|
|
5027
|
+
properties: Object.fromEntries(Object.entries(props2).filter(([k]) => !isLocalPathField(k)))
|
|
3928
5028
|
}
|
|
3929
5029
|
};
|
|
3930
5030
|
});
|
|
@@ -3939,11 +5039,18 @@ var init_skills = __esm({
|
|
|
3939
5039
|
pixeldojo_caption: render("Caption video"),
|
|
3940
5040
|
pixeldojo_overlay: render("Add offer or end card"),
|
|
3941
5041
|
pixeldojo_audio: render("Generate music, speech or sound"),
|
|
5042
|
+
pixeldojo_effects: read("List one-click effects"),
|
|
5043
|
+
pixeldojo_effect: render("Run one-click effect"),
|
|
3942
5044
|
pixeldojo_video: render("Change, animate or extend video"),
|
|
3943
5045
|
pixeldojo_ad: render("Make video ad"),
|
|
5046
|
+
pixeldojo_brand_kit: render("Brand kit from website"),
|
|
5047
|
+
pixeldojo_marketing: render("Image ads, motion graphics and templates"),
|
|
3944
5048
|
pixeldojo_campaign: render("Make product launch campaign"),
|
|
3945
5049
|
pixeldojo_film: render("Make short film"),
|
|
3946
5050
|
pixeldojo_episode: render("Make faceless video"),
|
|
5051
|
+
pixeldojo_drama: render("Make micro-drama, short film or trailer"),
|
|
5052
|
+
pixeldojo_music_video: render("Make music video for a song"),
|
|
5053
|
+
pixeldojo_kata: render("Recreate an edit with your cast"),
|
|
3947
5054
|
pixeldojo_run_workflow: render("Run saved workflow"),
|
|
3948
5055
|
pixeldojo_upload: render("Upload local file"),
|
|
3949
5056
|
pixeldojo_save_workflow: { ...render("Save workflow"), destructiveHint: true },
|
|
@@ -3952,6 +5059,8 @@ var init_skills = __esm({
|
|
|
3952
5059
|
pixeldojo_library: read("Search media library"),
|
|
3953
5060
|
pixeldojo_save: render("Save to My Media"),
|
|
3954
5061
|
pixeldojo_save_character: render("Save character or element"),
|
|
5062
|
+
pixeldojo_build_character: render("Build AI character from traits"),
|
|
5063
|
+
pixeldojo_perform: render("Make character dance or do a trend"),
|
|
3955
5064
|
pixeldojo_list_workflows: read("List saved workflows"),
|
|
3956
5065
|
pixeldojo_from_url: { ...read("Read product page"), openWorldHint: true }
|
|
3957
5066
|
};
|
|
@@ -3961,10 +5070,10 @@ function makeAttributedClient(options) {
|
|
|
3961
5070
|
const { mcpVersion, skillName, baseFetch, ...sdkOptions } = options;
|
|
3962
5071
|
const real = baseFetch ?? globalThis.fetch.bind(globalThis);
|
|
3963
5072
|
const wrappedFetch = (input, init) => {
|
|
3964
|
-
const
|
|
3965
|
-
|
|
3966
|
-
if (skillName)
|
|
3967
|
-
return real(input, { ...init, headers });
|
|
5073
|
+
const headers4 = new Headers(init?.headers);
|
|
5074
|
+
headers4.set("x-pixeldojo-source", `mcp/${mcpVersion}`);
|
|
5075
|
+
if (skillName) headers4.set("x-pixeldojo-skill", skillName);
|
|
5076
|
+
return real(input, { ...init, headers: headers4 });
|
|
3968
5077
|
};
|
|
3969
5078
|
return new PixelDojoClient({
|
|
3970
5079
|
...sdkOptions,
|
|
@@ -4008,7 +5117,7 @@ function makeRedactedLogger(target = console) {
|
|
|
4008
5117
|
}
|
|
4009
5118
|
|
|
4010
5119
|
// src/server.ts
|
|
4011
|
-
var PACKAGE_VERSION = "0.
|
|
5120
|
+
var PACKAGE_VERSION = "0.30.0" ;
|
|
4012
5121
|
var SERVER_INSTRUCTIONS = "Pixel Dojo generates images, video, audio and short films from one catalog of AI models, billed in credits from the connected Pixel Dojo 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: pixeldojo_save keeps one in the user's My Media permanently (after a safety check), and finished films stay in the account library. In any prompt, @Name uses a character, product, outfit, location, prop or style the user saved in Character Studio: its photos are attached automatically. pixeldojo_library source=characters lists them, and pixeldojo_save_character saves a new one from 3 to 5 photos.";
|
|
4013
5122
|
function buildServer(options) {
|
|
4014
5123
|
if (!options.apiKey) {
|