@pixeldojo/mcp 0.26.0 → 0.31.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 +3 -1
- package/dist/cli.cjs +1062 -76
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1062 -76
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1062 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1062 -76
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -239,11 +239,11 @@ function nearestAspectFromEnum(requested, allowed) {
|
|
|
239
239
|
}
|
|
240
240
|
async function snapAspectRatio(apiId, requested, client, opts = {}) {
|
|
241
241
|
if (!requested) return void 0;
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
242
|
+
const props2 = await getFieldConstraints(apiId, client);
|
|
243
|
+
if (props2 === null) {
|
|
244
244
|
return opts.onUnknown === "omit" ? void 0 : requested;
|
|
245
245
|
}
|
|
246
|
-
const field =
|
|
246
|
+
const field = props2.aspect_ratio;
|
|
247
247
|
if (!field) return void 0;
|
|
248
248
|
if (!field.enum || field.enum.length === 0) return requested;
|
|
249
249
|
return nearestAspectFromEnum(requested, field.enum);
|
|
@@ -274,11 +274,11 @@ function resolutionHeight(value) {
|
|
|
274
274
|
}
|
|
275
275
|
async function snapResolution(apiId, requested, client, opts = {}) {
|
|
276
276
|
if (!requested) return void 0;
|
|
277
|
-
const
|
|
278
|
-
if (
|
|
277
|
+
const props2 = await getFieldConstraints(apiId, client);
|
|
278
|
+
if (props2 === null) {
|
|
279
279
|
return opts.onUnknown === "omit" ? void 0 : requested;
|
|
280
280
|
}
|
|
281
|
-
const field =
|
|
281
|
+
const field = props2.resolution;
|
|
282
282
|
if (!field) return void 0;
|
|
283
283
|
if (!field.enum || field.enum.length === 0) return requested;
|
|
284
284
|
if (field.enum.includes(requested)) return requested;
|
|
@@ -299,11 +299,11 @@ async function snapResolution(apiId, requested, client, opts = {}) {
|
|
|
299
299
|
}
|
|
300
300
|
async function snapDuration(apiId, requested, client, opts = {}) {
|
|
301
301
|
if (requested === void 0) return void 0;
|
|
302
|
-
const
|
|
303
|
-
if (
|
|
302
|
+
const props2 = await getFieldConstraints(apiId, client);
|
|
303
|
+
if (props2 === null) {
|
|
304
304
|
return opts.onUnknown === "omit" ? void 0 : requested;
|
|
305
305
|
}
|
|
306
|
-
const field =
|
|
306
|
+
const field = props2.duration;
|
|
307
307
|
if (!field) return void 0;
|
|
308
308
|
if (field.enum && field.enum.length > 0) {
|
|
309
309
|
const allowed = field.enum.map(Number).filter((n) => Number.isFinite(n));
|
|
@@ -331,11 +331,11 @@ async function resolveImageRefs(apiId, urls, client) {
|
|
|
331
331
|
if (urls.length === 0) return null;
|
|
332
332
|
const info = await getModelInfo(apiId, client);
|
|
333
333
|
if (info === null) return null;
|
|
334
|
-
const
|
|
335
|
-
const key = info.media ? info.media.image?.key : REF_KEYS.find((k) =>
|
|
334
|
+
const props2 = info.props;
|
|
335
|
+
const key = info.media ? info.media.image?.key : REF_KEYS.find((k) => props2[k] !== void 0);
|
|
336
336
|
if (!key) return null;
|
|
337
337
|
const also = info.media?.image?.also;
|
|
338
|
-
const field =
|
|
338
|
+
const field = props2[key] ?? {};
|
|
339
339
|
if (field.type === "array") {
|
|
340
340
|
const cap = typeof field.maxItems === "number" ? field.maxItems : urls.length;
|
|
341
341
|
const kept = urls.slice(0, Math.max(1, cap));
|
|
@@ -551,7 +551,7 @@ var init_generate = __esm({
|
|
|
551
551
|
InputSchema = zod.z.object({
|
|
552
552
|
prompt: zod.z.string().min(1).max(8e3).describe('Prompt describing what to generate. Write @Name to use a character or element the user saved in Character Studio ("@Mara on a beach"): its photos are attached automatically on models that take reference images. pixeldojo_library source=characters lists them.'),
|
|
553
553
|
model: zod.z.string().optional().describe(
|
|
554
|
-
`Model apiId. Recommended (the models the PixelDojo studios use): "seedream-5" for images (the default), "seedance-2-5" for video (prompt only or a starting image), "wan-3-0-video" for video the others refuse. Use another model only when the user names one. Full catalog: https://pixeldojo.ai/api/v1/models; one model's fields: https://pixeldojo.ai/llm/{apiId}.txt. Omit for seedream-5, which makes still images only; name a video model to get a video.`
|
|
554
|
+
`Model apiId. Recommended (the models the PixelDojo studios use): "seedream-5" for images (the default), "seedance-2-5" for video (prompt only or a starting image), "kling-4-0" for a whole scene up to 30 s written as a shot list (dialogue in quotes, exact on-screen text), "minimax-h3-turbo" for the cheapest video from a photo or up to 9 reference images (it needs at least one picture), "wan-3-0-video" for video the others refuse. Use another model only when the user names one. Full catalog: https://pixeldojo.ai/api/v1/models; one model's fields: https://pixeldojo.ai/llm/{apiId}.txt. Omit for seedream-5, which makes still images only; name a video model to get a video.`
|
|
555
555
|
),
|
|
556
556
|
preset: zod.z.string().optional().describe(
|
|
557
557
|
"Preset slug that seeds the running model's settings; explicit fields and params override it. Each preset belongs to one model (browse them by model at https://pixeldojo.ai/presets), so set `model` to that preset's model: a slug the running model has no preset for is rejected with a 400 before any charge."
|
|
@@ -590,7 +590,7 @@ var init_generate = __esm({
|
|
|
590
590
|
prompt: { type: "string", description: 'Prompt describing what to generate. Write @Name to use a character or element the user saved in Character Studio ("@Mara on a beach"): its photos are attached automatically on models that take reference images. pixeldojo_library source=characters lists them.' },
|
|
591
591
|
model: {
|
|
592
592
|
type: "string",
|
|
593
|
-
description: `Model apiId. Recommended (the models the PixelDojo studios use): "seedream-5" for images (the default), "seedance-2-5" for video (prompt only or a starting image), "wan-3-0-video" for video the others refuse. Use another model only when the user names one. Full catalog: https://pixeldojo.ai/api/v1/models; one model's fields: https://pixeldojo.ai/llm/{apiId}.txt. Omit for seedream-5, which makes still images only; name a video model to get a video.`
|
|
593
|
+
description: `Model apiId. Recommended (the models the PixelDojo studios use): "seedream-5" for images (the default), "seedance-2-5" for video (prompt only or a starting image), "kling-4-0" for a whole scene up to 30 s written as a shot list (dialogue in quotes, exact on-screen text), "minimax-h3-turbo" for the cheapest video from a photo or up to 9 reference images (it needs at least one picture), "wan-3-0-video" for video the others refuse. Use another model only when the user names one. Full catalog: https://pixeldojo.ai/api/v1/models; one model's fields: https://pixeldojo.ai/llm/{apiId}.txt. Omit for seedream-5, which makes still images only; name a video model to get a video.`
|
|
594
594
|
},
|
|
595
595
|
preset: {
|
|
596
596
|
type: "string",
|
|
@@ -638,8 +638,8 @@ var init_generate = __esm({
|
|
|
638
638
|
};
|
|
639
639
|
generateSkill = {
|
|
640
640
|
name: "pixeldojo_generate",
|
|
641
|
-
description: "Generate an image or video from a prompt with any model in the PixelDojo catalog. With no `model`, a prompt runs on seedream-5, which makes still images only. For a video, name seedance-2-5, which works from a prompt alone or a starting image. If a provider refuses the content, retry once on wan-3-0-video (video) or seedream-5 (images), the least-restricted models. For a multi-shot film or a music video synced to a song use pixeldojo_film; to change, move or extend an existing clip use pixeldojo_video. These are the models the PixelDojo studios use; name another only when the user asks for it. References: `image_url`/`image_urls` for stills, `video_url` for a source clip, `image_path`/`image_paths` for absolute local files (uploaded to 24h temp storage first). A clip or an audio track URL with no `model` runs on seedance-2-reference; a named model that cannot read a clip is swapped for it and the result says so, while a named model with no audio input drops the track. Model-specific settings go in `params` alongside an explicit `model`. Returns asset URLs, or a jobId for pixeldojo_status when the job outlasts the 30s wait.",
|
|
642
|
-
hostedDescription: "Generate an image or video from a prompt with any model in the PixelDojo catalog. With no `model`, a prompt runs on seedream-5, which makes still images only. For a video, name seedance-2-5, which works from a prompt alone or a starting image. If a provider refuses the content, retry once on wan-3-0-video (video) or seedream-5 (images), the least-restricted models. For a multi-shot film or a music video synced to a song use pixeldojo_film; to change, move or extend an existing clip use pixeldojo_video. These are the models the PixelDojo studios use; name another only when the user asks for it. References: `image_url`/`image_urls` for stills and `video_url` for a source clip, all public http(s) URLs. A clip or an audio track URL with no `model` runs on seedance-2-reference; a named model that cannot read a clip is swapped for it and the result says so, while a named model with no audio input drops the track. Model-specific settings go in `params` alongside an explicit `model`. Returns asset URLs, or a jobId for pixeldojo_status when the job outlasts the 30s wait.",
|
|
641
|
+
description: "Generate an image or video from a prompt with any model in the PixelDojo catalog. With no `model`, a prompt runs on seedream-5, which makes still images only. For a video, name seedance-2-5, which works from a prompt alone or a starting image; kling-4-0 for a multi-shot scene up to 30 s with dialogue; minimax-h3-turbo for the lowest price when you have a photo or reference images (it refuses a prompt alone). If a provider refuses the content, retry once on wan-3-0-video (video) or seedream-5 (images), the least-restricted models. For a multi-shot film or a music video synced to a song use pixeldojo_film; to change, move or extend an existing clip use pixeldojo_video. These are the models the PixelDojo studios use; name another only when the user asks for it. References: `image_url`/`image_urls` for stills, `video_url` for a source clip, `image_path`/`image_paths` for absolute local files (uploaded to 24h temp storage first). A clip or an audio track URL with no `model` runs on seedance-2-reference; a named model that cannot read a clip is swapped for it and the result says so, while a named model with no audio input drops the track. Model-specific settings go in `params` alongside an explicit `model`. Returns asset URLs, or a jobId for pixeldojo_status when the job outlasts the 30s wait.",
|
|
642
|
+
hostedDescription: "Generate an image or video from a prompt with any model in the PixelDojo catalog. With no `model`, a prompt runs on seedream-5, which makes still images only. For a video, name seedance-2-5, which works from a prompt alone or a starting image; kling-4-0 for a multi-shot scene up to 30 s with dialogue; minimax-h3-turbo for the lowest price when you have a photo or reference images (it refuses a prompt alone). If a provider refuses the content, retry once on wan-3-0-video (video) or seedream-5 (images), the least-restricted models. For a multi-shot film or a music video synced to a song use pixeldojo_film; to change, move or extend an existing clip use pixeldojo_video. These are the models the PixelDojo studios use; name another only when the user asks for it. References: `image_url`/`image_urls` for stills and `video_url` for a source clip, all public http(s) URLs. A clip or an audio track URL with no `model` runs on seedance-2-reference; a named model that cannot read a clip is swapped for it and the result says so, while a named model with no audio input drops the track. Model-specific settings go in `params` alongside an explicit `model`. Returns asset URLs, or a jobId for pixeldojo_status when the job outlasts the 30s wait.",
|
|
643
643
|
inputZod: InputSchema,
|
|
644
644
|
inputJsonSchema: InputJsonSchema,
|
|
645
645
|
allowedModels: null,
|
|
@@ -1053,6 +1053,8 @@ var init_storyboard = __esm({
|
|
|
1053
1053
|
ALLOWED2 = [
|
|
1054
1054
|
"veo-3.1-fast",
|
|
1055
1055
|
"veo-3.1-standard",
|
|
1056
|
+
// Kling 4.0 (2026-10-24): a brief written as a shot list renders as one clip, up to 30 s.
|
|
1057
|
+
"kling-4-0",
|
|
1056
1058
|
"kling-video-v3-standard-text",
|
|
1057
1059
|
"seedance-2-high",
|
|
1058
1060
|
VIDEO_REFERENCE_MODEL
|
|
@@ -1673,7 +1675,7 @@ function needsSave(url) {
|
|
|
1673
1675
|
return Boolean(url && url.startsWith("https://temp.pixeldojo.ai/"));
|
|
1674
1676
|
}
|
|
1675
1677
|
async function filmApi(ctx, method, path, body) {
|
|
1676
|
-
const res = await fetch(`${ctx.baseUrl}${path}`, {
|
|
1678
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}${path}`, {
|
|
1677
1679
|
method,
|
|
1678
1680
|
headers: {
|
|
1679
1681
|
Authorization: `Bearer ${ctx.apiKey}`,
|
|
@@ -2255,7 +2257,7 @@ var STORY_LOOKS, MUSIC_VIDEO_LOOKS, LOOKS, InputSchema10, InputJsonSchema10, sho
|
|
|
2255
2257
|
var init_film = __esm({
|
|
2256
2258
|
"src/skills/film.ts"() {
|
|
2257
2259
|
init_upload_helpers();
|
|
2258
|
-
STORY_LOOKS = ["live-action", "anime", "3d-animation", "noir", "horror", "sci-fi", "documentary", "western", "romance", "romantic-comedy", "comedy"];
|
|
2260
|
+
STORY_LOOKS = ["live-action", "action", "anime", "3d-animation", "noir", "horror", "sci-fi", "documentary", "western", "romance", "romantic-comedy", "comedy"];
|
|
2259
2261
|
MUSIC_VIDEO_LOOKS = ["rap-video", "neon-club", "stage-performance", "retro-camcorder", "y2k-pop", "moody-rnb", "rock-grit", "dream-pop", "k-pop"];
|
|
2260
2262
|
LOOKS = [...STORY_LOOKS, ...MUSIC_VIDEO_LOOKS];
|
|
2261
2263
|
InputSchema10 = zod.z.object({
|
|
@@ -2444,6 +2446,27 @@ function buildVideoPayload(verb, apiId, i) {
|
|
|
2444
2446
|
return { body: { prompt, video_url: i.videoUrl, video_duration: vd }, note: droppedImages };
|
|
2445
2447
|
case "happyhorse-1.0-video-edit":
|
|
2446
2448
|
return { body: { prompt, video_url: i.videoUrl, video_duration: vd, reference_urls: i.images } };
|
|
2449
|
+
case "kling-4-0":
|
|
2450
|
+
return {
|
|
2451
|
+
body: {
|
|
2452
|
+
prompt: /@video\s*1/i.test(prompt) ? prompt : `Edit @Video1: ${prompt}`,
|
|
2453
|
+
video: i.videoUrl,
|
|
2454
|
+
reference_images: i.images,
|
|
2455
|
+
duration: clamp(Math.ceil(vd), 3, 30),
|
|
2456
|
+
resolution: "1080p"
|
|
2457
|
+
}
|
|
2458
|
+
};
|
|
2459
|
+
case "minimax-h3-turbo":
|
|
2460
|
+
return {
|
|
2461
|
+
body: {
|
|
2462
|
+
prompt: `Recreate <Video 1> exactly: the same people, the same motion and timing, the same camera move and framing, with one change: ${prompt}`,
|
|
2463
|
+
reference_videos: [i.videoUrl],
|
|
2464
|
+
reference_video_audio: true,
|
|
2465
|
+
resolution: "720p",
|
|
2466
|
+
duration: clamp(Math.ceil(vd ?? 5), 5, 15)
|
|
2467
|
+
},
|
|
2468
|
+
note: droppedImages
|
|
2469
|
+
};
|
|
2447
2470
|
default:
|
|
2448
2471
|
return { body: { prompt, video_url: i.videoUrl, video_duration: vd, image_urls: i.images } };
|
|
2449
2472
|
}
|
|
@@ -2572,6 +2595,8 @@ var init_video = __esm({
|
|
|
2572
2595
|
"seedance-2-5-video-edit",
|
|
2573
2596
|
"flux-video-edit",
|
|
2574
2597
|
"kling-video-edit",
|
|
2598
|
+
"kling-4-0",
|
|
2599
|
+
"minimax-h3-turbo",
|
|
2575
2600
|
"wan-video-edit",
|
|
2576
2601
|
"seedance-video-edit",
|
|
2577
2602
|
"happyhorse-1.0-video-edit",
|
|
@@ -2591,9 +2616,10 @@ var init_video = __esm({
|
|
|
2591
2616
|
"happyhorse-1.0-video-edit",
|
|
2592
2617
|
"xai-video-edit",
|
|
2593
2618
|
"kling-motion-control",
|
|
2594
|
-
"wan-video-character-swap"
|
|
2619
|
+
"wan-video-character-swap",
|
|
2620
|
+
"kling-4-0"
|
|
2595
2621
|
]);
|
|
2596
|
-
NO_IMAGE_ENGINES = /* @__PURE__ */ new Set(["flux-video-edit", "xai-video-edit"]);
|
|
2622
|
+
NO_IMAGE_ENGINES = /* @__PURE__ */ new Set(["flux-video-edit", "xai-video-edit", "minimax-h3-turbo"]);
|
|
2597
2623
|
InputSchema11 = zod.z.object({
|
|
2598
2624
|
verb: zod.z.enum(VERBS),
|
|
2599
2625
|
prompt: zod.z.string().max(8e3).optional(),
|
|
@@ -2679,7 +2705,7 @@ var init_video = __esm({
|
|
|
2679
2705
|
}
|
|
2680
2706
|
});
|
|
2681
2707
|
async function episodeApi(ctx, method, path, body) {
|
|
2682
|
-
const res = await fetch(`${ctx.baseUrl}/api/faceless-studio/episodes${path}`, {
|
|
2708
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}/api/faceless-studio/episodes${path}`, {
|
|
2683
2709
|
method,
|
|
2684
2710
|
headers: {
|
|
2685
2711
|
Authorization: `Bearer ${ctx.apiKey}`,
|
|
@@ -2919,6 +2945,487 @@ var init_episode = __esm({
|
|
|
2919
2945
|
};
|
|
2920
2946
|
}
|
|
2921
2947
|
});
|
|
2948
|
+
async function dramaApi(ctx, method, path, body) {
|
|
2949
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}/api/v1/drama${path}`, {
|
|
2950
|
+
method,
|
|
2951
|
+
headers: {
|
|
2952
|
+
Authorization: `Bearer ${ctx.apiKey}`,
|
|
2953
|
+
"Content-Type": "application/json",
|
|
2954
|
+
"x-pixeldojo-source": `mcp/${ctx.mcpVersion}`,
|
|
2955
|
+
"x-pixeldojo-skill": "drama"
|
|
2956
|
+
},
|
|
2957
|
+
...body !== void 0 ? { body: JSON.stringify(body) } : {}
|
|
2958
|
+
});
|
|
2959
|
+
const data = await res.json().catch(() => ({}));
|
|
2960
|
+
return { status: res.status, data };
|
|
2961
|
+
}
|
|
2962
|
+
function describeDrama(v, o = DRAMA_OPTS) {
|
|
2963
|
+
const id = v.id;
|
|
2964
|
+
const stubborn = Array.from(new Set(v.retaken.filter((b, i, all) => all.indexOf(b) !== i)));
|
|
2965
|
+
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.` : "";
|
|
2966
|
+
const next2 = (action) => `${o.tool} with {"${o.idField}": "${id}", "action": "${action}"}`;
|
|
2967
|
+
const music = o.unit === "section";
|
|
2968
|
+
const what = music ? "music video" : "episode";
|
|
2969
|
+
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".` : ""}` };
|
|
2970
|
+
if (v.status === "quote") {
|
|
2971
|
+
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).`;
|
|
2972
|
+
return {
|
|
2973
|
+
kind: "text",
|
|
2974
|
+
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")
|
|
2975
|
+
};
|
|
2976
|
+
}
|
|
2977
|
+
const gist = (note) => {
|
|
2978
|
+
const first = note.split(/(?<=\.) /)[0];
|
|
2979
|
+
return first.length > 160 ? `${first.slice(0, 157).trimEnd()}...` : first;
|
|
2980
|
+
};
|
|
2981
|
+
const rewrites = (b) => {
|
|
2982
|
+
const shots2 = Array.from(new Set(Array.from((b.redo_films ?? "").matchAll(/Shot (\d+) \(/g), (m) => m[1])));
|
|
2983
|
+
return shots2.length ? ` (the redo rewrites shot${shots2.length > 1 ? "s" : ""} ${shots2.join(", ")})` : "";
|
|
2984
|
+
};
|
|
2985
|
+
if (v.status === "notes") {
|
|
2986
|
+
const flagged = v.beats.filter((b) => b.note && (b.needs_redo ?? true));
|
|
2987
|
+
const other = v.beats.filter((b) => b.note && b.needs_redo === false);
|
|
2988
|
+
return {
|
|
2989
|
+
kind: "text",
|
|
2990
|
+
text: [
|
|
2991
|
+
`Every ${o.unit} is filmed. Before the cut, the review flagged ${o.unit}s ${flagged.map((b) => b.beat).join(", ")}:`,
|
|
2992
|
+
...flagged.map((b) => `- ${o.unit} ${b.beat}: ${gist(b.note)}${rewrites(b)}`),
|
|
2993
|
+
other.length ? `Also noted, no redo needed: ${other.map((b) => `${o.unit} ${b.beat}: ${gist(b.note)}`).join(" ")}` : "",
|
|
2994
|
+
simplify,
|
|
2995
|
+
`Show these to the user and ask which they want: redo those ${o.unit}s with the review's fixes (${o.tool} with {"${o.idField}": "${id}", "action": "redo", "beats": [${flagged.map((b) => b.beat).join(", ")}]}, no notes needed, each at its own price; add notes only for the user's own changes), or cut it as it is (action "cut", free). Nothing more is filmed until they choose.`
|
|
2996
|
+
].filter(Boolean).join("\n")
|
|
2997
|
+
};
|
|
2998
|
+
}
|
|
2999
|
+
if (v.status === "done" && v.final_url) {
|
|
3000
|
+
const redo = v.beats.filter((b) => (b.note || b.missing_lines.length) && (b.needs_redo ?? true));
|
|
3001
|
+
const notes = redo.map((b) => `${o.unit} ${b.beat}: ${b.note ? gist(b.note) : `did not say ${b.missing_lines.map((l) => `"${l}"`).join(", ")}`}`);
|
|
3002
|
+
const other = v.beats.filter((b) => b.note && b.needs_redo === false).map((b) => `${o.unit} ${b.beat}: ${gist(b.note)}`);
|
|
3003
|
+
return {
|
|
3004
|
+
kind: "assets",
|
|
3005
|
+
text: [
|
|
3006
|
+
`"${v.title}" is finished and saved to the Library: ${v.final_url}`,
|
|
3007
|
+
v.retaken.length ? `Filmed again: ${o.unit} ${v.retaken.join(", ")}.` : "",
|
|
3008
|
+
notes.length ? `Review notes: ${notes.join("; ")}. Offer a redo of those ${o.unit}s (action "redo" with beats and notes).` : "",
|
|
3009
|
+
other.length ? `Also noted, no redo needed: ${other.join("; ")}.` : "",
|
|
3010
|
+
simplify
|
|
3011
|
+
].filter(Boolean).join("\n"),
|
|
3012
|
+
assetUrls: [v.final_url]
|
|
3013
|
+
};
|
|
3014
|
+
}
|
|
3015
|
+
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;
|
|
3016
|
+
const ready = v.beats.filter((b) => b.url).length;
|
|
3017
|
+
const total = v.beats.length || (music ? v.sections?.length ?? 0 : 5);
|
|
3018
|
+
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.filming_note ? ` (your note: ${gist(b.filming_note)})` : b.missing_lines.length ? ` (it dropped the line "${b.missing_lines[0]}")` : b.note ? ` (the review asked: ${gist(b.note)})` : ""}`);
|
|
3019
|
+
return {
|
|
3020
|
+
kind: "text",
|
|
3021
|
+
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.`,
|
|
3022
|
+
followUp: { input: { action: "status", [o.idField]: id }, afterSec: v.status === "scripting" ? 20 : 45 }
|
|
3023
|
+
};
|
|
3024
|
+
}
|
|
3025
|
+
async function waitForPlan2(ctx, id) {
|
|
3026
|
+
const sleep = ctx.pollOverrides?.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
3027
|
+
let last = await dramaApi(ctx, "GET", `/${id}`);
|
|
3028
|
+
for (let i = 0; i < 8 && last.data.status === "scripting"; i += 1) {
|
|
3029
|
+
await sleep(3e3);
|
|
3030
|
+
last = await dramaApi(ctx, "GET", `/${id}`);
|
|
3031
|
+
}
|
|
3032
|
+
return last;
|
|
3033
|
+
}
|
|
3034
|
+
var KINDS, LOOKS2, STORY_TYPES, InputSchema13, InputJsonSchema13, errorText, STEP, DRAMA_OPTS, dramaSkill;
|
|
3035
|
+
var init_drama = __esm({
|
|
3036
|
+
"src/skills/drama.ts"() {
|
|
3037
|
+
KINDS = ["micro-drama", "short-film", "trailer"];
|
|
3038
|
+
LOOKS2 = ["live-action", "action", "anime", "3d-animation", "noir", "horror", "sci-fi", "documentary", "western", "romance", "romantic-comedy", "comedy"];
|
|
3039
|
+
STORY_TYPES = ["billionaire", "werewolf", "mafia", "revenge", "secret-identity", "vampire", "second-chance"];
|
|
3040
|
+
InputSchema13 = zod.z.object({
|
|
3041
|
+
action: zod.z.enum(["create", "produce", "status", "redo", "cut"]).default("create"),
|
|
3042
|
+
idea: zod.z.string().min(8).max(1500).optional(),
|
|
3043
|
+
format: zod.z.enum(["9:16", "16:9"]).default("9:16"),
|
|
3044
|
+
mature: zod.z.boolean().optional(),
|
|
3045
|
+
kind: zod.z.enum(KINDS).default("micro-drama"),
|
|
3046
|
+
look: zod.z.enum(LOOKS2).optional(),
|
|
3047
|
+
story_type: zod.z.enum(STORY_TYPES).optional(),
|
|
3048
|
+
title_card: zod.z.boolean().optional(),
|
|
3049
|
+
name_tags: zod.z.boolean().optional(),
|
|
3050
|
+
end_screen: zod.z.boolean().optional(),
|
|
3051
|
+
end_text: zod.z.string().max(60).optional(),
|
|
3052
|
+
brand_color: zod.z.string().regex(/^#[0-9a-fA-F]{6}$/).optional(),
|
|
3053
|
+
logo_url: zod.z.string().url().optional(),
|
|
3054
|
+
cast: zod.z.array(zod.z.object({ name: zod.z.string().min(1).max(40), image_url: zod.z.string().url() })).max(5).optional(),
|
|
3055
|
+
scenes: zod.z.number().int().min(1).max(15).optional(),
|
|
3056
|
+
score: zod.z.boolean().optional(),
|
|
3057
|
+
drama_id: zod.z.string().max(60).optional(),
|
|
3058
|
+
beats: zod.z.array(zod.z.number().int().min(1).max(15)).min(1).max(15).optional(),
|
|
3059
|
+
notes: zod.z.array(zod.z.string().max(300)).max(15).optional()
|
|
3060
|
+
});
|
|
3061
|
+
InputJsonSchema13 = {
|
|
3062
|
+
type: "object",
|
|
3063
|
+
properties: {
|
|
3064
|
+
action: {
|
|
3065
|
+
type: "string",
|
|
3066
|
+
enum: ["create", "produce", "status", "redo", "cut"],
|
|
3067
|
+
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."
|
|
3068
|
+
},
|
|
3069
|
+
idea: { type: "string", description: "Create: the story in a line or two (who, the conflict, the twist)." },
|
|
3070
|
+
format: { type: "string", enum: ["9:16", "16:9"], description: "Create: vertical 9:16 (default) or widescreen 16:9." },
|
|
3071
|
+
mature: { type: "boolean", description: "Create: true for adult work (the server also detects it from the idea). Runs on the less-restricted engines." },
|
|
3072
|
+
kind: {
|
|
3073
|
+
type: "string",
|
|
3074
|
+
enum: [...KINDS],
|
|
3075
|
+
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)."
|
|
3076
|
+
},
|
|
3077
|
+
look: { type: "string", enum: [...LOOKS2], description: "Create (optional): the visual style and genre. Default live-action (a micro-drama story type brings its own)." },
|
|
3078
|
+
story_type: {
|
|
3079
|
+
type: "string",
|
|
3080
|
+
enum: [...STORY_TYPES],
|
|
3081
|
+
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."
|
|
3082
|
+
},
|
|
3083
|
+
title_card: { type: "boolean", description: "Create: the episode title over the opening hook. Default on." },
|
|
3084
|
+
name_tags: { type: "boolean", description: "Create: a name and role tag the first time each character speaks. Default on." },
|
|
3085
|
+
end_screen: { type: "boolean", description: 'Create: a 3.5-second "To be continued" end screen after the last line. Default on.' },
|
|
3086
|
+
end_text: { type: "string", description: `Create: the end screen's line, up to 60 characters. Default "Episode 2 coming soon".` },
|
|
3087
|
+
brand_color: { type: "string", description: "Create: accent colour for the graphics, #RRGGBB. Default a warm gold." },
|
|
3088
|
+
logo_url: { type: "string", description: "Create: a logo on the PixelDojo CDN for the end screen." },
|
|
3089
|
+
cast: {
|
|
3090
|
+
type: "array",
|
|
3091
|
+
items: {
|
|
3092
|
+
type: "object",
|
|
3093
|
+
properties: {
|
|
3094
|
+
name: { type: "string", description: "The character's name as the story uses it." },
|
|
3095
|
+
image_url: { type: "string", description: "A clear front-facing portrait on the PixelDojo CDN." }
|
|
3096
|
+
},
|
|
3097
|
+
required: ["name", "image_url"]
|
|
3098
|
+
},
|
|
3099
|
+
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."
|
|
3100
|
+
},
|
|
3101
|
+
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)." },
|
|
3102
|
+
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)." },
|
|
3103
|
+
drama_id: { type: "string", description: "From create. Required for produce, status and redo." },
|
|
3104
|
+
beats: { type: "array", items: { type: "integer", minimum: 1, maximum: 15 }, description: "Redo: the beat numbers to film again." },
|
|
3105
|
+
notes: { type: "array", items: { type: "string" }, description: "Redo (optional): what to fix in each of those beats, in the same order." }
|
|
3106
|
+
}
|
|
3107
|
+
};
|
|
3108
|
+
errorText = (d, status2) => (typeof d.error === "string" ? d.error : d.error?.message) ?? `HTTP ${status2}`;
|
|
3109
|
+
STEP = {
|
|
3110
|
+
scripting: "writing the episode",
|
|
3111
|
+
keyframes: "making the cast portraits and the location",
|
|
3112
|
+
shots: "filming the beats",
|
|
3113
|
+
cutting: "cutting the episode"
|
|
3114
|
+
};
|
|
3115
|
+
DRAMA_OPTS = { tool: "pixeldojo_drama", idField: "drama_id", unit: "beat" };
|
|
3116
|
+
dramaSkill = {
|
|
3117
|
+
name: "pixeldojo_drama",
|
|
3118
|
+
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).",
|
|
3119
|
+
inputZod: InputSchema13,
|
|
3120
|
+
inputJsonSchema: InputJsonSchema13,
|
|
3121
|
+
allowedModels: ["seedance-2-5", "seedream-4"],
|
|
3122
|
+
defaultModel: "seedance-2-5",
|
|
3123
|
+
async run(input, ctx) {
|
|
3124
|
+
if (input.action === "create") {
|
|
3125
|
+
if (!input.idea?.trim()) return { kind: "text", text: "Provide an `idea` (a line or two) to plan an episode." };
|
|
3126
|
+
const created = await dramaApi(ctx, "POST", "", {
|
|
3127
|
+
idea: input.idea.trim(),
|
|
3128
|
+
format: input.format,
|
|
3129
|
+
kind: input.kind,
|
|
3130
|
+
...input.mature ? { mature: true } : {},
|
|
3131
|
+
...input.look ? { look: input.look } : {},
|
|
3132
|
+
...input.story_type ? { story_type: input.story_type } : {},
|
|
3133
|
+
...input.scenes ? { scenes: input.scenes } : {},
|
|
3134
|
+
...input.score === false ? { score: false } : {},
|
|
3135
|
+
...Object.fromEntries(
|
|
3136
|
+
["title_card", "name_tags", "end_screen", "end_text", "brand_color", "logo_url"].filter((k) => input[k] !== void 0).map((k) => [k, input[k]])
|
|
3137
|
+
),
|
|
3138
|
+
...input.cast?.length ? { cast: input.cast } : {},
|
|
3139
|
+
// Stop before the cut when the review flags a scene: the user decides, not the agent.
|
|
3140
|
+
review: true
|
|
3141
|
+
});
|
|
3142
|
+
if (!created.data.id) return { kind: "text", text: `Could not start the episode: ${errorText(created.data, created.status)}` };
|
|
3143
|
+
const planned = await waitForPlan2(ctx, created.data.id);
|
|
3144
|
+
return describeDrama(planned.data);
|
|
3145
|
+
}
|
|
3146
|
+
if (!input.drama_id) return { kind: "text", text: `${input.action} needs drama_id (from create).` };
|
|
3147
|
+
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;
|
|
3148
|
+
if (!res) return { kind: "text", text: "redo needs beats (the beat numbers to film again)." };
|
|
3149
|
+
if (!res.data.id) return { kind: "text", text: errorText(res.data, res.status) };
|
|
3150
|
+
return describeDrama(res.data);
|
|
3151
|
+
}
|
|
3152
|
+
};
|
|
3153
|
+
}
|
|
3154
|
+
});
|
|
3155
|
+
async function api(ctx, method, path, body) {
|
|
3156
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}/api/v1/music-video${path}`, {
|
|
3157
|
+
method,
|
|
3158
|
+
headers: {
|
|
3159
|
+
Authorization: `Bearer ${ctx.apiKey}`,
|
|
3160
|
+
"Content-Type": "application/json",
|
|
3161
|
+
"x-pixeldojo-source": `mcp/${ctx.mcpVersion}`,
|
|
3162
|
+
"x-pixeldojo-skill": "music_video"
|
|
3163
|
+
},
|
|
3164
|
+
...body !== void 0 ? { body: JSON.stringify(body) } : {}
|
|
3165
|
+
});
|
|
3166
|
+
return { status: res.status, data: await res.json().catch(() => ({})) };
|
|
3167
|
+
}
|
|
3168
|
+
var MUSIC_LOOKS, InputSchema14, InputJsonSchema14, errorText2, describe, musicVideoSkill;
|
|
3169
|
+
var init_music_video = __esm({
|
|
3170
|
+
"src/skills/music-video.ts"() {
|
|
3171
|
+
init_drama();
|
|
3172
|
+
MUSIC_LOOKS = [
|
|
3173
|
+
"live-action",
|
|
3174
|
+
"action",
|
|
3175
|
+
"anime",
|
|
3176
|
+
"3d-animation",
|
|
3177
|
+
"noir",
|
|
3178
|
+
"horror",
|
|
3179
|
+
"sci-fi",
|
|
3180
|
+
"documentary",
|
|
3181
|
+
"western",
|
|
3182
|
+
"romance",
|
|
3183
|
+
"romantic-comedy",
|
|
3184
|
+
"comedy",
|
|
3185
|
+
"rap-video",
|
|
3186
|
+
"neon-club",
|
|
3187
|
+
"stage-performance",
|
|
3188
|
+
"retro-camcorder",
|
|
3189
|
+
"y2k-pop",
|
|
3190
|
+
"moody-rnb",
|
|
3191
|
+
"rock-grit",
|
|
3192
|
+
"dream-pop",
|
|
3193
|
+
"k-pop"
|
|
3194
|
+
];
|
|
3195
|
+
InputSchema14 = zod.z.object({
|
|
3196
|
+
action: zod.z.enum(["create", "produce", "status", "redo"]).default("create"),
|
|
3197
|
+
song_url: zod.z.string().url().optional(),
|
|
3198
|
+
idea: zod.z.string().min(8).max(1500).optional(),
|
|
3199
|
+
format: zod.z.enum(["9:16", "16:9"]).default("9:16"),
|
|
3200
|
+
mature: zod.z.boolean().optional(),
|
|
3201
|
+
look: zod.z.enum(MUSIC_LOOKS).optional(),
|
|
3202
|
+
start_sec: zod.z.number().min(0).optional(),
|
|
3203
|
+
length_sec: zod.z.number().int().min(10).max(60).optional(),
|
|
3204
|
+
artist: zod.z.string().max(60).optional(),
|
|
3205
|
+
song_title: zod.z.string().max(80).optional(),
|
|
3206
|
+
title_card: zod.z.boolean().optional(),
|
|
3207
|
+
end_screen: zod.z.boolean().optional(),
|
|
3208
|
+
end_text: zod.z.string().max(60).optional(),
|
|
3209
|
+
cast: zod.z.array(zod.z.object({ name: zod.z.string().min(1).max(40), image_url: zod.z.string().url() })).max(3).optional(),
|
|
3210
|
+
music_video_id: zod.z.string().max(60).optional(),
|
|
3211
|
+
beats: zod.z.array(zod.z.number().int().min(1).max(12)).min(1).max(12).optional(),
|
|
3212
|
+
notes: zod.z.array(zod.z.string().max(300)).max(12).optional()
|
|
3213
|
+
});
|
|
3214
|
+
InputJsonSchema14 = {
|
|
3215
|
+
type: "object",
|
|
3216
|
+
properties: {
|
|
3217
|
+
action: {
|
|
3218
|
+
type: "string",
|
|
3219
|
+
enum: ["create", "produce", "status", "redo"],
|
|
3220
|
+
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."
|
|
3221
|
+
},
|
|
3222
|
+
song_url: { type: "string", description: "Create: the song on the PixelDojo CDN (attach or upload it first)." },
|
|
3223
|
+
idea: { type: "string", description: "Create: the story or performance concept in a line or two." },
|
|
3224
|
+
format: { type: "string", enum: ["9:16", "16:9"], description: "Create: vertical 9:16 (default) or widescreen 16:9." },
|
|
3225
|
+
mature: { type: "boolean", description: "Create: true for adult work (the server also detects it from the idea). Runs on the less-restricted engines." },
|
|
3226
|
+
look: { type: "string", enum: [...MUSIC_LOOKS], description: "Create (optional): the visual style, e.g. neon-club, rap-video, stage-performance, retro-camcorder, k-pop." },
|
|
3227
|
+
start_sec: { type: "number", description: "Create (optional): where in the song to start, in seconds. Default 0." },
|
|
3228
|
+
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." },
|
|
3229
|
+
artist: { type: "string", description: "Create (optional): the artist name for the title card." },
|
|
3230
|
+
song_title: { type: "string", description: "Create (optional): the song title for the title card." },
|
|
3231
|
+
title_card: { type: "boolean", description: "Create: the song title over the opening. Default on." },
|
|
3232
|
+
end_screen: { type: "boolean", description: "Create: an end screen after the song. Default off." },
|
|
3233
|
+
end_text: { type: "string", description: "Create: the end screen's line, up to 60 characters." },
|
|
3234
|
+
cast: {
|
|
3235
|
+
type: "array",
|
|
3236
|
+
items: {
|
|
3237
|
+
type: "object",
|
|
3238
|
+
properties: {
|
|
3239
|
+
name: { type: "string", description: "The character's name; the first one is the performer." },
|
|
3240
|
+
image_url: { type: "string", description: "A clear front-facing portrait on the PixelDojo CDN." }
|
|
3241
|
+
},
|
|
3242
|
+
required: ["name", "image_url"]
|
|
3243
|
+
},
|
|
3244
|
+
description: "Create (optional): up to 3 characters, the performer first, each with a portrait on the PixelDojo CDN."
|
|
3245
|
+
},
|
|
3246
|
+
music_video_id: { type: "string", description: "From create. Required for produce, status and redo." },
|
|
3247
|
+
beats: { type: "array", items: { type: "integer", minimum: 1 }, description: "Redo: the section numbers to film again." },
|
|
3248
|
+
notes: { type: "array", items: { type: "string" }, description: "Redo (optional): what to fix in each of those sections, in the same order." }
|
|
3249
|
+
}
|
|
3250
|
+
};
|
|
3251
|
+
errorText2 = (d, status2) => (typeof d.error === "string" ? d.error : d.error?.message) ?? `HTTP ${status2}`;
|
|
3252
|
+
describe = (v) => describeDrama(v, { tool: "pixeldojo_music_video", idField: "music_video_id", unit: "section" });
|
|
3253
|
+
musicVideoSkill = {
|
|
3254
|
+
name: "pixeldojo_music_video",
|
|
3255
|
+
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).",
|
|
3256
|
+
inputZod: InputSchema14,
|
|
3257
|
+
inputJsonSchema: InputJsonSchema14,
|
|
3258
|
+
allowedModels: ["p-video-2-pro-reference", "seedream-4"],
|
|
3259
|
+
defaultModel: "p-video-2-pro-reference",
|
|
3260
|
+
async run(input, ctx) {
|
|
3261
|
+
if (input.action === "create") {
|
|
3262
|
+
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." };
|
|
3263
|
+
const { action: _a, music_video_id: _m, beats: _b, notes: _n, ...rest } = input;
|
|
3264
|
+
const created = await api(ctx, "POST", "", { ...Object.fromEntries(Object.entries(rest).filter(([, v]) => v !== void 0)), idea: input.idea.trim() });
|
|
3265
|
+
if (!created.data.id) return { kind: "text", text: `Could not start the music video: ${errorText2(created.data, created.status)}` };
|
|
3266
|
+
const sleep = ctx.pollOverrides?.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
3267
|
+
let last = await api(ctx, "GET", `/${created.data.id}`);
|
|
3268
|
+
for (let i = 0; i < 8 && last.data.status === "scripting"; i += 1) {
|
|
3269
|
+
await sleep(3e3);
|
|
3270
|
+
last = await api(ctx, "GET", `/${created.data.id}`);
|
|
3271
|
+
}
|
|
3272
|
+
return describe(last.data);
|
|
3273
|
+
}
|
|
3274
|
+
if (!input.music_video_id) return { kind: "text", text: `${input.action} needs music_video_id (from create).` };
|
|
3275
|
+
const id = input.music_video_id;
|
|
3276
|
+
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;
|
|
3277
|
+
if (!res) return { kind: "text", text: "redo needs beats (the section numbers to film again)." };
|
|
3278
|
+
if (!res.data.id) return { kind: "text", text: errorText2(res.data, res.status) };
|
|
3279
|
+
return describe(res.data);
|
|
3280
|
+
}
|
|
3281
|
+
};
|
|
3282
|
+
}
|
|
3283
|
+
});
|
|
3284
|
+
async function kataApi(ctx, method, path, body) {
|
|
3285
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}/api/v1/kata${path}`, {
|
|
3286
|
+
method,
|
|
3287
|
+
headers: {
|
|
3288
|
+
Authorization: `Bearer ${ctx.apiKey}`,
|
|
3289
|
+
"Content-Type": "application/json",
|
|
3290
|
+
"x-pixeldojo-source": `mcp/${ctx.mcpVersion}`,
|
|
3291
|
+
"x-pixeldojo-skill": "kata"
|
|
3292
|
+
},
|
|
3293
|
+
...body !== void 0 ? { body: JSON.stringify(body) } : {}
|
|
3294
|
+
});
|
|
3295
|
+
const data = await res.json().catch(() => ({}));
|
|
3296
|
+
return { status: res.status, data };
|
|
3297
|
+
}
|
|
3298
|
+
function describeKata(v) {
|
|
3299
|
+
const next2 = (action) => `pixeldojo_kata with {"kata_id": "${v.id}", "action": "${action}"}`;
|
|
3300
|
+
if (v.status === "failed") return { kind: "text", text: `The Kata stopped: ${v.error ?? "unknown error"}. Anything that failed was refunded.` };
|
|
3301
|
+
if (v.status === "quote") {
|
|
3302
|
+
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)}` : ""}`);
|
|
3303
|
+
const words = v.shots.filter((s) => s.text).map((s) => `${s.from.toFixed(1)}s "${s.text}"`);
|
|
3304
|
+
return {
|
|
3305
|
+
kind: "text",
|
|
3306
|
+
text: [
|
|
3307
|
+
`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:`,
|
|
3308
|
+
...scenes,
|
|
3309
|
+
words.length ? `On screen: ${words.join(", ")}.` : "",
|
|
3310
|
+
`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.)`
|
|
3311
|
+
].filter(Boolean).join("\n")
|
|
3312
|
+
};
|
|
3313
|
+
}
|
|
3314
|
+
if (v.status === "done" && v.final_url) {
|
|
3315
|
+
return { kind: "assets", text: `"${v.title}" is finished and saved to the Library: ${v.final_url}`, assetUrls: [v.final_url] };
|
|
3316
|
+
}
|
|
3317
|
+
return {
|
|
3318
|
+
kind: "text",
|
|
3319
|
+
text: `Still ${STEP2[v.status] ?? v.status}. It takes about 5 to 15 minutes in all. Call ${next2("status")} in about a minute.`,
|
|
3320
|
+
followUp: { input: { action: "status", kata_id: v.id }, afterSec: v.status === "analyzing" || v.status === "scripting" ? 20 : 45 }
|
|
3321
|
+
};
|
|
3322
|
+
}
|
|
3323
|
+
async function waitForPlan3(ctx, id) {
|
|
3324
|
+
const sleep = ctx.pollOverrides?.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
3325
|
+
let last = await kataApi(ctx, "GET", `/${id}`);
|
|
3326
|
+
for (let i = 0; i < 10 && (last.data.status === "analyzing" || last.data.status === "scripting"); i += 1) {
|
|
3327
|
+
await sleep(4e3);
|
|
3328
|
+
last = await kataApi(ctx, "GET", `/${id}`);
|
|
3329
|
+
}
|
|
3330
|
+
return last;
|
|
3331
|
+
}
|
|
3332
|
+
var InputSchema15, InputJsonSchema15, errorText3, STEP2, KIND, kataSkill;
|
|
3333
|
+
var init_kata = __esm({
|
|
3334
|
+
"src/skills/kata.ts"() {
|
|
3335
|
+
InputSchema15 = zod.z.object({
|
|
3336
|
+
action: zod.z.enum(["create", "produce", "status", "presets"]).default("create"),
|
|
3337
|
+
reference_url: zod.z.string().url().optional(),
|
|
3338
|
+
preset: zod.z.string().max(80).optional(),
|
|
3339
|
+
cast: zod.z.array(zod.z.object({ name: zod.z.string().min(1).max(40), image_url: zod.z.string().url().optional(), description: zod.z.string().max(200).optional() })).max(3).optional(),
|
|
3340
|
+
photos: zod.z.array(zod.z.object({ url: zod.z.string().url(), note: zod.z.string().max(80).optional() })).max(4).optional(),
|
|
3341
|
+
instructions: zod.z.string().max(1500).optional(),
|
|
3342
|
+
look: zod.z.string().max(80).optional(),
|
|
3343
|
+
kata_id: zod.z.string().max(60).optional()
|
|
3344
|
+
});
|
|
3345
|
+
InputJsonSchema15 = {
|
|
3346
|
+
type: "object",
|
|
3347
|
+
properties: {
|
|
3348
|
+
action: {
|
|
3349
|
+
type: "string",
|
|
3350
|
+
enum: ["create", "produce", "status", "presets"],
|
|
3351
|
+
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."
|
|
3352
|
+
},
|
|
3353
|
+
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." },
|
|
3354
|
+
preset: { type: "string", description: 'Create: a Kata library preset slug (from action "presets") instead of a reference.' },
|
|
3355
|
+
cast: {
|
|
3356
|
+
type: "array",
|
|
3357
|
+
items: {
|
|
3358
|
+
type: "object",
|
|
3359
|
+
properties: {
|
|
3360
|
+
name: { type: "string", description: "Their name. Without image_url, the saved Character Studio character of that name." },
|
|
3361
|
+
image_url: { type: "string", description: "A clear photo of them on the PixelDojo CDN." },
|
|
3362
|
+
description: { type: "string", description: "Optional: who they are, in a few words." }
|
|
3363
|
+
},
|
|
3364
|
+
required: ["name"]
|
|
3365
|
+
},
|
|
3366
|
+
description: 'Create: up to 3 people who replace the people in the edit. Use saved characters by name (pixeldojo_library source "characters").'
|
|
3367
|
+
},
|
|
3368
|
+
photos: {
|
|
3369
|
+
type: "array",
|
|
3370
|
+
items: { type: "object", properties: { url: { type: "string", description: "Public URL of the photo." }, note: { type: "string", description: 'What it is (e.g. "the product").' } }, required: ["url"] },
|
|
3371
|
+
description: "Create: up to 4 products or photos to put in the edit, on the PixelDojo CDN."
|
|
3372
|
+
},
|
|
3373
|
+
instructions: { type: "string", description: "Create (optional): what to change, e.g. the setting, the words on screen, where the product goes." },
|
|
3374
|
+
look: { type: "string", description: 'Create (optional): style transfer, one look for every new shot, e.g. "hand-drawn anime".' },
|
|
3375
|
+
kata_id: { type: "string", description: "From create. Required for produce and status." }
|
|
3376
|
+
}
|
|
3377
|
+
};
|
|
3378
|
+
errorText3 = (d, status2) => d.message ?? (typeof d.error === "string" ? d.error : d.error?.message) ?? `HTTP ${status2}`;
|
|
3379
|
+
STEP2 = {
|
|
3380
|
+
analyzing: "reading the edit cut by cut",
|
|
3381
|
+
scripting: "planning the remake",
|
|
3382
|
+
music: "scoring a new track on the same tempo",
|
|
3383
|
+
beats: "finding the beat",
|
|
3384
|
+
keyframes: "making the keyframes",
|
|
3385
|
+
animating: "filming the shots",
|
|
3386
|
+
cutting: "cutting it where the reference cuts",
|
|
3387
|
+
rendering: "setting the words and transitions",
|
|
3388
|
+
reviewing: "checking the final cut"
|
|
3389
|
+
};
|
|
3390
|
+
KIND = { clip: "new shot", still: "still", swap: "motion transfer", photo: "your photo" };
|
|
3391
|
+
kataSkill = {
|
|
3392
|
+
name: "pixeldojo_kata",
|
|
3393
|
+
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.`,
|
|
3394
|
+
inputZod: InputSchema15,
|
|
3395
|
+
inputJsonSchema: InputJsonSchema15,
|
|
3396
|
+
allowedModels: ["seedance-2-5", "google-nano-banana", "kling-motion-control"],
|
|
3397
|
+
defaultModel: "seedance-2-5",
|
|
3398
|
+
async run(input, ctx) {
|
|
3399
|
+
if (input.action === "presets") {
|
|
3400
|
+
const res2 = await kataApi(ctx, "GET", "/presets");
|
|
3401
|
+
const list = res2.data.presets ?? [];
|
|
3402
|
+
if (!list.length) return { kind: "text", text: "The Kata library is empty right now. Recreate any edit with a reference_url." };
|
|
3403
|
+
return {
|
|
3404
|
+
kind: "text",
|
|
3405
|
+
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")
|
|
3406
|
+
};
|
|
3407
|
+
}
|
|
3408
|
+
if (input.action === "create") {
|
|
3409
|
+
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".' };
|
|
3410
|
+
const created = await kataApi(ctx, "POST", "", {
|
|
3411
|
+
...input.preset ? { preset: input.preset } : { reference_url: input.reference_url },
|
|
3412
|
+
...input.cast?.length ? { cast: input.cast } : {},
|
|
3413
|
+
...input.photos?.length ? { photos: input.photos } : {},
|
|
3414
|
+
...input.instructions ? { instructions: input.instructions } : {},
|
|
3415
|
+
...input.look ? { look: input.look } : {}
|
|
3416
|
+
});
|
|
3417
|
+
if (!created.data.id) return { kind: "text", text: `Could not start the Kata: ${errorText3(created.data, created.status)}` };
|
|
3418
|
+
const planned = await waitForPlan3(ctx, created.data.id);
|
|
3419
|
+
return describeKata(planned.data);
|
|
3420
|
+
}
|
|
3421
|
+
if (!input.kata_id) return { kind: "text", text: `${input.action} needs kata_id (from create).` };
|
|
3422
|
+
const res = input.action === "status" ? await kataApi(ctx, "GET", `/${input.kata_id}`) : await kataApi(ctx, "POST", `/${input.kata_id}`, { action: "produce" });
|
|
3423
|
+
if (!res.data.id) return { kind: "text", text: errorText3(res.data, res.status) };
|
|
3424
|
+
return describeKata(res.data);
|
|
3425
|
+
}
|
|
3426
|
+
};
|
|
3427
|
+
}
|
|
3428
|
+
});
|
|
2922
3429
|
async function run13(input, ctx) {
|
|
2923
3430
|
const productImages = [
|
|
2924
3431
|
...input.product_image_urls ?? [],
|
|
@@ -2943,7 +3450,9 @@ async function run13(input, ctx) {
|
|
|
2943
3450
|
quality: input.quality,
|
|
2944
3451
|
resolution: input.resolution,
|
|
2945
3452
|
aspect_ratio: input.aspect_ratio,
|
|
2946
|
-
duration: input.duration
|
|
3453
|
+
duration: input.duration,
|
|
3454
|
+
reference_video_url: input.reference_video_url,
|
|
3455
|
+
brand_kit: input.brand_kit
|
|
2947
3456
|
};
|
|
2948
3457
|
const client = ctx.client;
|
|
2949
3458
|
const submitted = await client.runAd(body);
|
|
@@ -2959,16 +3468,16 @@ async function run13(input, ctx) {
|
|
|
2959
3468
|
const styleLabel = submitted.ad?.style ?? input.style ?? "ugc-testimonial";
|
|
2960
3469
|
return pollResultToSkillResult(
|
|
2961
3470
|
result,
|
|
2962
|
-
(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]}
|
|
3471
|
+
(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.`
|
|
2963
3472
|
);
|
|
2964
3473
|
}
|
|
2965
|
-
var
|
|
3474
|
+
var InputSchema16, InputJsonSchema16, adSkill;
|
|
2966
3475
|
var init_ad = __esm({
|
|
2967
3476
|
"src/skills/ad.ts"() {
|
|
2968
3477
|
init_types();
|
|
2969
3478
|
init_poll();
|
|
2970
3479
|
init_upload_helpers();
|
|
2971
|
-
|
|
3480
|
+
InputSchema16 = zod.z.object({
|
|
2972
3481
|
style: zod.z.string().max(80).optional().describe(
|
|
2973
3482
|
"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."
|
|
2974
3483
|
),
|
|
@@ -2986,7 +3495,9 @@ var init_ad = __esm({
|
|
|
2986
3495
|
quality: zod.z.enum(["mini", "fast", "high"]).optional(),
|
|
2987
3496
|
resolution: zod.z.enum(["480p", "720p", "1080p", "4k"]).optional().describe('1080p/4k require quality "high".'),
|
|
2988
3497
|
aspect_ratio: zod.z.enum(["16:9", "4:3", "1:1", "3:4", "9:16", "21:9"]).optional(),
|
|
2989
|
-
duration: zod.z.number().int().min(4).max(15).optional()
|
|
3498
|
+
duration: zod.z.number().int().min(4).max(15).optional(),
|
|
3499
|
+
reference_video_url: zod.z.string().url().optional(),
|
|
3500
|
+
brand_kit: zod.z.boolean().optional()
|
|
2990
3501
|
}).refine(
|
|
2991
3502
|
(v) => v.product_url || (v.product_image_urls?.length || v.product_image_paths?.length) && v.product_name,
|
|
2992
3503
|
{
|
|
@@ -2994,7 +3505,7 @@ var init_ad = __esm({
|
|
|
2994
3505
|
path: ["product_url"]
|
|
2995
3506
|
}
|
|
2996
3507
|
);
|
|
2997
|
-
|
|
3508
|
+
InputJsonSchema16 = {
|
|
2998
3509
|
type: "object",
|
|
2999
3510
|
properties: {
|
|
3000
3511
|
style: {
|
|
@@ -3072,6 +3583,15 @@ var init_ad = __esm({
|
|
|
3072
3583
|
minimum: 4,
|
|
3073
3584
|
maximum: 15,
|
|
3074
3585
|
description: "Ad length in seconds. Defaults to the style's length; clamped to what the engine allows."
|
|
3586
|
+
},
|
|
3587
|
+
reference_video_url: {
|
|
3588
|
+
type: "string",
|
|
3589
|
+
format: "uri",
|
|
3590
|
+
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."
|
|
3591
|
+
},
|
|
3592
|
+
brand_kit: {
|
|
3593
|
+
type: "boolean",
|
|
3594
|
+
description: "The account's brand kit (palette, voice, selling points; see pixeldojo_brand_kit) rides on every ad. false skips it."
|
|
3075
3595
|
}
|
|
3076
3596
|
}
|
|
3077
3597
|
// "product_url OR product_name+images" is enforced by the server and the
|
|
@@ -3081,8 +3601,8 @@ var init_ad = __esm({
|
|
|
3081
3601
|
name: "pixeldojo_ad",
|
|
3082
3602
|
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.",
|
|
3083
3603
|
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.",
|
|
3084
|
-
inputZod:
|
|
3085
|
-
inputJsonSchema:
|
|
3604
|
+
inputZod: InputSchema16,
|
|
3605
|
+
inputJsonSchema: InputJsonSchema16,
|
|
3086
3606
|
// Composition skill — the server routes to the ad engine internally.
|
|
3087
3607
|
allowedModels: [],
|
|
3088
3608
|
defaultModel: "",
|
|
@@ -3117,10 +3637,10 @@ async function run14(input, ctx) {
|
|
|
3117
3637
|
statusUrl: result.statusUrl ?? ctx.buildStatusUrl(result.campaignId)
|
|
3118
3638
|
};
|
|
3119
3639
|
}
|
|
3120
|
-
var
|
|
3640
|
+
var InputSchema17, InputJsonSchema17, campaignSkill;
|
|
3121
3641
|
var init_campaign = __esm({
|
|
3122
3642
|
"src/skills/campaign.ts"() {
|
|
3123
|
-
|
|
3643
|
+
InputSchema17 = zod.z.object({
|
|
3124
3644
|
productUrl: zod.z.string().url().optional().describe("Product page URL. We extract name + description + images automatically."),
|
|
3125
3645
|
product: zod.z.object({
|
|
3126
3646
|
name: zod.z.string().min(1).max(200),
|
|
@@ -3136,7 +3656,7 @@ var init_campaign = __esm({
|
|
|
3136
3656
|
message: "productUrl or product is required",
|
|
3137
3657
|
path: ["productUrl"]
|
|
3138
3658
|
});
|
|
3139
|
-
|
|
3659
|
+
InputJsonSchema17 = {
|
|
3140
3660
|
type: "object",
|
|
3141
3661
|
properties: {
|
|
3142
3662
|
productUrl: {
|
|
@@ -3187,8 +3707,8 @@ var init_campaign = __esm({
|
|
|
3187
3707
|
campaignSkill = {
|
|
3188
3708
|
name: "pixeldojo_campaign",
|
|
3189
3709
|
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.",
|
|
3190
|
-
inputZod:
|
|
3191
|
-
inputJsonSchema:
|
|
3710
|
+
inputZod: InputSchema17,
|
|
3711
|
+
inputJsonSchema: InputJsonSchema17,
|
|
3192
3712
|
// Composition skill — internal sub-jobs route to per-tool models, no
|
|
3193
3713
|
// single allowed-models list applies here.
|
|
3194
3714
|
allowedModels: [],
|
|
@@ -3227,13 +3747,13 @@ async function run15(input, ctx) {
|
|
|
3227
3747
|
statusUrl: result.statusUrl ?? ctx.buildStatusUrl(result.campaignId)
|
|
3228
3748
|
};
|
|
3229
3749
|
}
|
|
3230
|
-
var
|
|
3750
|
+
var InputSchema18, InputJsonSchema18, campaignStatusSkill;
|
|
3231
3751
|
var init_campaign_status = __esm({
|
|
3232
3752
|
"src/skills/campaign-status.ts"() {
|
|
3233
|
-
|
|
3753
|
+
InputSchema18 = zod.z.object({
|
|
3234
3754
|
campaignId: zod.z.string().min(1).max(200).describe("Campaign id returned from a prior pixeldojo_campaign handoff.")
|
|
3235
3755
|
});
|
|
3236
|
-
|
|
3756
|
+
InputJsonSchema18 = {
|
|
3237
3757
|
type: "object",
|
|
3238
3758
|
properties: {
|
|
3239
3759
|
campaignId: {
|
|
@@ -3246,8 +3766,8 @@ var init_campaign_status = __esm({
|
|
|
3246
3766
|
campaignStatusSkill = {
|
|
3247
3767
|
name: "pixeldojo_campaign_status",
|
|
3248
3768
|
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.",
|
|
3249
|
-
inputZod:
|
|
3250
|
-
inputJsonSchema:
|
|
3769
|
+
inputZod: InputSchema18,
|
|
3770
|
+
inputJsonSchema: InputJsonSchema18,
|
|
3251
3771
|
allowedModels: [],
|
|
3252
3772
|
defaultModel: "",
|
|
3253
3773
|
run: run15
|
|
@@ -3270,16 +3790,16 @@ async function run16(input, ctx) {
|
|
|
3270
3790
|
(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.)`
|
|
3271
3791
|
};
|
|
3272
3792
|
}
|
|
3273
|
-
var
|
|
3793
|
+
var InputSchema19, InputJsonSchema19, uploadSkill;
|
|
3274
3794
|
var init_upload = __esm({
|
|
3275
3795
|
"src/skills/upload.ts"() {
|
|
3276
3796
|
init_upload_helpers();
|
|
3277
|
-
|
|
3797
|
+
InputSchema19 = zod.z.object({
|
|
3278
3798
|
path: zod.z.string().min(1).max(4096).describe(
|
|
3279
3799
|
"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."
|
|
3280
3800
|
)
|
|
3281
3801
|
});
|
|
3282
|
-
|
|
3802
|
+
InputJsonSchema19 = {
|
|
3283
3803
|
type: "object",
|
|
3284
3804
|
properties: {
|
|
3285
3805
|
path: {
|
|
@@ -3292,8 +3812,8 @@ var init_upload = __esm({
|
|
|
3292
3812
|
uploadSkill = {
|
|
3293
3813
|
name: "pixeldojo_upload",
|
|
3294
3814
|
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.",
|
|
3295
|
-
inputZod:
|
|
3296
|
-
inputJsonSchema:
|
|
3815
|
+
inputZod: InputSchema19,
|
|
3816
|
+
inputJsonSchema: InputJsonSchema19,
|
|
3297
3817
|
allowedModels: [],
|
|
3298
3818
|
defaultModel: "",
|
|
3299
3819
|
run: run16
|
|
@@ -3338,14 +3858,14 @@ async function run17(input, ctx) {
|
|
|
3338
3858
|
(urls) => urls.length === 0 ? `Job ${submitted.jobId} completed but returned no assets.` : `Audio ready. Asset: ${urls[0]}`
|
|
3339
3859
|
);
|
|
3340
3860
|
}
|
|
3341
|
-
var ALLOWED4, DEFAULT_MODEL6,
|
|
3861
|
+
var ALLOWED4, DEFAULT_MODEL6, InputSchema20, InputJsonSchema20, audioSkill;
|
|
3342
3862
|
var init_audio = __esm({
|
|
3343
3863
|
"src/skills/audio.ts"() {
|
|
3344
3864
|
init_poll();
|
|
3345
3865
|
init_types();
|
|
3346
3866
|
ALLOWED4 = ["seed-audio", "text-to-speech"];
|
|
3347
3867
|
DEFAULT_MODEL6 = "seed-audio";
|
|
3348
|
-
|
|
3868
|
+
InputSchema20 = zod.z.object({
|
|
3349
3869
|
prompt: zod.z.string().min(1).describe(
|
|
3350
3870
|
"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."
|
|
3351
3871
|
),
|
|
@@ -3355,7 +3875,7 @@ var init_audio = __esm({
|
|
|
3355
3875
|
output_format: zod.z.string().optional().describe("Output format. seed-audio: mp3 (default), wav, pcm, ogg_opus. text-to-speech: mp3 (default), wav, flac, pcm."),
|
|
3356
3876
|
speed: zod.z.number().min(0.5).max(2).optional().describe("Speech speed multiplier, 0.5-2 (default 1). Both models.")
|
|
3357
3877
|
});
|
|
3358
|
-
|
|
3878
|
+
InputJsonSchema20 = {
|
|
3359
3879
|
type: "object",
|
|
3360
3880
|
properties: {
|
|
3361
3881
|
prompt: {
|
|
@@ -3393,8 +3913,8 @@ var init_audio = __esm({
|
|
|
3393
3913
|
audioSkill = {
|
|
3394
3914
|
name: "pixeldojo_audio",
|
|
3395
3915
|
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.",
|
|
3396
|
-
inputZod:
|
|
3397
|
-
inputJsonSchema:
|
|
3916
|
+
inputZod: InputSchema20,
|
|
3917
|
+
inputJsonSchema: InputJsonSchema20,
|
|
3398
3918
|
allowedModels: [...ALLOWED4],
|
|
3399
3919
|
defaultModel: DEFAULT_MODEL6,
|
|
3400
3920
|
run: run17
|
|
@@ -3452,17 +3972,17 @@ ${lines.join("\n")}
|
|
|
3452
3972
|
Pass any URL back into pixeldojo_generate, pixeldojo_edit, pixeldojo_character, or pixeldojo_upscale as a reference input.`
|
|
3453
3973
|
};
|
|
3454
3974
|
}
|
|
3455
|
-
var
|
|
3975
|
+
var InputSchema21, InputJsonSchema21, librarySkill;
|
|
3456
3976
|
var init_library = __esm({
|
|
3457
3977
|
"src/skills/library.ts"() {
|
|
3458
|
-
|
|
3978
|
+
InputSchema21 = zod.z.object({
|
|
3459
3979
|
source: zod.z.enum(["media", "characters"]).optional().describe("media (default): saved and recent results. characters: saved Character Studio characters and elements, usable as @Name in prompts."),
|
|
3460
3980
|
q: zod.z.string().optional().describe("Substring match against the prompt that produced the asset."),
|
|
3461
3981
|
model: zod.z.string().optional().describe("Restrict to a single model (apiId)."),
|
|
3462
3982
|
modality: zod.z.enum(["image", "video", "audio"]).optional().describe("Restrict to one output type."),
|
|
3463
3983
|
limit: zod.z.number().int().min(1).max(50).optional().describe("Max results (default 10).")
|
|
3464
3984
|
});
|
|
3465
|
-
|
|
3985
|
+
InputJsonSchema21 = {
|
|
3466
3986
|
type: "object",
|
|
3467
3987
|
properties: {
|
|
3468
3988
|
source: {
|
|
@@ -3487,8 +4007,8 @@ var init_library = __esm({
|
|
|
3487
4007
|
librarySkill = {
|
|
3488
4008
|
name: "pixeldojo_library",
|
|
3489
4009
|
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.",
|
|
3490
|
-
inputZod:
|
|
3491
|
-
inputJsonSchema:
|
|
4010
|
+
inputZod: InputSchema21,
|
|
4011
|
+
inputJsonSchema: InputJsonSchema21,
|
|
3492
4012
|
allowedModels: [],
|
|
3493
4013
|
defaultModel: "",
|
|
3494
4014
|
run: run18
|
|
@@ -3509,17 +4029,17 @@ async function run19(input, ctx) {
|
|
|
3509
4029
|
It will appear at https://pixeldojo.ai/my-images and in pixeldojo_library searches.`
|
|
3510
4030
|
};
|
|
3511
4031
|
}
|
|
3512
|
-
var
|
|
4032
|
+
var InputSchema22, InputJsonSchema22, saveSkill;
|
|
3513
4033
|
var init_save = __esm({
|
|
3514
4034
|
"src/skills/save.ts"() {
|
|
3515
|
-
|
|
4035
|
+
InputSchema22 = zod.z.object({
|
|
3516
4036
|
url: zod.z.string().url().describe("The asset URL to save (image or video)."),
|
|
3517
4037
|
prompt: zod.z.string().optional().describe("The prompt that produced it \u2014 makes it findable in the library later."),
|
|
3518
4038
|
tool_name: zod.z.string().optional().describe("Tool/model slug that produced it."),
|
|
3519
4039
|
modality: zod.z.enum(["image", "video", "audio"]).optional(),
|
|
3520
4040
|
job_id: zod.z.string().optional().describe("The jobId that produced this asset, when known.")
|
|
3521
4041
|
});
|
|
3522
|
-
|
|
4042
|
+
InputJsonSchema22 = {
|
|
3523
4043
|
type: "object",
|
|
3524
4044
|
properties: {
|
|
3525
4045
|
url: { type: "string", format: "uri", description: "The result URL to keep (image or video from a PixelDojo job)." },
|
|
@@ -3533,8 +4053,8 @@ var init_save = __esm({
|
|
|
3533
4053
|
saveSkill = {
|
|
3534
4054
|
name: "pixeldojo_save",
|
|
3535
4055
|
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.`,
|
|
3536
|
-
inputZod:
|
|
3537
|
-
inputJsonSchema:
|
|
4056
|
+
inputZod: InputSchema22,
|
|
4057
|
+
inputJsonSchema: InputJsonSchema22,
|
|
3538
4058
|
allowedModels: [],
|
|
3539
4059
|
defaultModel: "",
|
|
3540
4060
|
run: run19
|
|
@@ -3553,21 +4073,21 @@ async function run20(input, ctx) {
|
|
|
3553
4073
|
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.`
|
|
3554
4074
|
};
|
|
3555
4075
|
}
|
|
3556
|
-
var
|
|
4076
|
+
var KINDS2, InputSchema23, InputJsonSchema23, saveCharacterSkill;
|
|
3557
4077
|
var init_save_character = __esm({
|
|
3558
4078
|
"src/skills/save-character.ts"() {
|
|
3559
|
-
|
|
3560
|
-
|
|
4079
|
+
KINDS2 = ["character", "product", "outfit", "location", "object", "style"];
|
|
4080
|
+
InputSchema23 = zod.z.object({
|
|
3561
4081
|
name: zod.z.string().min(1).max(60).describe("What to call it. Used as @Name in prompts."),
|
|
3562
|
-
kind: zod.z.enum(
|
|
4082
|
+
kind: zod.z.enum(KINDS2).optional().describe("Default character."),
|
|
3563
4083
|
image_urls: zod.z.array(zod.z.string().url()).max(8).optional().describe("3 to 5 photos from different angles works best for a character."),
|
|
3564
4084
|
description: zod.z.string().max(1500).optional().describe("Appearance notes, or the scene text for an element.")
|
|
3565
4085
|
});
|
|
3566
|
-
|
|
4086
|
+
InputJsonSchema23 = {
|
|
3567
4087
|
type: "object",
|
|
3568
4088
|
properties: {
|
|
3569
4089
|
name: { type: "string", description: "What to call it. Used as @Name in prompts afterwards." },
|
|
3570
|
-
kind: { type: "string", enum:
|
|
4090
|
+
kind: { type: "string", enum: KINDS2, description: "character (default), product, outfit, location, object (a prop) or style." },
|
|
3571
4091
|
image_urls: {
|
|
3572
4092
|
type: "array",
|
|
3573
4093
|
items: { type: "string", format: "uri" },
|
|
@@ -3581,8 +4101,8 @@ var init_save_character = __esm({
|
|
|
3581
4101
|
saveCharacterSkill = {
|
|
3582
4102
|
name: "pixeldojo_save_character",
|
|
3583
4103
|
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.",
|
|
3584
|
-
inputZod:
|
|
3585
|
-
inputJsonSchema:
|
|
4104
|
+
inputZod: InputSchema23,
|
|
4105
|
+
inputJsonSchema: InputJsonSchema23,
|
|
3586
4106
|
allowedModels: [],
|
|
3587
4107
|
defaultModel: "",
|
|
3588
4108
|
run: run20
|
|
@@ -3607,7 +4127,7 @@ async function listRun(input, ctx) {
|
|
|
3607
4127
|
}
|
|
3608
4128
|
const lines = effects.map((e) => {
|
|
3609
4129
|
const ins = e.inputs.map(
|
|
3610
|
-
(i) => i.kind === "image" ? `photo "${i.label}"` : `text "${i.label}"${i.options ? ` [${i.options.join(" | ")}]` : ""}${i.optional ? " (optional)" : ""}`
|
|
4130
|
+
(i) => i.kind === "image" ? `photo "${i.label}"${i.optional ? " (optional)" : ""}` : `text "${i.label}"${i.options ? ` [${i.options.join(" | ")}]` : ""}${i.optional ? " (optional)" : ""}`
|
|
3611
4131
|
);
|
|
3612
4132
|
return `- ${e.slug} (${e.family}, ${e.output}, ${priceOf(e)}): ${e.title}. ${e.tagline} Inputs: ${ins.join(", ")}.`;
|
|
3613
4133
|
});
|
|
@@ -3731,6 +4251,446 @@ var init_effects = __esm({
|
|
|
3731
4251
|
};
|
|
3732
4252
|
}
|
|
3733
4253
|
});
|
|
4254
|
+
async function call2(ctx, skill, path, init = {}) {
|
|
4255
|
+
const res = await (ctx.fetch ?? fetch)(`${ctx.baseUrl}${path}`, {
|
|
4256
|
+
method: init.method ?? "GET",
|
|
4257
|
+
headers: headers2(ctx, skill),
|
|
4258
|
+
...init.body !== void 0 ? { body: JSON.stringify(init.body) } : {}
|
|
4259
|
+
});
|
|
4260
|
+
const data = await res.json().catch(() => ({}));
|
|
4261
|
+
const err = data.error;
|
|
4262
|
+
return { ok: res.ok, data, error: typeof err === "string" ? err : err?.message ?? `HTTP ${res.status}` };
|
|
4263
|
+
}
|
|
4264
|
+
async function kitRun(input, ctx) {
|
|
4265
|
+
const path = "/api/v1/marketing/brand-kit";
|
|
4266
|
+
if (input.action === "import") {
|
|
4267
|
+
if (!input.url) return { kind: "text", text: "Pass url: the brand's website, like yourbrand.com." };
|
|
4268
|
+
const r2 = await call2(ctx, "pixeldojo_brand_kit", path, { method: "POST", body: { url: input.url, save: input.save } });
|
|
4269
|
+
if (!r2.ok) return { kind: "text", text: `Brand kit not imported: ${r2.error}` };
|
|
4270
|
+
return { kind: "text", text: `${r2.data.saved === false ? "Imported (not saved)." : "Imported and saved."}
|
|
4271
|
+
${describeKit(r2.data.brand_kit)}` };
|
|
4272
|
+
}
|
|
4273
|
+
if (input.action === "update") {
|
|
4274
|
+
const patch = {
|
|
4275
|
+
...input.name !== void 0 ? { name: input.name } : {},
|
|
4276
|
+
...input.tagline !== void 0 ? { tagline: input.tagline } : {},
|
|
4277
|
+
...input.voice !== void 0 ? { voice: input.voice } : {},
|
|
4278
|
+
...input.colors ? { colors: input.colors.map((c) => c.trim().toLowerCase()) } : {},
|
|
4279
|
+
...input.fonts ? { fonts: input.fonts } : {},
|
|
4280
|
+
...input.selling_points ? { sellingPoints: input.selling_points } : {},
|
|
4281
|
+
...input.logo_url ? { logoUrl: input.logo_url } : {}
|
|
4282
|
+
};
|
|
4283
|
+
const r2 = await call2(ctx, "pixeldojo_brand_kit", path, { method: "PATCH", body: patch });
|
|
4284
|
+
if (!r2.ok) return { kind: "text", text: `Brand kit not updated: ${r2.error}` };
|
|
4285
|
+
return { kind: "text", text: `Updated.
|
|
4286
|
+
${describeKit(r2.data.brand_kit)}` };
|
|
4287
|
+
}
|
|
4288
|
+
const r = await call2(ctx, "pixeldojo_brand_kit", path);
|
|
4289
|
+
if (!r.ok) return { kind: "text", text: `Could not read the brand kit: ${r.error}` };
|
|
4290
|
+
return { kind: "text", text: describeKit(r.data.brand_kit ?? null) };
|
|
4291
|
+
}
|
|
4292
|
+
async function templatesRun(input, ctx) {
|
|
4293
|
+
const q = new URLSearchParams();
|
|
4294
|
+
if (input.kind) q.set("kind", input.kind);
|
|
4295
|
+
if (input.category) q.set("category", input.category);
|
|
4296
|
+
const r = await call2(ctx, "pixeldojo_marketing", `/api/v1/marketing/templates?${q}`);
|
|
4297
|
+
if (!r.ok) return { kind: "text", text: `Could not list templates: ${r.error}` };
|
|
4298
|
+
const rows = r.data.templates ?? [];
|
|
4299
|
+
const lines = rows.map((t) => {
|
|
4300
|
+
const how = t.kind === "image" ? "action image" : t.kind === "motion" ? `action motion, fields ${t.fields?.join(", ")}, ${t.credits} credits` : "pixeldojo_ad style";
|
|
4301
|
+
return `- ${t.id} (${t.label}, ${t.category}): ${t.name}. ${how}. Example: ${t.preview ?? "none"}`;
|
|
4302
|
+
});
|
|
4303
|
+
const engines = r.data.image_engines ?? [];
|
|
4304
|
+
return {
|
|
4305
|
+
kind: "text",
|
|
4306
|
+
text: [
|
|
4307
|
+
`${rows.length} templates. Image templates run with action image (template = id), motion templates with action motion, video ad styles with pixeldojo_ad (style = id).`,
|
|
4308
|
+
...lines,
|
|
4309
|
+
"",
|
|
4310
|
+
`Image engines: ${engines.map((e) => `${e.id} ${e.credits_per_image} credits per image (${e.note})`).join("; ")}.`,
|
|
4311
|
+
...r.data.notes ?? []
|
|
4312
|
+
].join("\n")
|
|
4313
|
+
};
|
|
4314
|
+
}
|
|
4315
|
+
async function imageRun(input, ctx) {
|
|
4316
|
+
const local = input.product_image_paths?.length ? await uploadLocalFiles(input.product_image_paths, ctx) : [];
|
|
4317
|
+
const images = [...input.product_image_urls ?? [], ...local];
|
|
4318
|
+
if (!input.product_url && !(input.product_name && images.length)) {
|
|
4319
|
+
return { kind: "text", text: "Pass product_url, or product_name plus product_image_urls (or product_image_paths)." };
|
|
4320
|
+
}
|
|
4321
|
+
const r = await call2(ctx, "pixeldojo_marketing", "/api/v1/marketing/image", {
|
|
4322
|
+
method: "POST",
|
|
4323
|
+
body: {
|
|
4324
|
+
template: input.template,
|
|
4325
|
+
product_url: input.product_url,
|
|
4326
|
+
...!input.product_url ? { product: { name: input.product_name, description: input.product_description, images } } : {},
|
|
4327
|
+
character_images: input.character_image_urls,
|
|
4328
|
+
headline: input.headline,
|
|
4329
|
+
points: input.points,
|
|
4330
|
+
cta: input.cta,
|
|
4331
|
+
direction: input.direction,
|
|
4332
|
+
aspect_ratio: input.aspect_ratio,
|
|
4333
|
+
engine: input.engine,
|
|
4334
|
+
count: input.count,
|
|
4335
|
+
reference_ad_url: input.reference_ad_url,
|
|
4336
|
+
brand_kit: input.brand_kit
|
|
4337
|
+
}
|
|
4338
|
+
});
|
|
4339
|
+
if (!r.ok) return { kind: "text", text: `Images not started: ${r.error}` };
|
|
4340
|
+
const jobs = r.data.jobs ?? [];
|
|
4341
|
+
const polled = await Promise.all(
|
|
4342
|
+
jobs.map(
|
|
4343
|
+
(j) => pollJobUntilDoneOrHandoff(j.jobId, (id) => ctx.client.getJob(id), ctx.buildStatusUrl, {
|
|
4344
|
+
now: ctx.pollOverrides?.now,
|
|
4345
|
+
sleep: ctx.pollOverrides?.sleep
|
|
4346
|
+
})
|
|
4347
|
+
)
|
|
4348
|
+
);
|
|
4349
|
+
const urls = polled.flatMap((p) => p.kind === "completed" ? extractAssetUrls(p.job) : []);
|
|
4350
|
+
const pending = polled.filter((p) => p.kind === "handoff").map((p) => p.jobId);
|
|
4351
|
+
const failed = polled.filter((p) => p.kind === "failed").length;
|
|
4352
|
+
const credits = jobs.reduce((n, j) => n + (j.creditCost ?? 0), 0);
|
|
4353
|
+
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` : ""}.`;
|
|
4354
|
+
if (pending.length === 1 && !urls.length) {
|
|
4355
|
+
return { kind: "handoff", text: `${head} Check it with pixeldojo_status.`, jobId: pending[0], statusUrl: ctx.buildStatusUrl(pending[0]) };
|
|
4356
|
+
}
|
|
4357
|
+
const tail = pending.length ? ` Still rendering: ${pending.join(", ")} (check each with pixeldojo_status).` : "";
|
|
4358
|
+
if (urls.length) return { kind: "assets", text: `${head}${tail}`, assetUrls: urls };
|
|
4359
|
+
return { kind: "text", text: `${head}${tail}` };
|
|
4360
|
+
}
|
|
4361
|
+
async function settleMotion(view, ctx) {
|
|
4362
|
+
const now = ctx.pollOverrides?.now ?? Date.now;
|
|
4363
|
+
const sleep = ctx.pollOverrides?.sleep ?? ((ms) => new Promise((res) => setTimeout(res, ms)));
|
|
4364
|
+
const until = now() + 7e4;
|
|
4365
|
+
let v = view;
|
|
4366
|
+
while (v.status === "processing" && now() < until) {
|
|
4367
|
+
await sleep(5e3);
|
|
4368
|
+
const r = await call2(ctx, "pixeldojo_marketing", `/api/v1/marketing/motion/${encodeURIComponent(v.id)}`);
|
|
4369
|
+
if (r.ok) v = r.data;
|
|
4370
|
+
}
|
|
4371
|
+
if (v.status === "completed" && v.video_url) {
|
|
4372
|
+
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] };
|
|
4373
|
+
}
|
|
4374
|
+
if (v.status === "failed") return { kind: "text", text: `Render failed, nothing charged: ${v.error}` };
|
|
4375
|
+
return {
|
|
4376
|
+
kind: "text",
|
|
4377
|
+
text: `Still rendering (${v.step}). Check it with pixeldojo_marketing action status motion_id ${v.id} in about 15 seconds.`,
|
|
4378
|
+
followUp: { input: { action: "status", motion_id: v.id }, afterSec: 15 }
|
|
4379
|
+
};
|
|
4380
|
+
}
|
|
4381
|
+
async function motionRun(input, ctx) {
|
|
4382
|
+
if (input.action === "status") {
|
|
4383
|
+
if (!input.motion_id) return { kind: "text", text: "Pass motion_id." };
|
|
4384
|
+
const r2 = await call2(ctx, "pixeldojo_marketing", `/api/v1/marketing/motion/${encodeURIComponent(input.motion_id)}`);
|
|
4385
|
+
if (!r2.ok) return { kind: "text", text: `Could not read that render: ${r2.error}` };
|
|
4386
|
+
return settleMotion(r2.data, ctx);
|
|
4387
|
+
}
|
|
4388
|
+
const endCard = input.action === "end_card";
|
|
4389
|
+
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);
|
|
4390
|
+
const r = await call2(ctx, "pixeldojo_marketing", "/api/v1/marketing/motion", {
|
|
4391
|
+
method: "POST",
|
|
4392
|
+
body: {
|
|
4393
|
+
template: endCard ? "end-card" : input.template,
|
|
4394
|
+
aspect_ratio: input.aspect_ratio === "4:5" ? "9:16" : input.aspect_ratio,
|
|
4395
|
+
headline: input.headline,
|
|
4396
|
+
points: input.points,
|
|
4397
|
+
cta: input.cta,
|
|
4398
|
+
stat: input.stat,
|
|
4399
|
+
stat_label: input.stat_label,
|
|
4400
|
+
price_was: input.price_was,
|
|
4401
|
+
price_now: input.price_now,
|
|
4402
|
+
product_image_url: product,
|
|
4403
|
+
video_url: input.video_url,
|
|
4404
|
+
brand_name: input.brand_name,
|
|
4405
|
+
colors: input.colors?.map((c) => c.trim().toLowerCase()),
|
|
4406
|
+
brand_kit: input.brand_kit
|
|
4407
|
+
}
|
|
4408
|
+
});
|
|
4409
|
+
if (!r.ok) return { kind: "text", text: `Not started: ${r.error}` };
|
|
4410
|
+
return settleMotion(r.data, ctx);
|
|
4411
|
+
}
|
|
4412
|
+
async function marketingRun(input, ctx) {
|
|
4413
|
+
if (input.action === "templates") return templatesRun(input, ctx);
|
|
4414
|
+
if (input.action === "image") return imageRun(input, ctx);
|
|
4415
|
+
return motionRun(input, ctx);
|
|
4416
|
+
}
|
|
4417
|
+
var headers2, KitSchema, describeKit, brandKitSkill, ACTIONS, MOTION, MarketingSchema, props, marketingSkill;
|
|
4418
|
+
var init_marketing = __esm({
|
|
4419
|
+
"src/skills/marketing.ts"() {
|
|
4420
|
+
init_poll();
|
|
4421
|
+
init_upload_helpers();
|
|
4422
|
+
init_types();
|
|
4423
|
+
headers2 = (ctx, skill) => ({
|
|
4424
|
+
Authorization: `Bearer ${ctx.apiKey}`,
|
|
4425
|
+
"Content-Type": "application/json",
|
|
4426
|
+
"x-pixeldojo-source": `mcp/${ctx.mcpVersion}`,
|
|
4427
|
+
"x-pixeldojo-skill": skill
|
|
4428
|
+
});
|
|
4429
|
+
KitSchema = zod.z.object({
|
|
4430
|
+
action: zod.z.enum(["get", "import", "update"]).optional(),
|
|
4431
|
+
url: zod.z.string().max(2048).optional(),
|
|
4432
|
+
save: zod.z.boolean().optional(),
|
|
4433
|
+
name: zod.z.string().max(60).optional(),
|
|
4434
|
+
tagline: zod.z.string().max(80).optional(),
|
|
4435
|
+
voice: zod.z.string().max(240).optional(),
|
|
4436
|
+
colors: zod.z.array(zod.z.string()).max(5).optional(),
|
|
4437
|
+
fonts: zod.z.array(zod.z.string()).max(2).optional(),
|
|
4438
|
+
selling_points: zod.z.array(zod.z.string()).max(5).optional(),
|
|
4439
|
+
logo_url: zod.z.string().url().optional()
|
|
4440
|
+
});
|
|
4441
|
+
describeKit = (k) => !k ? "No brand kit yet. Import one from the website with action import and url." : [
|
|
4442
|
+
`Brand kit: ${k.name || "(no name)"}${k.url ? ` (${k.url})` : ""}`,
|
|
4443
|
+
`Logo: ${k.logoUrl ?? "none (add logo_url, a PixelDojo upload)"}`,
|
|
4444
|
+
`Colors: ${k.colors.join(" ") || "none"}`,
|
|
4445
|
+
`Fonts: ${k.fonts.join(", ") || "none"}`,
|
|
4446
|
+
`Tagline: ${k.tagline || "none"}`,
|
|
4447
|
+
`Voice: ${k.voice || "none"}`,
|
|
4448
|
+
`Selling points: ${k.sellingPoints.join("; ") || "none"}`,
|
|
4449
|
+
"Every ad, campaign, image and motion template uses it unless that call passes brand_kit: false."
|
|
4450
|
+
].join("\n");
|
|
4451
|
+
brandKitSkill = {
|
|
4452
|
+
name: "pixeldojo_brand_kit",
|
|
4453
|
+
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.",
|
|
4454
|
+
inputZod: KitSchema,
|
|
4455
|
+
inputJsonSchema: {
|
|
4456
|
+
type: "object",
|
|
4457
|
+
properties: {
|
|
4458
|
+
action: { type: "string", enum: ["get", "import", "update"], description: "Default get." },
|
|
4459
|
+
url: { type: "string", description: "import: the brand website, e.g. yourbrand.com." },
|
|
4460
|
+
save: { type: "boolean", description: "import: false returns the kit without saving it. Default true." },
|
|
4461
|
+
name: { type: "string", description: "Brand name." },
|
|
4462
|
+
tagline: { type: "string", description: "Short brand tagline." },
|
|
4463
|
+
voice: { type: "string", description: "How the brand talks, one or two sentences." },
|
|
4464
|
+
colors: { type: "array", items: { type: "string" }, maxItems: 5, description: "#RRGGBB, lead color first." },
|
|
4465
|
+
fonts: { type: "array", items: { type: "string" }, maxItems: 2, description: "Up to two brand font names." },
|
|
4466
|
+
selling_points: { type: "array", items: { type: "string" }, maxItems: 5, description: "Short product claims, 2-7 words each." },
|
|
4467
|
+
logo_url: { type: "string", format: "uri", description: "A logo on PixelDojo (upload it first); PNG with transparency is best." }
|
|
4468
|
+
}
|
|
4469
|
+
},
|
|
4470
|
+
allowedModels: [],
|
|
4471
|
+
defaultModel: "",
|
|
4472
|
+
run: kitRun
|
|
4473
|
+
};
|
|
4474
|
+
ACTIONS = ["templates", "image", "motion", "end_card", "status"];
|
|
4475
|
+
MOTION = ["kinetic-headline", "feature-callouts", "count-up", "price-drop", "logo-sting"];
|
|
4476
|
+
MarketingSchema = zod.z.object({
|
|
4477
|
+
action: zod.z.enum(ACTIONS),
|
|
4478
|
+
kind: zod.z.enum(["image", "motion", "video"]).optional(),
|
|
4479
|
+
category: zod.z.string().max(40).optional(),
|
|
4480
|
+
template: zod.z.string().max(60).optional(),
|
|
4481
|
+
product_url: zod.z.string().url().optional(),
|
|
4482
|
+
product_name: zod.z.string().max(200).optional(),
|
|
4483
|
+
product_description: zod.z.string().max(2e3).optional(),
|
|
4484
|
+
product_image_urls: zod.z.array(zod.z.string().url()).max(5).optional(),
|
|
4485
|
+
product_image_paths: zod.z.array(zod.z.string()).max(5).optional(),
|
|
4486
|
+
character_image_urls: zod.z.array(zod.z.string().url()).max(2).optional(),
|
|
4487
|
+
headline: zod.z.string().max(80).optional(),
|
|
4488
|
+
points: zod.z.array(zod.z.string().max(70)).max(3).optional(),
|
|
4489
|
+
cta: zod.z.string().max(30).optional(),
|
|
4490
|
+
direction: zod.z.string().max(1500).optional(),
|
|
4491
|
+
aspect_ratio: zod.z.enum(["1:1", "4:5", "9:16", "16:9"]).optional(),
|
|
4492
|
+
engine: zod.z.enum(["nano-banana-pro", "nano-banana-2-1", "ideogram-4-5"]).optional(),
|
|
4493
|
+
count: zod.z.number().int().min(1).max(8).optional(),
|
|
4494
|
+
reference_ad_url: zod.z.string().url().optional(),
|
|
4495
|
+
stat: zod.z.string().max(16).optional(),
|
|
4496
|
+
stat_label: zod.z.string().max(40).optional(),
|
|
4497
|
+
price_was: zod.z.string().max(16).optional(),
|
|
4498
|
+
price_now: zod.z.string().max(16).optional(),
|
|
4499
|
+
video_url: zod.z.string().url().optional(),
|
|
4500
|
+
motion_id: zod.z.string().max(80).optional(),
|
|
4501
|
+
brand_name: zod.z.string().max(60).optional(),
|
|
4502
|
+
colors: zod.z.array(zod.z.string()).max(5).optional(),
|
|
4503
|
+
brand_kit: zod.z.boolean().optional()
|
|
4504
|
+
});
|
|
4505
|
+
props = {
|
|
4506
|
+
action: {
|
|
4507
|
+
type: "string",
|
|
4508
|
+
enum: ACTIONS,
|
|
4509
|
+
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)."
|
|
4510
|
+
},
|
|
4511
|
+
kind: { type: "string", enum: ["image", "motion", "video"], description: "templates: filter." },
|
|
4512
|
+
category: { type: "string", description: "templates: product-shot, motion, ugc, tiktok, ads, posters or marketplace." },
|
|
4513
|
+
template: {
|
|
4514
|
+
type: "string",
|
|
4515
|
+
description: `image: an image template id from templates (e.g. stacked-shout, pure-white, ice-float). motion: ${MOTION.join(", ")}.`
|
|
4516
|
+
},
|
|
4517
|
+
product_url: { type: "string", format: "uri", description: "image: product page; name, description and photos are read from it." },
|
|
4518
|
+
product_name: { type: "string", description: "Product name when there is no product_url (with product_image_urls)." },
|
|
4519
|
+
product_description: { type: "string", description: "Short product description when there is no product_url." },
|
|
4520
|
+
product_image_urls: { type: "array", items: { type: "string", format: "uri" }, maxItems: 5, description: "Product photos. motion uses the first, cut out automatically." },
|
|
4521
|
+
product_image_paths: { type: "array", items: { type: "string" }, maxItems: 5, description: "Local product photos instead of URLs; uploaded first." },
|
|
4522
|
+
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." },
|
|
4523
|
+
headline: { type: "string", description: "Exact words on the ad. Blank uses the brand kit tagline." },
|
|
4524
|
+
points: { type: "array", items: { type: "string" }, maxItems: 3, description: "Selling points on the ad. Blank uses the brand kit." },
|
|
4525
|
+
cta: { type: "string", description: 'Button text. Default "Shop now".' },
|
|
4526
|
+
direction: { type: "string", description: "image: extra art direction added to the template." },
|
|
4527
|
+
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)." },
|
|
4528
|
+
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." },
|
|
4529
|
+
count: { type: "integer", minimum: 1, maximum: 8, description: "image: how many (each charged)." },
|
|
4530
|
+
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." },
|
|
4531
|
+
stat: { type: "string", description: 'count-up: the number, e.g. "10,000+", "4.9", "98%".' },
|
|
4532
|
+
stat_label: { type: "string", description: "count-up: what it counts." },
|
|
4533
|
+
price_was: { type: "string", description: 'price-drop: old price, e.g. "$140".' },
|
|
4534
|
+
price_now: { type: "string", description: 'price-drop: new price, e.g. "$98".' },
|
|
4535
|
+
video_url: { type: "string", format: "uri", description: "end_card: the finished ad (a PixelDojo result)." },
|
|
4536
|
+
motion_id: { type: "string", description: "status: the id a motion or end_card call returned." },
|
|
4537
|
+
brand_name: { type: "string", description: "motion: the brand shown when there is no logo. Default: the brand kit." },
|
|
4538
|
+
colors: { type: "array", items: { type: "string" }, maxItems: 5, description: "motion: #RRGGBB, lead color first. Default: the brand kit." },
|
|
4539
|
+
brand_kit: { type: "boolean", description: "false skips the brand kit for this call." }
|
|
4540
|
+
};
|
|
4541
|
+
marketingSkill = {
|
|
4542
|
+
name: "pixeldojo_marketing",
|
|
4543
|
+
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.",
|
|
4544
|
+
inputZod: MarketingSchema,
|
|
4545
|
+
inputJsonSchema: { type: "object", required: ["action"], properties: props },
|
|
4546
|
+
allowedModels: [],
|
|
4547
|
+
defaultModel: "",
|
|
4548
|
+
run: marketingRun
|
|
4549
|
+
};
|
|
4550
|
+
}
|
|
4551
|
+
});
|
|
4552
|
+
async function pollToResult(jobId, ctx, successText) {
|
|
4553
|
+
const result = await pollJobUntilDoneOrHandoff(jobId, (id) => ctx.client.getJob(id), ctx.buildStatusUrl, {
|
|
4554
|
+
now: ctx.pollOverrides?.now,
|
|
4555
|
+
sleep: ctx.pollOverrides?.sleep
|
|
4556
|
+
});
|
|
4557
|
+
return pollResultToSkillResult(result, (urls) => urls.length === 0 ? `Job ${jobId} completed but returned no assets.` : successText(urls));
|
|
4558
|
+
}
|
|
4559
|
+
async function buildRun(input, ctx) {
|
|
4560
|
+
const doFetch = ctx.fetch ?? fetch;
|
|
4561
|
+
if (input.action === "traits") {
|
|
4562
|
+
const res2 = await doFetch(`${ctx.baseUrl}/api/v1/characters/build`, { headers: headers3(ctx, "pixeldojo_build_character") });
|
|
4563
|
+
const data2 = await res2.json().catch(() => ({}));
|
|
4564
|
+
if (!res2.ok || !data2.traits) return { kind: "text", text: `Could not list traits: ${data2.error ?? `HTTP ${res2.status}`}` };
|
|
4565
|
+
return {
|
|
4566
|
+
kind: "text",
|
|
4567
|
+
text: [
|
|
4568
|
+
`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.`,
|
|
4569
|
+
...data2.traits.map(
|
|
4570
|
+
(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(", ")}`
|
|
4571
|
+
)
|
|
4572
|
+
].join("\n")
|
|
4573
|
+
};
|
|
4574
|
+
}
|
|
4575
|
+
const res = await doFetch(`${ctx.baseUrl}/api/v1/characters/build`, {
|
|
4576
|
+
method: "POST",
|
|
4577
|
+
headers: headers3(ctx, "pixeldojo_build_character"),
|
|
4578
|
+
body: JSON.stringify({
|
|
4579
|
+
...input.picks ? { picks: input.picks } : {},
|
|
4580
|
+
...input.randomize ? { randomize: true } : {},
|
|
4581
|
+
...input.details ? { details: input.details } : {},
|
|
4582
|
+
...input.takes ? { takes: input.takes } : {}
|
|
4583
|
+
})
|
|
4584
|
+
});
|
|
4585
|
+
const data = await res.json().catch(() => ({}));
|
|
4586
|
+
if (!res.ok || !data.jobId) {
|
|
4587
|
+
const err = typeof data.error === "string" ? data.error : data.error?.message;
|
|
4588
|
+
return { kind: "text", text: `Character not built (nothing charged): ${err ?? `HTTP ${res.status}`}` };
|
|
4589
|
+
}
|
|
4590
|
+
return pollToResult(
|
|
4591
|
+
data.jobId,
|
|
4592
|
+
ctx,
|
|
4593
|
+
(urls) => [
|
|
4594
|
+
`${urls.length} take${urls.length === 1 ? "" : "s"} of ${data.summary ?? "the character"} (${data.creditCost ?? "?"} credits):`,
|
|
4595
|
+
...urls.map((u, i) => `${i + 1}. ${u}`),
|
|
4596
|
+
`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.`
|
|
4597
|
+
].join("\n")
|
|
4598
|
+
);
|
|
4599
|
+
}
|
|
4600
|
+
async function performRun(input, ctx) {
|
|
4601
|
+
const doFetch = ctx.fetch ?? fetch;
|
|
4602
|
+
if (input.action === "list") {
|
|
4603
|
+
const res2 = await doFetch(`${ctx.baseUrl}/api/v1/characters/perform`, { headers: headers3(ctx, "pixeldojo_perform") });
|
|
4604
|
+
const data2 = await res2.json().catch(() => ({}));
|
|
4605
|
+
if (!res2.ok || !data2.presets) return { kind: "text", text: `Could not list presets: ${data2.error ?? `HTTP ${res2.status}`}` };
|
|
4606
|
+
return {
|
|
4607
|
+
kind: "text",
|
|
4608
|
+
text: [
|
|
4609
|
+
'Perform presets (a 5 s video of a saved character doing it). Run one with action "run", character and preset:',
|
|
4610
|
+
...data2.presets.map((p) => `- ${p.slug} (${p.group}, ${p.credits} credits): ${p.title}. ${p.tagline}`)
|
|
4611
|
+
].join("\n")
|
|
4612
|
+
};
|
|
4613
|
+
}
|
|
4614
|
+
if (!input.character || !input.preset) {
|
|
4615
|
+
return { kind: "text", text: `Pass character (a saved character's name or @Name) and preset (from action "list").` };
|
|
4616
|
+
}
|
|
4617
|
+
const res = await doFetch(`${ctx.baseUrl}/api/v1/characters/perform`, {
|
|
4618
|
+
method: "POST",
|
|
4619
|
+
headers: headers3(ctx, "pixeldojo_perform"),
|
|
4620
|
+
body: JSON.stringify({ character: input.character, preset: input.preset })
|
|
4621
|
+
});
|
|
4622
|
+
const data = await res.json().catch(() => ({}));
|
|
4623
|
+
if (!res.ok || !data.jobId) {
|
|
4624
|
+
const err = typeof data.error === "string" ? data.error : data.error?.message;
|
|
4625
|
+
return { kind: "text", text: `Not started (nothing charged): ${err ?? `HTTP ${res.status}`}` };
|
|
4626
|
+
}
|
|
4627
|
+
return pollToResult(data.jobId, ctx, (urls) => `${input.character} performed ${input.preset} (${data.creditCost ?? "?"} credits). Asset: ${urls[0]}`);
|
|
4628
|
+
}
|
|
4629
|
+
var headers3, BuildSchema, buildCharacterSkill, PerformSchema, performSkill;
|
|
4630
|
+
var init_character_builder = __esm({
|
|
4631
|
+
"src/skills/character-builder.ts"() {
|
|
4632
|
+
init_poll();
|
|
4633
|
+
init_types();
|
|
4634
|
+
headers3 = (ctx, skill) => ({
|
|
4635
|
+
Authorization: `Bearer ${ctx.apiKey}`,
|
|
4636
|
+
"Content-Type": "application/json",
|
|
4637
|
+
"x-pixeldojo-source": `mcp/${ctx.mcpVersion}`,
|
|
4638
|
+
"x-pixeldojo-skill": skill
|
|
4639
|
+
});
|
|
4640
|
+
BuildSchema = zod.z.object({
|
|
4641
|
+
action: zod.z.enum(["traits", "build"]),
|
|
4642
|
+
picks: zod.z.record(zod.z.union([zod.z.string(), zod.z.array(zod.z.string())])).optional(),
|
|
4643
|
+
randomize: zod.z.boolean().optional(),
|
|
4644
|
+
details: zod.z.string().max(200).optional(),
|
|
4645
|
+
takes: zod.z.number().int().min(1).max(4).optional()
|
|
4646
|
+
});
|
|
4647
|
+
buildCharacterSkill = {
|
|
4648
|
+
name: "pixeldojo_build_character",
|
|
4649
|
+
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.`,
|
|
4650
|
+
inputZod: BuildSchema,
|
|
4651
|
+
inputJsonSchema: {
|
|
4652
|
+
type: "object",
|
|
4653
|
+
required: ["action"],
|
|
4654
|
+
properties: {
|
|
4655
|
+
action: { type: "string", enum: ["traits", "build"], description: "traits = list trait and option ids (free). build = render the takes (paid)." },
|
|
4656
|
+
picks: {
|
|
4657
|
+
type: "object",
|
|
4658
|
+
additionalProperties: { anyOf: [{ type: "string" }, { type: "array", items: { type: "string" } }] },
|
|
4659
|
+
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.'
|
|
4660
|
+
},
|
|
4661
|
+
randomize: { type: "boolean", description: "build: fill every trait not in picks at random." },
|
|
4662
|
+
details: { type: "string", description: 'build: up to 200 characters of extra look, e.g. "freckles, gold hoops, a vintage denim jacket".' },
|
|
4663
|
+
takes: { type: "integer", minimum: 1, maximum: 4, description: "build: how many takes (default 4)." }
|
|
4664
|
+
}
|
|
4665
|
+
},
|
|
4666
|
+
allowedModels: [],
|
|
4667
|
+
defaultModel: "",
|
|
4668
|
+
run: buildRun
|
|
4669
|
+
};
|
|
4670
|
+
PerformSchema = zod.z.object({
|
|
4671
|
+
action: zod.z.enum(["list", "run"]),
|
|
4672
|
+
character: zod.z.string().max(100).optional(),
|
|
4673
|
+
preset: zod.z.string().max(80).optional()
|
|
4674
|
+
});
|
|
4675
|
+
performSkill = {
|
|
4676
|
+
name: "pixeldojo_perform",
|
|
4677
|
+
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.',
|
|
4678
|
+
inputZod: PerformSchema,
|
|
4679
|
+
inputJsonSchema: {
|
|
4680
|
+
type: "object",
|
|
4681
|
+
required: ["action"],
|
|
4682
|
+
properties: {
|
|
4683
|
+
action: { type: "string", enum: ["list", "run"], description: "list = presets with prices (free). run = make the video (paid)." },
|
|
4684
|
+
character: { type: "string", description: "run: the saved character's name or @Name (pixeldojo_library source=characters lists them)." },
|
|
4685
|
+
preset: { type: "string", description: 'run: a preset slug from action "list", e.g. "ai-dance", "shoulder-shimmy", "red-carpet".' }
|
|
4686
|
+
}
|
|
4687
|
+
},
|
|
4688
|
+
allowedModels: [],
|
|
4689
|
+
defaultModel: "",
|
|
4690
|
+
run: performRun
|
|
4691
|
+
};
|
|
4692
|
+
}
|
|
4693
|
+
});
|
|
3734
4694
|
function substitutePlaceholders(args, inputs, prevUrl) {
|
|
3735
4695
|
const missing = [];
|
|
3736
4696
|
const fill = (value) => {
|
|
@@ -3974,10 +4934,13 @@ __export(skills_exports, {
|
|
|
3974
4934
|
TOOL_ANNOTATIONS: () => TOOL_ANNOTATIONS,
|
|
3975
4935
|
adSkill: () => adSkill,
|
|
3976
4936
|
audioSkill: () => audioSkill,
|
|
4937
|
+
brandKitSkill: () => brandKitSkill,
|
|
4938
|
+
buildCharacterSkill: () => buildCharacterSkill,
|
|
3977
4939
|
campaignSkill: () => campaignSkill,
|
|
3978
4940
|
campaignStatusSkill: () => campaignStatusSkill,
|
|
3979
4941
|
captionSkill: () => captionSkill,
|
|
3980
4942
|
characterSkill: () => characterSkill,
|
|
4943
|
+
dramaSkill: () => dramaSkill,
|
|
3981
4944
|
editSkill: () => editSkill,
|
|
3982
4945
|
effectRunSkill: () => effectRunSkill,
|
|
3983
4946
|
effectsListSkill: () => effectsListSkill,
|
|
@@ -3987,9 +4950,13 @@ __export(skills_exports, {
|
|
|
3987
4950
|
findSkill: () => findSkill,
|
|
3988
4951
|
fromUrlSkill: () => fromUrlSkill,
|
|
3989
4952
|
generateSkill: () => generateSkill,
|
|
4953
|
+
kataSkill: () => kataSkill,
|
|
3990
4954
|
librarySkill: () => librarySkill,
|
|
3991
4955
|
listWorkflowsSkill: () => listWorkflowsSkill,
|
|
4956
|
+
marketingSkill: () => marketingSkill,
|
|
4957
|
+
musicVideoSkill: () => musicVideoSkill,
|
|
3992
4958
|
overlaySkill: () => overlaySkill,
|
|
4959
|
+
performSkill: () => performSkill,
|
|
3993
4960
|
runWorkflowSkill: () => runWorkflowSkill,
|
|
3994
4961
|
saveCharacterSkill: () => saveCharacterSkill,
|
|
3995
4962
|
saveSkill: () => saveSkill,
|
|
@@ -4034,6 +5001,9 @@ var init_skills = __esm({
|
|
|
4034
5001
|
init_film();
|
|
4035
5002
|
init_video();
|
|
4036
5003
|
init_episode();
|
|
5004
|
+
init_drama();
|
|
5005
|
+
init_music_video();
|
|
5006
|
+
init_kata();
|
|
4037
5007
|
init_ad();
|
|
4038
5008
|
init_campaign();
|
|
4039
5009
|
init_campaign_status();
|
|
@@ -4043,6 +5013,8 @@ var init_skills = __esm({
|
|
|
4043
5013
|
init_save();
|
|
4044
5014
|
init_save_character();
|
|
4045
5015
|
init_effects();
|
|
5016
|
+
init_marketing();
|
|
5017
|
+
init_character_builder();
|
|
4046
5018
|
init_workflows();
|
|
4047
5019
|
ALL_SKILLS = [
|
|
4048
5020
|
generateSkill,
|
|
@@ -4058,6 +5030,8 @@ var init_skills = __esm({
|
|
|
4058
5030
|
librarySkill,
|
|
4059
5031
|
saveSkill,
|
|
4060
5032
|
saveCharacterSkill,
|
|
5033
|
+
buildCharacterSkill,
|
|
5034
|
+
performSkill,
|
|
4061
5035
|
saveWorkflowSkill,
|
|
4062
5036
|
runWorkflowSkill,
|
|
4063
5037
|
listWorkflowsSkill,
|
|
@@ -4065,23 +5039,28 @@ var init_skills = __esm({
|
|
|
4065
5039
|
fromUrlSkill,
|
|
4066
5040
|
uploadSkill,
|
|
4067
5041
|
adSkill,
|
|
5042
|
+
brandKitSkill,
|
|
5043
|
+
marketingSkill,
|
|
4068
5044
|
campaignSkill,
|
|
4069
5045
|
campaignStatusSkill,
|
|
4070
5046
|
filmSkill,
|
|
4071
5047
|
videoSkill,
|
|
4072
|
-
episodeSkill
|
|
5048
|
+
episodeSkill,
|
|
5049
|
+
dramaSkill,
|
|
5050
|
+
musicVideoSkill,
|
|
5051
|
+
kataSkill
|
|
4073
5052
|
];
|
|
4074
5053
|
isLocalPathField = (key) => /_paths?$/.test(key);
|
|
4075
5054
|
HOSTED_SKILLS = ALL_SKILLS.filter(
|
|
4076
5055
|
(s) => s.name !== uploadSkill.name
|
|
4077
5056
|
).map((s) => {
|
|
4078
|
-
const
|
|
5057
|
+
const props2 = s.inputJsonSchema.properties ?? {};
|
|
4079
5058
|
return {
|
|
4080
5059
|
...s,
|
|
4081
5060
|
description: s.hostedDescription ?? s.description,
|
|
4082
5061
|
inputJsonSchema: {
|
|
4083
5062
|
...s.inputJsonSchema,
|
|
4084
|
-
properties: Object.fromEntries(Object.entries(
|
|
5063
|
+
properties: Object.fromEntries(Object.entries(props2).filter(([k]) => !isLocalPathField(k)))
|
|
4085
5064
|
}
|
|
4086
5065
|
};
|
|
4087
5066
|
});
|
|
@@ -4100,9 +5079,14 @@ var init_skills = __esm({
|
|
|
4100
5079
|
pixeldojo_effect: render("Run one-click effect"),
|
|
4101
5080
|
pixeldojo_video: render("Change, animate or extend video"),
|
|
4102
5081
|
pixeldojo_ad: render("Make video ad"),
|
|
5082
|
+
pixeldojo_brand_kit: render("Brand kit from website"),
|
|
5083
|
+
pixeldojo_marketing: render("Image ads, motion graphics and templates"),
|
|
4103
5084
|
pixeldojo_campaign: render("Make product launch campaign"),
|
|
4104
5085
|
pixeldojo_film: render("Make short film"),
|
|
4105
5086
|
pixeldojo_episode: render("Make faceless video"),
|
|
5087
|
+
pixeldojo_drama: render("Make micro-drama, short film or trailer"),
|
|
5088
|
+
pixeldojo_music_video: render("Make music video for a song"),
|
|
5089
|
+
pixeldojo_kata: render("Recreate an edit with your cast"),
|
|
4106
5090
|
pixeldojo_run_workflow: render("Run saved workflow"),
|
|
4107
5091
|
pixeldojo_upload: render("Upload local file"),
|
|
4108
5092
|
pixeldojo_save_workflow: { ...render("Save workflow"), destructiveHint: true },
|
|
@@ -4111,6 +5095,8 @@ var init_skills = __esm({
|
|
|
4111
5095
|
pixeldojo_library: read("Search media library"),
|
|
4112
5096
|
pixeldojo_save: render("Save to My Media"),
|
|
4113
5097
|
pixeldojo_save_character: render("Save character or element"),
|
|
5098
|
+
pixeldojo_build_character: render("Build AI character from traits"),
|
|
5099
|
+
pixeldojo_perform: render("Make character dance or do a trend"),
|
|
4114
5100
|
pixeldojo_list_workflows: read("List saved workflows"),
|
|
4115
5101
|
pixeldojo_from_url: { ...read("Read product page"), openWorldHint: true }
|
|
4116
5102
|
};
|
|
@@ -4120,10 +5106,10 @@ function makeAttributedClient(options) {
|
|
|
4120
5106
|
const { mcpVersion, skillName, baseFetch, ...sdkOptions } = options;
|
|
4121
5107
|
const real = baseFetch ?? globalThis.fetch.bind(globalThis);
|
|
4122
5108
|
const wrappedFetch = (input, init) => {
|
|
4123
|
-
const
|
|
4124
|
-
|
|
4125
|
-
if (skillName)
|
|
4126
|
-
return real(input, { ...init, headers:
|
|
5109
|
+
const headers4 = new Headers(init?.headers);
|
|
5110
|
+
headers4.set("x-pixeldojo-source", `mcp/${mcpVersion}`);
|
|
5111
|
+
if (skillName) headers4.set("x-pixeldojo-skill", skillName);
|
|
5112
|
+
return real(input, { ...init, headers: headers4 });
|
|
4127
5113
|
};
|
|
4128
5114
|
return new sdk.PixelDojoClient({
|
|
4129
5115
|
...sdkOptions,
|
|
@@ -4167,7 +5153,7 @@ function makeRedactedLogger(target = console) {
|
|
|
4167
5153
|
}
|
|
4168
5154
|
|
|
4169
5155
|
// src/server.ts
|
|
4170
|
-
var PACKAGE_VERSION = "0.
|
|
5156
|
+
var PACKAGE_VERSION = "0.31.0" ;
|
|
4171
5157
|
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.";
|
|
4172
5158
|
function buildServer(options) {
|
|
4173
5159
|
if (!options.apiKey) {
|