@marlinjai/studio-mcp 0.14.0 → 0.15.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
@@ -122,6 +122,7 @@ The token is held in memory only. It is never logged, never serialized into a re
122
122
  | `studio_delete_asset` | Delete one asset (an image, a video, a rendered slide or reel) for everyone with its stored file. Needs an admin key, and the PERSON's yes, confirmed the same way as a project delete. Refused while a post, a saved workflow, a published recipe or work in flight still uses it: the result then carries `usedIn` with each place and nothing is deleted. Records of what happened (campaign shots, sent posts, past runs, the job and its cost) survive without it. |
123
123
  | `studio_list_workflows` / `studio_move_workflow` | List a project's saved workflows; move one to another project with its runs and results (reversible, not confirmed). |
124
124
  | `studio_list_campaigns` / `studio_delete_campaign` | List the company's campaigns; delete one with its shot list (its images stay), confirmed by the person exactly like a project delete. |
125
+ | `studio_prompts_list` / `studio_prompts_save` / `studio_prompts_delete` | The company's saved prompts ("My prompts"), shared by every project: list them (newest or most used), save one (the text with its mentions and settings, or `assetId` to keep the recipe an image was made with; the same recipe twice returns the first with `alreadySaved: true`), and delete one, confirmed by the person exactly like a project delete. Any member's key may. Free. |
125
126
  | `studio_list_published` | List every published recipe: `{ recipes: [{ slug, label, publishedRevision, updatedAt, hasEffects }] }`. `hasEffects` tells you whether running it creates/attaches an entity record (a character, a brand reference) on success, versus a pure generation recipe. Free, read-only. |
126
127
  | `studio_describe_published` | Describe one published recipe by slug: `{ slug, definition, hasEffects }`. `definition` is the FROZEN workflow (params, node shapes) exactly as it was at publish time, never the live authoring document. Read this before `studio_run_published` to know what params it needs. Free, read-only. |
127
128
  | `studio_run_published` | Run a published recipe by slug against its frozen definition; `params` fill the definition's own param bindings. On success, the recipe's declared post-run effects fire automatically (e.g. minting creates the character and attaches its reference views); effects never fire on a failed, partial or cancelled run. Each node is a paid job. A recipe that creates a character requires `likenessRightsConfirmed: true`, refused before any spend otherwise. |
package/dist/cli.js CHANGED
@@ -195,6 +195,25 @@ var StudioClient = class {
195
195
  deleteCampaign(campaignId) {
196
196
  return this.json("DELETE", `/api/campaigns/${encodeURIComponent(campaignId)}`);
197
197
  }
198
+ // ── Saved prompts ("My prompts", company-wide) ──
199
+ listSavedPrompts(opts = {}) {
200
+ const q = new URLSearchParams();
201
+ if (opts.sort) q.set("sort", opts.sort);
202
+ if (opts.limit !== void 0) q.set("limit", String(opts.limit));
203
+ if (opts.offset !== void 0) q.set("offset", String(opts.offset));
204
+ const qs = q.toString();
205
+ return this.json("GET", `/api/v1/prompts${qs ? `?${qs}` : ""}`);
206
+ }
207
+ getSavedPrompt(promptId) {
208
+ return this.json("GET", `/api/v1/prompts/${encodeURIComponent(promptId)}`);
209
+ }
210
+ /** 201 saved; 200 with `alreadySaved: true` when the company already saved the same recipe. */
211
+ savePrompt(body) {
212
+ return this.json("POST", "/api/v1/prompts", { json: body });
213
+ }
214
+ deleteSavedPrompt(promptId) {
215
+ return this.json("DELETE", `/api/v1/prompts/${encodeURIComponent(promptId)}`);
216
+ }
198
217
  // ── Generation jobs ──
199
218
  /**
200
219
  * One image job. `brandSlug` is optional: without it the image is generated
@@ -533,7 +552,7 @@ function projectQuery(projectId) {
533
552
  }
534
553
 
535
554
  // src/tools.ts
536
- import { z as z11 } from "zod";
555
+ import { z as z12 } from "zod";
537
556
 
538
557
  // ../lumitra-core/dist/models/index.js
539
558
  var veo = (tier, label) => {
@@ -6604,6 +6623,9 @@ var COMPOSITION_TOOLS = [
6604
6623
  studioCompositionSendToSocial
6605
6624
  ];
6606
6625
 
6626
+ // src/promptTools.ts
6627
+ import { z as z11 } from "zod";
6628
+
6607
6629
  // src/manageTools.ts
6608
6630
  import { randomUUID as randomUUID3 } from "crypto";
6609
6631
  import { z as z10 } from "zod";
@@ -6852,10 +6874,87 @@ var MANAGE_TOOLS = [
6852
6874
  studioDeleteCampaign
6853
6875
  ];
6854
6876
 
6877
+ // src/promptTools.ts
6878
+ var MAX_MENTIONS = 10;
6879
+ var mentionSchema = z11.object({
6880
+ kind: z11.enum(["character", "product", "location"]),
6881
+ id: z11.string().max(200).regex(/^[a-z0-9-]+$/, "lowercase letters, numbers and hyphens only").describe("The cast member's slug, as in the prompt token @[kind:slug]."),
6882
+ name: z11.string().min(1).max(200).describe("Its display name."),
6883
+ rowId: z11.string().min(1).max(200).optional().describe("Its database id, when known.")
6884
+ }).strict();
6885
+ var settingsSchema = z11.object({
6886
+ model: z11.string().min(1).max(200).optional(),
6887
+ aspectRatio: z11.string().min(1).max(32).optional(),
6888
+ imageSize: z11.string().min(1).max(32).optional(),
6889
+ candidateCount: z11.number().int().min(1).max(8).optional(),
6890
+ thinkingLevel: z11.enum(["none", "minimal", "high"]).optional(),
6891
+ temperature: z11.number().min(0).max(2).optional(),
6892
+ seed: z11.number().int().optional()
6893
+ }).strict();
6894
+ function promptDeleteSummary(p) {
6895
+ const text = p.prompt.trim();
6896
+ const shown = text.length > 120 ? `${text.slice(0, 117)}...` : text;
6897
+ const used = p.usageCount > 0 ? ` It was used ${p.usageCount === 1 ? "once" : `${p.usageCount} times`}.` : "";
6898
+ return `Delete the saved prompt "${p.title}" ("${shown}") from the company's prompt library, for everyone in the company?${used} Images made with it stay. This cannot be undone.`;
6899
+ }
6900
+ function promptSubject(p) {
6901
+ return ["delete-prompt", p.id, p.title, p.updatedAt].join(":");
6902
+ }
6903
+ var studioPromptsList = defineTool({
6904
+ name: "studio_prompts_list",
6905
+ description: 'List the company\'s saved prompts ("My prompts"): prompts that worked, kept to use again, shared by every project and every person in the company. Each has `prompt` (with mention tokens such as @[character:bruno]), `mentions`, `settings` (model, aspectRatio, imageSize, candidateCount, ...), `title`, `usageCount` and `savedByMe`. Newest first, or `sort: "most-used"`. Pages with `limit` (up to 200) and the returned `nextOffset`. Free.',
6906
+ inputSchema: {
6907
+ sort: z11.enum(["newest", "most-used"]).optional().describe("newest (default) or most-used."),
6908
+ limit: z11.number().int().min(1).max(200).optional().describe("How many to return, 1 to 200 (default 50)."),
6909
+ offset: z11.number().int().min(0).optional().describe("Where to start: the nextOffset of the previous page.")
6910
+ },
6911
+ annotations: { readOnlyHint: true },
6912
+ handler: async (args, ctx) => ctx.client.listSavedPrompts(args)
6913
+ });
6914
+ var studioPromptsSave = defineTool({
6915
+ name: "studio_prompts_save",
6916
+ description: "Save a prompt to the company's prompt library, to use again. Either the prompt itself (`prompt`, optional `mentions` and `settings`), or `assetId`: the recipe that image was made with (its prompt, mentions and settings), with any field you also send replacing the copied one. `title` defaults to the first words of the prompt. Saving the same prompt, mentions and settings again returns the prompt saved first with `alreadySaved: true`, never a second copy. A prompt whose mention tokens are not all listed in `mentions` is refused (400 invalid_mentions), exactly as studio_generate_image would refuse it. An image of another company, a video and an image without a recorded prompt are refused. Free.",
6917
+ inputSchema: {
6918
+ prompt: z11.string().min(1).max(2e4).optional().describe("The prompt text, mention tokens such as @[character:bruno] included."),
6919
+ mentions: z11.array(mentionSchema).max(MAX_MENTIONS).optional().describe(`The cast mentioned in the prompt, in prompt order (at most ${MAX_MENTIONS}). Every @[kind:slug] token of the prompt must be listed, as for studio_generate_image.`),
6920
+ settings: settingsSchema.optional().describe("The generation settings to keep with it."),
6921
+ title: z11.string().min(1).max(120).optional().describe("A name for the prompt; defaults to its first words."),
6922
+ assetId: z11.string().min(1).optional().describe("An image, from studio_list_assets: save the prompt it was made with.")
6923
+ },
6924
+ annotations: { idempotentHint: true },
6925
+ handler: async (args, ctx) => {
6926
+ if (!args.prompt && !args.assetId) throw new ToolInputError("Send the prompt text, or an assetId to save the prompt that image was made with.");
6927
+ const res = await ctx.client.savePrompt(args);
6928
+ return { prompt: res.prompt, alreadySaved: res.alreadySaved === true };
6929
+ }
6930
+ });
6931
+ var studioPromptsDelete = defineTool({
6932
+ name: "studio_prompts_delete",
6933
+ description: "Delete a saved prompt from the company's prompt library, for everyone in the company. Images made with it stay. The PERSON confirms every delete in the chat: this tool shows them the prompt through the client's confirmation dialog before anything happens. If the client has no such dialog, the tool returns `confirmationRequired` with a `summary` and a `confirmationToken`: show the summary to the person exactly as written, and only after they explicitly say yes call again with the token. Never confirm on their behalf.",
6934
+ inputSchema: {
6935
+ promptId: z11.string().min(1).describe("The saved prompt, from studio_prompts_list."),
6936
+ confirmationToken
6937
+ },
6938
+ annotations: { destructiveHint: true },
6939
+ handler: async (args, ctx) => {
6940
+ const { prompt } = await ctx.client.getSavedPrompt(args.promptId);
6941
+ const summary = promptDeleteSummary(prompt);
6942
+ const gate = await confirmWithPerson(ctx, summary, promptSubject(prompt), args.confirmationToken);
6943
+ if (gate !== "proceed") return gate;
6944
+ try {
6945
+ const res = await ctx.client.deleteSavedPrompt(args.promptId);
6946
+ return { deleted: true, promptId: res.deleted, summary };
6947
+ } catch (err) {
6948
+ return roleRefusal(err, "Deleting a saved prompt needs a key with at least the company member role; this key does not have it.");
6949
+ }
6950
+ }
6951
+ });
6952
+ var PROMPT_TOOLS = [studioPromptsList, studioPromptsSave, studioPromptsDelete];
6953
+
6855
6954
  // src/tools.ts
6856
- var slug = z11.string().regex(/^[a-z0-9-]+$/, "lowercase letters, numbers and hyphens only").describe("URL-safe identifier: lowercase letters, numbers, hyphens.");
6857
- var waitSeconds = z11.number().int().min(1).max(3600).default(DEFAULT_TIMEOUT_MS / 1e3).describe("Maximum seconds to wait before giving up and returning the id to poll later. Default 600.");
6858
- var httpUrl = z11.string().url().refine((u) => /^https?:\/\//i.test(u), "must be an http(s) URL");
6955
+ var slug = z12.string().regex(/^[a-z0-9-]+$/, "lowercase letters, numbers and hyphens only").describe("URL-safe identifier: lowercase letters, numbers, hyphens.");
6956
+ var waitSeconds = z12.number().int().min(1).max(3600).default(DEFAULT_TIMEOUT_MS / 1e3).describe("Maximum seconds to wait before giving up and returning the id to poll later. Default 600.");
6957
+ var httpUrl = z12.string().url().refine((u) => /^https?:\/\//i.test(u), "must be an http(s) URL");
6859
6958
  function pollOpts(ctx, timeoutSec) {
6860
6959
  return { ...ctx.poll, timeoutMs: timeoutSec * 1e3 };
6861
6960
  }
@@ -6931,30 +7030,30 @@ var studioGenerateImage = defineTool({
6931
7030
  brandSlug: slug.optional().describe(
6932
7031
  "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."
6933
7032
  ),
6934
- brandMode: z11.string().optional().describe('Optional brand mode (e.g. "illustration"); modes are defined per brand. Only meaningful with brandSlug.'),
6935
- prompt: z11.string().min(1).describe("What to generate. With brandSlug, the brand style prefix is prepended server-side."),
7033
+ brandMode: z12.string().optional().describe('Optional brand mode (e.g. "illustration"); modes are defined per brand. Only meaningful with brandSlug.'),
7034
+ prompt: z12.string().min(1).describe("What to generate. With brandSlug, the brand style prefix is prepended server-side."),
6936
7035
  characterSlug: slug.optional().describe(
6937
7036
  "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
7037
  ),
6939
- mentions: z11.array(
6940
- z11.object({
6941
- kind: z11.enum(["character", "product", "location"]).describe("What the mention names."),
7038
+ mentions: z12.array(
7039
+ z12.object({
7040
+ kind: z12.enum(["character", "product", "location"]).describe("What the mention names."),
6942
7041
  id: slug.describe("The slug of the character (studio_list_characters), product or location (GET /api/products, GET /api/locations).")
6943
7042
  })
6944
7043
  ).min(1).max(10).optional().describe(
6945
7044
  "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."
6946
7045
  ),
6947
- projectId: z11.string().min(1).optional().describe(
7046
+ projectId: z12.string().min(1).optional().describe(
6948
7047
  '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.'
6949
7048
  ),
6950
- model: z11.string().optional().describe('Image model id (e.g. "kie/nano-banana-2", "fal/nano-banana-2"). Omit for the Studio default.'),
6951
- aspectRatio: z11.string().optional().describe('Aspect ratio such as "1:1", "16:9", "3:4".'),
6952
- imageSize: z11.string().optional().describe('Provider size hint, e.g. "1K", "2K".'),
6953
- seed: z11.number().int().optional(),
6954
- candidateCount: z11.number().int().min(1).max(4).optional().describe(
7049
+ model: z12.string().optional().describe('Image model id (e.g. "kie/nano-banana-2", "fal/nano-banana-2"). Omit for the Studio default.'),
7050
+ aspectRatio: z12.string().optional().describe('Aspect ratio such as "1:1", "16:9", "3:4".'),
7051
+ imageSize: z12.string().optional().describe('Provider size hint, e.g. "1K", "2K".'),
7052
+ seed: z12.number().int().optional(),
7053
+ candidateCount: z12.number().int().min(1).max(4).optional().describe(
6955
7054
  "Number of candidates (1 to 4). Not every model takes a count: most KIE image models render one image whatever is asked, and a `route/...` model runs on KIE first, so expect one there too (its fal fallback may render up to four). The result carries `candidates: { requested, rendered, mayRender? }`, plus a `notice` whenever fewer will be rendered than were asked for; only rendered images are charged."
6956
7055
  ),
6957
- wait: z11.boolean().default(true).describe("Poll until the job finishes (default true)."),
7056
+ wait: z12.boolean().default(true).describe("Poll until the job finishes (default true)."),
6958
7057
  waitSeconds
6959
7058
  },
6960
7059
  handler: async (args, ctx) => {
@@ -6991,23 +7090,23 @@ var studioGenerate3d = defineTool({
6991
7090
  name: "studio_generate_3d",
6992
7091
  description: "Generate one 3D model (a textured GLB mesh) through 3D AI Studio, from a text prompt or from one image (imageUrl). Text models: studio3d/tripo-3-1-text-to-3d (the default), studio3d/hunyuan-3-1-rapid, studio3d/hunyuan-3-1-pro. Image models: studio3d/trellis-2 (the default when imageUrl is given), studio3d/tripo-3-1-image-to-3d. Submits a job and, when wait=true (default), polls until it finishes (usually one to five minutes) and returns the signed GLB URL and its cost in USD (Studio prices the request it sent, since 3D AI Studio reports no per-job charge). With wait=false it returns the jobId for studio_get_job. The price follows the model and the quality flags; the returned costUsd is the exact amount.",
6993
7092
  inputSchema: {
6994
- prompt: z11.string().min(1).max(1024).describe("What to model. With imageUrl, a short description of the object in the image."),
7093
+ prompt: z12.string().min(1).max(1024).describe("What to model. With imageUrl, a short description of the object in the image."),
6995
7094
  imageUrl: httpUrl.optional().describe("Public http(s) URL of one image to model from. Selects an image model."),
6996
- model: z11.string().min(1).optional().describe("3D model id from the list in the description. Omit for the default (text or image, by whether imageUrl is given)."),
6997
- options: z11.object({
6998
- enableTexture: z11.boolean().optional().describe("Texture the mesh (default true). Off gives bare geometry and costs less."),
6999
- enablePbr: z11.boolean().optional().describe("Physically-based rendering (PBR) material maps. Default on for Hunyuan Pro, off elsewhere."),
7000
- textureQuality: z11.enum(["standard", "detailed"]).optional().describe("Tripo texture tier. detailed costs more."),
7001
- geometryQuality: z11.enum(["standard", "detailed"]).optional().describe("Tripo geometry tier. detailed costs more."),
7002
- quadRemesh: z11.boolean().optional().describe("Tripo: quad topology instead of triangles."),
7003
- smartLowPoly: z11.boolean().optional().describe("Tripo text-to-3D: a low-poly mesh."),
7004
- resolution: z11.enum(["512", "1024", "1536"]).optional().describe("TRELLIS.2 resolution (default 1024)."),
7005
- targetPolycount: z11.number().int().min(100).max(15e5).optional().describe("Target face count, where the model supports one."),
7006
- topology: z11.enum(["quad", "triangle"]).optional().describe("Hunyuan Pro polygon type."),
7007
- seed: z11.number().int().optional()
7095
+ model: z12.string().min(1).optional().describe("3D model id from the list in the description. Omit for the default (text or image, by whether imageUrl is given)."),
7096
+ options: z12.object({
7097
+ enableTexture: z12.boolean().optional().describe("Texture the mesh (default true). Off gives bare geometry and costs less."),
7098
+ enablePbr: z12.boolean().optional().describe("Physically-based rendering (PBR) material maps. Default on for Hunyuan Pro, off elsewhere."),
7099
+ textureQuality: z12.enum(["standard", "detailed"]).optional().describe("Tripo texture tier. detailed costs more."),
7100
+ geometryQuality: z12.enum(["standard", "detailed"]).optional().describe("Tripo geometry tier. detailed costs more."),
7101
+ quadRemesh: z12.boolean().optional().describe("Tripo: quad topology instead of triangles."),
7102
+ smartLowPoly: z12.boolean().optional().describe("Tripo text-to-3D: a low-poly mesh."),
7103
+ resolution: z12.enum(["512", "1024", "1536"]).optional().describe("TRELLIS.2 resolution (default 1024)."),
7104
+ targetPolycount: z12.number().int().min(100).max(15e5).optional().describe("Target face count, where the model supports one."),
7105
+ topology: z12.enum(["quad", "triangle"]).optional().describe("Hunyuan Pro polygon type."),
7106
+ seed: z12.number().int().optional()
7008
7107
  }).optional().describe("Model-specific quality flags. Each changes the price; the returned costUsd is the price of the request that was sent."),
7009
- projectId: z11.string().min(1).optional().describe("Project to file the model under (from studio_list_projects). Omit for the default project."),
7010
- wait: z11.boolean().default(true).describe("Poll until the job finishes (default true)."),
7108
+ projectId: z12.string().min(1).optional().describe("Project to file the model under (from studio_list_projects). Omit for the default project."),
7109
+ wait: z12.boolean().default(true).describe("Poll until the job finishes (default true)."),
7011
7110
  waitSeconds
7012
7111
  },
7013
7112
  handler: async (args, ctx) => {
@@ -7045,8 +7144,8 @@ var studioFindAnimations = defineTool({
7045
7144
  name: "studio_find_animations",
7046
7145
  description: 'Search Meshy\'s animation library (678 presets in five categories: WalkAndRun, BodyMovements, DailyActions, Fighting, Dancing) for the presets studio_rig_3d can apply. Every word of the query must match a preset\'s name, category or subcategory (e.g. "sword", "walking woman", "dance"). Free and local: no request, no cost. Returns id, name and category for up to `limit` matches.',
7047
7146
  inputSchema: {
7048
- query: z11.string().describe('Words to match, e.g. "sword slash". Empty returns the first presets in library order.'),
7049
- limit: z11.number().int().min(1).max(50).default(25)
7147
+ query: z12.string().describe('Words to match, e.g. "sword slash". Empty returns the first presets in library order.'),
7148
+ limit: z12.number().int().min(1).max(50).default(25)
7050
7149
  },
7051
7150
  annotations: { readOnlyHint: true },
7052
7151
  handler: async (args) => ({ animations: searchAnimations(args.query, args.limit) })
@@ -7055,12 +7154,12 @@ var studioRig3d = defineTool({
7055
7154
  name: "studio_rig_3d",
7056
7155
  description: "Rig a humanoid 3D model and animate it (Meshy on fal): adds a skeleton and skin weights to a Model3D asset and applies up to 10 animation presets from Meshy's library; walk and run clips always come with the rig. Pass the mesh's assetId (studio_generate_3d returns it as assetId) and presets as names or ids (find them with studio_find_animations). Runs as a one-node workflow, so the cost gate and quota apply. Waits by default (usually one to three minutes) and returns the rigged GLB url, each clip's name and url, and costUsd (what it cost your company: a price per rig plus a price per preset). Humanoid characters only: an animal or an object will fail at the provider.",
7057
7156
  inputSchema: {
7058
- projectId: z11.string().min(1).describe("The project the mesh lives in (from studio_list_projects)."),
7059
- meshAssetId: z11.string().min(1).describe("The Model3D asset to rig: the assetId studio_generate_3d returned."),
7060
- animations: z11.array(z11.union([z11.string().min(1), z11.number().int()])).max(RIG_MAX_CLIPS).default([]).describe('Up to 10 presets, each a name ("Double_Combo_Attack", or loosely "double combo attack") or an id. Empty rigs with only the included walk and run.'),
7061
- heightMeters: z11.number().min(0.3).max(5).optional().describe("The character's approximate height in meters (default 1.7); Meshy scales the rig to it."),
7062
- visibility: z11.enum(["listed", "unlisted"]).optional(),
7063
- wait: z11.boolean().default(true).describe("Poll until the rig finishes (default true)."),
7157
+ projectId: z12.string().min(1).describe("The project the mesh lives in (from studio_list_projects)."),
7158
+ meshAssetId: z12.string().min(1).describe("The Model3D asset to rig: the assetId studio_generate_3d returned."),
7159
+ animations: z12.array(z12.union([z12.string().min(1), z12.number().int()])).max(RIG_MAX_CLIPS).default([]).describe('Up to 10 presets, each a name ("Double_Combo_Attack", or loosely "double combo attack") or an id. Empty rigs with only the included walk and run.'),
7160
+ heightMeters: z12.number().min(0.3).max(5).optional().describe("The character's approximate height in meters (default 1.7); Meshy scales the rig to it."),
7161
+ visibility: z12.enum(["listed", "unlisted"]).optional(),
7162
+ wait: z12.boolean().default(true).describe("Poll until the rig finishes (default true)."),
7064
7163
  waitSeconds
7065
7164
  },
7066
7165
  handler: async (args, ctx) => {
@@ -7117,8 +7216,8 @@ var studioGetJob = defineTool({
7117
7216
  name: "studio_get_job",
7118
7217
  description: "Fetch the status of a generation job by jobId: status (queued, running, succeeded, failed, canceled), cost, model, error message and a freshly signed result URL once it succeeded. Set wait=true to block until the job reaches a terminal state.",
7119
7218
  inputSchema: {
7120
- jobId: z11.string().min(1),
7121
- wait: z11.boolean().default(false).describe("Poll until terminal (default false: return the current state)."),
7219
+ jobId: z12.string().min(1),
7220
+ wait: z12.boolean().default(false).describe("Poll until terminal (default false: return the current state)."),
7122
7221
  waitSeconds
7123
7222
  },
7124
7223
  annotations: { readOnlyHint: true },
@@ -7151,18 +7250,18 @@ var studioPromptEnhance = defineTool({
7151
7250
  name: "studio_prompt_enhance",
7152
7251
  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
7252
  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"]),
7253
+ prompt: z12.string().min(1).max(4e3).describe("The prompt to rewrite, mention tokens included."),
7254
+ target: z12.enum(["image", "video"]).default("image").describe('What the prompt is for: "image" (default) or "video".'),
7255
+ mentions: z12.array(
7256
+ z12.object({
7257
+ kind: z12.enum(["character", "product", "location"]),
7159
7258
  id: slug.describe("The slug, exactly as the token in the prompt carries it."),
7160
- name: z11.string().max(200).optional()
7259
+ name: z12.string().max(200).optional()
7161
7260
  })
7162
7261
  ).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.'),
7262
+ model: z12.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
7263
  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.')
7264
+ brandMode: z12.string().optional().describe('Optional brand mode (e.g. "hero"). Only meaningful with brandSlug.')
7166
7265
  },
7167
7266
  annotations: { readOnlyHint: true },
7168
7267
  handler: async (args, ctx) => {
@@ -7177,7 +7276,7 @@ var studioPromptEnhance = defineTool({
7177
7276
  }
7178
7277
  });
7179
7278
  var LIKENESS_REFUSAL = `${LIKENESS_CONFIRMATION_REQUIRED_CODE}: ${likenessConfirmationRequiredMessage()}`;
7180
- var likenessRightsConfirmed = z11.literal(true, { error: LIKENESS_REFUSAL }).describe(likenessConfirmationToolDescription());
7279
+ var likenessRightsConfirmed = z12.literal(true, { error: LIKENESS_REFUSAL }).describe(likenessConfirmationToolDescription());
7181
7280
  function assertLikenessRightsConfirmed(value) {
7182
7281
  if (!isLikenessRightsConfirmed(value)) throw new Error(LIKENESS_REFUSAL);
7183
7282
  }
@@ -7185,11 +7284,11 @@ var studioCreateCharacter = defineTool({
7185
7284
  name: "studio_create_character",
7186
7285
  description: "Create an empty character record (no reference images yet). Prefer studio_mint_character, which generates the 7-view identity sheet and freezes it as references in one call. Use this only when you will upload your own reference images. Requires likenessRightsConfirmed: true, which you may only pass after the human you act for confirmed it for this character. Fails with 409 (code slug_taken) only if your own company already has a character with this slug; a slug another company uses is free to take.",
7187
7286
  inputSchema: {
7188
- name: z11.string().min(1).describe('Display name, e.g. "Bruno Hartmann".'),
7287
+ name: z12.string().min(1).describe('Display name, e.g. "Bruno Hartmann".'),
7189
7288
  slug,
7190
- descriptorPrompt: z11.string().min(1).describe("The identity description prepended to every generation that uses this character."),
7191
- negativePrompt: z11.string().optional(),
7192
- defaultModel: z11.string().optional().describe("Default image model id for this character."),
7289
+ descriptorPrompt: z12.string().min(1).describe("The identity description prepended to every generation that uses this character."),
7290
+ negativePrompt: z12.string().optional(),
7291
+ defaultModel: z12.string().optional().describe("Default image model id for this character."),
7193
7292
  likenessRightsConfirmed
7194
7293
  },
7195
7294
  handler: async (args, ctx) => {
@@ -7209,16 +7308,16 @@ var studioMintCharacter = defineTool({
7209
7308
  name: "studio_mint_character",
7210
7309
  description: "Mint a consistent character from a text description: runs the curated character-sheet workflow (seed face with fal/nano-banana-2, then six identity-pinned edits with fal/nano-banana-2-edit: three-quarter, profile, full-body, close-up, warm lighting, cool lighting), waits for it, creates the character, and uploads the 7 views as frozen references with the right categories. Returns the slug, reference count, per-view URLs, the runId and total cost (about $0.30). The description should cover face, hair, age, build and distinguishing features; wardrobe is standardized to a plain gray tee. Takes 2 to 5 minutes. Requires likenessRightsConfirmed: true, which you may only pass after the human you act for confirmed it for this character; without it the tool refuses before the run starts, so nothing is spent.",
7211
7310
  inputSchema: {
7212
- projectId: z11.string().min(1).describe("Project id from studio_list_projects."),
7213
- name: z11.string().min(1).describe("Display name."),
7311
+ projectId: z12.string().min(1).describe("Project id from studio_list_projects."),
7312
+ name: z12.string().min(1).describe("Display name."),
7214
7313
  slug,
7215
- description: z11.string().min(10).describe("Seed identity description (face, hair, age, build, distinguishing features)."),
7216
- descriptorPrompt: z11.string().optional().describe("Override for the character's stored descriptor prompt. Defaults to the description."),
7217
- negativePrompt: z11.string().optional(),
7218
- defaultModel: z11.string().optional(),
7219
- seedModel: z11.string().optional().describe("Override the seed text-to-image model (default fal/nano-banana-2)."),
7220
- viewModel: z11.string().optional().describe("Override the view image-edit model (default fal/nano-banana-2-edit)."),
7221
- visibility: z11.enum(["listed", "unlisted"]).optional().describe("Whether the run shows in the Studio workflow list."),
7314
+ description: z12.string().min(10).describe("Seed identity description (face, hair, age, build, distinguishing features)."),
7315
+ descriptorPrompt: z12.string().optional().describe("Override for the character's stored descriptor prompt. Defaults to the description."),
7316
+ negativePrompt: z12.string().optional(),
7317
+ defaultModel: z12.string().optional(),
7318
+ seedModel: z12.string().optional().describe("Override the seed text-to-image model (default fal/nano-banana-2)."),
7319
+ viewModel: z12.string().optional().describe("Override the view image-edit model (default fal/nano-banana-2-edit)."),
7320
+ visibility: z12.enum(["listed", "unlisted"]).optional().describe("Whether the run shows in the Studio workflow list."),
7222
7321
  likenessRightsConfirmed,
7223
7322
  waitSeconds
7224
7323
  },
@@ -7277,12 +7376,12 @@ var studioCreateBrand = defineTool({
7277
7376
  name: "studio_create_brand",
7278
7377
  description: "Create a brand (a style preset: name, slug, optional style prefix prepended to every prompt, optional free-text context). Upload reference images afterwards with studio_upload_brand_reference. Fails with 409 (code slug_taken) only if your own company already has a brand with this slug; a slug another company uses is free to take.",
7279
7378
  inputSchema: {
7280
- name: z11.string().min(1),
7379
+ name: z12.string().min(1),
7281
7380
  slug,
7282
- stylePrefix: z11.string().optional().describe("Text prepended to every prompt generated under this brand."),
7283
- context: z11.string().optional().describe("Markdown brand context (tone, palette, do/don't)."),
7284
- defaultModel: z11.string().optional(),
7285
- maxReferenceImages: z11.number().int().min(0).max(8).optional()
7381
+ stylePrefix: z12.string().optional().describe("Text prepended to every prompt generated under this brand."),
7382
+ context: z12.string().optional().describe("Markdown brand context (tone, palette, do/don't)."),
7383
+ defaultModel: z12.string().optional(),
7384
+ maxReferenceImages: z12.number().int().min(0).max(8).optional()
7286
7385
  },
7287
7386
  handler: async (args, ctx) => {
7288
7387
  const { config } = await ctx.client.createBrand({
@@ -7301,11 +7400,11 @@ var studioUploadBrandReference = defineTool({
7301
7400
  description: `Upload one reference image to a brand's library from a local file path or an http(s) URL. The Studio converts it to a 512px WebP and injects it into generations under that brand (up to the brand's maxReferenceImages). Category groups references (default "general"); tags and a 1 to 10 quality score are optional.`,
7302
7401
  inputSchema: {
7303
7402
  brandSlug: slug.describe("The slug of a brand of your company (from studio_create_brand). A slug that names no brand of your company is a 404, and nothing is uploaded."),
7304
- source: z11.string().min(1).describe("Local file path or http(s) URL of an image."),
7305
- category: z11.string().optional().describe('Library category, default "general".'),
7306
- label: z11.string().optional().describe("Optional file name / label."),
7307
- tags: z11.array(z11.string()).optional(),
7308
- score: z11.number().int().min(1).max(10).optional()
7403
+ source: z12.string().min(1).describe("Local file path or http(s) URL of an image."),
7404
+ category: z12.string().optional().describe('Library category, default "general".'),
7405
+ label: z12.string().optional().describe("Optional file name / label."),
7406
+ tags: z12.array(z12.string()).optional(),
7407
+ score: z12.number().int().min(1).max(10).optional()
7309
7408
  },
7310
7409
  handler: async (args, ctx) => {
7311
7410
  const file = await loadImageSource(args.source, ctx.client);
@@ -7326,26 +7425,26 @@ var studioRunWorkflow = defineTool({
7326
7425
  name: "studio_run_workflow",
7327
7426
  description: `Run a generation workflow DAG. Pass an inline definition (nodes of provider calls wired by ref bindings; this is what the hosted Studio accepts) or the savedId of a workflow saved in the Studio (the Studio runs that workflow's current document, exactly what the canvas would run). Params fill {kind:"param"} bindings. Returns the runId plus per-node status, URLs and cost; with wait=true (default) it blocks until the run is terminal (succeeded, failed, partial, cancelled). Each node becomes a paid job. Use an inline definition ONLY for the first batch of a new deliverable (one workflow, a node per item, a stable label); a follow-up on an existing item belongs in that saved workflow as a new node (studio_workflow_apply: addNode plus connect from the node it refines) run here with savedId and nodeIds, because every listed inline run is saved as its own workflow. A clip with both a start and an end frame is checked for continuity before it is paid for (see acknowledgeContinuity).`,
7328
7427
  inputSchema: {
7329
- projectId: z11.string().min(1).describe("Project id from studio_list_projects."),
7428
+ projectId: z12.string().min(1).describe("Project id from studio_list_projects."),
7330
7429
  definition: workflowDefinitionSchema.optional(),
7331
- savedId: z11.string().optional().describe("Id of a saved workflow (from studio_workflow_create, studio_workflow_get or a listed run) to run instead of an inline definition. An unknown id is a 404 naming it; a workflow that is not runnable yet comes back as not_runnable with per-node issues."),
7332
- params: z11.record(z11.string(), z11.unknown()).optional().describe("Values for the definition's params."),
7333
- nodeIds: z11.array(z11.string()).optional().describe("Run only this subset of nodes (requires an inline `definition` or a `savedId`)."),
7334
- upstreamGenerations: z11.record(z11.string(), z11.string()).optional().describe(
7430
+ savedId: z12.string().optional().describe("Id of a saved workflow (from studio_workflow_create, studio_workflow_get or a listed run) to run instead of an inline definition. An unknown id is a 404 naming it; a workflow that is not runnable yet comes back as not_runnable with per-node issues."),
7431
+ params: z12.record(z12.string(), z12.unknown()).optional().describe("Values for the definition's params."),
7432
+ nodeIds: z12.array(z12.string()).optional().describe("Run only this subset of nodes (requires an inline `definition` or a `savedId`)."),
7433
+ upstreamGenerations: z12.record(z12.string(), z12.string()).optional().describe(
7335
7434
  'Pin WHICH generation of an upstream node feeds this subset run: { "<upstream node id>": "<node-run id>" } (the per-node `id` that studio_get_run returns). A verified pin is reused even when the planner has no matching cache key for it (an inline first batch, or a node edited and reverted), so a follow-up node wired from an earlier generation runs against exactly that image. An unknown id is refused naming the node, never silently replaced by the latest.'
7336
7435
  ),
7337
- runs: z11.number().int().min(1).max(8).optional().describe("Repeat a node subset N times (1 to 8)."),
7338
- visibility: z11.enum(["listed", "unlisted"]).optional().describe("Whether the run shows in the Studio workflow list."),
7339
- budgetUsd: z11.number().nonnegative().optional().describe(
7436
+ runs: z12.number().int().min(1).max(8).optional().describe("Repeat a node subset N times (1 to 8)."),
7437
+ visibility: z12.enum(["listed", "unlisted"]).optional().describe("Whether the run shows in the Studio workflow list."),
7438
+ budgetUsd: z12.number().nonnegative().optional().describe(
7340
7439
  'S6b: hard cap on the estimated cost, verified server-side before anything is created. An unverifiable estimate (a credits-only or unpriced executing node) refuses too, never proceeds silently. Refusal: { code: "budget_exceeded", estimate }. For `runs`>1 this is the AGGREGATE cap across every iteration.'
7341
7440
  ),
7342
- confirm: z11.boolean().optional().describe(
7441
+ confirm: z12.boolean().optional().describe(
7343
7442
  'S6b: bypasses the confirmation threshold for this one request (a flat $10 today) when the estimate meets or exceeds it. Without this, such a run refuses with { code: "confirmation_required", estimate }.'
7344
7443
  ),
7345
- acknowledgeContinuity: z11.boolean().optional().describe(
7444
+ acknowledgeContinuity: z12.boolean().optional().describe(
7346
7445
  'Run despite the continuity check. Before a run executes an image-to-video node with BOTH a start frame (inputImageUrl) and an end frame (endImageUrl), the Studio compares the two frames with a vision model (one small paid check per new pair of frames, remembered for your company, so an unchanged pair is never charged twice): a person or a held object in one frame and not the other makes the video model invent or erase it mid-clip. Frames that disagree refuse with { code: "continuity_mismatch", nodes: [{ nodeId, differences }] }; a check that could not run refuses with { code: "continuity_unchecked", nodes: [{ nodeId, reason }] }. Nothing is spent on either. Show the differences to the person you act for and fix the frames; pass true only when they decide to run anyway.'
7347
7446
  ),
7348
- wait: z11.boolean().default(true),
7447
+ wait: z12.boolean().default(true),
7349
7448
  waitSeconds
7350
7449
  },
7351
7450
  handler: async (args, ctx) => {
@@ -7377,8 +7476,8 @@ var studioGetRun = defineTool({
7377
7476
  name: "studio_get_run",
7378
7477
  description: "Fetch a workflow run by runId: overall status (pending, running, succeeded, failed, partial, awaiting_decision, cancelled; cancelled means somebody stopped it), total cost, and per-node status, result URL, cost and error message. Set wait=true to block until the run settles. A run at awaiting_decision is parked on a person at a judge node: waiting returns immediately with a `waiting` block naming the node and its candidates, because polling can never clear it; ask the user to choose and submit their answer with studio_decide_judge.",
7379
7478
  inputSchema: {
7380
- runId: z11.string().min(1),
7381
- wait: z11.boolean().default(false),
7479
+ runId: z12.string().min(1),
7480
+ wait: z12.boolean().default(false),
7382
7481
  waitSeconds
7383
7482
  },
7384
7483
  annotations: { readOnlyHint: true },
@@ -7391,11 +7490,11 @@ var studioDecideJudge = defineTool({
7391
7490
  name: "studio_decide_judge",
7392
7491
  description: "Submit a PERSON'S decision on a parked judge node (a run whose status is awaiting_decision). Approving that candidate resumes the run from that node; rejecting fails the node and stops the branch. Never call this on your own judgement: a judge node exists precisely because a human is meant to look, so show them the candidates from studio_get_run's `waiting` block and pass on the answer they give. `candidate.generationId` comes from that same block, and may be omitted only when the node has exactly one candidate.",
7393
7492
  inputSchema: {
7394
- runId: z11.string().min(1),
7395
- nodeId: z11.string().min(1),
7396
- verdict: z11.enum(["approved", "rejected"]),
7397
- candidate: z11.object({ generationId: z11.string().min(1), index: z11.number().int().min(0).optional() }).optional(),
7398
- reason: z11.string().max(500).optional()
7493
+ runId: z12.string().min(1),
7494
+ nodeId: z12.string().min(1),
7495
+ verdict: z12.enum(["approved", "rejected"]),
7496
+ candidate: z12.object({ generationId: z12.string().min(1), index: z12.number().int().min(0).optional() }).optional(),
7497
+ reason: z12.string().max(500).optional()
7399
7498
  },
7400
7499
  annotations: { destructiveHint: false, idempotentHint: false },
7401
7500
  handler: async (args, ctx) => {
@@ -7411,8 +7510,8 @@ var studioGetRunOutput = defineTool({
7411
7510
  name: "studio_get_run_output",
7412
7511
  description: "Get a FRESH signed URL for one node's output of a workflow run (signed URLs expire; call this when an earlier URL stopped working). Returns url, kind (image, video, model3d) and mime.",
7413
7512
  inputSchema: {
7414
- runId: z11.string().min(1),
7415
- nodeId: z11.string().min(1)
7513
+ runId: z12.string().min(1),
7514
+ nodeId: z12.string().min(1)
7416
7515
  },
7417
7516
  annotations: { readOnlyHint: true },
7418
7517
  handler: async (args, ctx) => {
@@ -7424,22 +7523,22 @@ var studioReplaceCharacterInVideo = defineTool({
7424
7523
  name: "studio_replace_character_in_video",
7425
7524
  description: 'Put a minted character into a video shot through the still-swap route: (1) an image-edit node (fal/nano-banana-2-edit) replaces the person in a scene FRAME with the character; (2) an image-to-video node animates that still (default fal/seedance-pro-image-to-video; with endFrameUrl it switches to fal/kling-v2-5-image-to-video and binds the end keyframe so the clip lands on it). Be honest with the user about what this route is: the video step REGENERATES the motion from the stills, so the original performance, timing and background are recreated rather than preserved; when the original motion must survive exactly, say so before spending. Declare scope: identity (default) takes face, head and hair and keeps the footage body; full_body also takes the character body proportions, which changes the silhouette. Pass preserve with the two or three shot-specific constraints most likely to fail, from looking at the frame (e.g. "keep the open door in front of his body", "match the face soft focus"), or a complete swapPrompt of your own. Never add a realism suffix like "photorealistic" or a promise that every pixel stays identical; the model cannot keep either and the suffix sharpens deliberately soft subjects. Give the character as characterSlug (its full-body reference is used, falling back to three-quarter then face) or as an explicit characterReferenceUrl. Requires a frame URL: extract a representative frame from the video yourself first (this tool does not decode video). Waits for both nodes and returns stillUrl, videoUrl, runId and costUsd (what the take cost your company; about $1.05 with the default models on prepaid credits without a subscription). Inspect the still before paying for more takes, keep generated cuts under 5 seconds, and budget one take plus two retries per shot. Do not use video-to-video swap models on dark or handheld footage.',
7426
7525
  inputSchema: {
7427
- projectId: z11.string().min(1).describe("Project id from studio_list_projects."),
7526
+ projectId: z12.string().min(1).describe("Project id from studio_list_projects."),
7428
7527
  sceneFrameUrl: httpUrl.describe("Public or signed URL of ONE frame of the target shot (png/jpg)."),
7429
7528
  characterSlug: slug.optional().describe(
7430
7529
  "Character to insert: one of your company's, or one another company shared. Its full-body reference (fallback three-quarter, face) is resolved automatically. A slug your company cannot use is a 404 before the run starts, so nothing is spent."
7431
7530
  ),
7432
7531
  characterReferenceUrl: httpUrl.optional().describe("Explicit character reference image URL (use instead of characterSlug)."),
7433
7532
  endFrameUrl: httpUrl.optional().describe("Optional second approved keyframe for the END of the clip. Switches the video model to Kling (start + end frame) unless videoModel is set explicitly."),
7434
- scope: z11.enum(SWAP_SCOPES).optional().describe("How much of the person to replace. identity (default): face, head and hair from the character, the footage keeps its body. full_body: also the character body proportions; the silhouette changes, so the background behind the old body and every contact point must be re-derived."),
7435
- preserve: z11.array(z11.string().min(1).max(200)).max(6).optional().describe('Shot-specific constraints most likely to fail, as concrete relationships seen in the frame, one per entry (e.g. "keep the open door in front of his body"). Appended to the composed prompt.'),
7436
- swapPrompt: z11.string().optional().describe("A complete still-swap edit prompt of your own; replaces the composed one, so scope and preserve are then ignored."),
7437
- motionPrompt: z11.string().optional().describe("Override the motion description for the video node."),
7438
- videoModel: z11.string().optional().describe(`Image-to-video model id. Default ${DEFAULT_SWAP_VIDEO_MODEL}, or ${KEYFRAME_SWAP_VIDEO_MODEL} when endFrameUrl is given.`),
7439
- editModel: z11.string().default(DEFAULT_SWAP_EDIT_MODEL).describe("Image-edit model id for the still swap."),
7440
- aspectRatio: z11.string().default("16:9"),
7441
- visibility: z11.enum(["listed", "unlisted"]).optional(),
7442
- acknowledgeContinuity: z11.boolean().optional().describe(
7533
+ scope: z12.enum(SWAP_SCOPES).optional().describe("How much of the person to replace. identity (default): face, head and hair from the character, the footage keeps its body. full_body: also the character body proportions; the silhouette changes, so the background behind the old body and every contact point must be re-derived."),
7534
+ preserve: z12.array(z12.string().min(1).max(200)).max(6).optional().describe('Shot-specific constraints most likely to fail, as concrete relationships seen in the frame, one per entry (e.g. "keep the open door in front of his body"). Appended to the composed prompt.'),
7535
+ swapPrompt: z12.string().optional().describe("A complete still-swap edit prompt of your own; replaces the composed one, so scope and preserve are then ignored."),
7536
+ motionPrompt: z12.string().optional().describe("Override the motion description for the video node."),
7537
+ videoModel: z12.string().optional().describe(`Image-to-video model id. Default ${DEFAULT_SWAP_VIDEO_MODEL}, or ${KEYFRAME_SWAP_VIDEO_MODEL} when endFrameUrl is given.`),
7538
+ editModel: z12.string().default(DEFAULT_SWAP_EDIT_MODEL).describe("Image-edit model id for the still swap."),
7539
+ aspectRatio: z12.string().default("16:9"),
7540
+ visibility: z12.enum(["listed", "unlisted"]).optional(),
7541
+ acknowledgeContinuity: z12.boolean().optional().describe(
7443
7542
  "With endFrameUrl only. The swapped still (the clip's start frame) is compared with the end frame before the clip is paid for; when they do not show the same people and the same objects in their hands, the video node fails with continuity_mismatch and the differences, and nothing is spent on the clip (the still was already made). Fix the end frame, or call again with true when the person you act for decides to run anyway."
7444
7543
  ),
7445
7544
  waitSeconds
@@ -7507,7 +7606,7 @@ var studioGetSpend = defineTool({
7507
7606
  name: "studio_get_spend",
7508
7607
  description: `Read the spend ledger: total USD and job counts for today, the last 7 days and the last 30 days, plus the most recent paid actions. The amounts are what the company paid (each job's costUsd): for a company on prepaid credits, what left its balance for those jobs. tzOffsetMinutes is the viewer's Date.getTimezoneOffset() so "today" rolls at local midnight (default UTC).`,
7509
7608
  inputSchema: {
7510
- tzOffsetMinutes: z11.number().int().min(-840).max(840).optional()
7609
+ tzOffsetMinutes: z12.number().int().min(-840).max(840).optional()
7511
7610
  },
7512
7611
  annotations: { readOnlyHint: true },
7513
7612
  handler: async (args, ctx) => {
@@ -7535,7 +7634,7 @@ var studioDescribePublished = defineTool({
7535
7634
  name: "studio_describe_published",
7536
7635
  description: "Describe one published recipe by slug: { slug, definition, hasEffects }. definition is the FROZEN workflow (params, node shapes) exactly as it was at publish time, never the live authoring document, which may have moved on since. Read this before studio_run_published to know what params it needs. Free, read-only.",
7537
7636
  inputSchema: {
7538
- slug: z11.string().min(1).describe("The recipe slug, from studio_list_published.")
7637
+ slug: z12.string().min(1).describe("The recipe slug, from studio_list_published.")
7539
7638
  },
7540
7639
  annotations: { readOnlyHint: true },
7541
7640
  handler: async (args, ctx) => {
@@ -7547,20 +7646,20 @@ var studioRunPublished = defineTool({
7547
7646
  name: "studio_run_published",
7548
7647
  description: `Run a published recipe by slug. Runs its FROZEN definition (studio_describe_published shows exactly what it needs); params fill the definition's own {kind:"param"} bindings. On success, the recipe's declared post-run effects fire automatically (e.g. character minting creates the character and attaches its reference views); effects never fire on a failed or partial run, by design. A recipe that creates a character (hasEffects, see studio_describe_published) requires likenessRightsConfirmed: true and refuses with { code: "likeness_rights_confirmation_required" } before anything is spent when it is missing. Returns the runId plus per-node status, URLs and cost; with wait=true (default) it blocks until the run is terminal. Each node becomes a paid job. The same $10 confirm-gate as studio_run_workflow applies: an estimate at or over the threshold refuses with { code: "confirmation_required", estimate } unless confirm: true is set. So does its continuity check before a clip with a start and an end frame (see acknowledgeContinuity).`,
7549
7648
  inputSchema: {
7550
- slug: z11.string().min(1).describe("The recipe slug, from studio_list_published."),
7551
- projectId: z11.string().min(1).describe("Project id from studio_list_projects."),
7552
- params: z11.record(z11.string(), z11.unknown()).optional().describe("Values for the recipe's params (see studio_describe_published)."),
7553
- budgetUsd: z11.number().nonnegative().optional().describe(
7649
+ slug: z12.string().min(1).describe("The recipe slug, from studio_list_published."),
7650
+ projectId: z12.string().min(1).describe("Project id from studio_list_projects."),
7651
+ params: z12.record(z12.string(), z12.unknown()).optional().describe("Values for the recipe's params (see studio_describe_published)."),
7652
+ budgetUsd: z12.number().nonnegative().optional().describe(
7554
7653
  'Hard cap on the estimated cost, verified server-side before anything is created. An unverifiable estimate (a credits-only or unpriced executing node) refuses too. Refusal: { code: "budget_exceeded", estimate }.'
7555
7654
  ),
7556
- confirm: z11.boolean().optional().describe(
7655
+ confirm: z12.boolean().optional().describe(
7557
7656
  'Bypasses the confirmation threshold for this one request (a flat $10 today) when the estimate meets or exceeds it. Without this, such a run refuses with { code: "confirmation_required", estimate }.'
7558
7657
  ),
7559
- likenessRightsConfirmed: z11.literal(true).optional().describe(`Required when the recipe creates a character; ignored otherwise. ${likenessConfirmationToolDescription()}`),
7560
- acknowledgeContinuity: z11.boolean().optional().describe(
7658
+ likenessRightsConfirmed: z12.literal(true).optional().describe(`Required when the recipe creates a character; ignored otherwise. ${likenessConfirmationToolDescription()}`),
7659
+ acknowledgeContinuity: z12.boolean().optional().describe(
7561
7660
  'Run despite the continuity check, exactly as on studio_run_workflow: a recipe with an image-to-video node that has both a start and an end frame refuses with { code: "continuity_mismatch", nodes: [{ nodeId, differences }] } or { code: "continuity_unchecked", nodes: [{ nodeId, reason }] } before anything is spent. Pass true only when the person you act for decides to run anyway.'
7562
7661
  ),
7563
- wait: z11.boolean().default(true),
7662
+ wait: z12.boolean().default(true),
7564
7663
  waitSeconds
7565
7664
  },
7566
7665
  handler: async (args, ctx) => {
@@ -7603,7 +7702,8 @@ var TOOLS = [
7603
7702
  studioGetUsage,
7604
7703
  ...WORKFLOW_TOOLS,
7605
7704
  ...MANAGE_TOOLS,
7606
- ...COMPOSITION_TOOLS
7705
+ ...COMPOSITION_TOOLS,
7706
+ ...PROMPT_TOOLS
7607
7707
  ];
7608
7708
  var TOOL_NAMES = TOOLS.map((t) => t.name);
7609
7709
  function toolResult(value) {
@@ -7621,7 +7721,7 @@ function toolError(message) {
7621
7721
  }
7622
7722
  async function invokeTool(def, args, ctx) {
7623
7723
  try {
7624
- const parsed = z11.object(def.inputSchema).parse(args ?? {});
7724
+ const parsed = z12.object(def.inputSchema).parse(args ?? {});
7625
7725
  const value = await def.handler(parsed, ctx);
7626
7726
  return toolResult(value);
7627
7727
  } catch (err) {
@@ -7672,7 +7772,7 @@ function registerTools(server, base) {
7672
7772
 
7673
7773
  // src/server.ts
7674
7774
  var SERVER_NAME = "lumitra-studio";
7675
- var SERVER_VERSION = "0.14.0";
7775
+ var SERVER_VERSION = "0.15.0";
7676
7776
  function createStudioMcpServer(opts = {}) {
7677
7777
  const config = opts.config ?? resolveConfig(opts.env ?? process.env);
7678
7778
  const client = new StudioClient(config, {