@marlinjai/studio-mcp 0.3.0 → 0.5.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
@@ -869,11 +869,12 @@ interface ProjectionIssue {
869
869
  /**
870
870
  * Server configuration, resolved from the environment once at startup.
871
871
  *
872
- * `LUMITRA_STUDIO_API_KEY` is the bearer token. The legacy name
873
- * `LUMITRA_STUDIO_SERVICE_TOKEN` (the batch skill + lola-stories backend) is
874
- * accepted as a fallback so an existing cc.sh-injected environment works
875
- * unchanged. The token is held in memory only: nothing in this package ever
876
- * logs, echoes, or serializes it (see `redactSecret` in errors.ts).
872
+ * `LUMITRA_STUDIO_API_KEY` is the bearer token, and the only name read. The
873
+ * legacy name `LUMITRA_STUDIO_SERVICE_TOKEN` was a fallback until 0.4.0; the two
874
+ * names carried different keys on one machine, so there is now one. A legacy
875
+ * variable that is still set is named in the error, never read. The token is
876
+ * held in memory only: nothing in this package ever logs, echoes, or serializes
877
+ * it (see `redactSecret` in errors.ts).
877
878
  *
878
879
  * Placeholder handling: the Agent Plugins spec only guarantees expansion of
879
880
  * `${PLUGIN_ROOT}` / `${PLUGIN_DATA}` in a plugin's `.mcp.json`, so some
@@ -928,12 +929,41 @@ interface JobResponse {
928
929
  [k: string]: unknown;
929
930
  }>;
930
931
  }
932
+ /**
933
+ * How many images a job will really make for the count that was asked for.
934
+ * Mirrors `CandidatePlan` in the Studio's `src/lib/jobs/candidates.ts`.
935
+ */
936
+ interface CandidatePlan {
937
+ /** How many candidates the request asked for (one when it named none). */
938
+ requested: number;
939
+ /** How many images to expect. */
940
+ rendered: number;
941
+ /** For an automatic route whose fallback renders more: the most the job can render. */
942
+ mayRender?: number;
943
+ }
944
+ /** `POST /api/generate` for an image job. `candidates` and `notice` are absent
945
+ * from a Studio older than 2026-10-11; `notice` is present only when fewer
946
+ * images will be made than were asked for. */
947
+ interface GenerateImageResponse {
948
+ jobId: string;
949
+ kind: string;
950
+ candidates?: CandidatePlan;
951
+ notice?: string;
952
+ }
931
953
  interface CharacterSummary {
954
+ /** Unique within the key's company, not across companies. */
932
955
  slug: string;
933
956
  name: string;
934
957
  descriptorPrompt: string;
935
958
  negativePrompt?: string | null;
936
959
  defaultModel?: string | null;
960
+ /** True when the character's owner shared it with every company. */
961
+ shared?: boolean;
962
+ /**
963
+ * False for a character another company shared: usable in generations,
964
+ * never editable (uploads, edits and deletes answer 403).
965
+ */
966
+ owned?: boolean;
937
967
  }
938
968
  interface CharacterReference {
939
969
  id: string;
@@ -1056,8 +1086,18 @@ interface TenantUsageResponse {
1056
1086
  tenantId?: string;
1057
1087
  month: string;
1058
1088
  plan: string;
1059
- /** `null` = explicitly unlimited (only an operator-set plan can be). */
1089
+ /** `null` = no monthly cap: an operator-set unlimited plan, or a company on
1090
+ * prepaid credits, whose balance is the cap (see `credits`). */
1060
1091
  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. */
1095
+ credits?: {
1096
+ balanceUsd: number;
1097
+ dailyLimitUsd: number | null;
1098
+ usedTodayUsd: number;
1099
+ dailyResetsAt: string;
1100
+ } | null;
1061
1101
  /** `default`: no plan of its own, the default cap applies. `row`: an
1062
1102
  * operator-set plan. Absent from a Studio older than 2026-09-23. */
1063
1103
  capSource?: 'row' | 'default';
@@ -1201,16 +1241,22 @@ declare class StudioClient {
1201
1241
  listProjects(): Promise<{
1202
1242
  projects: ProjectSummary[];
1203
1243
  }>;
1244
+ /**
1245
+ * One image job. `brandSlug` is optional: without it the image is generated
1246
+ * with no brand. A `brandSlug` or `characterSlug` the key's company cannot
1247
+ * use is refused with 404 `input_not_found` before anything is spent (since
1248
+ * 2026-10-11; it used to generate without the brand). `projectId` chooses the
1249
+ * project; without it the job lands in the project named after the brand, or
1250
+ * in `default`.
1251
+ */
1204
1252
  generate(body: {
1205
- brandSlug: string;
1253
+ brandSlug?: string;
1206
1254
  brandMode?: string;
1207
1255
  prompt: string;
1208
1256
  characterSlug?: string;
1257
+ projectId?: string;
1209
1258
  settings?: Record<string, unknown>;
1210
- }): Promise<{
1211
- jobId: string;
1212
- kind: string;
1213
- }>;
1259
+ }): Promise<GenerateImageResponse>;
1214
1260
  /**
1215
1261
  * One 3D generation. `/api/generate` routes to its 3D branch on `?force=3d`
1216
1262
  * (a prompt alone would be classified by its words); the model and its flags
@@ -1499,7 +1545,7 @@ declare function registerTools(server: McpServer, ctx: ToolContext): void;
1499
1545
  */
1500
1546
 
1501
1547
  declare const SERVER_NAME = "lumitra-studio";
1502
- declare const SERVER_VERSION = "0.3.0";
1548
+ declare const SERVER_VERSION = "0.5.0";
1503
1549
  interface CreateServerOptions {
1504
1550
  config?: StudioConfig;
1505
1551
  env?: NodeJS.ProcessEnv;
@@ -2839,7 +2885,7 @@ declare function buildCharacterSwapDefinition(input: CharacterSwapInput): Workfl
2839
2885
  * `studio-mcp --http [--port 3939]` Streamable HTTP transport on /mcp (remote / shared)
2840
2886
  *
2841
2887
  * Config: LUMITRA_STUDIO_BASE_URL (default https://studio.lumitra.co) and
2842
- * LUMITRA_STUDIO_API_KEY (or legacy LUMITRA_STUDIO_SERVICE_TOKEN). The token is
2888
+ * LUMITRA_STUDIO_API_KEY (the only key name read). The token is
2843
2889
  * never printed. All diagnostics go to stderr (stdout is the stdio transport).
2844
2890
  */
2845
2891
 
@@ -2859,4 +2905,4 @@ declare function parseArgs(argv: string[]): CliArgs;
2859
2905
  declare function createHttpHandler(): (req: IncomingMessage, res: ServerResponse) => Promise<void>;
2860
2906
  declare function main(argv?: string[]): Promise<void>;
2861
2907
 
2862
- export { type AllTenantsUsageResponse, type Binding, CHARACTER_SHEET_DEFINITION, CHARACTER_SHEET_NODES, 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 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 };
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 };