@mindstudio-ai/agent 0.1.172 → 0.1.173

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.
@@ -271,9 +271,9 @@ var init_metadata = __esm({
271
271
  "downloadVideo": {
272
272
  stepType: "downloadVideo",
273
273
  description: "Download a video file",
274
- usageNotes: "- Works with YouTube, TikTok, etc., by using ytdlp behind the scenes\n- Can save as mp4 or mp3",
275
- inputSchema: { "type": "object", "properties": { "videoUrl": { "type": "string", "description": "URL of the video to download (supports YouTube, TikTok, etc. via yt-dlp)" }, "format": { "enum": ["mp4", "mp3"], "type": "string", "description": "Output format for the downloaded file" } }, "required": ["videoUrl", "format"] },
276
- outputSchema: { "type": "object", "properties": { "videoUrl": { "type": "string", "description": "URL of the downloaded and re-hosted video file" } }, "required": ["videoUrl"] }
274
+ usageNotes: "- Works with YouTube, TikTok, etc., by using ytdlp behind the scenes\n- Can save as mp4 or mp3\n- `item` picks one item of a URL that holds several: a carousel, a playlist, a post with several videos. A link to one slide of a carousel downloads that slide. `itemCount` in the output says how many there are, so download item 1 and loop for the rest\n- `start` and `duration` (seconds) download a clip. An mp4 clip is cut without re-encoding, so it can start a moment before `start` (for an exact cut, trim the result with `trimMedia`); an mp3 clip is exact\n- Videos and audio only: a photo (a photo post, a photo in a carousel) fails as `video_unavailable`, and so does an item the URL doesn't have",
275
+ inputSchema: { "type": "object", "properties": { "videoUrl": { "type": "string", "description": "URL of the video to download (supports YouTube, TikTok, etc. via yt-dlp)" }, "format": { "enum": ["mp4", "mp3"], "type": "string", "description": "Output format for the downloaded file" }, "item": { "type": "number", "description": "Which item to download from a URL that holds several (a carousel, a playlist, a post with several videos), counting from 1. Omit for the one the URL names, else the first" }, "start": { "type": "number", "description": "Start of a clip, in seconds. Omit to start at the beginning" }, "duration": { "type": "number", "description": "Length of a clip, in seconds. Omit to run to the end" } }, "required": ["videoUrl", "format"] },
276
+ outputSchema: { "type": "object", "properties": { "videoUrl": { "type": "string", "description": "URL of the downloaded and re-hosted video file" }, "title": { "type": "string", "description": "The video's title, as the site gives it" }, "durationSec": { "type": "number", "description": "How long the downloaded file runs, in seconds: a clip's own length" }, "itemCount": { "type": "number", "description": "How many items the URL holds: 1 for a single video. Absent for a playlist the site doesn't count up front (a channel, a long playlist)" } }, "required": ["videoUrl"] }
277
277
  },
278
278
  "enhanceImageGenerationPrompt": {
279
279
  stepType: "enhanceImageGenerationPrompt",
@@ -5591,6 +5591,7 @@ function createVoice(call) {
5591
5591
  async call(params) {
5592
5592
  return await call("call", {
5593
5593
  to: params.to,
5594
+ ...params.from !== void 0 ? { from: params.from } : {},
5594
5595
  assumeIdentity: params.assumeIdentity === true
5595
5596
  });
5596
5597
  }
@@ -5906,36 +5907,35 @@ Then describe the page briefly: its layout, its content, and what state it is in
5906
5907
  });
5907
5908
  }
5908
5909
  async screenshot(options = {}) {
5909
- const { store, key, fullPage, cursor } = options;
5910
+ const { store, key, fullPage, cursor, boxes } = options;
5911
+ const asked = {
5912
+ op: "screenshot",
5913
+ fullPage: !!fullPage,
5914
+ cursor: !!cursor,
5915
+ ...boxes?.length ? { boxes: boxes.map(toWireTarget) } : {}
5916
+ };
5917
+ const measured = (shot2) => ({
5918
+ width: shot2.width,
5919
+ height: shot2.height,
5920
+ deviceScaleFactor: shot2.deviceScaleFactor,
5921
+ ...shot2.boxes ? { boxes: shot2.boxes } : {}
5922
+ });
5910
5923
  if (store) {
5911
5924
  const token = await store.createUploadToken({
5912
5925
  ...key ? { key } : { filename: "screenshot.png" },
5913
5926
  contentType: "image/png"
5914
5927
  });
5915
5928
  const shot2 = await this.run({
5916
- op: "screenshot",
5917
- fullPage: !!fullPage,
5918
- cursor: !!cursor,
5929
+ ...asked,
5919
5930
  upload: { url: token.upload.url, fields: token.upload.fields }
5920
5931
  });
5921
- return {
5922
- ...await store.head(token.key),
5923
- width: shot2.width,
5924
- height: shot2.height,
5925
- deviceScaleFactor: shot2.deviceScaleFactor
5926
- };
5932
+ return { ...await store.head(token.key), ...measured(shot2) };
5927
5933
  }
5928
- const shot = await this.run({
5929
- op: "screenshot",
5930
- fullPage: !!fullPage,
5931
- cursor: !!cursor
5932
- });
5934
+ const shot = await this.run(asked);
5933
5935
  return {
5934
5936
  data: Buffer.from(shot.data ?? "", "base64"),
5935
5937
  contentType: "image/png",
5936
- width: shot.width,
5937
- height: shot.height,
5938
- deviceScaleFactor: shot.deviceScaleFactor
5938
+ ...measured(shot)
5939
5939
  };
5940
5940
  }
5941
5941
  /**
@@ -10035,7 +10035,7 @@ async function startMcpServer(options) {
10035
10035
  capabilities: { tools: {} },
10036
10036
  serverInfo: {
10037
10037
  name: "mindstudio-agent",
10038
- version: "0.1.172"
10038
+ version: "0.1.173"
10039
10039
  },
10040
10040
  instructions: 'Welcome to MindStudio \u2014 a platform with 200+ AI models, 850+ third-party integrations, and pre-built agents.\n\nGetting started:\n1. Call `ask` with any question about the SDK \u2014 it knows every action, model, and connector and returns working code with real model IDs and config options. Examples: ask("generate an image with FLUX"), ask("what models support vision?"), ask("how do I send a Slack message?").\n2. Call `changeName` to set your display name \u2014 use your name or whatever your user calls you. This is how you\'ll appear in MindStudio request logs.\n3. If you have a profile picture, pass its public image URL to `changeProfilePicture`.\n4. For manual browsing, call `listActions` to discover all available actions.\n\nThen use the tools to generate text, images, video, audio, search the web, work with data sources, run agents, and more.\n\nImportant:\n- AI-powered actions (text generation, image generation, video, audio, etc.) cost money. Before running these, call `estimateActionCost` and confirm with the user before proceeding \u2014 unless they\'ve explicitly told you to go ahead.\n- Not all agents from `listAgents` are configured for API use. Do not try to run an agent just because it appears in the list \u2014 it will likely fail. Only run agents the user specifically asks you to run.'
10041
10041
  });
@@ -10977,7 +10977,7 @@ function isNewerVersion(current, latest) {
10977
10977
  return false;
10978
10978
  }
10979
10979
  async function checkForUpdate() {
10980
- const currentVersion = "0.1.172";
10980
+ const currentVersion = "0.1.173";
10981
10981
  if (!currentVersion || process.env.MINDSTUDIO_NO_UPDATE_CHECK) {
10982
10982
  return null;
10983
10983
  }
@@ -11012,7 +11012,7 @@ async function checkForUpdate() {
11012
11012
  }
11013
11013
  }
11014
11014
  function printUpdateNotice(latestVersion) {
11015
- const currentVersion = "0.1.172";
11015
+ const currentVersion = "0.1.173";
11016
11016
  process.stderr.write(
11017
11017
  `
11018
11018
  ${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
@@ -11025,7 +11025,7 @@ function isStandaloneBinary() {
11025
11025
  return !argv1.includes("node_modules");
11026
11026
  }
11027
11027
  async function cmdUpdate() {
11028
- const currentVersion = "0.1.172";
11028
+ const currentVersion = "0.1.173";
11029
11029
  process.stderr.write(
11030
11030
  ` ${ansi2.gray("Current version:")} ${currentVersion}
11031
11031
  `
@@ -11146,7 +11146,7 @@ async function cmdLogin(options) {
11146
11146
  process.stderr.write("\n");
11147
11147
  printLogo();
11148
11148
  process.stderr.write("\n");
11149
- const ver = "0.1.172";
11149
+ const ver = "0.1.173";
11150
11150
  process.stderr.write(
11151
11151
  ` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
11152
11152
  `
@@ -11458,7 +11458,7 @@ async function main() {
11458
11458
  const updatePromise = command !== "mcp" && command !== "login" && command !== "update" ? checkForUpdate() : Promise.resolve(null);
11459
11459
  try {
11460
11460
  if (command === "version" || command === "-v") {
11461
- process.stdout.write("0.1.172\n");
11461
+ process.stdout.write("0.1.173\n");
11462
11462
  return;
11463
11463
  }
11464
11464
  if (command === "login") {
package/llms.txt CHANGED
@@ -378,8 +378,11 @@ Scan text for personally identifiable information using Microsoft Presidio.
378
378
  Download a video file
379
379
  - Works with YouTube, TikTok, etc., by using ytdlp behind the scenes
380
380
  - Can save as mp4 or mp3
381
- - Input: `{ videoUrl: string, format: "mp4" | "mp3" }`
382
- - Output: `{ videoUrl: string }`
381
+ - `item` picks one item of a URL that holds several: a carousel, a playlist, a post with several videos. A link to one slide of a carousel downloads that slide. `itemCount` in the output says how many there are, so download item 1 and loop for the rest
382
+ - `start` and `duration` (seconds) download a clip. An mp4 clip is cut without re-encoding, so it can start a moment before `start` (for an exact cut, trim the result with `trimMedia`); an mp3 clip is exact
383
+ - Videos and audio only: a photo (a photo post, a photo in a carousel) fails as `video_unavailable`, and so does an item the URL doesn't have
384
+ - Input: `{ videoUrl: string, format: "mp4" | "mp3", item?: number, start?: number, duration?: number }`
385
+ - Output: `{ videoUrl: string, title?: string, durationSec?: number, itemCount?: number }`
383
386
 
384
387
  #### enhanceImageGenerationPrompt
385
388
  Generate or enhance an image generation prompt using a language model. Optionally generates a negative prompt.
@@ -2033,12 +2036,12 @@ await session.type({ label: 'Email' }, process.env.DEMO_EMAIL!);
2033
2036
  await session.type({ label: 'Password' }, process.env.DEMO_PASSWORD!, { submit: true });
2034
2037
  await session.waitFor('Dashboard');
2035
2038
  const clicked = await session.click({ role: 'link', text: 'Settings' }); // { url, title, snapshot, matched, box }
2036
- const shot = await session.screenshot({ store: Shots }); // StoredFile & { width, height, deviceScaleFactor }; no store → { data: Buffer, ... }
2039
+ const shot = await session.screenshot({ store: Shots, boxes: ['e12'] }); // StoredFile & { width, height, deviceScaleFactor, boxes }; no store → { data: Buffer, ... }
2037
2040
  const later = await browser.session(session.id); // pick it up from another call (a cron resuming a run)
2038
2041
  await session.close();
2039
2042
  ```
2040
2043
 
2041
- Every action returns the page afterward, `{ url, title, snapshot }`: `snapshot` is an outline with a ref on everything actionable (`button "Save" [ref=e12]`). Targets: a ref from the latest snapshot (`'e12'`), or `{ text }`, `{ role, text }`, `{ label }`, `{ selector }`. Element actions add `matched` and `box` (viewport CSS pixels, for a highlight). Pages render at 2x, so a screenshot is twice the viewport's size (its `deviceScaleFactor`). The rest: `goto(url)`, `snapshot()`, `select(target, option)`, `press(key)`, `scroll({ to?, by? })`, `screenshot({ fullPage?, cursor? })` (`cursor` keeps the session's cursor in the shot, where it last acted), `evaluate(fn, arg?)` (sent as source: no closures, pass what it needs as `arg`). Input is the browser's own; password values never appear in a snapshot. Pages go out through the deployment's exit proxy, on Remy's cloud a US residential address held for the session (the platform's own hosts, the app's included, direct), and the user agent is Chrome's with `RemyBrowser/1.0`, where to report a session and an opaque reference after it; each session's open and close, with its sites, are in the workspace's audit log. Billed for browser time per hour, from ready to its end, and that traffic per MB, so close a session when its work is done; a workspace has 10 open at once unless its limit is raised. Actions on one session run one at a time, in call order.
2044
+ Every action returns the page afterward, `{ url, title, snapshot }`: `snapshot` is an outline with a ref on everything actionable (`button "Save" [ref=e12]`). Targets: a ref from the latest snapshot (`'e12'`), or `{ text }`, `{ role, text }`, `{ label }`, `{ selector }`. Element actions add `matched` and `box` (where it was in the viewport as the action landed, CSS pixels). Pages render at 2x, so a screenshot is twice the viewport's size (its `deviceScaleFactor`). The rest: `goto(url)`, `snapshot()`, `select(target, option)`, `press(key)`, `scroll({ to?, by? })`, `screenshot({ fullPage?, cursor?, boxes? })` (`cursor` keeps the session's cursor in the shot, where it last acted; `boxes` takes targets, and the shot's `boxes` say where each is in it, measured as it's taken, `null` where the page hasn't one: draw highlights from these, since a page can move after an action), `evaluate(fn, arg?)` (sent as source: no closures, pass what it needs as `arg`). Input is the browser's own; password values never appear in a snapshot. Pages go out through the deployment's exit proxy, on Remy's cloud a US residential address held for the session (the platform's own hosts, the app's included, direct), and the user agent is Chrome's with `RemyBrowser/1.0`, where to report a session and an opaque reference after it; each session's open and close, with its sites, are in the workspace's audit log. Billed for browser time per hour, from ready to its end, and that traffic per MB, so close a session when its work is done; a workspace has 10 open at once unless its limit is raised. Actions on one session run one at a time, in call order.
2042
2045
 
2043
2046
  **A model drives it** through `runTask({ tools: [...session.tools({ secrets: { password: process.env.X! } })] })`: one tool, `browser`, taking a list of steps (`snapshot`, `navigate`, `click`, `type`, `select`, `press`, `scroll`, `wait`) run in order, stopping at the first that fails, answering with each step's outcome and the page after the last. A `type` step can name a secret in place of its text, which the model never sees, and only the latest page stays in full in the task's transcript (`supersedes`). With `session.tools({ screenshots: Store })` the model also gets `browser_screenshot({ question?, fullPage?, cursor? })`, which saves a screenshot to that store and answers with its `key` and a written description (an `analyzeImage` call), for what the outline can't say; those answers all stay in the transcript. **A person watches it** when a method returns `session.grantView()` (after its own access checks) and the frontend calls `browser.view(element, { getToken, onEnd? })` from `@mindstudio-ai/interface`, which draws the page into a `<canvas>`; its `state` is `connecting`, `live`, then `ended` (with `onEnd(reason)`).
2044
2047
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/agent",
3
- "version": "0.1.172",
3
+ "version": "0.1.173",
4
4
  "description": "TypeScript SDK for MindStudio direct step execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",