@mindstudio-ai/agent 0.1.175 → 0.1.176

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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ What changed in `@mindstudio-ai/agent`, newest first, each version under its own
4
4
 
5
5
  Versions before 0.1.163 aren't recorded here.
6
6
 
7
+ ## 0.1.176
8
+
9
+ ### Changed behavior
10
+
11
+ - The platform limits how many file calls an app's methods make a minute, all of a store's operations together (`put`, `get`, `head`, `list`, `delete`, uploads and their parts, signed URLs), at 10,000 by default. A file call it refuses never ran, so the SDK sends it again every few seconds for a little over a minute, and only then throws `MindStudioError` with `code === 'rate_limited'`. An app moving files flat out runs at the limit, its calls taking longer, rather than failing past it. Check: code that moves many files in one go (an import, a bulk copy) should expect it to take minutes at that rate, and a loop that times its own file calls should allow for the wait.
12
+ - `renderVideoFromHtmlComposition` renders with HyperFrames 0.8.186, and its usage notes name that version, where they named 0.8.148. A render now fails where a frame can't be read, where it used to finish a shorter or smaller video than it asked for without saying why. Check: a composition written for 0.8.148 still lints clean under 0.8.186's `hyperframes lint`, and an app that installed `@hyperframes/player` at 0.8.148 for previews moves it to 0.8.186, so the preview matches the render.
13
+
7
14
  ## 0.1.175
8
15
 
9
16
  ### New
package/dist/cli.js CHANGED
@@ -825,7 +825,7 @@ var init_metadata = __esm({
825
825
  "renderVideoFromHtmlComposition": {
826
826
  stepType: "renderVideoFromHtmlComposition",
827
827
  description: "Render an HTML composition (HTML, CSS, media and seekable animation on a timeline) to a video file",
828
- usageNotes: "- Renders an HTML composition in HyperFrames' format (https://hyperframes.heygen.com) with HyperFrames 0.8.148, in Chrome off the app's own sandbox; author for that version\n- Pass the composition as `html`, the page itself (up to 10 MB), or as `project`, the URL of a zip of a project's folder (`index.html` at its root, or the file `entryFile` names) or of one HTML file, up to 2 GiB: an app file or any public URL\n- `variables` overrides the composition's `data-composition-variables` defaults, which it reads with `window.__hyperframes.getVariables()`\n- Whatever the composition loads itself (fonts, scripts, images, video) is fetched as it renders, so each is in the project or at a public URL; a private app file needs a signed URL\n- fps 24, 30 or 60 (default 30); quality draft, standard or high (default standard); format mp4 (default), webm or mov (both keep transparency), or gif\n- An mp4, webm or mov renders in chunks of about 10 seconds side by side, so a long video takes little longer than a short one; a call finishes within about 30 minutes, and reports its progress as it goes. A gif renders whole, within 15 minutes\n- A composition HyperFrames can't render fails with HyperFrames' own reason",
828
+ usageNotes: "- Renders an HTML composition in HyperFrames' format (https://hyperframes.heygen.com) with HyperFrames 0.8.186, in Chrome off the app's own sandbox; author for that version\n- Pass the composition as `html`, the page itself (up to 10 MB), or as `project`, the URL of a zip of a project's folder (`index.html` at its root, or the file `entryFile` names) or of one HTML file, up to 2 GiB: an app file or any public URL\n- `variables` overrides the composition's `data-composition-variables` defaults, which it reads with `window.__hyperframes.getVariables()`\n- Whatever the composition loads itself (fonts, scripts, images, video) is fetched as it renders, so each is in the project or at a public URL; a private app file needs a signed URL\n- fps 24, 30 or 60 (default 30); quality draft, standard or high (default standard); format mp4 (default), webm or mov (both keep transparency), or gif\n- An mp4, webm or mov renders in chunks of about 10 seconds side by side, so a long video takes little longer than a short one; a call finishes within about 30 minutes, and reports its progress as it goes. A gif renders whole, within 15 minutes\n- A composition HyperFrames can't render fails with HyperFrames' own reason",
829
829
  inputSchema: { "type": "object", "properties": { "html": { "type": "string", "description": "The composition's HTML, up to 10 MB; give this or project" }, "project": { "type": "string", "description": "URL of a zip of the project's folder, or of one self-contained HTML file; give this or html" }, "entryFile": { "type": "string", "description": "The entry HTML inside the zip, relative to its root; index.html when omitted" }, "variables": { "type": "object", "properties": {}, "required": [], "description": "Values over the composition's declared variables" }, "fps": { "enum": [24, 30, 60], "type": "number", "description": "Frames per second: 24, 30 (default) or 60" }, "quality": { "enum": ["draft", "standard", "high"], "type": "string", "description": "Encode quality: draft, standard (default) or high" }, "format": { "enum": ["mp4", "webm", "mov", "gif"], "type": "string", "description": "mp4 (default), webm or mov (both keep transparency), or gif" }, "intermediateAsset": { "type": "boolean", "description": "When true, the asset is created but hidden from the user's gallery (tagged as intermediate)" } } },
830
830
  outputSchema: { "type": "object", "properties": { "videoUrl": { "type": "string", "description": "URL of the rendered video" }, "durationSec": { "type": "number", "description": "Its length in seconds" }, "frames": { "type": "number", "description": "How many frames it has" } }, "required": ["videoUrl", "durationSec", "frames"] }
831
831
  },
@@ -7611,7 +7611,7 @@ function resolveToken(provided, config) {
7611
7611
  401
7612
7612
  );
7613
7613
  }
7614
- var DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, toStepLogEvent, stepFailure, MindStudioAgent;
7614
+ var DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, FILES_RATE_LIMIT_WAIT_MS, toStepLogEvent, stepFailure, MindStudioAgent;
7615
7615
  var init_client = __esm({
7616
7616
  async "src/client.ts"() {
7617
7617
  "use strict";
@@ -7639,6 +7639,7 @@ var init_client = __esm({
7639
7639
  init_metadata();
7640
7640
  DEFAULT_BASE_URL = "https://v1.mindstudio-api.com";
7641
7641
  DEFAULT_MAX_RETRIES = 3;
7642
+ FILES_RATE_LIMIT_WAIT_MS = 75e3;
7642
7643
  toStepLogEvent = (event) => ({
7643
7644
  value: event.value,
7644
7645
  tag: event.tag,
@@ -8902,12 +8903,30 @@ var init_client = __esm({
8902
8903
  /**
8903
8904
  * @internal Transport for the `files` namespace — POST /_internal/v2/files/<op>
8904
8905
  * with the raw hook token (mirrors `_executeDbBatch`).
8906
+ *
8907
+ * Waits out the platform's per-app limit on file calls: its 429 comes before
8908
+ * the call does anything, whatever the op, so the call is sent again every
8909
+ * few seconds for a little over the limit's one-minute window, and only then
8910
+ * throws `rate_limited`. An app moving files flat out runs at the limit
8911
+ * rather than failing past it.
8905
8912
  */
8906
8913
  async _filesRequest(op, body) {
8907
- return this._brokeredRequest("files", op, body, {
8908
- fallbackMessage: "File operation failed",
8909
- fallbackCode: "file_error"
8910
- });
8914
+ const giveUpAt = Date.now() + FILES_RATE_LIMIT_WAIT_MS;
8915
+ while (true) {
8916
+ try {
8917
+ return await this._brokeredRequest("files", op, body, {
8918
+ fallbackMessage: "File operation failed",
8919
+ fallbackCode: "file_error"
8920
+ });
8921
+ } catch (err) {
8922
+ if (!(err instanceof MindStudioError) || err.status !== 429 || Date.now() >= giveUpAt) {
8923
+ throw err;
8924
+ }
8925
+ await new Promise(
8926
+ (resolve) => setTimeout(resolve, 4e3 + Math.random() * 2e3)
8927
+ );
8928
+ }
8929
+ }
8911
8930
  }
8912
8931
  /**
8913
8932
  * @internal Transport for the `dataSources` namespace —
@@ -10067,7 +10086,7 @@ async function startMcpServer(options) {
10067
10086
  capabilities: { tools: {} },
10068
10087
  serverInfo: {
10069
10088
  name: "mindstudio-agent",
10070
- version: "0.1.175"
10089
+ version: "0.1.176"
10071
10090
  },
10072
10091
  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.'
10073
10092
  });
@@ -11107,7 +11126,7 @@ function isNewerVersion(current, latest) {
11107
11126
  return false;
11108
11127
  }
11109
11128
  async function checkForUpdate() {
11110
- const currentVersion = "0.1.175";
11129
+ const currentVersion = "0.1.176";
11111
11130
  if (!currentVersion || process.env.MINDSTUDIO_NO_UPDATE_CHECK) {
11112
11131
  return null;
11113
11132
  }
@@ -11142,7 +11161,7 @@ async function checkForUpdate() {
11142
11161
  }
11143
11162
  }
11144
11163
  function printUpdateNotice(latestVersion) {
11145
- const currentVersion = "0.1.175";
11164
+ const currentVersion = "0.1.176";
11146
11165
  process.stderr.write(
11147
11166
  `
11148
11167
  ${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
@@ -11155,7 +11174,7 @@ function isStandaloneBinary() {
11155
11174
  return !argv1.includes("node_modules");
11156
11175
  }
11157
11176
  async function cmdUpdate() {
11158
- const currentVersion = "0.1.175";
11177
+ const currentVersion = "0.1.176";
11159
11178
  process.stderr.write(
11160
11179
  ` ${ansi2.gray("Current version:")} ${currentVersion}
11161
11180
  `
@@ -11296,7 +11315,7 @@ async function cmdLogin(options) {
11296
11315
  process.stderr.write("\n");
11297
11316
  printLogo();
11298
11317
  process.stderr.write("\n");
11299
- const ver = "0.1.175";
11318
+ const ver = "0.1.176";
11300
11319
  process.stderr.write(
11301
11320
  ` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
11302
11321
  `
@@ -11624,7 +11643,7 @@ async function main() {
11624
11643
  const updatePromise = command !== "mcp" && command !== "login" && command !== "update" ? checkForUpdate() : Promise.resolve(null);
11625
11644
  try {
11626
11645
  if (command === "version" || command === "-v") {
11627
- process.stdout.write("0.1.175\n");
11646
+ process.stdout.write("0.1.176\n");
11628
11647
  return;
11629
11648
  }
11630
11649
  if (command === "login") {
package/dist/index.d.ts CHANGED
@@ -5452,6 +5452,12 @@ declare class MindStudioAgent$1 {
5452
5452
  /**
5453
5453
  * @internal Transport for the `files` namespace — POST /_internal/v2/files/<op>
5454
5454
  * with the raw hook token (mirrors `_executeDbBatch`).
5455
+ *
5456
+ * Waits out the platform's per-app limit on file calls: its 429 comes before
5457
+ * the call does anything, whatever the op, so the call is sent again every
5458
+ * few seconds for a little over the limit's one-minute window, and only then
5459
+ * throws `rate_limited`. An app moving files flat out runs at the limit
5460
+ * rather than failing past it.
5455
5461
  */
5456
5462
  private _filesRequest;
5457
5463
  /**
@@ -11718,7 +11724,7 @@ interface StepMethods {
11718
11724
  * Render an HTML composition (HTML, CSS, media and seekable animation on a timeline) to a video file
11719
11725
  *
11720
11726
  * @remarks
11721
- * - Renders an HTML composition in HyperFrames' format (https://hyperframes.heygen.com) with HyperFrames 0.8.148, in Chrome off the app's own sandbox; author for that version
11727
+ * - Renders an HTML composition in HyperFrames' format (https://hyperframes.heygen.com) with HyperFrames 0.8.186, in Chrome off the app's own sandbox; author for that version
11722
11728
  * - Pass the composition as `html`, the page itself (up to 10 MB), or as `project`, the URL of a zip of a project's folder (`index.html` at its root, or the file `entryFile` names) or of one HTML file, up to 2 GiB: an app file or any public URL
11723
11729
  * - `variables` overrides the composition's `data-composition-variables` defaults, which it reads with `window.__hyperframes.getVariables()`
11724
11730
  * - Whatever the composition loads itself (fonts, scripts, images, video) is fetched as it renders, so each is in the project or at a public URL; a private app file needs a signed URL
package/dist/index.js CHANGED
@@ -5637,7 +5637,7 @@ var stepMetadata = {
5637
5637
  "renderVideoFromHtmlComposition": {
5638
5638
  stepType: "renderVideoFromHtmlComposition",
5639
5639
  description: "Render an HTML composition (HTML, CSS, media and seekable animation on a timeline) to a video file",
5640
- usageNotes: "- Renders an HTML composition in HyperFrames' format (https://hyperframes.heygen.com) with HyperFrames 0.8.148, in Chrome off the app's own sandbox; author for that version\n- Pass the composition as `html`, the page itself (up to 10 MB), or as `project`, the URL of a zip of a project's folder (`index.html` at its root, or the file `entryFile` names) or of one HTML file, up to 2 GiB: an app file or any public URL\n- `variables` overrides the composition's `data-composition-variables` defaults, which it reads with `window.__hyperframes.getVariables()`\n- Whatever the composition loads itself (fonts, scripts, images, video) is fetched as it renders, so each is in the project or at a public URL; a private app file needs a signed URL\n- fps 24, 30 or 60 (default 30); quality draft, standard or high (default standard); format mp4 (default), webm or mov (both keep transparency), or gif\n- An mp4, webm or mov renders in chunks of about 10 seconds side by side, so a long video takes little longer than a short one; a call finishes within about 30 minutes, and reports its progress as it goes. A gif renders whole, within 15 minutes\n- A composition HyperFrames can't render fails with HyperFrames' own reason",
5640
+ usageNotes: "- Renders an HTML composition in HyperFrames' format (https://hyperframes.heygen.com) with HyperFrames 0.8.186, in Chrome off the app's own sandbox; author for that version\n- Pass the composition as `html`, the page itself (up to 10 MB), or as `project`, the URL of a zip of a project's folder (`index.html` at its root, or the file `entryFile` names) or of one HTML file, up to 2 GiB: an app file or any public URL\n- `variables` overrides the composition's `data-composition-variables` defaults, which it reads with `window.__hyperframes.getVariables()`\n- Whatever the composition loads itself (fonts, scripts, images, video) is fetched as it renders, so each is in the project or at a public URL; a private app file needs a signed URL\n- fps 24, 30 or 60 (default 30); quality draft, standard or high (default standard); format mp4 (default), webm or mov (both keep transparency), or gif\n- An mp4, webm or mov renders in chunks of about 10 seconds side by side, so a long video takes little longer than a short one; a call finishes within about 30 minutes, and reports its progress as it goes. A gif renders whole, within 15 minutes\n- A composition HyperFrames can't render fails with HyperFrames' own reason",
5641
5641
  inputSchema: { "type": "object", "properties": { "html": { "type": "string", "description": "The composition's HTML, up to 10 MB; give this or project" }, "project": { "type": "string", "description": "URL of a zip of the project's folder, or of one self-contained HTML file; give this or html" }, "entryFile": { "type": "string", "description": "The entry HTML inside the zip, relative to its root; index.html when omitted" }, "variables": { "type": "object", "properties": {}, "required": [], "description": "Values over the composition's declared variables" }, "fps": { "enum": [24, 30, 60], "type": "number", "description": "Frames per second: 24, 30 (default) or 60" }, "quality": { "enum": ["draft", "standard", "high"], "type": "string", "description": "Encode quality: draft, standard (default) or high" }, "format": { "enum": ["mp4", "webm", "mov", "gif"], "type": "string", "description": "mp4 (default), webm or mov (both keep transparency), or gif" }, "intermediateAsset": { "type": "boolean", "description": "When true, the asset is created but hidden from the user's gallery (tagged as intermediate)" } } },
5642
5642
  outputSchema: { "type": "object", "properties": { "videoUrl": { "type": "string", "description": "URL of the rendered video" }, "durationSec": { "type": "number", "description": "Its length in seconds" }, "frames": { "type": "number", "description": "How many frames it has" } }, "required": ["videoUrl", "durationSec", "frames"] }
5643
5643
  },
@@ -7291,6 +7291,7 @@ function applyStepMethods(AgentClass) {
7291
7291
  // src/client.ts
7292
7292
  var DEFAULT_BASE_URL = "https://v1.mindstudio-api.com";
7293
7293
  var DEFAULT_MAX_RETRIES = 3;
7294
+ var FILES_RATE_LIMIT_WAIT_MS = 75e3;
7294
7295
  var toStepLogEvent = (event) => ({
7295
7296
  value: event.value,
7296
7297
  tag: event.tag,
@@ -8554,12 +8555,30 @@ var MindStudioAgent = class {
8554
8555
  /**
8555
8556
  * @internal Transport for the `files` namespace — POST /_internal/v2/files/<op>
8556
8557
  * with the raw hook token (mirrors `_executeDbBatch`).
8558
+ *
8559
+ * Waits out the platform's per-app limit on file calls: its 429 comes before
8560
+ * the call does anything, whatever the op, so the call is sent again every
8561
+ * few seconds for a little over the limit's one-minute window, and only then
8562
+ * throws `rate_limited`. An app moving files flat out runs at the limit
8563
+ * rather than failing past it.
8557
8564
  */
8558
8565
  async _filesRequest(op, body) {
8559
- return this._brokeredRequest("files", op, body, {
8560
- fallbackMessage: "File operation failed",
8561
- fallbackCode: "file_error"
8562
- });
8566
+ const giveUpAt = Date.now() + FILES_RATE_LIMIT_WAIT_MS;
8567
+ while (true) {
8568
+ try {
8569
+ return await this._brokeredRequest("files", op, body, {
8570
+ fallbackMessage: "File operation failed",
8571
+ fallbackCode: "file_error"
8572
+ });
8573
+ } catch (err) {
8574
+ if (!(err instanceof MindStudioError) || err.status !== 429 || Date.now() >= giveUpAt) {
8575
+ throw err;
8576
+ }
8577
+ await new Promise(
8578
+ (resolve) => setTimeout(resolve, 4e3 + Math.random() * 2e3)
8579
+ );
8580
+ }
8581
+ }
8563
8582
  }
8564
8583
  /**
8565
8584
  * @internal Transport for the `dataSources` namespace —