@mindstudio-ai/agent 0.1.53 → 0.1.54

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.
@@ -5132,12 +5132,24 @@ function buildReferenceDocs(data) {
5132
5132
  Thread persistence: pass \`{ threadId: result.$threadId, appId: result.$appId }\` as second arg.
5133
5133
  All 200+ models accessed through one API key \u2014 MindStudio routes to the provider server-side.
5134
5134
 
5135
- Debug logging / execution visibility:
5136
- - **All step methods** (generateImage, generateText, searchGoogle, etc.) accept an \`onLog\` callback in the OPTIONS object (second argument). This enables SSE streaming with real-time debug logs during execution. Example: \`await mindstudio.generateImage({ prompt: '...' }, { onLog: (event) => console.log(event.tag, event.value) })\`. The event has \`{ value: string, tag: string, ts: number }\`. This is the programmatic equivalent of the CLI's stderr logging. It works on ANY step method \u2014 not just generateText.
5135
+ Execution visibility (\`onLog\`):
5136
+ - **All step methods** (generateImage, generateText, searchGoogle, etc.) accept an \`onLog\` callback in the OPTIONS object (second argument). This enables SSE streaming with real-time progress during execution. Example: \`await mindstudio.generateImage({ prompt: '...' }, { onLog: (event) => console.log(event.tag, event.value) })\`. The event has \`{ value: string, tag: string, ts: number }\`. It works on ANY step method.
5137
5137
  - **Task agents** use \`onEvent\` (on the options object itself, not a second arg) for streaming events during the tool-use loop.
5138
- - **\`stream()\`** is for pushing SSE chunks to the frontend UI \u2014 it is NOT for debug logging.
5139
5138
 
5140
- Streaming: \`stream()\` is a separate function for sending SSE chunks to the frontend \u2014 it is NOT an option you pass to step methods. Streaming is automatic when the sandbox sets STREAM_ID. Import as \`import { stream } from '@mindstudio-ai/agent'\` and call \`await stream('Processing...')\` or \`await stream({ progress: 50 })\`. When there's no active stream, calls are silently ignored.
5139
+ Progress for long-running operations:
5140
+ For any step that takes more than a few seconds (video generation, image generation, audio generation, lipsync, upscaling, etc.), ALWAYS use \`onLog\` combined with \`stream()\` to keep the user informed. This is the standard pattern, not optional:
5141
+ \`\`\`typescript
5142
+ import { mindstudio, stream } from '@mindstudio-ai/agent';
5143
+
5144
+ await stream('Generating your video...');
5145
+ const { videoUrl } = await mindstudio.generateVideo({
5146
+ prompt: '...',
5147
+ }, {
5148
+ onLog: (event) => stream({ status: event.value }),
5149
+ });
5150
+ await stream({ status: 'done', videoUrl });
5151
+ \`\`\`
5152
+ Without this pattern, long-running operations appear to hang with no feedback to the user. \`stream()\` calls are silently ignored when there is no active SSE connection (CLI, background jobs), so it is always safe to include.
5141
5153
 
5142
5154
  Database queries (Query, Mutation) support both \`await\` and \`.then()/.catch()\` \u2014 use standard try/catch with await or chain \`.catch()\` directly.
5143
5155
 
@@ -5577,7 +5589,7 @@ async function startMcpServer(options) {
5577
5589
  capabilities: { tools: {} },
5578
5590
  serverInfo: {
5579
5591
  name: "mindstudio-agent",
5580
- version: "0.1.53"
5592
+ version: "0.1.54"
5581
5593
  },
5582
5594
  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 or icon, call `uploadFile` to upload it, then `changeProfilePicture` with the returned URL.\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.'
5583
5595
  });
@@ -6438,7 +6450,7 @@ function isNewerVersion(current, latest) {
6438
6450
  return false;
6439
6451
  }
6440
6452
  async function checkForUpdate() {
6441
- const currentVersion = "0.1.53";
6453
+ const currentVersion = "0.1.54";
6442
6454
  if (!currentVersion) return null;
6443
6455
  try {
6444
6456
  const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -6467,7 +6479,7 @@ async function checkForUpdate() {
6467
6479
  }
6468
6480
  }
6469
6481
  function printUpdateNotice(latestVersion) {
6470
- const currentVersion = "0.1.53";
6482
+ const currentVersion = "0.1.54";
6471
6483
  process.stderr.write(
6472
6484
  `
6473
6485
  ${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
@@ -6480,7 +6492,7 @@ function isStandaloneBinary() {
6480
6492
  return !argv1.includes("node_modules");
6481
6493
  }
6482
6494
  async function cmdUpdate() {
6483
- const currentVersion = "0.1.53";
6495
+ const currentVersion = "0.1.54";
6484
6496
  process.stderr.write(
6485
6497
  ` ${ansi2.gray("Current version:")} ${currentVersion}
6486
6498
  `
@@ -6595,7 +6607,7 @@ async function cmdLogin(options) {
6595
6607
  process.stderr.write("\n");
6596
6608
  printLogo();
6597
6609
  process.stderr.write("\n");
6598
- const ver = "0.1.53";
6610
+ const ver = "0.1.54";
6599
6611
  process.stderr.write(
6600
6612
  ` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
6601
6613
  `
@@ -6906,7 +6918,7 @@ async function main() {
6906
6918
  try {
6907
6919
  if (command === "version" || command === "-v") {
6908
6920
  process.stdout.write(
6909
- "0.1.53\n"
6921
+ "0.1.54\n"
6910
6922
  );
6911
6923
  return;
6912
6924
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/agent",
3
- "version": "0.1.53",
3
+ "version": "0.1.54",
4
4
  "description": "TypeScript SDK for MindStudio direct step execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",