@pixeldojo/mcp 0.26.0 → 0.30.0

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