@mcp-use/cli 3.2.0-canary.13 → 3.2.0-canary.15

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.js CHANGED
@@ -1685,7 +1685,7 @@ async function loginCommand(options) {
1685
1685
  }
1686
1686
  await deleteConfig();
1687
1687
  }
1688
- console.log(source_default.cyan.bold("Logging in to mcp-use cloud...\n"));
1688
+ console.log(source_default.cyan.bold("Logging in to Manufact cloud...\n"));
1689
1689
  const authBaseUrl = await getAuthBaseUrl();
1690
1690
  const deviceResp = await requestDeviceCode(authBaseUrl);
1691
1691
  const {
@@ -3917,12 +3917,14 @@ async function callToolCommand(name, toolName, argsList, options) {
3917
3917
  const callResult = await session.callTool(toolName, args, {
3918
3918
  timeout: options?.timeout
3919
3919
  });
3920
+ const toolWithMeta = session.tools.find((t) => t.name === toolName);
3921
+ const resourceUri = detectToolResourceUri(toolWithMeta);
3922
+ const wantsScreenshot = options?.screenshot === true || options?.screenshotOutput !== void 0 || options?.screenshotDeviceScaleFactor !== void 0;
3920
3923
  let screenshot = null;
3921
3924
  let screenshotError = null;
3922
- if (options?.screenshot !== false) {
3923
- const tool2 = session.tools.find((t) => t.name === toolName);
3924
- const resourceUri = detectToolResourceUri(tool2);
3925
- if (resourceUri) {
3925
+ let widgetHintUri = null;
3926
+ if (resourceUri) {
3927
+ if (wantsScreenshot) {
3926
3928
  console.error(
3927
3929
  formatInfo(`Capturing widget screenshot (${resourceUri})...`)
3928
3930
  );
@@ -3955,6 +3957,8 @@ async function callToolCommand(name, toolName, argsList, options) {
3955
3957
  } catch (err) {
3956
3958
  screenshotError = err?.message ?? String(err);
3957
3959
  }
3960
+ } else {
3961
+ widgetHintUri = resourceUri;
3958
3962
  }
3959
3963
  }
3960
3964
  if (options?.json) {
@@ -3974,6 +3978,13 @@ async function callToolCommand(name, toolName, argsList, options) {
3974
3978
  formatWarning(`Skipped widget screenshot: ${screenshotError}`)
3975
3979
  );
3976
3980
  }
3981
+ if (widgetHintUri) {
3982
+ console.error(
3983
+ formatInfo(
3984
+ `This tool renders a widget (${widgetHintUri}). Re-run with --screenshot to save a PNG of it.`
3985
+ )
3986
+ );
3987
+ }
3977
3988
  if (callResult.isError) {
3978
3989
  await cleanupAndExit(1);
3979
3990
  }
@@ -4385,14 +4396,14 @@ function createPerClientCommand(name) {
4385
4396
  toolsCommand.command("call <tool> [args...]").description(
4386
4397
  "Call a tool. Args as key=value pairs (use key:=<json> for nested values, or pass a JSON object)"
4387
4398
  ).option("--timeout <ms>", "Request timeout in milliseconds", parseInt).option("--json", "Output as JSON").option(
4388
- "--no-screenshot",
4389
- "Skip the auto-screenshot for tools that render a widget"
4399
+ "--screenshot",
4400
+ "Capture a PNG screenshot of the rendered widget for tools that declare a UI resource"
4390
4401
  ).option(
4391
4402
  "--screenshot-output <path>",
4392
- "Output PNG path for the widget screenshot (defaults to ./<view>-<timestamp>.png)"
4403
+ "Output PNG path for the widget screenshot (implies --screenshot; defaults to ./<view>-<timestamp>.png)"
4393
4404
  ).option(
4394
4405
  "--screenshot-device-scale-factor <n>",
4395
- "Device pixel ratio for the auto-screenshot (e.g. 2 for Retina). Defaults to 1."
4406
+ "Device pixel ratio for the widget screenshot (implies --screenshot; e.g. 2 for Retina). Defaults to 1."
4396
4407
  ).action(
4397
4408
  (tool, args, options) => callToolCommand(name, tool, args, options)
4398
4409
  );
@@ -9215,7 +9226,7 @@ Looked for:
9215
9226
  process.exit(1);
9216
9227
  }
9217
9228
  });
9218
- program.command("login").description("Login to mcp-use cloud").option(
9229
+ program.command("login").description("Login to Manufact cloud").option(
9219
9230
  "--api-key <key>",
9220
9231
  "Login with an API key directly (non-interactive, for CI/CD)"
9221
9232
  ).option("--org <slug|id|name>", "Select an organization non-interactively").action(async (opts) => {