@marlinjai/studio-mcp 0.12.0 → 0.14.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
@@ -84,13 +84,14 @@ The token is held in memory only. It is never logged, never serialized into a re
84
84
  | Tool | What it does |
85
85
  |---|---|
86
86
  | `studio_list_projects` | List projects (id, slug, name). A `projectId` is needed by the workflow-based tools and optional on `studio_generate_image` and `studio_generate_3d`. |
87
- | `studio_generate_image` | Submit an image generation, wait for it, return the signed URL and cost. Only `prompt` is required: `brandSlug` (a brand of the key's company) applies that brand's style and references, and leaving it out generates without a brand; `characterSlug` pins a character; `projectId` chooses the project the image is filed in. A `brandSlug` or `characterSlug` the company cannot use is refused with `404` `input_not_found` before anything is spent. The result carries `candidates: { requested, rendered, mayRender? }` and, when the model renders fewer images than `candidateCount` asked for, a `notice`. `wait=false` returns the `jobId`. |
87
+ | `studio_generate_image` | Submit an image generation, wait for it, return the signed URL and cost. Only `prompt` is required: `brandSlug` (a brand of the key's company) applies that brand's style and references, and leaving it out generates without a brand; `characterSlug` pins a character; `mentions` (0.13.0) puts several characters, products and locations of the company in one image, in prompt order (`[{ kind, id: slug }]`, at most 10; more references than the model takes is a `400` `too_many_references`, one without a reference image a `422` `mention_without_reference`); `projectId` chooses the project the image is filed in. A `brandSlug`, `characterSlug` or mention the company cannot use is refused with `404` `input_not_found` before anything is spent. The result carries `candidates: { requested, rendered, mayRender? }` and, when the model renders fewer images than `candidateCount` asked for, a `notice`. `wait=false` returns the `jobId`. |
88
88
  | `studio_generate_3d` | Generate one 3D model (a textured GLB mesh) from a prompt or one image through 3D AI Studio, wait for it, return the signed GLB URL and cost (the price follows the model and the quality flags). Refuses a model and image mismatch before submitting. `wait=false` returns the `jobId`. |
89
89
  | `studio_rig_3d` | Rig a humanoid Model3D and apply up to 10 Meshy animation presets (by name or id) through a one-node workflow; returns the rigged GLB, each clip's name and url, and the cost ($0.20 per rig plus $0.12 per preset). Refuses an unknown preset, with close matches, before submitting. |
90
90
  | `studio_find_animations` | Search Meshy's 678-preset animation library by words. Local, free, no request. |
91
91
  | `studio_get_job` | Read a job's status, cost, error and fresh result URL; `wait=true` blocks until terminal. |
92
92
  | `studio_list_characters` | List the characters the key can use: its company's own, plus the ones another company shared with everyone (`owned: false`, usable in generations, read-only). A slug is unique within one company. |
93
93
  | `studio_get_character` | One character with its frozen reference images (category + URL). For a character the company owns the URL is a direct image URL; for one another company shared (`owned: false`) it is a Studio address that works unchanged as an image input to any Studio tool, is not a public image URL, and stops working when the owner stops sharing. |
94
+ | `studio_prompt_enhance` | Rewrite a short prompt into a richer one for an image or video model (subject, setting, light, lens, composition; for video the camera movement), in the prompt's language, without changing what it asks for. Mentions travel as tokens (`@[character:<slug>]`, `@[product:<slug>]`, `@[location:<slug>]`) listed in `mentions`, and the rewrite keeps each exactly once. Free for the company, limited per key and per company per day (`429` with the wait in the error text). Generates nothing. |
94
95
  | `studio_create_character` | Create an empty character record (for your own references). Requires `likenessRightsConfirmed: true`. |
95
96
  | `studio_mint_character` | Run the curated character-sheet workflow inline, wait, create the character, upload the 7 views as references. Requires `likenessRightsConfirmed: true` and refuses before the run starts without it. Returns `slug`, `referenceCount`, `costUsd`, `runId`. |
96
97
  | `studio_create_brand` | Create a brand (style prefix + context). |
package/dist/cli.js CHANGED
@@ -202,7 +202,9 @@ var StudioClient = class {
202
202
  * use is refused with 404 `input_not_found` before anything is spent (since
203
203
  * 2026-10-11; it used to generate without the brand). `projectId` chooses the
204
204
  * project; without it the job lands in the project named after the brand, or
205
- * in `default`.
205
+ * in `default`. `mentions` (since 2026-10-25) puts several characters,
206
+ * products and locations in one image, in prompt order, each by its slug;
207
+ * more references than the model takes is a 400 `too_many_references`.
206
208
  */
207
209
  generate(body) {
208
210
  return this.json("POST", "/api/generate", { json: body });
@@ -226,6 +228,15 @@ var StudioClient = class {
226
228
  getCharacter(slug2) {
227
229
  return this.json("GET", `/api/characters/${encodeURIComponent(slug2)}`);
228
230
  }
231
+ // ── Prompts ──
232
+ /**
233
+ * Enhance: the prompt rewritten into a richer one for an image or video
234
+ * model, every mention token (`@[character:<slug>]`) kept exactly once.
235
+ * Free for the company, limited per key (429 with the wait in `error`).
236
+ */
237
+ enhancePrompt(body) {
238
+ return this.json("POST", "/api/v1/prompts/enhance", { json: body });
239
+ }
229
240
  createCharacter(body) {
230
241
  return this.json("POST", "/api/characters", { json: body });
231
242
  }
@@ -734,7 +745,10 @@ var CATALOG_ENTRIES = [
734
745
  task: "text-to-image",
735
746
  label: "Imagen 4 Fast (KIE)",
736
747
  description: "Google Imagen 4 Fast via KIE. No IP indemnity.",
737
- capabilities: { resolutions: [] }
748
+ // Text only: KIE's imagen4-fast input has no image field, so the adapter
749
+ // (buildKieInput) sends none. Declared, so a reference is refused before
750
+ // spend instead of being dropped after it.
751
+ capabilities: { resolutions: [], maxInputImages: 0 }
738
752
  },
739
753
  {
740
754
  id: "kie/seedream-v4",
@@ -742,7 +756,9 @@ var CATALOG_ENTRIES = [
742
756
  modality: "image",
743
757
  task: "text-to-image",
744
758
  label: "Seedream V4 (KIE)",
745
- description: "ByteDance Seedream V4 via KIE. Stylized output not available on Vertex. No IP indemnity."
759
+ description: "ByteDance Seedream V4 via KIE. Stylized output not available on Vertex. No IP indemnity.",
760
+ // Text only, like imagen-4-fast: the seedream-v4 text-to-image input has no image field.
761
+ capabilities: { maxInputImages: 0 }
746
762
  },
747
763
  // ── KIE.ai: newer image models, the cheaper route (price feed 2026-09-23) ─
748
764
  {
@@ -3388,7 +3404,10 @@ var CATALOG_ENTRIES2 = [
3388
3404
  task: "text-to-image",
3389
3405
  label: "Imagen 4 Fast (KIE)",
3390
3406
  description: "Google Imagen 4 Fast via KIE. No IP indemnity.",
3391
- capabilities: { resolutions: [] }
3407
+ // Text only: KIE's imagen4-fast input has no image field, so the adapter
3408
+ // (buildKieInput) sends none. Declared, so a reference is refused before
3409
+ // spend instead of being dropped after it.
3410
+ capabilities: { resolutions: [], maxInputImages: 0 }
3392
3411
  },
3393
3412
  {
3394
3413
  id: "kie/seedream-v4",
@@ -3396,7 +3415,9 @@ var CATALOG_ENTRIES2 = [
3396
3415
  modality: "image",
3397
3416
  task: "text-to-image",
3398
3417
  label: "Seedream V4 (KIE)",
3399
- description: "ByteDance Seedream V4 via KIE. Stylized output not available on Vertex. No IP indemnity."
3418
+ description: "ByteDance Seedream V4 via KIE. Stylized output not available on Vertex. No IP indemnity.",
3419
+ // Text only, like imagen-4-fast: the seedream-v4 text-to-image input has no image field.
3420
+ capabilities: { maxInputImages: 0 }
3400
3421
  },
3401
3422
  // ── KIE.ai: newer image models, the cheaper route (price feed 2026-09-23) ─
3402
3423
  {
@@ -6905,7 +6926,7 @@ var studioListProjects = defineTool({
6905
6926
  });
6906
6927
  var studioGenerateImage = defineTool({
6907
6928
  name: "studio_generate_image",
6908
- description: "Generate an image from a prompt. A brand is optional: pass brandSlug to have the Studio apply that brand's style prefix and reference images server-side, or leave it out for an image without a brand. Optionally pin a character (characterSlug) so its identity references are injected too. A brandSlug or characterSlug that names nothing your company can use is refused before anything is spent (404, code input_not_found), and the error text says what to do next: act on it or relay it as written. The image is filed in projectId when given, otherwise in the project named after the brand (created on first use), otherwise in the project \"default\". Submits a job and, when wait=true (default), polls until it finishes and returns the signed image URL and costUsd (what the job cost your company: for a company on prepaid credits, what left its balance). With wait=false it returns the jobId immediately for studio_get_job. candidateCount asks for up to four candidates, but some models render one image regardless of the count: the result carries `candidates: { requested, rendered, mayRender? }`, and a `notice` to pass on to the user whenever fewer images will be made than were asked for. A typical image costs about $0.06 on prepaid credits without a subscription; the job's costUsd is the exact amount.",
6929
+ description: "Generate an image from a prompt. A brand is optional: pass brandSlug to have the Studio apply that brand's style prefix and reference images server-side, or leave it out for an image without a brand. Optionally pin a character (characterSlug) so its identity references are injected too, or put several characters, products and locations of your company in one image with mentions (in prompt order). A brandSlug, characterSlug or mention that names nothing your company can use is refused before anything is spent (404, code input_not_found), and the error text says what to do next: act on it or relay it as written. The image is filed in projectId when given, otherwise in the project named after the brand (created on first use), otherwise in the project \"default\". Submits a job and, when wait=true (default), polls until it finishes and returns the signed image URL and costUsd (what the job cost your company: for a company on prepaid credits, what left its balance). With wait=false it returns the jobId immediately for studio_get_job. candidateCount asks for up to four candidates, but some models render one image regardless of the count: the result carries `candidates: { requested, rendered, mayRender? }`, and a `notice` to pass on to the user whenever fewer images will be made than were asked for. A typical image costs about $0.06 on prepaid credits without a subscription; the job's costUsd is the exact amount.",
6909
6930
  inputSchema: {
6910
6931
  brandSlug: slug.optional().describe(
6911
6932
  "Optional. The slug of a brand of your company (create one with studio_create_brand). Omit it to generate without a brand. A slug that names no brand of your company is refused with 404 input_not_found; it is never used as a project name."
@@ -6913,7 +6934,15 @@ var studioGenerateImage = defineTool({
6913
6934
  brandMode: z11.string().optional().describe('Optional brand mode (e.g. "illustration"); modes are defined per brand. Only meaningful with brandSlug.'),
6914
6935
  prompt: z11.string().min(1).describe("What to generate. With brandSlug, the brand style prefix is prepended server-side."),
6915
6936
  characterSlug: slug.optional().describe(
6916
- "Optional character whose identity references are injected: one of your company's, or one another company shared (see studio_list_characters). A slug your company cannot use is refused with 404 input_not_found."
6937
+ "Optional character whose identity references are injected: one of your company's, or one another company shared (see studio_list_characters). A slug your company cannot use is refused with 404 input_not_found. To put several characters, products or locations in one image, use mentions instead."
6938
+ ),
6939
+ mentions: z11.array(
6940
+ z11.object({
6941
+ kind: z11.enum(["character", "product", "location"]).describe("What the mention names."),
6942
+ id: slug.describe("The slug of the character (studio_list_characters), product or location (GET /api/products, GET /api/locations).")
6943
+ })
6944
+ ).min(1).max(10).optional().describe(
6945
+ "Optional: the characters, products and locations of your company to put in the image, in the order the prompt names them (at most 10). Each one's reference images are sent in that order and the Studio tells the model which image is which, so name them in the prompt by their names (or as tokens such as @[character:ana], which the Studio replaces with the name). The model must take a reference image for each mention plus any attached image: an edit model such as fal/nano-banana-2-edit takes 8, and so does the default when no model is named (with mentions and a candidateCount above 1 the default is fal/nano-banana-2-edit, which renders up to 4); a text-only model takes none. Too many is refused with 400 too_many_references, a model that cannot take references with 400 model_takes_no_references, both before anything is spent. A mention your company cannot use is refused with 404 input_not_found, one without a reference image with 422 mention_without_reference. Sent together with characterSlug, that character comes first."
6917
6946
  ),
6918
6947
  projectId: z11.string().min(1).optional().describe(
6919
6948
  '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.'
@@ -6940,6 +6969,7 @@ var studioGenerateImage = defineTool({
6940
6969
  ...args.brandMode ? { brandMode: args.brandMode } : {},
6941
6970
  prompt: args.prompt,
6942
6971
  ...args.characterSlug ? { characterSlug: args.characterSlug } : {},
6972
+ ...args.mentions && args.mentions.length > 0 ? { mentions: args.mentions } : {},
6943
6973
  ...args.projectId ? { projectId: args.projectId } : {},
6944
6974
  ...Object.keys(settings).length > 0 ? { settings } : {}
6945
6975
  });
@@ -7117,6 +7147,35 @@ var studioGetCharacter = defineTool({
7117
7147
  return { character };
7118
7148
  }
7119
7149
  });
7150
+ var studioPromptEnhance = defineTool({
7151
+ name: "studio_prompt_enhance",
7152
+ description: "Rewrite a short prompt into a richer one an image or video model renders well: subject, setting, light, lens and composition (for video also the camera movement and the action over the shot), in the language of the prompt, without changing what it asks for. Free for your company (nothing is charged, no job is created), but limited per API key over a few minutes and per company per day: past either it answers an error that says when to try again, so wait that long rather than retrying. A person, product or place of your company goes into the prompt as a mention token, `@[character:<slug>]`, `@[product:<slug>]` or `@[location:<slug>]` (slugs from studio_list_characters, GET /api/products, GET /api/locations), and every token must also be listed in `mentions`; the rewrite keeps each token exactly once, so pass the returned prompt and mentions on unchanged. A mention or brandSlug your company cannot use is refused with 404 input_not_found. With brandSlug the rewrite follows the brand's style guide without copying it (studio_generate_image applies it again). Nothing is generated: pass the returned prompt and mentions unchanged to studio_generate_image as its prompt and mentions.",
7153
+ inputSchema: {
7154
+ prompt: z11.string().min(1).max(4e3).describe("The prompt to rewrite, mention tokens included."),
7155
+ target: z11.enum(["image", "video"]).default("image").describe('What the prompt is for: "image" (default) or "video".'),
7156
+ mentions: z11.array(
7157
+ z11.object({
7158
+ kind: z11.enum(["character", "product", "location"]),
7159
+ id: slug.describe("The slug, exactly as the token in the prompt carries it."),
7160
+ name: z11.string().max(200).optional()
7161
+ })
7162
+ ).max(10).optional().describe("Every mention token of the prompt (at most 10). The returned mentions carry the names your company gave them."),
7163
+ model: z11.string().optional().describe('Optional. The image or video model the prompt will be rendered with (e.g. "kie/nano-banana-2"), so the rewrite suits it. It must make the target.'),
7164
+ brandSlug: slug.optional().describe("Optional. A brand of your company whose style the rewrite should follow."),
7165
+ brandMode: z11.string().optional().describe('Optional brand mode (e.g. "hero"). Only meaningful with brandSlug.')
7166
+ },
7167
+ annotations: { readOnlyHint: true },
7168
+ handler: async (args, ctx) => {
7169
+ return ctx.client.enhancePrompt({
7170
+ prompt: args.prompt,
7171
+ target: args.target,
7172
+ ...args.mentions && args.mentions.length > 0 ? { mentions: args.mentions } : {},
7173
+ ...args.model ? { model: args.model } : {},
7174
+ ...args.brandSlug ? { brandSlug: args.brandSlug } : {},
7175
+ ...args.brandMode ? { brandMode: args.brandMode } : {}
7176
+ });
7177
+ }
7178
+ });
7120
7179
  var LIKENESS_REFUSAL = `${LIKENESS_CONFIRMATION_REQUIRED_CODE}: ${likenessConfirmationRequiredMessage()}`;
7121
7180
  var likenessRightsConfirmed = z11.literal(true, { error: LIKENESS_REFUSAL }).describe(likenessConfirmationToolDescription());
7122
7181
  function assertLikenessRightsConfirmed(value) {
@@ -7527,6 +7586,7 @@ var TOOLS = [
7527
7586
  studioGetJob,
7528
7587
  studioListCharacters,
7529
7588
  studioGetCharacter,
7589
+ studioPromptEnhance,
7530
7590
  studioCreateCharacter,
7531
7591
  studioMintCharacter,
7532
7592
  studioCreateBrand,
@@ -7612,7 +7672,7 @@ function registerTools(server, base) {
7612
7672
 
7613
7673
  // src/server.ts
7614
7674
  var SERVER_NAME = "lumitra-studio";
7615
- var SERVER_VERSION = "0.12.0";
7675
+ var SERVER_VERSION = "0.14.0";
7616
7676
  function createStudioMcpServer(opts = {}) {
7617
7677
  const config = opts.config ?? resolveConfig(opts.env ?? process.env);
7618
7678
  const client = new StudioClient(config, {
package/dist/index.d.ts CHANGED
@@ -1326,6 +1326,25 @@ interface GenerateImageResponse {
1326
1326
  candidates?: CandidatePlan;
1327
1327
  notice?: string;
1328
1328
  }
1329
+ /** One @ mention of a prompt: a character, product or location of the company, by slug. */
1330
+ interface PromptMention {
1331
+ kind: 'character' | 'product' | 'location';
1332
+ /** The slug, as the prompt's token `@[kind:slug]` carries it. */
1333
+ id: string;
1334
+ name?: string;
1335
+ }
1336
+ interface EnhancePromptRequest {
1337
+ prompt: string;
1338
+ target: 'image' | 'video';
1339
+ mentions?: PromptMention[];
1340
+ model?: string;
1341
+ brandSlug?: string;
1342
+ brandMode?: string;
1343
+ }
1344
+ interface EnhancePromptResponse {
1345
+ prompt: string;
1346
+ mentions: Array<Required<PromptMention>>;
1347
+ }
1329
1348
  interface CharacterSummary {
1330
1349
  /** Unique within the key's company, not across companies. */
1331
1350
  slug: string;
@@ -1680,13 +1699,19 @@ declare class StudioClient {
1680
1699
  * use is refused with 404 `input_not_found` before anything is spent (since
1681
1700
  * 2026-10-11; it used to generate without the brand). `projectId` chooses the
1682
1701
  * project; without it the job lands in the project named after the brand, or
1683
- * in `default`.
1702
+ * in `default`. `mentions` (since 2026-10-25) puts several characters,
1703
+ * products and locations in one image, in prompt order, each by its slug;
1704
+ * more references than the model takes is a 400 `too_many_references`.
1684
1705
  */
1685
1706
  generate(body: {
1686
1707
  brandSlug?: string;
1687
1708
  brandMode?: string;
1688
1709
  prompt: string;
1689
1710
  characterSlug?: string;
1711
+ mentions?: Array<{
1712
+ kind: 'character' | 'product' | 'location';
1713
+ id: string;
1714
+ }>;
1690
1715
  projectId?: string;
1691
1716
  settings?: Record<string, unknown>;
1692
1717
  }): Promise<GenerateImageResponse>;
@@ -1719,6 +1744,12 @@ declare class StudioClient {
1719
1744
  [k: string]: unknown;
1720
1745
  };
1721
1746
  }>;
1747
+ /**
1748
+ * Enhance: the prompt rewritten into a richer one for an image or video
1749
+ * model, every mention token (`@[character:<slug>]`) kept exactly once.
1750
+ * Free for the company, limited per key (429 with the wait in `error`).
1751
+ */
1752
+ enhancePrompt(body: EnhancePromptRequest): Promise<EnhancePromptResponse>;
1722
1753
  createCharacter(body: {
1723
1754
  name: string;
1724
1755
  slug: string;
@@ -2080,7 +2111,7 @@ declare function registerTools(server: McpServer, base: ToolContext): void;
2080
2111
  */
2081
2112
 
2082
2113
  declare const SERVER_NAME = "lumitra-studio";
2083
- declare const SERVER_VERSION = "0.12.0";
2114
+ declare const SERVER_VERSION = "0.14.0";
2084
2115
  interface CreateServerOptions {
2085
2116
  config?: StudioConfig;
2086
2117
  env?: NodeJS.ProcessEnv;
@@ -3448,4 +3479,4 @@ declare function parseArgs(argv: string[]): CliArgs;
3448
3479
  declare function createHttpHandler(): (req: IncomingMessage, res: ServerResponse) => Promise<void>;
3449
3480
  declare function main(argv?: string[]): Promise<void>;
3450
3481
 
3451
- export { type AllTenantsUsageResponse, type AssetReference, type AssetUsage, type Binding, type BrandKitResponse, CHARACTER_SHEET_DEFINITION, CHARACTER_SHEET_NODES, type CampaignContents, type CampaignListing, type CandidatePlan, type CharacterReference, type CharacterSummary, type CharacterSwapInput, type CompositionRecord, type CompositionSummary, ConfigError, ContractError, type CreateServerOptions, DEFAULT_BASE_URL, DEFAULT_MOTION_PROMPT, DEFAULT_SWAP_EDIT_MODEL, DEFAULT_SWAP_PROMPT, DEFAULT_SWAP_VIDEO_MODEL, DEFAULT_TIMEOUT_MS, type DocumentSummary, type FetchLike, type GenerateImageResponse, type JobResponse, type JobStatus, type JudgeCandidate, MINT_REFERENCE_CATEGORIES, type NodeResultResponse, type NodeRun, type NodeStatus, type NodeSummary, type NodeTypesResponse, type PollOptions, PollTimeoutError, type ProjectAsset, type ProjectContents, type ProjectSummary, type Projection, type RemovedNode, type RunResponse, type RunStartResponse, type RunStatus, SERVER_NAME, SERVER_VERSION, SUMMARY_TEXT_CHARS, SWAP_SCOPES, type SavedWorkflowListing, type SocialProjectSummary, type SocialSendView, type SpendLedger, StudioApiError, StudioClient, type StudioClientOptions, type StudioConfig, type StudioMcp, type SummaryMeta, type SwapPromptOptions, type SwapScope, TOOLS, TOOL_NAMES, type TaskDescriptor, type TenantSpendSummary, type TenantUsageResponse, type ToolContext, type ToolDef, ToolInputError, type ToolResult, type TurnaroundView, type UploadFile, type UsageByModel, type UsageResponse, WORKFLOW_TOOLS, type WorkflowApplyResponse, type WorkflowCreateResponse, type WorkflowDefinition, type WorkflowDocumentResponse, type WorkflowNode, type WorkflowValidateResponse, affectedNodes, buildCharacterSheetParams, buildCharacterSwapDefinition, categoryForNode, characterSheetDefinition, composeSwapPrompt, createHttpHandler, createStudioMcpServer, extensionForMime, filenameFromUrl, invokeTool, main, mimeForFilename, parseArgs, parseDocument, parseOps, pollUntil, projectionOf, redactSecret, registerTools, resolveConfig, seedFacePrompt, studioWorkflowApply, studioWorkflowCreate, studioWorkflowDescribe, studioWorkflowGet, studioWorkflowScreenshot, studioWorkflowValidate, summarizeDocument, summarizeNode, touchedNodeIds, turnaroundViewPrompt, waitForJob, waitForRun };
3482
+ export { type AllTenantsUsageResponse, type AssetReference, type AssetUsage, type Binding, type BrandKitResponse, CHARACTER_SHEET_DEFINITION, CHARACTER_SHEET_NODES, type CampaignContents, type CampaignListing, type CandidatePlan, type CharacterReference, type CharacterSummary, type CharacterSwapInput, type CompositionRecord, type CompositionSummary, ConfigError, ContractError, type CreateServerOptions, DEFAULT_BASE_URL, DEFAULT_MOTION_PROMPT, DEFAULT_SWAP_EDIT_MODEL, DEFAULT_SWAP_PROMPT, DEFAULT_SWAP_VIDEO_MODEL, DEFAULT_TIMEOUT_MS, type DocumentSummary, type EnhancePromptRequest, type EnhancePromptResponse, type FetchLike, type GenerateImageResponse, type JobResponse, type JobStatus, type JudgeCandidate, MINT_REFERENCE_CATEGORIES, type NodeResultResponse, type NodeRun, type NodeStatus, type NodeSummary, type NodeTypesResponse, type PollOptions, PollTimeoutError, type ProjectAsset, type ProjectContents, type ProjectSummary, type Projection, type PromptMention, type RemovedNode, type RunResponse, type RunStartResponse, type RunStatus, SERVER_NAME, SERVER_VERSION, SUMMARY_TEXT_CHARS, SWAP_SCOPES, type SavedWorkflowListing, type SocialProjectSummary, type SocialSendView, type SpendLedger, StudioApiError, StudioClient, type StudioClientOptions, type StudioConfig, type StudioMcp, type SummaryMeta, type SwapPromptOptions, type SwapScope, TOOLS, TOOL_NAMES, type TaskDescriptor, type TenantSpendSummary, type TenantUsageResponse, type ToolContext, type ToolDef, ToolInputError, type ToolResult, type TurnaroundView, type UploadFile, type UsageByModel, type UsageResponse, WORKFLOW_TOOLS, type WorkflowApplyResponse, type WorkflowCreateResponse, type WorkflowDefinition, type WorkflowDocumentResponse, type WorkflowNode, type WorkflowValidateResponse, affectedNodes, buildCharacterSheetParams, buildCharacterSwapDefinition, categoryForNode, characterSheetDefinition, composeSwapPrompt, createHttpHandler, createStudioMcpServer, extensionForMime, filenameFromUrl, invokeTool, main, mimeForFilename, parseArgs, parseDocument, parseOps, pollUntil, projectionOf, redactSecret, registerTools, resolveConfig, seedFacePrompt, studioWorkflowApply, studioWorkflowCreate, studioWorkflowDescribe, studioWorkflowGet, studioWorkflowScreenshot, studioWorkflowValidate, summarizeDocument, summarizeNode, touchedNodeIds, turnaroundViewPrompt, waitForJob, waitForRun };
package/dist/index.js CHANGED
@@ -149,7 +149,9 @@ var StudioClient = class {
149
149
  * use is refused with 404 `input_not_found` before anything is spent (since
150
150
  * 2026-10-11; it used to generate without the brand). `projectId` chooses the
151
151
  * project; without it the job lands in the project named after the brand, or
152
- * in `default`.
152
+ * in `default`. `mentions` (since 2026-10-25) puts several characters,
153
+ * products and locations in one image, in prompt order, each by its slug;
154
+ * more references than the model takes is a 400 `too_many_references`.
153
155
  */
154
156
  generate(body) {
155
157
  return this.json("POST", "/api/generate", { json: body });
@@ -173,6 +175,15 @@ var StudioClient = class {
173
175
  getCharacter(slug2) {
174
176
  return this.json("GET", `/api/characters/${encodeURIComponent(slug2)}`);
175
177
  }
178
+ // ── Prompts ──
179
+ /**
180
+ * Enhance: the prompt rewritten into a richer one for an image or video
181
+ * model, every mention token (`@[character:<slug>]`) kept exactly once.
182
+ * Free for the company, limited per key (429 with the wait in `error`).
183
+ */
184
+ enhancePrompt(body) {
185
+ return this.json("POST", "/api/v1/prompts/enhance", { json: body });
186
+ }
176
187
  createCharacter(body) {
177
188
  return this.json("POST", "/api/characters", { json: body });
178
189
  }
@@ -726,7 +737,10 @@ var CATALOG_ENTRIES = [
726
737
  task: "text-to-image",
727
738
  label: "Imagen 4 Fast (KIE)",
728
739
  description: "Google Imagen 4 Fast via KIE. No IP indemnity.",
729
- capabilities: { resolutions: [] }
740
+ // Text only: KIE's imagen4-fast input has no image field, so the adapter
741
+ // (buildKieInput) sends none. Declared, so a reference is refused before
742
+ // spend instead of being dropped after it.
743
+ capabilities: { resolutions: [], maxInputImages: 0 }
730
744
  },
731
745
  {
732
746
  id: "kie/seedream-v4",
@@ -734,7 +748,9 @@ var CATALOG_ENTRIES = [
734
748
  modality: "image",
735
749
  task: "text-to-image",
736
750
  label: "Seedream V4 (KIE)",
737
- description: "ByteDance Seedream V4 via KIE. Stylized output not available on Vertex. No IP indemnity."
751
+ description: "ByteDance Seedream V4 via KIE. Stylized output not available on Vertex. No IP indemnity.",
752
+ // Text only, like imagen-4-fast: the seedream-v4 text-to-image input has no image field.
753
+ capabilities: { maxInputImages: 0 }
738
754
  },
739
755
  // ── KIE.ai: newer image models, the cheaper route (price feed 2026-09-23) ─
740
756
  {
@@ -3380,7 +3396,10 @@ var CATALOG_ENTRIES2 = [
3380
3396
  task: "text-to-image",
3381
3397
  label: "Imagen 4 Fast (KIE)",
3382
3398
  description: "Google Imagen 4 Fast via KIE. No IP indemnity.",
3383
- capabilities: { resolutions: [] }
3399
+ // Text only: KIE's imagen4-fast input has no image field, so the adapter
3400
+ // (buildKieInput) sends none. Declared, so a reference is refused before
3401
+ // spend instead of being dropped after it.
3402
+ capabilities: { resolutions: [], maxInputImages: 0 }
3384
3403
  },
3385
3404
  {
3386
3405
  id: "kie/seedream-v4",
@@ -3388,7 +3407,9 @@ var CATALOG_ENTRIES2 = [
3388
3407
  modality: "image",
3389
3408
  task: "text-to-image",
3390
3409
  label: "Seedream V4 (KIE)",
3391
- description: "ByteDance Seedream V4 via KIE. Stylized output not available on Vertex. No IP indemnity."
3410
+ description: "ByteDance Seedream V4 via KIE. Stylized output not available on Vertex. No IP indemnity.",
3411
+ // Text only, like imagen-4-fast: the seedream-v4 text-to-image input has no image field.
3412
+ capabilities: { maxInputImages: 0 }
3392
3413
  },
3393
3414
  // ── KIE.ai: newer image models, the cheaper route (price feed 2026-09-23) ─
3394
3415
  {
@@ -6900,7 +6921,7 @@ var studioListProjects = defineTool({
6900
6921
  });
6901
6922
  var studioGenerateImage = defineTool({
6902
6923
  name: "studio_generate_image",
6903
- description: "Generate an image from a prompt. A brand is optional: pass brandSlug to have the Studio apply that brand's style prefix and reference images server-side, or leave it out for an image without a brand. Optionally pin a character (characterSlug) so its identity references are injected too. A brandSlug or characterSlug that names nothing your company can use is refused before anything is spent (404, code input_not_found), and the error text says what to do next: act on it or relay it as written. The image is filed in projectId when given, otherwise in the project named after the brand (created on first use), otherwise in the project \"default\". Submits a job and, when wait=true (default), polls until it finishes and returns the signed image URL and costUsd (what the job cost your company: for a company on prepaid credits, what left its balance). With wait=false it returns the jobId immediately for studio_get_job. candidateCount asks for up to four candidates, but some models render one image regardless of the count: the result carries `candidates: { requested, rendered, mayRender? }`, and a `notice` to pass on to the user whenever fewer images will be made than were asked for. A typical image costs about $0.06 on prepaid credits without a subscription; the job's costUsd is the exact amount.",
6924
+ description: "Generate an image from a prompt. A brand is optional: pass brandSlug to have the Studio apply that brand's style prefix and reference images server-side, or leave it out for an image without a brand. Optionally pin a character (characterSlug) so its identity references are injected too, or put several characters, products and locations of your company in one image with mentions (in prompt order). A brandSlug, characterSlug or mention that names nothing your company can use is refused before anything is spent (404, code input_not_found), and the error text says what to do next: act on it or relay it as written. The image is filed in projectId when given, otherwise in the project named after the brand (created on first use), otherwise in the project \"default\". Submits a job and, when wait=true (default), polls until it finishes and returns the signed image URL and costUsd (what the job cost your company: for a company on prepaid credits, what left its balance). With wait=false it returns the jobId immediately for studio_get_job. candidateCount asks for up to four candidates, but some models render one image regardless of the count: the result carries `candidates: { requested, rendered, mayRender? }`, and a `notice` to pass on to the user whenever fewer images will be made than were asked for. A typical image costs about $0.06 on prepaid credits without a subscription; the job's costUsd is the exact amount.",
6904
6925
  inputSchema: {
6905
6926
  brandSlug: slug.optional().describe(
6906
6927
  "Optional. The slug of a brand of your company (create one with studio_create_brand). Omit it to generate without a brand. A slug that names no brand of your company is refused with 404 input_not_found; it is never used as a project name."
@@ -6908,7 +6929,15 @@ var studioGenerateImage = defineTool({
6908
6929
  brandMode: z11.string().optional().describe('Optional brand mode (e.g. "illustration"); modes are defined per brand. Only meaningful with brandSlug.'),
6909
6930
  prompt: z11.string().min(1).describe("What to generate. With brandSlug, the brand style prefix is prepended server-side."),
6910
6931
  characterSlug: slug.optional().describe(
6911
- "Optional character whose identity references are injected: one of your company's, or one another company shared (see studio_list_characters). A slug your company cannot use is refused with 404 input_not_found."
6932
+ "Optional character whose identity references are injected: one of your company's, or one another company shared (see studio_list_characters). A slug your company cannot use is refused with 404 input_not_found. To put several characters, products or locations in one image, use mentions instead."
6933
+ ),
6934
+ mentions: z11.array(
6935
+ z11.object({
6936
+ kind: z11.enum(["character", "product", "location"]).describe("What the mention names."),
6937
+ id: slug.describe("The slug of the character (studio_list_characters), product or location (GET /api/products, GET /api/locations).")
6938
+ })
6939
+ ).min(1).max(10).optional().describe(
6940
+ "Optional: the characters, products and locations of your company to put in the image, in the order the prompt names them (at most 10). Each one's reference images are sent in that order and the Studio tells the model which image is which, so name them in the prompt by their names (or as tokens such as @[character:ana], which the Studio replaces with the name). The model must take a reference image for each mention plus any attached image: an edit model such as fal/nano-banana-2-edit takes 8, and so does the default when no model is named (with mentions and a candidateCount above 1 the default is fal/nano-banana-2-edit, which renders up to 4); a text-only model takes none. Too many is refused with 400 too_many_references, a model that cannot take references with 400 model_takes_no_references, both before anything is spent. A mention your company cannot use is refused with 404 input_not_found, one without a reference image with 422 mention_without_reference. Sent together with characterSlug, that character comes first."
6912
6941
  ),
6913
6942
  projectId: z11.string().min(1).optional().describe(
6914
6943
  '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.'
@@ -6935,6 +6964,7 @@ var studioGenerateImage = defineTool({
6935
6964
  ...args.brandMode ? { brandMode: args.brandMode } : {},
6936
6965
  prompt: args.prompt,
6937
6966
  ...args.characterSlug ? { characterSlug: args.characterSlug } : {},
6967
+ ...args.mentions && args.mentions.length > 0 ? { mentions: args.mentions } : {},
6938
6968
  ...args.projectId ? { projectId: args.projectId } : {},
6939
6969
  ...Object.keys(settings).length > 0 ? { settings } : {}
6940
6970
  });
@@ -7112,6 +7142,35 @@ var studioGetCharacter = defineTool({
7112
7142
  return { character };
7113
7143
  }
7114
7144
  });
7145
+ var studioPromptEnhance = defineTool({
7146
+ name: "studio_prompt_enhance",
7147
+ description: "Rewrite a short prompt into a richer one an image or video model renders well: subject, setting, light, lens and composition (for video also the camera movement and the action over the shot), in the language of the prompt, without changing what it asks for. Free for your company (nothing is charged, no job is created), but limited per API key over a few minutes and per company per day: past either it answers an error that says when to try again, so wait that long rather than retrying. A person, product or place of your company goes into the prompt as a mention token, `@[character:<slug>]`, `@[product:<slug>]` or `@[location:<slug>]` (slugs from studio_list_characters, GET /api/products, GET /api/locations), and every token must also be listed in `mentions`; the rewrite keeps each token exactly once, so pass the returned prompt and mentions on unchanged. A mention or brandSlug your company cannot use is refused with 404 input_not_found. With brandSlug the rewrite follows the brand's style guide without copying it (studio_generate_image applies it again). Nothing is generated: pass the returned prompt and mentions unchanged to studio_generate_image as its prompt and mentions.",
7148
+ inputSchema: {
7149
+ prompt: z11.string().min(1).max(4e3).describe("The prompt to rewrite, mention tokens included."),
7150
+ target: z11.enum(["image", "video"]).default("image").describe('What the prompt is for: "image" (default) or "video".'),
7151
+ mentions: z11.array(
7152
+ z11.object({
7153
+ kind: z11.enum(["character", "product", "location"]),
7154
+ id: slug.describe("The slug, exactly as the token in the prompt carries it."),
7155
+ name: z11.string().max(200).optional()
7156
+ })
7157
+ ).max(10).optional().describe("Every mention token of the prompt (at most 10). The returned mentions carry the names your company gave them."),
7158
+ model: z11.string().optional().describe('Optional. The image or video model the prompt will be rendered with (e.g. "kie/nano-banana-2"), so the rewrite suits it. It must make the target.'),
7159
+ brandSlug: slug.optional().describe("Optional. A brand of your company whose style the rewrite should follow."),
7160
+ brandMode: z11.string().optional().describe('Optional brand mode (e.g. "hero"). Only meaningful with brandSlug.')
7161
+ },
7162
+ annotations: { readOnlyHint: true },
7163
+ handler: async (args, ctx) => {
7164
+ return ctx.client.enhancePrompt({
7165
+ prompt: args.prompt,
7166
+ target: args.target,
7167
+ ...args.mentions && args.mentions.length > 0 ? { mentions: args.mentions } : {},
7168
+ ...args.model ? { model: args.model } : {},
7169
+ ...args.brandSlug ? { brandSlug: args.brandSlug } : {},
7170
+ ...args.brandMode ? { brandMode: args.brandMode } : {}
7171
+ });
7172
+ }
7173
+ });
7115
7174
  var LIKENESS_REFUSAL = `${LIKENESS_CONFIRMATION_REQUIRED_CODE}: ${likenessConfirmationRequiredMessage()}`;
7116
7175
  var likenessRightsConfirmed = z11.literal(true, { error: LIKENESS_REFUSAL }).describe(likenessConfirmationToolDescription());
7117
7176
  function assertLikenessRightsConfirmed(value) {
@@ -7522,6 +7581,7 @@ var TOOLS = [
7522
7581
  studioGetJob,
7523
7582
  studioListCharacters,
7524
7583
  studioGetCharacter,
7584
+ studioPromptEnhance,
7525
7585
  studioCreateCharacter,
7526
7586
  studioMintCharacter,
7527
7587
  studioCreateBrand,
@@ -7607,7 +7667,7 @@ function registerTools(server, base) {
7607
7667
 
7608
7668
  // src/server.ts
7609
7669
  var SERVER_NAME = "lumitra-studio";
7610
- var SERVER_VERSION = "0.12.0";
7670
+ var SERVER_VERSION = "0.14.0";
7611
7671
  function createStudioMcpServer(opts = {}) {
7612
7672
  const config = opts.config ?? resolveConfig(opts.env ?? process.env);
7613
7673
  const client = new StudioClient(config, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marlinjai/studio-mcp",
3
- "version": "0.12.0",
3
+ "version": "0.14.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",