@marlinjai/studio-mcp 0.10.0 → 0.11.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 -1
- package/dist/cli.js +24 -6
- package/dist/index.d.ts +5 -2
- package/dist/index.js +24 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,7 +124,7 @@ The token is held in memory only. It is never logged, never serialized into a re
|
|
|
124
124
|
| `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. |
|
|
125
125
|
| `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. |
|
|
126
126
|
|
|
127
|
-
All waiting tools accept `waitSeconds` (default 600) and back off between polls (2s doubling up to 15s). A timeout never cancels anything server-side: the tool error carries the id so the agent can poll again.
|
|
127
|
+
All waiting tools accept `waitSeconds` (default 600) and back off between polls (2s doubling up to 15s). A timeout never cancels anything server-side: the tool error carries the id so the agent can poll again. A poll that gets a 503 (Studio could not reach its sign-in service, `auth_unavailable`) or no answer at all is waited out within the same budget instead of ending the wait, because the job keeps running either way.
|
|
128
128
|
|
|
129
129
|
### Tool signatures (the contract shared with the `lumitra-studio` plugin)
|
|
130
130
|
|
package/dist/cli.js
CHANGED
|
@@ -5460,6 +5460,9 @@ function assertImage(file, source) {
|
|
|
5460
5460
|
// src/poll.ts
|
|
5461
5461
|
var DEFAULT_TIMEOUT_MS = 6e5;
|
|
5462
5462
|
var defaultSleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
5463
|
+
function isTransientPollError(err) {
|
|
5464
|
+
return err instanceof StudioApiError && (err.status === 503 || err.status === 0);
|
|
5465
|
+
}
|
|
5463
5466
|
async function pollUntil(what, fetchState, isDone, opts = {}) {
|
|
5464
5467
|
const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
5465
5468
|
const factor = opts.factor ?? 1.5;
|
|
@@ -5468,15 +5471,30 @@ async function pollUntil(what, fetchState, isDone, opts = {}) {
|
|
|
5468
5471
|
const now = opts.now ?? Date.now;
|
|
5469
5472
|
const start = now();
|
|
5470
5473
|
let delay = opts.initialDelayMs ?? 2e3;
|
|
5471
|
-
let
|
|
5472
|
-
|
|
5474
|
+
let observed = false;
|
|
5475
|
+
let last;
|
|
5476
|
+
let lastTransient;
|
|
5477
|
+
const poll = async () => {
|
|
5478
|
+
try {
|
|
5479
|
+
last = await fetchState();
|
|
5480
|
+
observed = true;
|
|
5481
|
+
return isDone(last);
|
|
5482
|
+
} catch (err) {
|
|
5483
|
+
if (!isTransientPollError(err)) throw err;
|
|
5484
|
+
lastTransient = err;
|
|
5485
|
+
return false;
|
|
5486
|
+
}
|
|
5487
|
+
};
|
|
5488
|
+
if (await poll()) return last;
|
|
5473
5489
|
for (; ; ) {
|
|
5474
5490
|
const elapsed = now() - start;
|
|
5475
5491
|
const remaining = timeoutMs - elapsed;
|
|
5476
|
-
if (remaining <= 0)
|
|
5492
|
+
if (remaining <= 0) {
|
|
5493
|
+
if (!observed) throw lastTransient;
|
|
5494
|
+
throw new PollTimeoutError(what, timeoutMs, last);
|
|
5495
|
+
}
|
|
5477
5496
|
await sleep(Math.min(delay, remaining));
|
|
5478
|
-
|
|
5479
|
-
if (isDone(last)) return last;
|
|
5497
|
+
if (await poll()) return last;
|
|
5480
5498
|
delay = Math.min(maxDelay, Math.round(delay * factor));
|
|
5481
5499
|
}
|
|
5482
5500
|
}
|
|
@@ -7542,7 +7560,7 @@ function registerTools(server, base) {
|
|
|
7542
7560
|
|
|
7543
7561
|
// src/server.ts
|
|
7544
7562
|
var SERVER_NAME = "lumitra-studio";
|
|
7545
|
-
var SERVER_VERSION = "0.
|
|
7563
|
+
var SERVER_VERSION = "0.11.0";
|
|
7546
7564
|
function createStudioMcpServer(opts = {}) {
|
|
7547
7565
|
const config = opts.config ?? resolveConfig(opts.env ?? process.env);
|
|
7548
7566
|
const client = new StudioClient(config, {
|
package/dist/index.d.ts
CHANGED
|
@@ -1963,7 +1963,10 @@ interface PollOptions {
|
|
|
1963
1963
|
declare const DEFAULT_TIMEOUT_MS = 600000;
|
|
1964
1964
|
/**
|
|
1965
1965
|
* Call `fetchState` until `isDone(state)` is true or the budget is exhausted.
|
|
1966
|
-
*
|
|
1966
|
+
* A transient failure (`isTransientPollError`) is waited out like a not-done
|
|
1967
|
+
* state; any other error ends the wait. Throws PollTimeoutError (carrying the
|
|
1968
|
+
* last observed state) on timeout, or the last transient error when no state
|
|
1969
|
+
* was ever observed.
|
|
1967
1970
|
*/
|
|
1968
1971
|
declare function pollUntil<T>(what: string, fetchState: () => Promise<T>, isDone: (state: T) => boolean, opts?: PollOptions): Promise<T>;
|
|
1969
1972
|
declare function waitForJob(client: StudioClient, jobId: string, opts?: PollOptions): Promise<JobResponse>;
|
|
@@ -2051,7 +2054,7 @@ declare function registerTools(server: McpServer, base: ToolContext): void;
|
|
|
2051
2054
|
*/
|
|
2052
2055
|
|
|
2053
2056
|
declare const SERVER_NAME = "lumitra-studio";
|
|
2054
|
-
declare const SERVER_VERSION = "0.
|
|
2057
|
+
declare const SERVER_VERSION = "0.11.0";
|
|
2055
2058
|
interface CreateServerOptions {
|
|
2056
2059
|
config?: StudioConfig;
|
|
2057
2060
|
env?: NodeJS.ProcessEnv;
|
package/dist/index.js
CHANGED
|
@@ -5455,6 +5455,9 @@ function assertImage(file, source) {
|
|
|
5455
5455
|
// src/poll.ts
|
|
5456
5456
|
var DEFAULT_TIMEOUT_MS = 6e5;
|
|
5457
5457
|
var defaultSleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
5458
|
+
function isTransientPollError(err) {
|
|
5459
|
+
return err instanceof StudioApiError && (err.status === 503 || err.status === 0);
|
|
5460
|
+
}
|
|
5458
5461
|
async function pollUntil(what, fetchState, isDone, opts = {}) {
|
|
5459
5462
|
const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
5460
5463
|
const factor = opts.factor ?? 1.5;
|
|
@@ -5463,15 +5466,30 @@ async function pollUntil(what, fetchState, isDone, opts = {}) {
|
|
|
5463
5466
|
const now = opts.now ?? Date.now;
|
|
5464
5467
|
const start = now();
|
|
5465
5468
|
let delay = opts.initialDelayMs ?? 2e3;
|
|
5466
|
-
let
|
|
5467
|
-
|
|
5469
|
+
let observed = false;
|
|
5470
|
+
let last;
|
|
5471
|
+
let lastTransient;
|
|
5472
|
+
const poll = async () => {
|
|
5473
|
+
try {
|
|
5474
|
+
last = await fetchState();
|
|
5475
|
+
observed = true;
|
|
5476
|
+
return isDone(last);
|
|
5477
|
+
} catch (err) {
|
|
5478
|
+
if (!isTransientPollError(err)) throw err;
|
|
5479
|
+
lastTransient = err;
|
|
5480
|
+
return false;
|
|
5481
|
+
}
|
|
5482
|
+
};
|
|
5483
|
+
if (await poll()) return last;
|
|
5468
5484
|
for (; ; ) {
|
|
5469
5485
|
const elapsed = now() - start;
|
|
5470
5486
|
const remaining = timeoutMs - elapsed;
|
|
5471
|
-
if (remaining <= 0)
|
|
5487
|
+
if (remaining <= 0) {
|
|
5488
|
+
if (!observed) throw lastTransient;
|
|
5489
|
+
throw new PollTimeoutError(what, timeoutMs, last);
|
|
5490
|
+
}
|
|
5472
5491
|
await sleep(Math.min(delay, remaining));
|
|
5473
|
-
|
|
5474
|
-
if (isDone(last)) return last;
|
|
5492
|
+
if (await poll()) return last;
|
|
5475
5493
|
delay = Math.min(maxDelay, Math.round(delay * factor));
|
|
5476
5494
|
}
|
|
5477
5495
|
}
|
|
@@ -7537,7 +7555,7 @@ function registerTools(server, base) {
|
|
|
7537
7555
|
|
|
7538
7556
|
// src/server.ts
|
|
7539
7557
|
var SERVER_NAME = "lumitra-studio";
|
|
7540
|
-
var SERVER_VERSION = "0.
|
|
7558
|
+
var SERVER_VERSION = "0.11.0";
|
|
7541
7559
|
function createStudioMcpServer(opts = {}) {
|
|
7542
7560
|
const config = opts.config ?? resolveConfig(opts.env ?? process.env);
|
|
7543
7561
|
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.11.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",
|