@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 +1 -0
- package/dist/cli.js +216 -116
- package/dist/index.d.ts +59 -2
- package/dist/index.js +216 -116
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -142,6 +142,25 @@ var StudioClient = class {
|
|
|
142
142
|
deleteCampaign(campaignId) {
|
|
143
143
|
return this.json("DELETE", `/api/campaigns/${encodeURIComponent(campaignId)}`);
|
|
144
144
|
}
|
|
145
|
+
// ── Saved prompts ("My prompts", company-wide) ──
|
|
146
|
+
listSavedPrompts(opts = {}) {
|
|
147
|
+
const q = new URLSearchParams();
|
|
148
|
+
if (opts.sort) q.set("sort", opts.sort);
|
|
149
|
+
if (opts.limit !== void 0) q.set("limit", String(opts.limit));
|
|
150
|
+
if (opts.offset !== void 0) q.set("offset", String(opts.offset));
|
|
151
|
+
const qs = q.toString();
|
|
152
|
+
return this.json("GET", `/api/v1/prompts${qs ? `?${qs}` : ""}`);
|
|
153
|
+
}
|
|
154
|
+
getSavedPrompt(promptId) {
|
|
155
|
+
return this.json("GET", `/api/v1/prompts/${encodeURIComponent(promptId)}`);
|
|
156
|
+
}
|
|
157
|
+
/** 201 saved; 200 with `alreadySaved: true` when the company already saved the same recipe. */
|
|
158
|
+
savePrompt(body) {
|
|
159
|
+
return this.json("POST", "/api/v1/prompts", { json: body });
|
|
160
|
+
}
|
|
161
|
+
deleteSavedPrompt(promptId) {
|
|
162
|
+
return this.json("DELETE", `/api/v1/prompts/${encodeURIComponent(promptId)}`);
|
|
163
|
+
}
|
|
145
164
|
// ── Generation jobs ──
|
|
146
165
|
/**
|
|
147
166
|
* One image job. `brandSlug` is optional: without it the image is generated
|
|
@@ -525,7 +544,7 @@ function resolveConfig(env = process.env) {
|
|
|
525
544
|
}
|
|
526
545
|
|
|
527
546
|
// src/tools.ts
|
|
528
|
-
import { z as
|
|
547
|
+
import { z as z12 } from "zod";
|
|
529
548
|
|
|
530
549
|
// ../lumitra-core/dist/models/index.js
|
|
531
550
|
var veo = (tier, label) => {
|
|
@@ -6599,6 +6618,9 @@ var COMPOSITION_TOOLS = [
|
|
|
6599
6618
|
studioCompositionSendToSocial
|
|
6600
6619
|
];
|
|
6601
6620
|
|
|
6621
|
+
// src/promptTools.ts
|
|
6622
|
+
import { z as z11 } from "zod";
|
|
6623
|
+
|
|
6602
6624
|
// src/manageTools.ts
|
|
6603
6625
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
6604
6626
|
import { z as z10 } from "zod";
|
|
@@ -6847,10 +6869,87 @@ var MANAGE_TOOLS = [
|
|
|
6847
6869
|
studioDeleteCampaign
|
|
6848
6870
|
];
|
|
6849
6871
|
|
|
6872
|
+
// src/promptTools.ts
|
|
6873
|
+
var MAX_MENTIONS = 10;
|
|
6874
|
+
var mentionSchema = z11.object({
|
|
6875
|
+
kind: z11.enum(["character", "product", "location"]),
|
|
6876
|
+
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]."),
|
|
6877
|
+
name: z11.string().min(1).max(200).describe("Its display name."),
|
|
6878
|
+
rowId: z11.string().min(1).max(200).optional().describe("Its database id, when known.")
|
|
6879
|
+
}).strict();
|
|
6880
|
+
var settingsSchema = z11.object({
|
|
6881
|
+
model: z11.string().min(1).max(200).optional(),
|
|
6882
|
+
aspectRatio: z11.string().min(1).max(32).optional(),
|
|
6883
|
+
imageSize: z11.string().min(1).max(32).optional(),
|
|
6884
|
+
candidateCount: z11.number().int().min(1).max(8).optional(),
|
|
6885
|
+
thinkingLevel: z11.enum(["none", "minimal", "high"]).optional(),
|
|
6886
|
+
temperature: z11.number().min(0).max(2).optional(),
|
|
6887
|
+
seed: z11.number().int().optional()
|
|
6888
|
+
}).strict();
|
|
6889
|
+
function promptDeleteSummary(p) {
|
|
6890
|
+
const text = p.prompt.trim();
|
|
6891
|
+
const shown = text.length > 120 ? `${text.slice(0, 117)}...` : text;
|
|
6892
|
+
const used = p.usageCount > 0 ? ` It was used ${p.usageCount === 1 ? "once" : `${p.usageCount} times`}.` : "";
|
|
6893
|
+
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.`;
|
|
6894
|
+
}
|
|
6895
|
+
function promptSubject(p) {
|
|
6896
|
+
return ["delete-prompt", p.id, p.title, p.updatedAt].join(":");
|
|
6897
|
+
}
|
|
6898
|
+
var studioPromptsList = defineTool({
|
|
6899
|
+
name: "studio_prompts_list",
|
|
6900
|
+
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.',
|
|
6901
|
+
inputSchema: {
|
|
6902
|
+
sort: z11.enum(["newest", "most-used"]).optional().describe("newest (default) or most-used."),
|
|
6903
|
+
limit: z11.number().int().min(1).max(200).optional().describe("How many to return, 1 to 200 (default 50)."),
|
|
6904
|
+
offset: z11.number().int().min(0).optional().describe("Where to start: the nextOffset of the previous page.")
|
|
6905
|
+
},
|
|
6906
|
+
annotations: { readOnlyHint: true },
|
|
6907
|
+
handler: async (args, ctx) => ctx.client.listSavedPrompts(args)
|
|
6908
|
+
});
|
|
6909
|
+
var studioPromptsSave = defineTool({
|
|
6910
|
+
name: "studio_prompts_save",
|
|
6911
|
+
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.",
|
|
6912
|
+
inputSchema: {
|
|
6913
|
+
prompt: z11.string().min(1).max(2e4).optional().describe("The prompt text, mention tokens such as @[character:bruno] included."),
|
|
6914
|
+
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.`),
|
|
6915
|
+
settings: settingsSchema.optional().describe("The generation settings to keep with it."),
|
|
6916
|
+
title: z11.string().min(1).max(120).optional().describe("A name for the prompt; defaults to its first words."),
|
|
6917
|
+
assetId: z11.string().min(1).optional().describe("An image, from studio_list_assets: save the prompt it was made with.")
|
|
6918
|
+
},
|
|
6919
|
+
annotations: { idempotentHint: true },
|
|
6920
|
+
handler: async (args, ctx) => {
|
|
6921
|
+
if (!args.prompt && !args.assetId) throw new ToolInputError("Send the prompt text, or an assetId to save the prompt that image was made with.");
|
|
6922
|
+
const res = await ctx.client.savePrompt(args);
|
|
6923
|
+
return { prompt: res.prompt, alreadySaved: res.alreadySaved === true };
|
|
6924
|
+
}
|
|
6925
|
+
});
|
|
6926
|
+
var studioPromptsDelete = defineTool({
|
|
6927
|
+
name: "studio_prompts_delete",
|
|
6928
|
+
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.",
|
|
6929
|
+
inputSchema: {
|
|
6930
|
+
promptId: z11.string().min(1).describe("The saved prompt, from studio_prompts_list."),
|
|
6931
|
+
confirmationToken
|
|
6932
|
+
},
|
|
6933
|
+
annotations: { destructiveHint: true },
|
|
6934
|
+
handler: async (args, ctx) => {
|
|
6935
|
+
const { prompt } = await ctx.client.getSavedPrompt(args.promptId);
|
|
6936
|
+
const summary = promptDeleteSummary(prompt);
|
|
6937
|
+
const gate = await confirmWithPerson(ctx, summary, promptSubject(prompt), args.confirmationToken);
|
|
6938
|
+
if (gate !== "proceed") return gate;
|
|
6939
|
+
try {
|
|
6940
|
+
const res = await ctx.client.deleteSavedPrompt(args.promptId);
|
|
6941
|
+
return { deleted: true, promptId: res.deleted, summary };
|
|
6942
|
+
} catch (err) {
|
|
6943
|
+
return roleRefusal(err, "Deleting a saved prompt needs a key with at least the company member role; this key does not have it.");
|
|
6944
|
+
}
|
|
6945
|
+
}
|
|
6946
|
+
});
|
|
6947
|
+
var PROMPT_TOOLS = [studioPromptsList, studioPromptsSave, studioPromptsDelete];
|
|
6948
|
+
|
|
6850
6949
|
// src/tools.ts
|
|
6851
|
-
var slug =
|
|
6852
|
-
var waitSeconds =
|
|
6853
|
-
var httpUrl =
|
|
6950
|
+
var slug = z12.string().regex(/^[a-z0-9-]+$/, "lowercase letters, numbers and hyphens only").describe("URL-safe identifier: lowercase letters, numbers, hyphens.");
|
|
6951
|
+
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.");
|
|
6952
|
+
var httpUrl = z12.string().url().refine((u) => /^https?:\/\//i.test(u), "must be an http(s) URL");
|
|
6854
6953
|
function pollOpts(ctx, timeoutSec) {
|
|
6855
6954
|
return { ...ctx.poll, timeoutMs: timeoutSec * 1e3 };
|
|
6856
6955
|
}
|
|
@@ -6926,30 +7025,30 @@ var studioGenerateImage = defineTool({
|
|
|
6926
7025
|
brandSlug: slug.optional().describe(
|
|
6927
7026
|
"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."
|
|
6928
7027
|
),
|
|
6929
|
-
brandMode:
|
|
6930
|
-
prompt:
|
|
7028
|
+
brandMode: z12.string().optional().describe('Optional brand mode (e.g. "illustration"); modes are defined per brand. Only meaningful with brandSlug.'),
|
|
7029
|
+
prompt: z12.string().min(1).describe("What to generate. With brandSlug, the brand style prefix is prepended server-side."),
|
|
6931
7030
|
characterSlug: slug.optional().describe(
|
|
6932
7031
|
"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
7032
|
),
|
|
6934
|
-
mentions:
|
|
6935
|
-
|
|
6936
|
-
kind:
|
|
7033
|
+
mentions: z12.array(
|
|
7034
|
+
z12.object({
|
|
7035
|
+
kind: z12.enum(["character", "product", "location"]).describe("What the mention names."),
|
|
6937
7036
|
id: slug.describe("The slug of the character (studio_list_characters), product or location (GET /api/products, GET /api/locations).")
|
|
6938
7037
|
})
|
|
6939
7038
|
).min(1).max(10).optional().describe(
|
|
6940
7039
|
"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."
|
|
6941
7040
|
),
|
|
6942
|
-
projectId:
|
|
7041
|
+
projectId: z12.string().min(1).optional().describe(
|
|
6943
7042
|
'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.'
|
|
6944
7043
|
),
|
|
6945
|
-
model:
|
|
6946
|
-
aspectRatio:
|
|
6947
|
-
imageSize:
|
|
6948
|
-
seed:
|
|
6949
|
-
candidateCount:
|
|
7044
|
+
model: z12.string().optional().describe('Image model id (e.g. "kie/nano-banana-2", "fal/nano-banana-2"). Omit for the Studio default.'),
|
|
7045
|
+
aspectRatio: z12.string().optional().describe('Aspect ratio such as "1:1", "16:9", "3:4".'),
|
|
7046
|
+
imageSize: z12.string().optional().describe('Provider size hint, e.g. "1K", "2K".'),
|
|
7047
|
+
seed: z12.number().int().optional(),
|
|
7048
|
+
candidateCount: z12.number().int().min(1).max(4).optional().describe(
|
|
6950
7049
|
"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."
|
|
6951
7050
|
),
|
|
6952
|
-
wait:
|
|
7051
|
+
wait: z12.boolean().default(true).describe("Poll until the job finishes (default true)."),
|
|
6953
7052
|
waitSeconds
|
|
6954
7053
|
},
|
|
6955
7054
|
handler: async (args, ctx) => {
|
|
@@ -6986,23 +7085,23 @@ var studioGenerate3d = defineTool({
|
|
|
6986
7085
|
name: "studio_generate_3d",
|
|
6987
7086
|
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.",
|
|
6988
7087
|
inputSchema: {
|
|
6989
|
-
prompt:
|
|
7088
|
+
prompt: z12.string().min(1).max(1024).describe("What to model. With imageUrl, a short description of the object in the image."),
|
|
6990
7089
|
imageUrl: httpUrl.optional().describe("Public http(s) URL of one image to model from. Selects an image model."),
|
|
6991
|
-
model:
|
|
6992
|
-
options:
|
|
6993
|
-
enableTexture:
|
|
6994
|
-
enablePbr:
|
|
6995
|
-
textureQuality:
|
|
6996
|
-
geometryQuality:
|
|
6997
|
-
quadRemesh:
|
|
6998
|
-
smartLowPoly:
|
|
6999
|
-
resolution:
|
|
7000
|
-
targetPolycount:
|
|
7001
|
-
topology:
|
|
7002
|
-
seed:
|
|
7090
|
+
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)."),
|
|
7091
|
+
options: z12.object({
|
|
7092
|
+
enableTexture: z12.boolean().optional().describe("Texture the mesh (default true). Off gives bare geometry and costs less."),
|
|
7093
|
+
enablePbr: z12.boolean().optional().describe("Physically-based rendering (PBR) material maps. Default on for Hunyuan Pro, off elsewhere."),
|
|
7094
|
+
textureQuality: z12.enum(["standard", "detailed"]).optional().describe("Tripo texture tier. detailed costs more."),
|
|
7095
|
+
geometryQuality: z12.enum(["standard", "detailed"]).optional().describe("Tripo geometry tier. detailed costs more."),
|
|
7096
|
+
quadRemesh: z12.boolean().optional().describe("Tripo: quad topology instead of triangles."),
|
|
7097
|
+
smartLowPoly: z12.boolean().optional().describe("Tripo text-to-3D: a low-poly mesh."),
|
|
7098
|
+
resolution: z12.enum(["512", "1024", "1536"]).optional().describe("TRELLIS.2 resolution (default 1024)."),
|
|
7099
|
+
targetPolycount: z12.number().int().min(100).max(15e5).optional().describe("Target face count, where the model supports one."),
|
|
7100
|
+
topology: z12.enum(["quad", "triangle"]).optional().describe("Hunyuan Pro polygon type."),
|
|
7101
|
+
seed: z12.number().int().optional()
|
|
7003
7102
|
}).optional().describe("Model-specific quality flags. Each changes the price; the returned costUsd is the price of the request that was sent."),
|
|
7004
|
-
projectId:
|
|
7005
|
-
wait:
|
|
7103
|
+
projectId: z12.string().min(1).optional().describe("Project to file the model under (from studio_list_projects). Omit for the default project."),
|
|
7104
|
+
wait: z12.boolean().default(true).describe("Poll until the job finishes (default true)."),
|
|
7006
7105
|
waitSeconds
|
|
7007
7106
|
},
|
|
7008
7107
|
handler: async (args, ctx) => {
|
|
@@ -7040,8 +7139,8 @@ var studioFindAnimations = defineTool({
|
|
|
7040
7139
|
name: "studio_find_animations",
|
|
7041
7140
|
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.',
|
|
7042
7141
|
inputSchema: {
|
|
7043
|
-
query:
|
|
7044
|
-
limit:
|
|
7142
|
+
query: z12.string().describe('Words to match, e.g. "sword slash". Empty returns the first presets in library order.'),
|
|
7143
|
+
limit: z12.number().int().min(1).max(50).default(25)
|
|
7045
7144
|
},
|
|
7046
7145
|
annotations: { readOnlyHint: true },
|
|
7047
7146
|
handler: async (args) => ({ animations: searchAnimations(args.query, args.limit) })
|
|
@@ -7050,12 +7149,12 @@ var studioRig3d = defineTool({
|
|
|
7050
7149
|
name: "studio_rig_3d",
|
|
7051
7150
|
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.",
|
|
7052
7151
|
inputSchema: {
|
|
7053
|
-
projectId:
|
|
7054
|
-
meshAssetId:
|
|
7055
|
-
animations:
|
|
7056
|
-
heightMeters:
|
|
7057
|
-
visibility:
|
|
7058
|
-
wait:
|
|
7152
|
+
projectId: z12.string().min(1).describe("The project the mesh lives in (from studio_list_projects)."),
|
|
7153
|
+
meshAssetId: z12.string().min(1).describe("The Model3D asset to rig: the assetId studio_generate_3d returned."),
|
|
7154
|
+
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.'),
|
|
7155
|
+
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."),
|
|
7156
|
+
visibility: z12.enum(["listed", "unlisted"]).optional(),
|
|
7157
|
+
wait: z12.boolean().default(true).describe("Poll until the rig finishes (default true)."),
|
|
7059
7158
|
waitSeconds
|
|
7060
7159
|
},
|
|
7061
7160
|
handler: async (args, ctx) => {
|
|
@@ -7112,8 +7211,8 @@ var studioGetJob = defineTool({
|
|
|
7112
7211
|
name: "studio_get_job",
|
|
7113
7212
|
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.",
|
|
7114
7213
|
inputSchema: {
|
|
7115
|
-
jobId:
|
|
7116
|
-
wait:
|
|
7214
|
+
jobId: z12.string().min(1),
|
|
7215
|
+
wait: z12.boolean().default(false).describe("Poll until terminal (default false: return the current state)."),
|
|
7117
7216
|
waitSeconds
|
|
7118
7217
|
},
|
|
7119
7218
|
annotations: { readOnlyHint: true },
|
|
@@ -7146,18 +7245,18 @@ var studioPromptEnhance = defineTool({
|
|
|
7146
7245
|
name: "studio_prompt_enhance",
|
|
7147
7246
|
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
7247
|
inputSchema: {
|
|
7149
|
-
prompt:
|
|
7150
|
-
target:
|
|
7151
|
-
mentions:
|
|
7152
|
-
|
|
7153
|
-
kind:
|
|
7248
|
+
prompt: z12.string().min(1).max(4e3).describe("The prompt to rewrite, mention tokens included."),
|
|
7249
|
+
target: z12.enum(["image", "video"]).default("image").describe('What the prompt is for: "image" (default) or "video".'),
|
|
7250
|
+
mentions: z12.array(
|
|
7251
|
+
z12.object({
|
|
7252
|
+
kind: z12.enum(["character", "product", "location"]),
|
|
7154
7253
|
id: slug.describe("The slug, exactly as the token in the prompt carries it."),
|
|
7155
|
-
name:
|
|
7254
|
+
name: z12.string().max(200).optional()
|
|
7156
7255
|
})
|
|
7157
7256
|
).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:
|
|
7257
|
+
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.'),
|
|
7159
7258
|
brandSlug: slug.optional().describe("Optional. A brand of your company whose style the rewrite should follow."),
|
|
7160
|
-
brandMode:
|
|
7259
|
+
brandMode: z12.string().optional().describe('Optional brand mode (e.g. "hero"). Only meaningful with brandSlug.')
|
|
7161
7260
|
},
|
|
7162
7261
|
annotations: { readOnlyHint: true },
|
|
7163
7262
|
handler: async (args, ctx) => {
|
|
@@ -7172,7 +7271,7 @@ var studioPromptEnhance = defineTool({
|
|
|
7172
7271
|
}
|
|
7173
7272
|
});
|
|
7174
7273
|
var LIKENESS_REFUSAL = `${LIKENESS_CONFIRMATION_REQUIRED_CODE}: ${likenessConfirmationRequiredMessage()}`;
|
|
7175
|
-
var likenessRightsConfirmed =
|
|
7274
|
+
var likenessRightsConfirmed = z12.literal(true, { error: LIKENESS_REFUSAL }).describe(likenessConfirmationToolDescription());
|
|
7176
7275
|
function assertLikenessRightsConfirmed(value) {
|
|
7177
7276
|
if (!isLikenessRightsConfirmed(value)) throw new Error(LIKENESS_REFUSAL);
|
|
7178
7277
|
}
|
|
@@ -7180,11 +7279,11 @@ var studioCreateCharacter = defineTool({
|
|
|
7180
7279
|
name: "studio_create_character",
|
|
7181
7280
|
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.",
|
|
7182
7281
|
inputSchema: {
|
|
7183
|
-
name:
|
|
7282
|
+
name: z12.string().min(1).describe('Display name, e.g. "Bruno Hartmann".'),
|
|
7184
7283
|
slug,
|
|
7185
|
-
descriptorPrompt:
|
|
7186
|
-
negativePrompt:
|
|
7187
|
-
defaultModel:
|
|
7284
|
+
descriptorPrompt: z12.string().min(1).describe("The identity description prepended to every generation that uses this character."),
|
|
7285
|
+
negativePrompt: z12.string().optional(),
|
|
7286
|
+
defaultModel: z12.string().optional().describe("Default image model id for this character."),
|
|
7188
7287
|
likenessRightsConfirmed
|
|
7189
7288
|
},
|
|
7190
7289
|
handler: async (args, ctx) => {
|
|
@@ -7204,16 +7303,16 @@ var studioMintCharacter = defineTool({
|
|
|
7204
7303
|
name: "studio_mint_character",
|
|
7205
7304
|
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.",
|
|
7206
7305
|
inputSchema: {
|
|
7207
|
-
projectId:
|
|
7208
|
-
name:
|
|
7306
|
+
projectId: z12.string().min(1).describe("Project id from studio_list_projects."),
|
|
7307
|
+
name: z12.string().min(1).describe("Display name."),
|
|
7209
7308
|
slug,
|
|
7210
|
-
description:
|
|
7211
|
-
descriptorPrompt:
|
|
7212
|
-
negativePrompt:
|
|
7213
|
-
defaultModel:
|
|
7214
|
-
seedModel:
|
|
7215
|
-
viewModel:
|
|
7216
|
-
visibility:
|
|
7309
|
+
description: z12.string().min(10).describe("Seed identity description (face, hair, age, build, distinguishing features)."),
|
|
7310
|
+
descriptorPrompt: z12.string().optional().describe("Override for the character's stored descriptor prompt. Defaults to the description."),
|
|
7311
|
+
negativePrompt: z12.string().optional(),
|
|
7312
|
+
defaultModel: z12.string().optional(),
|
|
7313
|
+
seedModel: z12.string().optional().describe("Override the seed text-to-image model (default fal/nano-banana-2)."),
|
|
7314
|
+
viewModel: z12.string().optional().describe("Override the view image-edit model (default fal/nano-banana-2-edit)."),
|
|
7315
|
+
visibility: z12.enum(["listed", "unlisted"]).optional().describe("Whether the run shows in the Studio workflow list."),
|
|
7217
7316
|
likenessRightsConfirmed,
|
|
7218
7317
|
waitSeconds
|
|
7219
7318
|
},
|
|
@@ -7272,12 +7371,12 @@ var studioCreateBrand = defineTool({
|
|
|
7272
7371
|
name: "studio_create_brand",
|
|
7273
7372
|
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.",
|
|
7274
7373
|
inputSchema: {
|
|
7275
|
-
name:
|
|
7374
|
+
name: z12.string().min(1),
|
|
7276
7375
|
slug,
|
|
7277
|
-
stylePrefix:
|
|
7278
|
-
context:
|
|
7279
|
-
defaultModel:
|
|
7280
|
-
maxReferenceImages:
|
|
7376
|
+
stylePrefix: z12.string().optional().describe("Text prepended to every prompt generated under this brand."),
|
|
7377
|
+
context: z12.string().optional().describe("Markdown brand context (tone, palette, do/don't)."),
|
|
7378
|
+
defaultModel: z12.string().optional(),
|
|
7379
|
+
maxReferenceImages: z12.number().int().min(0).max(8).optional()
|
|
7281
7380
|
},
|
|
7282
7381
|
handler: async (args, ctx) => {
|
|
7283
7382
|
const { config } = await ctx.client.createBrand({
|
|
@@ -7296,11 +7395,11 @@ var studioUploadBrandReference = defineTool({
|
|
|
7296
7395
|
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.`,
|
|
7297
7396
|
inputSchema: {
|
|
7298
7397
|
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."),
|
|
7299
|
-
source:
|
|
7300
|
-
category:
|
|
7301
|
-
label:
|
|
7302
|
-
tags:
|
|
7303
|
-
score:
|
|
7398
|
+
source: z12.string().min(1).describe("Local file path or http(s) URL of an image."),
|
|
7399
|
+
category: z12.string().optional().describe('Library category, default "general".'),
|
|
7400
|
+
label: z12.string().optional().describe("Optional file name / label."),
|
|
7401
|
+
tags: z12.array(z12.string()).optional(),
|
|
7402
|
+
score: z12.number().int().min(1).max(10).optional()
|
|
7304
7403
|
},
|
|
7305
7404
|
handler: async (args, ctx) => {
|
|
7306
7405
|
const file = await loadImageSource(args.source, ctx.client);
|
|
@@ -7321,26 +7420,26 @@ var studioRunWorkflow = defineTool({
|
|
|
7321
7420
|
name: "studio_run_workflow",
|
|
7322
7421
|
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).`,
|
|
7323
7422
|
inputSchema: {
|
|
7324
|
-
projectId:
|
|
7423
|
+
projectId: z12.string().min(1).describe("Project id from studio_list_projects."),
|
|
7325
7424
|
definition: workflowDefinitionSchema.optional(),
|
|
7326
|
-
savedId:
|
|
7327
|
-
params:
|
|
7328
|
-
nodeIds:
|
|
7329
|
-
upstreamGenerations:
|
|
7425
|
+
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."),
|
|
7426
|
+
params: z12.record(z12.string(), z12.unknown()).optional().describe("Values for the definition's params."),
|
|
7427
|
+
nodeIds: z12.array(z12.string()).optional().describe("Run only this subset of nodes (requires an inline `definition` or a `savedId`)."),
|
|
7428
|
+
upstreamGenerations: z12.record(z12.string(), z12.string()).optional().describe(
|
|
7330
7429
|
'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.'
|
|
7331
7430
|
),
|
|
7332
|
-
runs:
|
|
7333
|
-
visibility:
|
|
7334
|
-
budgetUsd:
|
|
7431
|
+
runs: z12.number().int().min(1).max(8).optional().describe("Repeat a node subset N times (1 to 8)."),
|
|
7432
|
+
visibility: z12.enum(["listed", "unlisted"]).optional().describe("Whether the run shows in the Studio workflow list."),
|
|
7433
|
+
budgetUsd: z12.number().nonnegative().optional().describe(
|
|
7335
7434
|
'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.'
|
|
7336
7435
|
),
|
|
7337
|
-
confirm:
|
|
7436
|
+
confirm: z12.boolean().optional().describe(
|
|
7338
7437
|
'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 }.'
|
|
7339
7438
|
),
|
|
7340
|
-
acknowledgeContinuity:
|
|
7439
|
+
acknowledgeContinuity: z12.boolean().optional().describe(
|
|
7341
7440
|
'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.'
|
|
7342
7441
|
),
|
|
7343
|
-
wait:
|
|
7442
|
+
wait: z12.boolean().default(true),
|
|
7344
7443
|
waitSeconds
|
|
7345
7444
|
},
|
|
7346
7445
|
handler: async (args, ctx) => {
|
|
@@ -7372,8 +7471,8 @@ var studioGetRun = defineTool({
|
|
|
7372
7471
|
name: "studio_get_run",
|
|
7373
7472
|
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.",
|
|
7374
7473
|
inputSchema: {
|
|
7375
|
-
runId:
|
|
7376
|
-
wait:
|
|
7474
|
+
runId: z12.string().min(1),
|
|
7475
|
+
wait: z12.boolean().default(false),
|
|
7377
7476
|
waitSeconds
|
|
7378
7477
|
},
|
|
7379
7478
|
annotations: { readOnlyHint: true },
|
|
@@ -7386,11 +7485,11 @@ var studioDecideJudge = defineTool({
|
|
|
7386
7485
|
name: "studio_decide_judge",
|
|
7387
7486
|
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.",
|
|
7388
7487
|
inputSchema: {
|
|
7389
|
-
runId:
|
|
7390
|
-
nodeId:
|
|
7391
|
-
verdict:
|
|
7392
|
-
candidate:
|
|
7393
|
-
reason:
|
|
7488
|
+
runId: z12.string().min(1),
|
|
7489
|
+
nodeId: z12.string().min(1),
|
|
7490
|
+
verdict: z12.enum(["approved", "rejected"]),
|
|
7491
|
+
candidate: z12.object({ generationId: z12.string().min(1), index: z12.number().int().min(0).optional() }).optional(),
|
|
7492
|
+
reason: z12.string().max(500).optional()
|
|
7394
7493
|
},
|
|
7395
7494
|
annotations: { destructiveHint: false, idempotentHint: false },
|
|
7396
7495
|
handler: async (args, ctx) => {
|
|
@@ -7406,8 +7505,8 @@ var studioGetRunOutput = defineTool({
|
|
|
7406
7505
|
name: "studio_get_run_output",
|
|
7407
7506
|
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.",
|
|
7408
7507
|
inputSchema: {
|
|
7409
|
-
runId:
|
|
7410
|
-
nodeId:
|
|
7508
|
+
runId: z12.string().min(1),
|
|
7509
|
+
nodeId: z12.string().min(1)
|
|
7411
7510
|
},
|
|
7412
7511
|
annotations: { readOnlyHint: true },
|
|
7413
7512
|
handler: async (args, ctx) => {
|
|
@@ -7419,22 +7518,22 @@ var studioReplaceCharacterInVideo = defineTool({
|
|
|
7419
7518
|
name: "studio_replace_character_in_video",
|
|
7420
7519
|
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.',
|
|
7421
7520
|
inputSchema: {
|
|
7422
|
-
projectId:
|
|
7521
|
+
projectId: z12.string().min(1).describe("Project id from studio_list_projects."),
|
|
7423
7522
|
sceneFrameUrl: httpUrl.describe("Public or signed URL of ONE frame of the target shot (png/jpg)."),
|
|
7424
7523
|
characterSlug: slug.optional().describe(
|
|
7425
7524
|
"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."
|
|
7426
7525
|
),
|
|
7427
7526
|
characterReferenceUrl: httpUrl.optional().describe("Explicit character reference image URL (use instead of characterSlug)."),
|
|
7428
7527
|
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."),
|
|
7429
|
-
scope:
|
|
7430
|
-
preserve:
|
|
7431
|
-
swapPrompt:
|
|
7432
|
-
motionPrompt:
|
|
7433
|
-
videoModel:
|
|
7434
|
-
editModel:
|
|
7435
|
-
aspectRatio:
|
|
7436
|
-
visibility:
|
|
7437
|
-
acknowledgeContinuity:
|
|
7528
|
+
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."),
|
|
7529
|
+
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.'),
|
|
7530
|
+
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."),
|
|
7531
|
+
motionPrompt: z12.string().optional().describe("Override the motion description for the video node."),
|
|
7532
|
+
videoModel: z12.string().optional().describe(`Image-to-video model id. Default ${DEFAULT_SWAP_VIDEO_MODEL}, or ${KEYFRAME_SWAP_VIDEO_MODEL} when endFrameUrl is given.`),
|
|
7533
|
+
editModel: z12.string().default(DEFAULT_SWAP_EDIT_MODEL).describe("Image-edit model id for the still swap."),
|
|
7534
|
+
aspectRatio: z12.string().default("16:9"),
|
|
7535
|
+
visibility: z12.enum(["listed", "unlisted"]).optional(),
|
|
7536
|
+
acknowledgeContinuity: z12.boolean().optional().describe(
|
|
7438
7537
|
"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."
|
|
7439
7538
|
),
|
|
7440
7539
|
waitSeconds
|
|
@@ -7502,7 +7601,7 @@ var studioGetSpend = defineTool({
|
|
|
7502
7601
|
name: "studio_get_spend",
|
|
7503
7602
|
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).`,
|
|
7504
7603
|
inputSchema: {
|
|
7505
|
-
tzOffsetMinutes:
|
|
7604
|
+
tzOffsetMinutes: z12.number().int().min(-840).max(840).optional()
|
|
7506
7605
|
},
|
|
7507
7606
|
annotations: { readOnlyHint: true },
|
|
7508
7607
|
handler: async (args, ctx) => {
|
|
@@ -7530,7 +7629,7 @@ var studioDescribePublished = defineTool({
|
|
|
7530
7629
|
name: "studio_describe_published",
|
|
7531
7630
|
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.",
|
|
7532
7631
|
inputSchema: {
|
|
7533
|
-
slug:
|
|
7632
|
+
slug: z12.string().min(1).describe("The recipe slug, from studio_list_published.")
|
|
7534
7633
|
},
|
|
7535
7634
|
annotations: { readOnlyHint: true },
|
|
7536
7635
|
handler: async (args, ctx) => {
|
|
@@ -7542,20 +7641,20 @@ var studioRunPublished = defineTool({
|
|
|
7542
7641
|
name: "studio_run_published",
|
|
7543
7642
|
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).`,
|
|
7544
7643
|
inputSchema: {
|
|
7545
|
-
slug:
|
|
7546
|
-
projectId:
|
|
7547
|
-
params:
|
|
7548
|
-
budgetUsd:
|
|
7644
|
+
slug: z12.string().min(1).describe("The recipe slug, from studio_list_published."),
|
|
7645
|
+
projectId: z12.string().min(1).describe("Project id from studio_list_projects."),
|
|
7646
|
+
params: z12.record(z12.string(), z12.unknown()).optional().describe("Values for the recipe's params (see studio_describe_published)."),
|
|
7647
|
+
budgetUsd: z12.number().nonnegative().optional().describe(
|
|
7549
7648
|
'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 }.'
|
|
7550
7649
|
),
|
|
7551
|
-
confirm:
|
|
7650
|
+
confirm: z12.boolean().optional().describe(
|
|
7552
7651
|
'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 }.'
|
|
7553
7652
|
),
|
|
7554
|
-
likenessRightsConfirmed:
|
|
7555
|
-
acknowledgeContinuity:
|
|
7653
|
+
likenessRightsConfirmed: z12.literal(true).optional().describe(`Required when the recipe creates a character; ignored otherwise. ${likenessConfirmationToolDescription()}`),
|
|
7654
|
+
acknowledgeContinuity: z12.boolean().optional().describe(
|
|
7556
7655
|
'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.'
|
|
7557
7656
|
),
|
|
7558
|
-
wait:
|
|
7657
|
+
wait: z12.boolean().default(true),
|
|
7559
7658
|
waitSeconds
|
|
7560
7659
|
},
|
|
7561
7660
|
handler: async (args, ctx) => {
|
|
@@ -7598,7 +7697,8 @@ var TOOLS = [
|
|
|
7598
7697
|
studioGetUsage,
|
|
7599
7698
|
...WORKFLOW_TOOLS,
|
|
7600
7699
|
...MANAGE_TOOLS,
|
|
7601
|
-
...COMPOSITION_TOOLS
|
|
7700
|
+
...COMPOSITION_TOOLS,
|
|
7701
|
+
...PROMPT_TOOLS
|
|
7602
7702
|
];
|
|
7603
7703
|
var TOOL_NAMES = TOOLS.map((t) => t.name);
|
|
7604
7704
|
function toolResult(value) {
|
|
@@ -7616,7 +7716,7 @@ function toolError(message) {
|
|
|
7616
7716
|
}
|
|
7617
7717
|
async function invokeTool(def, args, ctx) {
|
|
7618
7718
|
try {
|
|
7619
|
-
const parsed =
|
|
7719
|
+
const parsed = z12.object(def.inputSchema).parse(args ?? {});
|
|
7620
7720
|
const value = await def.handler(parsed, ctx);
|
|
7621
7721
|
return toolResult(value);
|
|
7622
7722
|
} catch (err) {
|
|
@@ -7667,7 +7767,7 @@ function registerTools(server, base) {
|
|
|
7667
7767
|
|
|
7668
7768
|
// src/server.ts
|
|
7669
7769
|
var SERVER_NAME = "lumitra-studio";
|
|
7670
|
-
var SERVER_VERSION = "0.
|
|
7770
|
+
var SERVER_VERSION = "0.15.0";
|
|
7671
7771
|
function createStudioMcpServer(opts = {}) {
|
|
7672
7772
|
const config = opts.config ?? resolveConfig(opts.env ?? process.env);
|
|
7673
7773
|
const client = new StudioClient(config, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marlinjai/studio-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.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",
|