@marlinjai/studio-mcp 0.15.0 → 0.17.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 CHANGED
@@ -169,6 +169,7 @@ Nothing breaks for an existing caller that sends a real brand slug: every argume
169
169
  - **`studio_generate_image` no longer requires `brandSlug`.** Leave it out and the image is generated without a brand. Up to 0.4.0 the field was required, so an agent of a company with no brand sent a made-up slug. Since 2026-10-11 the Studio refuses a slug that names no brand of the key's company (`404`, `code: "input_not_found"`) instead of generating without a style into a project of that name, which left such an agent with no way to make an image at all.
170
170
  - **`studio_generate_image` takes `projectId`.** The image is filed in that project (one of the company's, from `studio_list_projects`). Without it the image lands in the project named after the brand, or in `default` when there is no brand.
171
171
  - **The candidate plan is passed through.** The result carries `candidates: { requested, rendered, mayRender? }` as the Studio reported it when it accepted the job, and a `notice` sentence when fewer images will be made than `candidateCount` asked for: most KIE image models render one image whatever the count. Only rendered images are charged.
172
+ - **People never go to KIE.** A request that carries a person (a character, a try-on, a swap, or an uploaded or referenced image or video) runs on the fal model of an automatic entry (`route/...`) only, priced as the fal model, and a model pinned to KIE (`kie/...`) is refused for it with `person_model_not_available` and the fal or automatic entry to use instead.
172
173
  - **A refusal reaches the agent as the Studio worded it.** The Studio's `error` sentence, which names the next step, is handed on unchanged, followed by a `hint` the sentence does not already contain and by the machine `code`, for example `POST /api/generate -> 404: Brand 'acme' not found. Create the brand first (POST /api/brands, or the studio_create_brand tool), or leave brandSlug out to generate without a brand. (code: input_not_found)`. Up to 0.4.0 the `code` and the `hint` were dropped. A client that matched a tool error by its exact full text sees the added ` (code: ...)` suffix; the sentence before it is unchanged.
173
174
  - **Descriptions match the Studio of 2026-10-11.** `studio_get_usage` describes the `credits` field (balance, daily limit, used today, reset time); `studio_list_characters`, `studio_get_character` and the `characterSlug` arguments describe shared characters (readable and castable, not editable, reference images as Studio addresses); `studio_upload_brand_reference` and `studio_replace_character_in_video` say that a slug the company cannot use is a `404` before anything is spent.
174
175
 
@@ -239,7 +240,7 @@ real person: I confirm the likeness acknowledgement for this character.
239
240
 
240
241
  ```text
241
242
  Generate a 16:9 image for brand "busbasis" with Bruno at a workbench in a bright workshop,
242
- model kie/nano-banana-2, and tell me the cost.
243
+ model route/nano-banana-2, and tell me the cost.
243
244
  ```
244
245
 
245
246
  ```text
package/dist/cli.js CHANGED
@@ -565,13 +565,14 @@ var veo = (tier, label) => {
565
565
  fallback: { start: `fal/${slug2}-image-to-video`, startAndEnd: `fal/${slug2}-first-last-frame` }
566
566
  };
567
567
  };
568
- var image = (slug2, label, defaultTier) => ({
568
+ var image = (slug2, label, defaultTier, fallbackWithImages) => ({
569
569
  kind: "image",
570
570
  id: `route/${slug2}`,
571
571
  label: `${label} (KIE, fal fallback)`,
572
572
  primary: `kie/${slug2}`,
573
573
  fallback: `fal/${slug2}`,
574
- defaultTier
574
+ defaultTier,
575
+ ...fallbackWithImages ? { fallbackWithImages } : {}
575
576
  });
576
577
  var ROUTES = [
577
578
  veo("lite", "Veo 3.1 Lite"),
@@ -650,7 +651,8 @@ var ROUTES = [
650
651
  primary: "kie/wan-3-0-image-to-video",
651
652
  fallback: { start: "fal/wan-3-0-image-to-video" }
652
653
  },
653
- image("nano-banana-2", "Nano Banana 2", "1K"),
654
+ // A character or reference image on the default image route: fal takes it on the edit endpoint.
655
+ image("nano-banana-2", "Nano Banana 2", "1K", "fal/nano-banana-2-edit"),
654
656
  image("nano-banana-2-edit", "Nano Banana 2 Edit", "1K"),
655
657
  image("nano-banana-pro", "Nano Banana Pro", "1K"),
656
658
  image("nano-banana-pro-edit", "Nano Banana Pro Edit", "1K"),
@@ -1513,7 +1515,23 @@ var CATALOG_ENTRIES = [
1513
1515
  modality: "audio",
1514
1516
  task: "text-to-speech",
1515
1517
  label: "ElevenLabs Multilingual v2 (TTS)",
1516
- description: "ElevenLabs Multilingual v2 text-to-speech. 99+ languages, brand-voice cloning capable. Default text-to-speech. Returns mp3 bytes synchronously.",
1518
+ description: "ElevenLabs Multilingual v2 text-to-speech. 99+ languages, brand-voice cloning capable. Default text-to-speech. Returns mp3 bytes synchronously. Up to 10,000 characters per request.",
1519
+ // ElevenLabs' text-to-speech API (voice_settings, checked 2026-10-25):
1520
+ // stability and similarity_boost run from 0 to 1 with defaults 0.5 and
1521
+ // 0.75; speed from 0.7 to 1.2 with 1 as the normal pace (its help center
1522
+ // states the bounds). Multilingual v2 takes 10,000 characters per request
1523
+ // (its models page). `speechRequestRefusal` refuses anything outside these
1524
+ // before a request is admitted.
1525
+ capabilities: {
1526
+ speech: {
1527
+ maxCharacters: 1e4,
1528
+ voiceSettings: {
1529
+ stability: { min: 0, max: 1, step: 0.05, default: 0.5 },
1530
+ similarityBoost: { min: 0, max: 1, step: 0.05, default: 0.75 },
1531
+ speed: { min: 0.7, max: 1.2, step: 0.05, default: 1 }
1532
+ }
1533
+ }
1534
+ },
1517
1535
  isDefault: true
1518
1536
  },
1519
1537
  {
@@ -1577,14 +1595,20 @@ var CATALOG_ENTRIES = [
1577
1595
  modality: "image",
1578
1596
  task: "text-to-image",
1579
1597
  label: "Gemini 2.5 Flash Image",
1580
- description: "Vertex AI direct. Fallback if KIE pricing or reliability turns sour. Needs GAC_JSON provisioning to activate. Google retires this model on 2027-03-15 (deprecations table, checked 2026-10-07); its named successor is gemini-3.1-flash-lite-image."
1598
+ description: "Vertex AI direct. Fallback if KIE pricing or reliability turns sour. Needs GAC_JSON provisioning to activate. Google retires this model on 2027-03-15 (deprecations table, checked 2026-10-07); its named successor is gemini-3.1-flash-lite-image.",
1599
+ // Google's model page (read 2026-10-25): "Maximum images per prompt: 3".
1600
+ // The adapter sends every image inline, downloading Studio references
1601
+ // first (providers/vertex.ts), up to 7 MB each.
1602
+ capabilities: { maxInputImages: 3 }
1581
1603
  },
1582
1604
  {
1583
1605
  id: "vertex/gemini-3-pro-image-preview",
1584
1606
  provider: "vertex",
1585
1607
  modality: "image",
1586
1608
  task: "text-to-image",
1587
- label: "Nano Banana Pro (preview)"
1609
+ label: "Nano Banana Pro (preview)",
1610
+ // Google's model page for Gemini 3 Pro Image (read 2026-10-25): "Maximum images per prompt: 14".
1611
+ capabilities: { maxInputImages: 14 }
1588
1612
  },
1589
1613
  {
1590
1614
  id: "vertex/gemini-3-1-flash-image-preview",
@@ -1592,16 +1616,29 @@ var CATALOG_ENTRIES = [
1592
1616
  modality: "image",
1593
1617
  task: "text-to-image",
1594
1618
  label: "Gemini 3.1 Flash Image (preview)",
1595
- description: "Vertex AI direct, newest flash variant. Global region. Preview status."
1619
+ description: "Vertex AI direct, newest flash variant. Global region. Preview status.",
1620
+ // Google's model page for Gemini 3.1 Flash Image (read 2026-10-25): "Maximum images per prompt: 14".
1621
+ capabilities: { maxInputImages: 14 }
1596
1622
  }
1597
1623
  ];
1598
1624
  var PINNED_FAL_NOTE = "Pinned to fal: a job on this entry never goes to KIE.";
1599
1625
  var PINNED_KIE_NOTE = "Pinned to KIE: no fal fallback. Pick the automatic entry of this model to get one.";
1626
+ var KIE_PERSON_NOTE = "Not available for images of people (a character, a try-on, a swap, or an uploaded or referenced image or video), because KIE offers no data processing agreement.";
1627
+ var ROUTE_PERSON_NOTE = "A request with a person in it (a character, a try-on, a swap, or an uploaded or referenced image or video) skips KIE and runs on fal only, priced as the fal model.";
1628
+ function kiePersonNote(entry) {
1629
+ if (entry.provider !== "kie" || entry.modality !== "image" && entry.modality !== "video") return null;
1630
+ const role = routeRoleOf(entry.id);
1631
+ if (role?.role !== "primary") return `${KIE_PERSON_NOTE} For those, pick a fal model.`;
1632
+ const route = role.route;
1633
+ const twin = route.kind === "image" ? route.fallback : "byResolution" in route.fallback ? Object.values(route.fallback.byResolution)[0] : route.fallback.start;
1634
+ return `${KIE_PERSON_NOTE} For those, pick ${twin} or the automatic entry ${route.id}, which runs them on fal.`;
1635
+ }
1600
1636
  function withRouteNote(entry) {
1601
1637
  const role = routeRoleOf(entry.id);
1602
- if (!role) return entry;
1603
- const note = role.role === "fallback" ? PINNED_FAL_NOTE : PINNED_KIE_NOTE;
1604
- return { ...entry, description: `${entry.description ?? ""} ${note}`.trim() };
1638
+ const person = kiePersonNote(entry);
1639
+ if (!role && !person) return entry;
1640
+ const note = !role ? "" : role.role === "fallback" ? PINNED_FAL_NOTE : PINNED_KIE_NOTE;
1641
+ return { ...entry, description: [entry.description ?? "", note, person ?? ""].filter(Boolean).join(" ").trim() };
1605
1642
  }
1606
1643
  var MODEL_CATALOG = CATALOG_ENTRIES.map(withRouteNote);
1607
1644
  var routeEntries = /* @__PURE__ */ new Map();
@@ -1618,7 +1655,7 @@ function routeEntry(id) {
1618
1655
  isDefault: void 0,
1619
1656
  id: route.id,
1620
1657
  label: route.label,
1621
- description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
1658
+ description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ${ROUTE_PERSON_NOTE} ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
1622
1659
  };
1623
1660
  routeEntries.set(id, entry);
1624
1661
  return entry;
@@ -2071,6 +2108,12 @@ var VIDEO_MAX_SECONDS_AT_RESOLUTION = {
2071
2108
  [LTX_25_FAST_I2V_ENDPOINT]: { "4k": 10 }
2072
2109
  };
2073
2110
  var VIDEO_UNSUPPORTED_PARAMS = {
2111
+ // Kling 2.5 Turbo and Seedance 1.0 Pro render silent clips and their schemas
2112
+ // declare no audio field at all (fal model schemas, checked 2026-10-25), so a
2113
+ // sound choice is refused before submit instead of being sent and ignored.
2114
+ "fal-ai/kling-video/v2.5-turbo/pro/image-to-video": ["generateAudio"],
2115
+ "fal-ai/bytedance/seedance/v1/pro/image-to-video": ["generateAudio"],
2116
+ "fal-ai/bytedance/seedance/v1/pro/text-to-video": ["generateAudio"],
2074
2117
  // Kling O3 Edit follows the source clip: its length, frame, size and look are
2075
2118
  // the source's, and the endpoint declares none of these knobs. A duration in
2076
2119
  // particular would only have been a (wrong) billing figure; the completer
@@ -2117,6 +2160,22 @@ var VIDEO_UNSUPPORTED_PARAMS = {
2117
2160
  [KLING_O3_PRO_R2V_ENDPOINT]: ["resolution", "seed", "negativePrompt"],
2118
2161
  ...Object.fromEntries(LTX_25_I2V_ENDPOINTS.map((e) => [e, ["seed", "negativePrompt"]]))
2119
2162
  };
2163
+ var VIDEO_AUDIO_SWITCH = {
2164
+ ...Object.fromEntries(VEO_ENDPOINTS.map((e) => [e, { default: false }])),
2165
+ [KLING_26_I2V_ENDPOINT]: { default: false },
2166
+ ...Object.fromEntries(KLING_O3_I2V_ENDPOINTS.map((e) => [e, { default: false }])),
2167
+ [KLING_O3_PRO_R2V_ENDPOINT]: { default: false },
2168
+ "bytedance/seedance-2.5/image-to-video": { default: true },
2169
+ "bytedance/seedance-2.0/image-to-video": { default: true },
2170
+ [WAN_30_I2V_ENDPOINT]: { default: true },
2171
+ ...Object.fromEntries(LTX_25_I2V_ENDPOINTS.map((e) => [e, { default: true }])),
2172
+ "blackforestlabs/flux-3/image-to-video/draft": { default: true },
2173
+ "blackforestlabs/flux-3/first-last-frame-to-video/draft": { default: true },
2174
+ "blackforestlabs/flux-3/keyframes-to-video/draft": { default: true },
2175
+ "blackforestlabs/flux-3/image-to-video": { default: true },
2176
+ "blackforestlabs/flux-3/first-last-frame-to-video": { default: true },
2177
+ "blackforestlabs/flux-3/keyframes-to-video": { default: true }
2178
+ };
2120
2179
  var ROWS = [
2121
2180
  [0, "Idle", "DailyActions", "Idle"],
2122
2181
  [1, "Walking_Woman", "WalkAndRun", "Walking"],
@@ -3224,13 +3283,14 @@ var veo2 = (tier, label) => {
3224
3283
  fallback: { start: `fal/${slug2}-image-to-video`, startAndEnd: `fal/${slug2}-first-last-frame` }
3225
3284
  };
3226
3285
  };
3227
- var image2 = (slug2, label, defaultTier) => ({
3286
+ var image2 = (slug2, label, defaultTier, fallbackWithImages) => ({
3228
3287
  kind: "image",
3229
3288
  id: `route/${slug2}`,
3230
3289
  label: `${label} (KIE, fal fallback)`,
3231
3290
  primary: `kie/${slug2}`,
3232
3291
  fallback: `fal/${slug2}`,
3233
- defaultTier
3292
+ defaultTier,
3293
+ ...fallbackWithImages ? { fallbackWithImages } : {}
3234
3294
  });
3235
3295
  var ROUTES2 = [
3236
3296
  veo2("lite", "Veo 3.1 Lite"),
@@ -3309,7 +3369,8 @@ var ROUTES2 = [
3309
3369
  primary: "kie/wan-3-0-image-to-video",
3310
3370
  fallback: { start: "fal/wan-3-0-image-to-video" }
3311
3371
  },
3312
- image2("nano-banana-2", "Nano Banana 2", "1K"),
3372
+ // A character or reference image on the default image route: fal takes it on the edit endpoint.
3373
+ image2("nano-banana-2", "Nano Banana 2", "1K", "fal/nano-banana-2-edit"),
3313
3374
  image2("nano-banana-2-edit", "Nano Banana 2 Edit", "1K"),
3314
3375
  image2("nano-banana-pro", "Nano Banana Pro", "1K"),
3315
3376
  image2("nano-banana-pro-edit", "Nano Banana Pro Edit", "1K"),
@@ -4172,7 +4233,23 @@ var CATALOG_ENTRIES2 = [
4172
4233
  modality: "audio",
4173
4234
  task: "text-to-speech",
4174
4235
  label: "ElevenLabs Multilingual v2 (TTS)",
4175
- description: "ElevenLabs Multilingual v2 text-to-speech. 99+ languages, brand-voice cloning capable. Default text-to-speech. Returns mp3 bytes synchronously.",
4236
+ description: "ElevenLabs Multilingual v2 text-to-speech. 99+ languages, brand-voice cloning capable. Default text-to-speech. Returns mp3 bytes synchronously. Up to 10,000 characters per request.",
4237
+ // ElevenLabs' text-to-speech API (voice_settings, checked 2026-10-25):
4238
+ // stability and similarity_boost run from 0 to 1 with defaults 0.5 and
4239
+ // 0.75; speed from 0.7 to 1.2 with 1 as the normal pace (its help center
4240
+ // states the bounds). Multilingual v2 takes 10,000 characters per request
4241
+ // (its models page). `speechRequestRefusal` refuses anything outside these
4242
+ // before a request is admitted.
4243
+ capabilities: {
4244
+ speech: {
4245
+ maxCharacters: 1e4,
4246
+ voiceSettings: {
4247
+ stability: { min: 0, max: 1, step: 0.05, default: 0.5 },
4248
+ similarityBoost: { min: 0, max: 1, step: 0.05, default: 0.75 },
4249
+ speed: { min: 0.7, max: 1.2, step: 0.05, default: 1 }
4250
+ }
4251
+ }
4252
+ },
4176
4253
  isDefault: true
4177
4254
  },
4178
4255
  {
@@ -4236,14 +4313,20 @@ var CATALOG_ENTRIES2 = [
4236
4313
  modality: "image",
4237
4314
  task: "text-to-image",
4238
4315
  label: "Gemini 2.5 Flash Image",
4239
- description: "Vertex AI direct. Fallback if KIE pricing or reliability turns sour. Needs GAC_JSON provisioning to activate. Google retires this model on 2027-03-15 (deprecations table, checked 2026-10-07); its named successor is gemini-3.1-flash-lite-image."
4316
+ description: "Vertex AI direct. Fallback if KIE pricing or reliability turns sour. Needs GAC_JSON provisioning to activate. Google retires this model on 2027-03-15 (deprecations table, checked 2026-10-07); its named successor is gemini-3.1-flash-lite-image.",
4317
+ // Google's model page (read 2026-10-25): "Maximum images per prompt: 3".
4318
+ // The adapter sends every image inline, downloading Studio references
4319
+ // first (providers/vertex.ts), up to 7 MB each.
4320
+ capabilities: { maxInputImages: 3 }
4240
4321
  },
4241
4322
  {
4242
4323
  id: "vertex/gemini-3-pro-image-preview",
4243
4324
  provider: "vertex",
4244
4325
  modality: "image",
4245
4326
  task: "text-to-image",
4246
- label: "Nano Banana Pro (preview)"
4327
+ label: "Nano Banana Pro (preview)",
4328
+ // Google's model page for Gemini 3 Pro Image (read 2026-10-25): "Maximum images per prompt: 14".
4329
+ capabilities: { maxInputImages: 14 }
4247
4330
  },
4248
4331
  {
4249
4332
  id: "vertex/gemini-3-1-flash-image-preview",
@@ -4251,16 +4334,29 @@ var CATALOG_ENTRIES2 = [
4251
4334
  modality: "image",
4252
4335
  task: "text-to-image",
4253
4336
  label: "Gemini 3.1 Flash Image (preview)",
4254
- description: "Vertex AI direct, newest flash variant. Global region. Preview status."
4337
+ description: "Vertex AI direct, newest flash variant. Global region. Preview status.",
4338
+ // Google's model page for Gemini 3.1 Flash Image (read 2026-10-25): "Maximum images per prompt: 14".
4339
+ capabilities: { maxInputImages: 14 }
4255
4340
  }
4256
4341
  ];
4257
4342
  var PINNED_FAL_NOTE2 = "Pinned to fal: a job on this entry never goes to KIE.";
4258
4343
  var PINNED_KIE_NOTE2 = "Pinned to KIE: no fal fallback. Pick the automatic entry of this model to get one.";
4344
+ var KIE_PERSON_NOTE2 = "Not available for images of people (a character, a try-on, a swap, or an uploaded or referenced image or video), because KIE offers no data processing agreement.";
4345
+ var ROUTE_PERSON_NOTE2 = "A request with a person in it (a character, a try-on, a swap, or an uploaded or referenced image or video) skips KIE and runs on fal only, priced as the fal model.";
4346
+ function kiePersonNote2(entry) {
4347
+ if (entry.provider !== "kie" || entry.modality !== "image" && entry.modality !== "video") return null;
4348
+ const role = routeRoleOf2(entry.id);
4349
+ if (role?.role !== "primary") return `${KIE_PERSON_NOTE2} For those, pick a fal model.`;
4350
+ const route = role.route;
4351
+ const twin = route.kind === "image" ? route.fallback : "byResolution" in route.fallback ? Object.values(route.fallback.byResolution)[0] : route.fallback.start;
4352
+ return `${KIE_PERSON_NOTE2} For those, pick ${twin} or the automatic entry ${route.id}, which runs them on fal.`;
4353
+ }
4259
4354
  function withRouteNote2(entry) {
4260
4355
  const role = routeRoleOf2(entry.id);
4261
- if (!role) return entry;
4262
- const note = role.role === "fallback" ? PINNED_FAL_NOTE2 : PINNED_KIE_NOTE2;
4263
- return { ...entry, description: `${entry.description ?? ""} ${note}`.trim() };
4356
+ const person = kiePersonNote2(entry);
4357
+ if (!role && !person) return entry;
4358
+ const note = !role ? "" : role.role === "fallback" ? PINNED_FAL_NOTE2 : PINNED_KIE_NOTE2;
4359
+ return { ...entry, description: [entry.description ?? "", note, person ?? ""].filter(Boolean).join(" ").trim() };
4264
4360
  }
4265
4361
  var MODEL_CATALOG2 = CATALOG_ENTRIES2.map(withRouteNote2);
4266
4362
  var routeEntries2 = /* @__PURE__ */ new Map();
@@ -4277,7 +4373,7 @@ function routeEntry2(id) {
4277
4373
  isDefault: void 0,
4278
4374
  id: route.id,
4279
4375
  label: route.label,
4280
- description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
4376
+ description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ${ROUTE_PERSON_NOTE2} ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
4281
4377
  };
4282
4378
  routeEntries2.set(id, entry);
4283
4379
  return entry;
@@ -4824,6 +4920,18 @@ function opTouches(doc, op) {
4824
4920
  }
4825
4921
  return [...out];
4826
4922
  }
4923
+ var MEDIA_INPUT_KEYS = [
4924
+ "inputImages",
4925
+ "inputImage",
4926
+ "inputImageUrl",
4927
+ "endImageUrl",
4928
+ "keyframeImageUrls",
4929
+ "referenceImageUrls",
4930
+ "inputVideoUrl",
4931
+ "draftCacheUrl",
4932
+ "parentAssetId"
4933
+ ];
4934
+ var MEDIA_KEYS = new Set(MEDIA_INPUT_KEYS);
4827
4935
  var RECIPE_EFFECT_TYPES = ["createCharacter", "addCharacterReference", "createBrand", "addBrandReference"];
4828
4936
  var EffectValueSourceSchema = z5.discriminatedUnion("kind", [
4829
4937
  z5.object({ kind: z5.literal("literal"), value: JsonNonNullValueSchema }),
@@ -5192,7 +5300,7 @@ function documentToDefinition(doc, opts = {}) {
5192
5300
  const keyframes = port === "image" && task === "image-to-video" && modelAcceptsKeyframes(node.model);
5193
5301
  const references = port === "reference";
5194
5302
  const listKey = orderedPortKey(task, port, 0, node.model) ?? b.key;
5195
- const items = [];
5303
+ const items2 = [];
5196
5304
  const itemSources = [];
5197
5305
  let uploading = false;
5198
5306
  for (const [ordinal, e] of portWires.entries()) {
@@ -5233,11 +5341,11 @@ function documentToDefinition(doc, opts = {}) {
5233
5341
  if (!item) continue;
5234
5342
  if (single) inputs[key] = item;
5235
5343
  else {
5236
- items.push(item);
5344
+ items2.push(item);
5237
5345
  itemSources.push(e.source);
5238
5346
  }
5239
5347
  }
5240
- if (references && !uploading && items.length > 0) {
5348
+ if (references && !uploading && items2.length > 0) {
5241
5349
  const limits = modelCharacterReferences(node.model);
5242
5350
  const grouped = limits ? referenceElementsFor(
5243
5351
  itemSources,
@@ -5250,7 +5358,7 @@ function documentToDefinition(doc, opts = {}) {
5250
5358
  if (grouped.ok) {
5251
5359
  inputs[listKey] = {
5252
5360
  kind: "list",
5253
- items: grouped.order.map((i) => items[i])
5361
+ items: grouped.order.map((i) => items2[i])
5254
5362
  };
5255
5363
  inputs.referenceElementIndexes = {
5256
5364
  kind: "literal",
@@ -5265,9 +5373,9 @@ function documentToDefinition(doc, opts = {}) {
5265
5373
  }
5266
5374
  continue;
5267
5375
  }
5268
- if (!uploading && items.length > 0)
5269
- inputs[listKey] = { kind: "list", items };
5270
- if (keyframes && !uploading && items.length > 0) {
5376
+ if (!uploading && items2.length > 0)
5377
+ inputs[listKey] = { kind: "list", items: items2 };
5378
+ if (keyframes && !uploading && items2.length > 0) {
5271
5379
  const positions = keyframePositionsFor(
5272
5380
  portWires.map((e) => e.source),
5273
5381
  node.settings
@@ -5889,7 +5997,7 @@ var studioWorkflowDescribe = defineTool({
5889
5997
  inputSchema: {
5890
5998
  tasks: z7.array(z7.string().min(1)).min(1).optional().describe('Only these task ids (e.g. ["text-to-image", "image-to-video"]). An unknown id is an error that lists the known ones.'),
5891
5999
  includeSettings: z7.boolean().default(false).describe("Include each task's settings knobs (key, type, range, default)."),
5892
- includeModels: z7.boolean().default(false).describe("Include the model catalog per task (id, label, provider, price, isDefault). price is what one generation costs your company at the default settings: { usd, fromUsd? }.")
6000
+ includeModels: z7.boolean().default(false).describe("Include the model catalog per task (id, label, provider, price, isDefault). price is what one generation costs your company at the default settings: { usd, fromUsd? }. A voice model is billed per character: its price is { usd, per: { characters: 1000 }, maxUsd }, usd for 1,000 characters and maxUsd the most one generation costs.")
5893
6001
  },
5894
6002
  annotations: { readOnlyHint: true },
5895
6003
  handler: async (args, ctx) => {
@@ -7046,7 +7154,7 @@ var studioGenerateImage = defineTool({
7046
7154
  projectId: z12.string().min(1).optional().describe(
7047
7155
  'Optional project to file the image under (an id from studio_list_projects; it must be a project of your company, anything else is a 404). Omit it to use the project named after brandSlug, or "default" when there is no brand.'
7048
7156
  ),
7049
- model: z12.string().optional().describe('Image model id (e.g. "kie/nano-banana-2", "fal/nano-banana-2"). Omit for the Studio default.'),
7157
+ model: z12.string().optional().describe('Image model id (e.g. "route/nano-banana-2", "fal/nano-banana-2"). Omit for the Studio default. A model pinned to KIE (kie/...) is not available for images of people (a character, a try-on, a swap, or an uploaded or referenced image) and is refused for them: use its fal entry (fal/...) or its automatic entry (route/...), which runs such a request on fal only.'),
7050
7158
  aspectRatio: z12.string().optional().describe('Aspect ratio such as "1:1", "16:9", "3:4".'),
7051
7159
  imageSize: z12.string().optional().describe('Provider size hint, e.g. "1K", "2K".'),
7052
7160
  seed: z12.number().int().optional(),
@@ -7419,7 +7527,7 @@ var studioUploadBrandReference = defineTool({
7419
7527
  }
7420
7528
  });
7421
7529
  var workflowDefinitionSchema = WorkflowDefinitionSchema.describe(
7422
- `Inline workflow DAG: { id, label?, params?: [{ name, type: string|number|boolean|json, required?, label?, description?, inputType?, cardinality?: one|many, default? }], nodes: [{ id, task (one of the model tasks listed), model (catalog id, e.g. fal/nano-banana-2-edit), inputs, retry? }] }. Node inputs are bindings: {kind:"literal",value}, {kind:"param",name,wrap?:"array"}, {kind:"ref",node,path:"url",wrap?:"array"} or an ordered {kind:"list",items:[...]} of those. Image-edit nodes take inputImages (an array: one wrapped ref/param, or a list in reference order, scene frame first); image-to-video nodes take inputImageUrl (start frame) and optionally endImageUrl (end frame, on models that accept one), EXCEPT on a keyframes model (fal/flux-3-keyframes-to-video and its -draft tier), which instead takes keyframeImageUrls (an ordered list of up to 10 images) with keyframeFrameIndexes (one strictly increasing frame per image on a fixed 24 fps timeline). Pass one shape or the other, never both. To hold a character's identity through the clip, an image-to-video node on a model with character references (route/kling-o3, kie/kling-o3-image-to-video, fal/kling-o3-pro-reference-to-video) also takes referenceImageUrls (a list of character photos, grouped by character, each character's frontal view first, 2 to 4 images per character, up to 3 characters) with referenceElementIndexes (the 0-based character of each image, ascending without gaps, e.g. [0,0,0,1,1]); they never count as the start or end frame, and they need inputImageUrl. kie/gemini-omni-flash-1-1-reference-to-video takes the same two fields with 1 to 6 character images in all and no end frame: its start frame goes in as reference image 1, named in the prompt as the exact scene and first frame, because KIE does not lock a first frame in its reference mode.`
7530
+ `Inline workflow DAG: { id, label?, params?: [{ name, type: string|number|boolean|json, required?, label?, description?, inputType?, cardinality?: one|many, default? }], nodes: [{ id, task (one of the model tasks listed), model (catalog id, e.g. fal/nano-banana-2-edit), inputs, retry? }] }. Node inputs are bindings: {kind:"literal",value}, {kind:"param",name,wrap?:"array"}, {kind:"ref",node,path:"url",wrap?:"array"} or an ordered {kind:"list",items:[...]} of those. Image-edit nodes take inputImages (an array: one wrapped ref/param, or a list in reference order, scene frame first); image-to-video nodes take inputImageUrl (start frame) and optionally endImageUrl (end frame, on models that accept one), EXCEPT on a keyframes model (fal/flux-3-keyframes-to-video and its -draft tier), which instead takes keyframeImageUrls (an ordered list of up to 10 images) with keyframeFrameIndexes (one strictly increasing frame per image on a fixed 24 fps timeline). Pass one shape or the other, never both. To hold a character's identity through the clip, an image-to-video node on a model with character references (route/kling-o3 or fal/kling-o3-pro-reference-to-video; a model pinned to KIE, kie/..., is not available for images of people and refuses a run whose node carries a character, a try-on, a swap or an uploaded or referenced image or video, so use the fal or route/ entry for those) also takes referenceImageUrls (a list of character photos, grouped by character, each character's frontal view first, 2 to 4 images per character, up to 3 characters) with referenceElementIndexes (the 0-based character of each image, ascending without gaps, e.g. [0,0,0,1,1]); they never count as the start or end frame, and they need inputImageUrl. kie/gemini-omni-flash-1-1-reference-to-video takes the same two fields with 1 to 6 character images in all and no end frame: its start frame goes in as reference image 1, named in the prompt as the exact scene and first frame, because KIE does not lock a first frame in its reference mode. It runs on KIE, so while Studio keeps people off KIE it is refused for character references like every other kie/ model.`
7423
7531
  );
7424
7532
  var studioRunWorkflow = defineTool({
7425
7533
  name: "studio_run_workflow",
@@ -7772,7 +7880,7 @@ function registerTools(server, base) {
7772
7880
 
7773
7881
  // src/server.ts
7774
7882
  var SERVER_NAME = "lumitra-studio";
7775
- var SERVER_VERSION = "0.15.0";
7883
+ var SERVER_VERSION = "0.17.0";
7776
7884
  function createStudioMcpServer(opts = {}) {
7777
7885
  const config = opts.config ?? resolveConfig(opts.env ?? process.env);
7778
7886
  const client = new StudioClient(config, {
package/dist/index.d.ts CHANGED
@@ -1578,6 +1578,20 @@ interface TaskDescriptor {
1578
1578
  id: string;
1579
1579
  label?: string;
1580
1580
  provider?: string;
1581
+ /**
1582
+ * What one generation costs your company at the default settings. For a
1583
+ * model billed per character of its text (a voice model), `per` names the
1584
+ * unit: `usd` is the price of `per.characters` characters and `maxUsd` the
1585
+ * most one generation costs, at the longest text the model takes.
1586
+ */
1587
+ price?: {
1588
+ usd: number;
1589
+ fromUsd?: number;
1590
+ per?: {
1591
+ characters: number;
1592
+ };
1593
+ maxUsd?: number;
1594
+ };
1581
1595
  }>;
1582
1596
  }
1583
1597
  interface NodeTypesResponse {
@@ -2168,7 +2182,7 @@ declare function registerTools(server: McpServer, base: ToolContext): void;
2168
2182
  */
2169
2183
 
2170
2184
  declare const SERVER_NAME = "lumitra-studio";
2171
- declare const SERVER_VERSION = "0.15.0";
2185
+ declare const SERVER_VERSION = "0.17.0";
2172
2186
  interface CreateServerOptions {
2173
2187
  config?: StudioConfig;
2174
2188
  env?: NodeJS.ProcessEnv;
package/dist/index.js CHANGED
@@ -557,13 +557,14 @@ var veo = (tier, label) => {
557
557
  fallback: { start: `fal/${slug2}-image-to-video`, startAndEnd: `fal/${slug2}-first-last-frame` }
558
558
  };
559
559
  };
560
- var image = (slug2, label, defaultTier) => ({
560
+ var image = (slug2, label, defaultTier, fallbackWithImages) => ({
561
561
  kind: "image",
562
562
  id: `route/${slug2}`,
563
563
  label: `${label} (KIE, fal fallback)`,
564
564
  primary: `kie/${slug2}`,
565
565
  fallback: `fal/${slug2}`,
566
- defaultTier
566
+ defaultTier,
567
+ ...fallbackWithImages ? { fallbackWithImages } : {}
567
568
  });
568
569
  var ROUTES = [
569
570
  veo("lite", "Veo 3.1 Lite"),
@@ -642,7 +643,8 @@ var ROUTES = [
642
643
  primary: "kie/wan-3-0-image-to-video",
643
644
  fallback: { start: "fal/wan-3-0-image-to-video" }
644
645
  },
645
- image("nano-banana-2", "Nano Banana 2", "1K"),
646
+ // A character or reference image on the default image route: fal takes it on the edit endpoint.
647
+ image("nano-banana-2", "Nano Banana 2", "1K", "fal/nano-banana-2-edit"),
646
648
  image("nano-banana-2-edit", "Nano Banana 2 Edit", "1K"),
647
649
  image("nano-banana-pro", "Nano Banana Pro", "1K"),
648
650
  image("nano-banana-pro-edit", "Nano Banana Pro Edit", "1K"),
@@ -1505,7 +1507,23 @@ var CATALOG_ENTRIES = [
1505
1507
  modality: "audio",
1506
1508
  task: "text-to-speech",
1507
1509
  label: "ElevenLabs Multilingual v2 (TTS)",
1508
- description: "ElevenLabs Multilingual v2 text-to-speech. 99+ languages, brand-voice cloning capable. Default text-to-speech. Returns mp3 bytes synchronously.",
1510
+ description: "ElevenLabs Multilingual v2 text-to-speech. 99+ languages, brand-voice cloning capable. Default text-to-speech. Returns mp3 bytes synchronously. Up to 10,000 characters per request.",
1511
+ // ElevenLabs' text-to-speech API (voice_settings, checked 2026-10-25):
1512
+ // stability and similarity_boost run from 0 to 1 with defaults 0.5 and
1513
+ // 0.75; speed from 0.7 to 1.2 with 1 as the normal pace (its help center
1514
+ // states the bounds). Multilingual v2 takes 10,000 characters per request
1515
+ // (its models page). `speechRequestRefusal` refuses anything outside these
1516
+ // before a request is admitted.
1517
+ capabilities: {
1518
+ speech: {
1519
+ maxCharacters: 1e4,
1520
+ voiceSettings: {
1521
+ stability: { min: 0, max: 1, step: 0.05, default: 0.5 },
1522
+ similarityBoost: { min: 0, max: 1, step: 0.05, default: 0.75 },
1523
+ speed: { min: 0.7, max: 1.2, step: 0.05, default: 1 }
1524
+ }
1525
+ }
1526
+ },
1509
1527
  isDefault: true
1510
1528
  },
1511
1529
  {
@@ -1569,14 +1587,20 @@ var CATALOG_ENTRIES = [
1569
1587
  modality: "image",
1570
1588
  task: "text-to-image",
1571
1589
  label: "Gemini 2.5 Flash Image",
1572
- description: "Vertex AI direct. Fallback if KIE pricing or reliability turns sour. Needs GAC_JSON provisioning to activate. Google retires this model on 2027-03-15 (deprecations table, checked 2026-10-07); its named successor is gemini-3.1-flash-lite-image."
1590
+ description: "Vertex AI direct. Fallback if KIE pricing or reliability turns sour. Needs GAC_JSON provisioning to activate. Google retires this model on 2027-03-15 (deprecations table, checked 2026-10-07); its named successor is gemini-3.1-flash-lite-image.",
1591
+ // Google's model page (read 2026-10-25): "Maximum images per prompt: 3".
1592
+ // The adapter sends every image inline, downloading Studio references
1593
+ // first (providers/vertex.ts), up to 7 MB each.
1594
+ capabilities: { maxInputImages: 3 }
1573
1595
  },
1574
1596
  {
1575
1597
  id: "vertex/gemini-3-pro-image-preview",
1576
1598
  provider: "vertex",
1577
1599
  modality: "image",
1578
1600
  task: "text-to-image",
1579
- label: "Nano Banana Pro (preview)"
1601
+ label: "Nano Banana Pro (preview)",
1602
+ // Google's model page for Gemini 3 Pro Image (read 2026-10-25): "Maximum images per prompt: 14".
1603
+ capabilities: { maxInputImages: 14 }
1580
1604
  },
1581
1605
  {
1582
1606
  id: "vertex/gemini-3-1-flash-image-preview",
@@ -1584,16 +1608,29 @@ var CATALOG_ENTRIES = [
1584
1608
  modality: "image",
1585
1609
  task: "text-to-image",
1586
1610
  label: "Gemini 3.1 Flash Image (preview)",
1587
- description: "Vertex AI direct, newest flash variant. Global region. Preview status."
1611
+ description: "Vertex AI direct, newest flash variant. Global region. Preview status.",
1612
+ // Google's model page for Gemini 3.1 Flash Image (read 2026-10-25): "Maximum images per prompt: 14".
1613
+ capabilities: { maxInputImages: 14 }
1588
1614
  }
1589
1615
  ];
1590
1616
  var PINNED_FAL_NOTE = "Pinned to fal: a job on this entry never goes to KIE.";
1591
1617
  var PINNED_KIE_NOTE = "Pinned to KIE: no fal fallback. Pick the automatic entry of this model to get one.";
1618
+ var KIE_PERSON_NOTE = "Not available for images of people (a character, a try-on, a swap, or an uploaded or referenced image or video), because KIE offers no data processing agreement.";
1619
+ var ROUTE_PERSON_NOTE = "A request with a person in it (a character, a try-on, a swap, or an uploaded or referenced image or video) skips KIE and runs on fal only, priced as the fal model.";
1620
+ function kiePersonNote(entry) {
1621
+ if (entry.provider !== "kie" || entry.modality !== "image" && entry.modality !== "video") return null;
1622
+ const role = routeRoleOf(entry.id);
1623
+ if (role?.role !== "primary") return `${KIE_PERSON_NOTE} For those, pick a fal model.`;
1624
+ const route = role.route;
1625
+ const twin = route.kind === "image" ? route.fallback : "byResolution" in route.fallback ? Object.values(route.fallback.byResolution)[0] : route.fallback.start;
1626
+ return `${KIE_PERSON_NOTE} For those, pick ${twin} or the automatic entry ${route.id}, which runs them on fal.`;
1627
+ }
1592
1628
  function withRouteNote(entry) {
1593
1629
  const role = routeRoleOf(entry.id);
1594
- if (!role) return entry;
1595
- const note = role.role === "fallback" ? PINNED_FAL_NOTE : PINNED_KIE_NOTE;
1596
- return { ...entry, description: `${entry.description ?? ""} ${note}`.trim() };
1630
+ const person = kiePersonNote(entry);
1631
+ if (!role && !person) return entry;
1632
+ const note = !role ? "" : role.role === "fallback" ? PINNED_FAL_NOTE : PINNED_KIE_NOTE;
1633
+ return { ...entry, description: [entry.description ?? "", note, person ?? ""].filter(Boolean).join(" ").trim() };
1597
1634
  }
1598
1635
  var MODEL_CATALOG = CATALOG_ENTRIES.map(withRouteNote);
1599
1636
  var routeEntries = /* @__PURE__ */ new Map();
@@ -1610,7 +1647,7 @@ function routeEntry(id) {
1610
1647
  isDefault: void 0,
1611
1648
  id: route.id,
1612
1649
  label: route.label,
1613
- description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
1650
+ description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ${ROUTE_PERSON_NOTE} ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
1614
1651
  };
1615
1652
  routeEntries.set(id, entry);
1616
1653
  return entry;
@@ -2063,6 +2100,12 @@ var VIDEO_MAX_SECONDS_AT_RESOLUTION = {
2063
2100
  [LTX_25_FAST_I2V_ENDPOINT]: { "4k": 10 }
2064
2101
  };
2065
2102
  var VIDEO_UNSUPPORTED_PARAMS = {
2103
+ // Kling 2.5 Turbo and Seedance 1.0 Pro render silent clips and their schemas
2104
+ // declare no audio field at all (fal model schemas, checked 2026-10-25), so a
2105
+ // sound choice is refused before submit instead of being sent and ignored.
2106
+ "fal-ai/kling-video/v2.5-turbo/pro/image-to-video": ["generateAudio"],
2107
+ "fal-ai/bytedance/seedance/v1/pro/image-to-video": ["generateAudio"],
2108
+ "fal-ai/bytedance/seedance/v1/pro/text-to-video": ["generateAudio"],
2066
2109
  // Kling O3 Edit follows the source clip: its length, frame, size and look are
2067
2110
  // the source's, and the endpoint declares none of these knobs. A duration in
2068
2111
  // particular would only have been a (wrong) billing figure; the completer
@@ -2109,6 +2152,22 @@ var VIDEO_UNSUPPORTED_PARAMS = {
2109
2152
  [KLING_O3_PRO_R2V_ENDPOINT]: ["resolution", "seed", "negativePrompt"],
2110
2153
  ...Object.fromEntries(LTX_25_I2V_ENDPOINTS.map((e) => [e, ["seed", "negativePrompt"]]))
2111
2154
  };
2155
+ var VIDEO_AUDIO_SWITCH = {
2156
+ ...Object.fromEntries(VEO_ENDPOINTS.map((e) => [e, { default: false }])),
2157
+ [KLING_26_I2V_ENDPOINT]: { default: false },
2158
+ ...Object.fromEntries(KLING_O3_I2V_ENDPOINTS.map((e) => [e, { default: false }])),
2159
+ [KLING_O3_PRO_R2V_ENDPOINT]: { default: false },
2160
+ "bytedance/seedance-2.5/image-to-video": { default: true },
2161
+ "bytedance/seedance-2.0/image-to-video": { default: true },
2162
+ [WAN_30_I2V_ENDPOINT]: { default: true },
2163
+ ...Object.fromEntries(LTX_25_I2V_ENDPOINTS.map((e) => [e, { default: true }])),
2164
+ "blackforestlabs/flux-3/image-to-video/draft": { default: true },
2165
+ "blackforestlabs/flux-3/first-last-frame-to-video/draft": { default: true },
2166
+ "blackforestlabs/flux-3/keyframes-to-video/draft": { default: true },
2167
+ "blackforestlabs/flux-3/image-to-video": { default: true },
2168
+ "blackforestlabs/flux-3/first-last-frame-to-video": { default: true },
2169
+ "blackforestlabs/flux-3/keyframes-to-video": { default: true }
2170
+ };
2112
2171
  var ROWS = [
2113
2172
  [0, "Idle", "DailyActions", "Idle"],
2114
2173
  [1, "Walking_Woman", "WalkAndRun", "Walking"],
@@ -3216,13 +3275,14 @@ var veo2 = (tier, label) => {
3216
3275
  fallback: { start: `fal/${slug2}-image-to-video`, startAndEnd: `fal/${slug2}-first-last-frame` }
3217
3276
  };
3218
3277
  };
3219
- var image2 = (slug2, label, defaultTier) => ({
3278
+ var image2 = (slug2, label, defaultTier, fallbackWithImages) => ({
3220
3279
  kind: "image",
3221
3280
  id: `route/${slug2}`,
3222
3281
  label: `${label} (KIE, fal fallback)`,
3223
3282
  primary: `kie/${slug2}`,
3224
3283
  fallback: `fal/${slug2}`,
3225
- defaultTier
3284
+ defaultTier,
3285
+ ...fallbackWithImages ? { fallbackWithImages } : {}
3226
3286
  });
3227
3287
  var ROUTES2 = [
3228
3288
  veo2("lite", "Veo 3.1 Lite"),
@@ -3301,7 +3361,8 @@ var ROUTES2 = [
3301
3361
  primary: "kie/wan-3-0-image-to-video",
3302
3362
  fallback: { start: "fal/wan-3-0-image-to-video" }
3303
3363
  },
3304
- image2("nano-banana-2", "Nano Banana 2", "1K"),
3364
+ // A character or reference image on the default image route: fal takes it on the edit endpoint.
3365
+ image2("nano-banana-2", "Nano Banana 2", "1K", "fal/nano-banana-2-edit"),
3305
3366
  image2("nano-banana-2-edit", "Nano Banana 2 Edit", "1K"),
3306
3367
  image2("nano-banana-pro", "Nano Banana Pro", "1K"),
3307
3368
  image2("nano-banana-pro-edit", "Nano Banana Pro Edit", "1K"),
@@ -4164,7 +4225,23 @@ var CATALOG_ENTRIES2 = [
4164
4225
  modality: "audio",
4165
4226
  task: "text-to-speech",
4166
4227
  label: "ElevenLabs Multilingual v2 (TTS)",
4167
- description: "ElevenLabs Multilingual v2 text-to-speech. 99+ languages, brand-voice cloning capable. Default text-to-speech. Returns mp3 bytes synchronously.",
4228
+ description: "ElevenLabs Multilingual v2 text-to-speech. 99+ languages, brand-voice cloning capable. Default text-to-speech. Returns mp3 bytes synchronously. Up to 10,000 characters per request.",
4229
+ // ElevenLabs' text-to-speech API (voice_settings, checked 2026-10-25):
4230
+ // stability and similarity_boost run from 0 to 1 with defaults 0.5 and
4231
+ // 0.75; speed from 0.7 to 1.2 with 1 as the normal pace (its help center
4232
+ // states the bounds). Multilingual v2 takes 10,000 characters per request
4233
+ // (its models page). `speechRequestRefusal` refuses anything outside these
4234
+ // before a request is admitted.
4235
+ capabilities: {
4236
+ speech: {
4237
+ maxCharacters: 1e4,
4238
+ voiceSettings: {
4239
+ stability: { min: 0, max: 1, step: 0.05, default: 0.5 },
4240
+ similarityBoost: { min: 0, max: 1, step: 0.05, default: 0.75 },
4241
+ speed: { min: 0.7, max: 1.2, step: 0.05, default: 1 }
4242
+ }
4243
+ }
4244
+ },
4168
4245
  isDefault: true
4169
4246
  },
4170
4247
  {
@@ -4228,14 +4305,20 @@ var CATALOG_ENTRIES2 = [
4228
4305
  modality: "image",
4229
4306
  task: "text-to-image",
4230
4307
  label: "Gemini 2.5 Flash Image",
4231
- description: "Vertex AI direct. Fallback if KIE pricing or reliability turns sour. Needs GAC_JSON provisioning to activate. Google retires this model on 2027-03-15 (deprecations table, checked 2026-10-07); its named successor is gemini-3.1-flash-lite-image."
4308
+ description: "Vertex AI direct. Fallback if KIE pricing or reliability turns sour. Needs GAC_JSON provisioning to activate. Google retires this model on 2027-03-15 (deprecations table, checked 2026-10-07); its named successor is gemini-3.1-flash-lite-image.",
4309
+ // Google's model page (read 2026-10-25): "Maximum images per prompt: 3".
4310
+ // The adapter sends every image inline, downloading Studio references
4311
+ // first (providers/vertex.ts), up to 7 MB each.
4312
+ capabilities: { maxInputImages: 3 }
4232
4313
  },
4233
4314
  {
4234
4315
  id: "vertex/gemini-3-pro-image-preview",
4235
4316
  provider: "vertex",
4236
4317
  modality: "image",
4237
4318
  task: "text-to-image",
4238
- label: "Nano Banana Pro (preview)"
4319
+ label: "Nano Banana Pro (preview)",
4320
+ // Google's model page for Gemini 3 Pro Image (read 2026-10-25): "Maximum images per prompt: 14".
4321
+ capabilities: { maxInputImages: 14 }
4239
4322
  },
4240
4323
  {
4241
4324
  id: "vertex/gemini-3-1-flash-image-preview",
@@ -4243,16 +4326,29 @@ var CATALOG_ENTRIES2 = [
4243
4326
  modality: "image",
4244
4327
  task: "text-to-image",
4245
4328
  label: "Gemini 3.1 Flash Image (preview)",
4246
- description: "Vertex AI direct, newest flash variant. Global region. Preview status."
4329
+ description: "Vertex AI direct, newest flash variant. Global region. Preview status.",
4330
+ // Google's model page for Gemini 3.1 Flash Image (read 2026-10-25): "Maximum images per prompt: 14".
4331
+ capabilities: { maxInputImages: 14 }
4247
4332
  }
4248
4333
  ];
4249
4334
  var PINNED_FAL_NOTE2 = "Pinned to fal: a job on this entry never goes to KIE.";
4250
4335
  var PINNED_KIE_NOTE2 = "Pinned to KIE: no fal fallback. Pick the automatic entry of this model to get one.";
4336
+ var KIE_PERSON_NOTE2 = "Not available for images of people (a character, a try-on, a swap, or an uploaded or referenced image or video), because KIE offers no data processing agreement.";
4337
+ var ROUTE_PERSON_NOTE2 = "A request with a person in it (a character, a try-on, a swap, or an uploaded or referenced image or video) skips KIE and runs on fal only, priced as the fal model.";
4338
+ function kiePersonNote2(entry) {
4339
+ if (entry.provider !== "kie" || entry.modality !== "image" && entry.modality !== "video") return null;
4340
+ const role = routeRoleOf2(entry.id);
4341
+ if (role?.role !== "primary") return `${KIE_PERSON_NOTE2} For those, pick a fal model.`;
4342
+ const route = role.route;
4343
+ const twin = route.kind === "image" ? route.fallback : "byResolution" in route.fallback ? Object.values(route.fallback.byResolution)[0] : route.fallback.start;
4344
+ return `${KIE_PERSON_NOTE2} For those, pick ${twin} or the automatic entry ${route.id}, which runs them on fal.`;
4345
+ }
4251
4346
  function withRouteNote2(entry) {
4252
4347
  const role = routeRoleOf2(entry.id);
4253
- if (!role) return entry;
4254
- const note = role.role === "fallback" ? PINNED_FAL_NOTE2 : PINNED_KIE_NOTE2;
4255
- return { ...entry, description: `${entry.description ?? ""} ${note}`.trim() };
4348
+ const person = kiePersonNote2(entry);
4349
+ if (!role && !person) return entry;
4350
+ const note = !role ? "" : role.role === "fallback" ? PINNED_FAL_NOTE2 : PINNED_KIE_NOTE2;
4351
+ return { ...entry, description: [entry.description ?? "", note, person ?? ""].filter(Boolean).join(" ").trim() };
4256
4352
  }
4257
4353
  var MODEL_CATALOG2 = CATALOG_ENTRIES2.map(withRouteNote2);
4258
4354
  var routeEntries2 = /* @__PURE__ */ new Map();
@@ -4269,7 +4365,7 @@ function routeEntry2(id) {
4269
4365
  isDefault: void 0,
4270
4366
  id: route.id,
4271
4367
  label: route.label,
4272
- description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
4368
+ description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ${ROUTE_PERSON_NOTE2} ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
4273
4369
  };
4274
4370
  routeEntries2.set(id, entry);
4275
4371
  return entry;
@@ -4816,6 +4912,18 @@ function opTouches(doc, op) {
4816
4912
  }
4817
4913
  return [...out];
4818
4914
  }
4915
+ var MEDIA_INPUT_KEYS = [
4916
+ "inputImages",
4917
+ "inputImage",
4918
+ "inputImageUrl",
4919
+ "endImageUrl",
4920
+ "keyframeImageUrls",
4921
+ "referenceImageUrls",
4922
+ "inputVideoUrl",
4923
+ "draftCacheUrl",
4924
+ "parentAssetId"
4925
+ ];
4926
+ var MEDIA_KEYS = new Set(MEDIA_INPUT_KEYS);
4819
4927
  var RECIPE_EFFECT_TYPES = ["createCharacter", "addCharacterReference", "createBrand", "addBrandReference"];
4820
4928
  var EffectValueSourceSchema = z5.discriminatedUnion("kind", [
4821
4929
  z5.object({ kind: z5.literal("literal"), value: JsonNonNullValueSchema }),
@@ -5184,7 +5292,7 @@ function documentToDefinition(doc, opts = {}) {
5184
5292
  const keyframes = port === "image" && task === "image-to-video" && modelAcceptsKeyframes(node.model);
5185
5293
  const references = port === "reference";
5186
5294
  const listKey = orderedPortKey(task, port, 0, node.model) ?? b.key;
5187
- const items = [];
5295
+ const items2 = [];
5188
5296
  const itemSources = [];
5189
5297
  let uploading = false;
5190
5298
  for (const [ordinal, e] of portWires.entries()) {
@@ -5225,11 +5333,11 @@ function documentToDefinition(doc, opts = {}) {
5225
5333
  if (!item) continue;
5226
5334
  if (single) inputs[key] = item;
5227
5335
  else {
5228
- items.push(item);
5336
+ items2.push(item);
5229
5337
  itemSources.push(e.source);
5230
5338
  }
5231
5339
  }
5232
- if (references && !uploading && items.length > 0) {
5340
+ if (references && !uploading && items2.length > 0) {
5233
5341
  const limits = modelCharacterReferences(node.model);
5234
5342
  const grouped = limits ? referenceElementsFor(
5235
5343
  itemSources,
@@ -5242,7 +5350,7 @@ function documentToDefinition(doc, opts = {}) {
5242
5350
  if (grouped.ok) {
5243
5351
  inputs[listKey] = {
5244
5352
  kind: "list",
5245
- items: grouped.order.map((i) => items[i])
5353
+ items: grouped.order.map((i) => items2[i])
5246
5354
  };
5247
5355
  inputs.referenceElementIndexes = {
5248
5356
  kind: "literal",
@@ -5257,9 +5365,9 @@ function documentToDefinition(doc, opts = {}) {
5257
5365
  }
5258
5366
  continue;
5259
5367
  }
5260
- if (!uploading && items.length > 0)
5261
- inputs[listKey] = { kind: "list", items };
5262
- if (keyframes && !uploading && items.length > 0) {
5368
+ if (!uploading && items2.length > 0)
5369
+ inputs[listKey] = { kind: "list", items: items2 };
5370
+ if (keyframes && !uploading && items2.length > 0) {
5263
5371
  const positions = keyframePositionsFor(
5264
5372
  portWires.map((e) => e.source),
5265
5373
  node.settings
@@ -5884,7 +5992,7 @@ var studioWorkflowDescribe = defineTool({
5884
5992
  inputSchema: {
5885
5993
  tasks: z7.array(z7.string().min(1)).min(1).optional().describe('Only these task ids (e.g. ["text-to-image", "image-to-video"]). An unknown id is an error that lists the known ones.'),
5886
5994
  includeSettings: z7.boolean().default(false).describe("Include each task's settings knobs (key, type, range, default)."),
5887
- includeModels: z7.boolean().default(false).describe("Include the model catalog per task (id, label, provider, price, isDefault). price is what one generation costs your company at the default settings: { usd, fromUsd? }.")
5995
+ includeModels: z7.boolean().default(false).describe("Include the model catalog per task (id, label, provider, price, isDefault). price is what one generation costs your company at the default settings: { usd, fromUsd? }. A voice model is billed per character: its price is { usd, per: { characters: 1000 }, maxUsd }, usd for 1,000 characters and maxUsd the most one generation costs.")
5888
5996
  },
5889
5997
  annotations: { readOnlyHint: true },
5890
5998
  handler: async (args, ctx) => {
@@ -7041,7 +7149,7 @@ var studioGenerateImage = defineTool({
7041
7149
  projectId: z12.string().min(1).optional().describe(
7042
7150
  'Optional project to file the image under (an id from studio_list_projects; it must be a project of your company, anything else is a 404). Omit it to use the project named after brandSlug, or "default" when there is no brand.'
7043
7151
  ),
7044
- model: z12.string().optional().describe('Image model id (e.g. "kie/nano-banana-2", "fal/nano-banana-2"). Omit for the Studio default.'),
7152
+ model: z12.string().optional().describe('Image model id (e.g. "route/nano-banana-2", "fal/nano-banana-2"). Omit for the Studio default. A model pinned to KIE (kie/...) is not available for images of people (a character, a try-on, a swap, or an uploaded or referenced image) and is refused for them: use its fal entry (fal/...) or its automatic entry (route/...), which runs such a request on fal only.'),
7045
7153
  aspectRatio: z12.string().optional().describe('Aspect ratio such as "1:1", "16:9", "3:4".'),
7046
7154
  imageSize: z12.string().optional().describe('Provider size hint, e.g. "1K", "2K".'),
7047
7155
  seed: z12.number().int().optional(),
@@ -7414,7 +7522,7 @@ var studioUploadBrandReference = defineTool({
7414
7522
  }
7415
7523
  });
7416
7524
  var workflowDefinitionSchema = WorkflowDefinitionSchema.describe(
7417
- `Inline workflow DAG: { id, label?, params?: [{ name, type: string|number|boolean|json, required?, label?, description?, inputType?, cardinality?: one|many, default? }], nodes: [{ id, task (one of the model tasks listed), model (catalog id, e.g. fal/nano-banana-2-edit), inputs, retry? }] }. Node inputs are bindings: {kind:"literal",value}, {kind:"param",name,wrap?:"array"}, {kind:"ref",node,path:"url",wrap?:"array"} or an ordered {kind:"list",items:[...]} of those. Image-edit nodes take inputImages (an array: one wrapped ref/param, or a list in reference order, scene frame first); image-to-video nodes take inputImageUrl (start frame) and optionally endImageUrl (end frame, on models that accept one), EXCEPT on a keyframes model (fal/flux-3-keyframes-to-video and its -draft tier), which instead takes keyframeImageUrls (an ordered list of up to 10 images) with keyframeFrameIndexes (one strictly increasing frame per image on a fixed 24 fps timeline). Pass one shape or the other, never both. To hold a character's identity through the clip, an image-to-video node on a model with character references (route/kling-o3, kie/kling-o3-image-to-video, fal/kling-o3-pro-reference-to-video) also takes referenceImageUrls (a list of character photos, grouped by character, each character's frontal view first, 2 to 4 images per character, up to 3 characters) with referenceElementIndexes (the 0-based character of each image, ascending without gaps, e.g. [0,0,0,1,1]); they never count as the start or end frame, and they need inputImageUrl. kie/gemini-omni-flash-1-1-reference-to-video takes the same two fields with 1 to 6 character images in all and no end frame: its start frame goes in as reference image 1, named in the prompt as the exact scene and first frame, because KIE does not lock a first frame in its reference mode.`
7525
+ `Inline workflow DAG: { id, label?, params?: [{ name, type: string|number|boolean|json, required?, label?, description?, inputType?, cardinality?: one|many, default? }], nodes: [{ id, task (one of the model tasks listed), model (catalog id, e.g. fal/nano-banana-2-edit), inputs, retry? }] }. Node inputs are bindings: {kind:"literal",value}, {kind:"param",name,wrap?:"array"}, {kind:"ref",node,path:"url",wrap?:"array"} or an ordered {kind:"list",items:[...]} of those. Image-edit nodes take inputImages (an array: one wrapped ref/param, or a list in reference order, scene frame first); image-to-video nodes take inputImageUrl (start frame) and optionally endImageUrl (end frame, on models that accept one), EXCEPT on a keyframes model (fal/flux-3-keyframes-to-video and its -draft tier), which instead takes keyframeImageUrls (an ordered list of up to 10 images) with keyframeFrameIndexes (one strictly increasing frame per image on a fixed 24 fps timeline). Pass one shape or the other, never both. To hold a character's identity through the clip, an image-to-video node on a model with character references (route/kling-o3 or fal/kling-o3-pro-reference-to-video; a model pinned to KIE, kie/..., is not available for images of people and refuses a run whose node carries a character, a try-on, a swap or an uploaded or referenced image or video, so use the fal or route/ entry for those) also takes referenceImageUrls (a list of character photos, grouped by character, each character's frontal view first, 2 to 4 images per character, up to 3 characters) with referenceElementIndexes (the 0-based character of each image, ascending without gaps, e.g. [0,0,0,1,1]); they never count as the start or end frame, and they need inputImageUrl. kie/gemini-omni-flash-1-1-reference-to-video takes the same two fields with 1 to 6 character images in all and no end frame: its start frame goes in as reference image 1, named in the prompt as the exact scene and first frame, because KIE does not lock a first frame in its reference mode. It runs on KIE, so while Studio keeps people off KIE it is refused for character references like every other kie/ model.`
7418
7526
  );
7419
7527
  var studioRunWorkflow = defineTool({
7420
7528
  name: "studio_run_workflow",
@@ -7767,7 +7875,7 @@ function registerTools(server, base) {
7767
7875
 
7768
7876
  // src/server.ts
7769
7877
  var SERVER_NAME = "lumitra-studio";
7770
- var SERVER_VERSION = "0.15.0";
7878
+ var SERVER_VERSION = "0.17.0";
7771
7879
  function createStudioMcpServer(opts = {}) {
7772
7880
  const config = opts.config ?? resolveConfig(opts.env ?? process.env);
7773
7881
  const client = new StudioClient(config, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marlinjai/studio-mcp",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "private": false,
5
5
  "description": "Model Context Protocol (MCP) server over the Lumitra Studio HTTP API: generate images, mint characters, run workflows, swap characters into video.",
6
6
  "license": "MIT",