@marlinjai/studio-mcp 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -86,8 +86,8 @@ declare const DocNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
86
86
  video: "video";
87
87
  audio: "audio";
88
88
  text: "text";
89
- mesh3d: "mesh3d";
90
89
  json: "json";
90
+ mesh3d: "mesh3d";
91
91
  }>;
92
92
  required: z.ZodDefault<z.ZodBoolean>;
93
93
  cardinality: z.ZodOptional<z.ZodEnum<{
@@ -175,8 +175,8 @@ declare const WorkflowDocumentSchema: z.ZodObject<{
175
175
  video: "video";
176
176
  audio: "audio";
177
177
  text: "text";
178
- mesh3d: "mesh3d";
179
178
  json: "json";
179
+ mesh3d: "mesh3d";
180
180
  }>;
181
181
  required: z.ZodDefault<z.ZodBoolean>;
182
182
  cardinality: z.ZodOptional<z.ZodEnum<{
@@ -196,9 +196,9 @@ declare const WorkflowDocumentSchema: z.ZodObject<{
196
196
  video: "video";
197
197
  audio: "audio";
198
198
  text: "text";
199
+ json: "json";
199
200
  mask: "mask";
200
201
  mesh3d: "mesh3d";
201
- json: "json";
202
202
  }>;
203
203
  }, z.core.$strip>>;
204
204
  layout: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -232,6 +232,7 @@ declare const WorkflowDocumentSchema: z.ZodObject<{
232
232
  }, z.core.$strip>>;
233
233
  }, z.core.$strip>;
234
234
  type WorkflowDocument = z.infer<typeof WorkflowDocumentSchema>;
235
+
235
236
  declare const OpSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
236
237
  type: z.ZodLiteral<"addNode">;
237
238
  node: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -906,6 +907,45 @@ interface ProjectSummary {
906
907
  slug: string;
907
908
  name: string;
908
909
  }
910
+ /** `GET /api/v1/projects/:id`: the project and what deleting it would remove. */
911
+ interface ProjectContents {
912
+ project: ProjectSummary & {
913
+ isDefault: boolean;
914
+ };
915
+ workflows: number;
916
+ publishedWorkflows: number;
917
+ runs: number;
918
+ assets: number;
919
+ chats: number;
920
+ campaignShots: number;
921
+ campaigns: number;
922
+ jobsInFlight: number;
923
+ runsInFlight: number;
924
+ }
925
+ /** One row of `GET /api/v1/workflows`. */
926
+ interface SavedWorkflowListing {
927
+ savedId: string;
928
+ label: string;
929
+ version?: number;
930
+ [key: string]: unknown;
931
+ }
932
+ /** One row of `GET /api/campaigns`. */
933
+ interface CampaignListing {
934
+ id: string;
935
+ name: string;
936
+ studioId: string;
937
+ shotCount: number | null;
938
+ createdAt: string;
939
+ }
940
+ /** `GET /api/campaigns/:id`: the campaign and what deleting it would remove or keep. */
941
+ interface CampaignContents {
942
+ id: string;
943
+ name: string;
944
+ createdAt: string;
945
+ shots: number;
946
+ imagesKept: number;
947
+ shotsRendering: number;
948
+ }
909
949
  type JobStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'canceled' | (string & {});
910
950
  interface JobResponse {
911
951
  job: {
@@ -1087,23 +1127,28 @@ interface TenantUsageResponse {
1087
1127
  month: string;
1088
1128
  plan: string;
1089
1129
  /** `null` = no monthly cap: an operator-set unlimited plan, or a company on
1090
- * prepaid credits, whose balance is the cap (see `credits`). */
1130
+ * prepaid credits, whose balance is the cap (see `credits`). Always null on
1131
+ * credits since 2026-10-11. */
1091
1132
  capUsd: number | null;
1092
- /** A company on prepaid credits: its balance, its daily limit (null: none)
1093
- * and what left the balance today, all in US dollars of credit. Null for a
1094
- * company not on credits; absent from a Studio older than 2026-10-10. */
1133
+ /** A company on prepaid credits: its balance, its daily limit (null: none),
1134
+ * what left the balance today, and whether the Lumitra operator set a
1135
+ * monthly limit on top (`operatorMonthlyLimit`, absent from a Studio older
1136
+ * than 2026-10-11; its amount is not reported). Null for a company not on
1137
+ * credits; absent from a Studio older than 2026-10-10. */
1095
1138
  credits?: {
1096
1139
  balanceUsd: number;
1097
1140
  dailyLimitUsd: number | null;
1098
1141
  usedTodayUsd: number;
1099
1142
  dailyResetsAt: string;
1143
+ operatorMonthlyLimit?: boolean;
1100
1144
  } | null;
1101
1145
  /** `default`: no plan of its own, the default cap applies. `row`: an
1102
1146
  * operator-set plan. Absent from a Studio older than 2026-09-23. */
1103
1147
  capSource?: 'row' | 'default';
1104
1148
  rpm: number | null;
1105
- /** Realized + in-flight estimated: the same total the quota guard checks
1106
- * against and a 402 body's `usedUsd` reports. */
1149
+ /** Realized + in-flight estimated, in what the company paid: for a company
1150
+ * on prepaid credits what left and will leave its balance for the month's
1151
+ * jobs, otherwise the total the quota guard checks its cap against. */
1107
1152
  usedUsd: number;
1108
1153
  realizedUsd: number;
1109
1154
  inFlightEstimatedUsd: number;
@@ -1241,6 +1286,48 @@ declare class StudioClient {
1241
1286
  listProjects(): Promise<{
1242
1287
  projects: ProjectSummary[];
1243
1288
  }>;
1289
+ createProject(name: string): Promise<{
1290
+ project: ProjectSummary & {
1291
+ isDefault: boolean;
1292
+ };
1293
+ }>;
1294
+ renameProject(projectId: string, name: string): Promise<{
1295
+ project: ProjectSummary & {
1296
+ isDefault: boolean;
1297
+ };
1298
+ }>;
1299
+ /** What a project holds, which is what deleting it would remove. */
1300
+ describeProject(projectId: string): Promise<ProjectContents>;
1301
+ deleteProject(projectId: string): Promise<{
1302
+ deleted: true;
1303
+ project: ProjectSummary;
1304
+ fallbackProjectId: string;
1305
+ }>;
1306
+ listWorkflows(opts?: {
1307
+ projectId?: string;
1308
+ }): Promise<{
1309
+ workflows: SavedWorkflowListing[];
1310
+ }>;
1311
+ moveWorkflow(savedId: string, body: {
1312
+ toProjectId: string;
1313
+ projectId?: string;
1314
+ }): Promise<{
1315
+ moved: true;
1316
+ savedId: string;
1317
+ projectId: string;
1318
+ runsMoved: number;
1319
+ assetsMoved: number;
1320
+ }>;
1321
+ listCampaigns(): Promise<{
1322
+ campaigns: CampaignListing[];
1323
+ }>;
1324
+ /** The campaign and what deleting it would remove or keep. */
1325
+ describeCampaign(campaignId: string): Promise<CampaignContents>;
1326
+ deleteCampaign(campaignId: string): Promise<{
1327
+ deleted: true;
1328
+ id: string;
1329
+ shotsDeleted: number;
1330
+ }>;
1244
1331
  /**
1245
1332
  * One image job. `brandSlug` is optional: without it the image is generated
1246
1333
  * with no brand. A `brandSlug` or `characterSlug` the key's company cannot
@@ -1487,6 +1574,22 @@ declare function pollUntil<T>(what: string, fetchState: () => Promise<T>, isDone
1487
1574
  declare function waitForJob(client: StudioClient, jobId: string, opts?: PollOptions): Promise<JobResponse>;
1488
1575
  declare function waitForRun(client: StudioClient, runId: string, opts?: PollOptions): Promise<RunResponse>;
1489
1576
 
1577
+ /** What a confirmation ended in. `unavailable`: the client cannot ask the person. */
1578
+ type ConfirmOutcome = 'confirmed' | 'declined' | 'unavailable';
1579
+ type ConfirmFn = (message: string) => Promise<ConfirmOutcome>;
1580
+ /**
1581
+ * One-time confirmation tokens for clients without elicitation. A token names
1582
+ * the exact `subject` the person was shown (the action, the target and a
1583
+ * fingerprint of its contents), so it cannot be spent on anything else.
1584
+ */
1585
+ declare class ConfirmationStore {
1586
+ #private;
1587
+ constructor(now?: () => number);
1588
+ issue(subject: string): string;
1589
+ /** True once for a live token issued for exactly this subject; the token is spent either way. */
1590
+ redeem(token: string, subject: string): boolean;
1591
+ }
1592
+
1490
1593
  /**
1491
1594
  * The shape of one tool in the catalog, shared by `tools.ts` (the recipe and
1492
1595
  * entity tools) and `workflowTools.ts` (the workflow command-model primitives)
@@ -1497,6 +1600,14 @@ interface ToolContext {
1497
1600
  client: StudioClient;
1498
1601
  /** Poll tuning (tests inject a zero-delay sleep). */
1499
1602
  poll?: Omit<PollOptions, 'timeoutMs'>;
1603
+ /**
1604
+ * Ask the PERSON to confirm a destructive action in the chat (Model Context
1605
+ * Protocol elicitation). `registerTools` wires it to the connected client;
1606
+ * resolves `unavailable` when the client cannot show the dialog.
1607
+ */
1608
+ confirm?: ConfirmFn;
1609
+ /** One-time confirmation tokens, the fallback for a client without elicitation. */
1610
+ confirmations?: ConfirmationStore;
1500
1611
  }
1501
1612
  interface ToolDef<Shape extends z.ZodRawShape = z.ZodRawShape> {
1502
1613
  name: string;
@@ -1537,7 +1648,7 @@ type ToolResult = {
1537
1648
  * an MCP tool error whose text is the API's own message, redacted of the key.
1538
1649
  */
1539
1650
  declare function invokeTool<Shape extends z.ZodRawShape>(def: ToolDef<Shape>, args: unknown, ctx: ToolContext): Promise<ToolResult>;
1540
- declare function registerTools(server: McpServer, ctx: ToolContext): void;
1651
+ declare function registerTools(server: McpServer, base: ToolContext): void;
1541
1652
 
1542
1653
  /**
1543
1654
  * Build an McpServer with the Studio tool catalog registered. Transport-agnostic:
@@ -1545,7 +1656,7 @@ declare function registerTools(server: McpServer, ctx: ToolContext): void;
1545
1656
  */
1546
1657
 
1547
1658
  declare const SERVER_NAME = "lumitra-studio";
1548
- declare const SERVER_VERSION = "0.5.0";
1659
+ declare const SERVER_VERSION = "0.7.0";
1549
1660
  interface CreateServerOptions {
1550
1661
  config?: StudioConfig;
1551
1662
  env?: NodeJS.ProcessEnv;
@@ -2265,8 +2376,8 @@ declare const studioWorkflowValidate: ToolDef<{
2265
2376
  video: "video";
2266
2377
  audio: "audio";
2267
2378
  text: "text";
2268
- mesh3d: "mesh3d";
2269
2379
  json: "json";
2380
+ mesh3d: "mesh3d";
2270
2381
  }>;
2271
2382
  required: z.ZodDefault<z.ZodBoolean>;
2272
2383
  cardinality: z.ZodOptional<z.ZodEnum<{
@@ -2286,9 +2397,9 @@ declare const studioWorkflowValidate: ToolDef<{
2286
2397
  video: "video";
2287
2398
  audio: "audio";
2288
2399
  text: "text";
2400
+ json: "json";
2289
2401
  mask: "mask";
2290
2402
  mesh3d: "mesh3d";
2291
- json: "json";
2292
2403
  }>;
2293
2404
  }, z.core.$strip>>;
2294
2405
  layout: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -2905,4 +3016,4 @@ declare function parseArgs(argv: string[]): CliArgs;
2905
3016
  declare function createHttpHandler(): (req: IncomingMessage, res: ServerResponse) => Promise<void>;
2906
3017
  declare function main(argv?: string[]): Promise<void>;
2907
3018
 
2908
- export { type AllTenantsUsageResponse, type Binding, CHARACTER_SHEET_DEFINITION, CHARACTER_SHEET_NODES, type CandidatePlan, type CharacterReference, type CharacterSummary, type CharacterSwapInput, ConfigError, ContractError, type CreateServerOptions, DEFAULT_BASE_URL, DEFAULT_MOTION_PROMPT, DEFAULT_SWAP_EDIT_MODEL, DEFAULT_SWAP_PROMPT, DEFAULT_SWAP_VIDEO_MODEL, DEFAULT_TIMEOUT_MS, type DocumentSummary, type FetchLike, type GenerateImageResponse, type JobResponse, type JobStatus, type JudgeCandidate, MINT_REFERENCE_CATEGORIES, type NodeResultResponse, type NodeRun, type NodeStatus, type NodeSummary, type NodeTypesResponse, type PollOptions, PollTimeoutError, type ProjectSummary, type Projection, type RemovedNode, type RunResponse, type RunStartResponse, type RunStatus, SERVER_NAME, SERVER_VERSION, SUMMARY_TEXT_CHARS, SWAP_SCOPES, type SpendLedger, StudioApiError, StudioClient, type StudioClientOptions, type StudioConfig, type StudioMcp, type SummaryMeta, type SwapPromptOptions, type SwapScope, TOOLS, TOOL_NAMES, type TaskDescriptor, type TenantSpendSummary, type TenantUsageResponse, type ToolContext, type ToolDef, ToolInputError, type ToolResult, type TurnaroundView, type UploadFile, type UsageByModel, type UsageResponse, WORKFLOW_TOOLS, type WorkflowApplyResponse, type WorkflowCreateResponse, type WorkflowDefinition, type WorkflowDocumentResponse, type WorkflowNode, type WorkflowValidateResponse, affectedNodes, buildCharacterSheetParams, buildCharacterSwapDefinition, categoryForNode, characterSheetDefinition, composeSwapPrompt, createHttpHandler, createStudioMcpServer, extensionForMime, filenameFromUrl, invokeTool, main, mimeForFilename, parseArgs, parseDocument, parseOps, pollUntil, projectionOf, redactSecret, registerTools, resolveConfig, seedFacePrompt, studioWorkflowApply, studioWorkflowCreate, studioWorkflowDescribe, studioWorkflowGet, studioWorkflowScreenshot, studioWorkflowValidate, summarizeDocument, summarizeNode, touchedNodeIds, turnaroundViewPrompt, waitForJob, waitForRun };
3019
+ export { type AllTenantsUsageResponse, type Binding, CHARACTER_SHEET_DEFINITION, CHARACTER_SHEET_NODES, type CampaignContents, type CampaignListing, type CandidatePlan, type CharacterReference, type CharacterSummary, type CharacterSwapInput, ConfigError, ContractError, type CreateServerOptions, DEFAULT_BASE_URL, DEFAULT_MOTION_PROMPT, DEFAULT_SWAP_EDIT_MODEL, DEFAULT_SWAP_PROMPT, DEFAULT_SWAP_VIDEO_MODEL, DEFAULT_TIMEOUT_MS, type DocumentSummary, type FetchLike, type GenerateImageResponse, type JobResponse, type JobStatus, type JudgeCandidate, MINT_REFERENCE_CATEGORIES, type NodeResultResponse, type NodeRun, type NodeStatus, type NodeSummary, type NodeTypesResponse, type PollOptions, PollTimeoutError, type ProjectContents, type ProjectSummary, type Projection, type RemovedNode, type RunResponse, type RunStartResponse, type RunStatus, SERVER_NAME, SERVER_VERSION, SUMMARY_TEXT_CHARS, SWAP_SCOPES, type SavedWorkflowListing, type SpendLedger, StudioApiError, StudioClient, type StudioClientOptions, type StudioConfig, type StudioMcp, type SummaryMeta, type SwapPromptOptions, type SwapScope, TOOLS, TOOL_NAMES, type TaskDescriptor, type TenantSpendSummary, type TenantUsageResponse, type ToolContext, type ToolDef, ToolInputError, type ToolResult, type TurnaroundView, type UploadFile, type UsageByModel, type UsageResponse, WORKFLOW_TOOLS, type WorkflowApplyResponse, type WorkflowCreateResponse, type WorkflowDefinition, type WorkflowDocumentResponse, type WorkflowNode, type WorkflowValidateResponse, affectedNodes, buildCharacterSheetParams, buildCharacterSwapDefinition, categoryForNode, characterSheetDefinition, composeSwapPrompt, createHttpHandler, createStudioMcpServer, extensionForMime, filenameFromUrl, invokeTool, main, mimeForFilename, parseArgs, parseDocument, parseOps, pollUntil, projectionOf, redactSecret, registerTools, resolveConfig, seedFacePrompt, studioWorkflowApply, studioWorkflowCreate, studioWorkflowDescribe, studioWorkflowGet, studioWorkflowScreenshot, studioWorkflowValidate, summarizeDocument, summarizeNode, touchedNodeIds, turnaroundViewPrompt, waitForJob, waitForRun };