@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.
- package/dist/cli.js +22 -10
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +22 -10
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
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
|
});
|
|
@@ -6534,7 +6546,7 @@ function isNewerVersion(current, latest) {
|
|
|
6534
6546
|
return false;
|
|
6535
6547
|
}
|
|
6536
6548
|
async function checkForUpdate() {
|
|
6537
|
-
const currentVersion = "0.1.
|
|
6549
|
+
const currentVersion = "0.1.54";
|
|
6538
6550
|
if (!currentVersion) return null;
|
|
6539
6551
|
try {
|
|
6540
6552
|
const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
@@ -6563,7 +6575,7 @@ async function checkForUpdate() {
|
|
|
6563
6575
|
}
|
|
6564
6576
|
}
|
|
6565
6577
|
function printUpdateNotice(latestVersion) {
|
|
6566
|
-
const currentVersion = "0.1.
|
|
6578
|
+
const currentVersion = "0.1.54";
|
|
6567
6579
|
process.stderr.write(
|
|
6568
6580
|
`
|
|
6569
6581
|
${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
|
|
@@ -6576,7 +6588,7 @@ function isStandaloneBinary() {
|
|
|
6576
6588
|
return !argv1.includes("node_modules");
|
|
6577
6589
|
}
|
|
6578
6590
|
async function cmdUpdate() {
|
|
6579
|
-
const currentVersion = "0.1.
|
|
6591
|
+
const currentVersion = "0.1.54";
|
|
6580
6592
|
process.stderr.write(
|
|
6581
6593
|
` ${ansi2.gray("Current version:")} ${currentVersion}
|
|
6582
6594
|
`
|
|
@@ -6711,7 +6723,7 @@ async function cmdLogin(options) {
|
|
|
6711
6723
|
process.stderr.write("\n");
|
|
6712
6724
|
printLogo();
|
|
6713
6725
|
process.stderr.write("\n");
|
|
6714
|
-
const ver = "0.1.
|
|
6726
|
+
const ver = "0.1.54";
|
|
6715
6727
|
process.stderr.write(
|
|
6716
6728
|
` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
|
|
6717
6729
|
`
|
|
@@ -7038,7 +7050,7 @@ async function main() {
|
|
|
7038
7050
|
try {
|
|
7039
7051
|
if (command === "version" || command === "-v") {
|
|
7040
7052
|
process.stdout.write(
|
|
7041
|
-
"0.1.
|
|
7053
|
+
"0.1.54\n"
|
|
7042
7054
|
);
|
|
7043
7055
|
return;
|
|
7044
7056
|
}
|