@mindstudio-ai/agent 0.1.23 → 0.1.25

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.
@@ -4806,7 +4806,7 @@ async function startMcpServer(options) {
4806
4806
  capabilities: { tools: {} },
4807
4807
  serverInfo: {
4808
4808
  name: "mindstudio-agent",
4809
- version: "0.1.23"
4809
+ version: "0.1.25"
4810
4810
  },
4811
4811
  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.'
4812
4812
  });
@@ -5436,15 +5436,25 @@ async function cmdExec(method, input, options) {
5436
5436
  `Unknown action: ${method}. Run 'mindstudio list-actions' to see available actions.`
5437
5437
  );
5438
5438
  }
5439
- const result = await agent.executeStep(meta.stepType, input, {
5440
- appId: options.appId,
5441
- threadId: options.threadId,
5442
- onLog: process.stderr.isTTY ? (log) => {
5439
+ let onLog;
5440
+ if (options.jsonLogs) {
5441
+ onLog = (log) => {
5442
+ process.stderr.write(
5443
+ JSON.stringify({ type: "log", value: log.value, tag: log.tag, ts: log.ts }) + "\n"
5444
+ );
5445
+ };
5446
+ } else if (process.stderr.isTTY) {
5447
+ onLog = (log) => {
5443
5448
  process.stderr.write(
5444
5449
  ` ${ansi2.cyan("\u27E1")} ${ansi2.gray(log.value)}
5445
5450
  `
5446
5451
  );
5447
- } : void 0
5452
+ };
5453
+ }
5454
+ const result = await agent.executeStep(meta.stepType, input, {
5455
+ appId: options.appId,
5456
+ threadId: options.threadId,
5457
+ onLog
5448
5458
  });
5449
5459
  if (options.outputKey) {
5450
5460
  const val = result[options.outputKey];
@@ -5652,7 +5662,7 @@ function isNewerVersion(current, latest) {
5652
5662
  return false;
5653
5663
  }
5654
5664
  async function checkForUpdate() {
5655
- const currentVersion = "0.1.23";
5665
+ const currentVersion = "0.1.25";
5656
5666
  if (!currentVersion) return null;
5657
5667
  try {
5658
5668
  const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -5681,7 +5691,7 @@ async function checkForUpdate() {
5681
5691
  }
5682
5692
  }
5683
5693
  function printUpdateNotice(latestVersion) {
5684
- const currentVersion = "0.1.23";
5694
+ const currentVersion = "0.1.25";
5685
5695
  process.stderr.write(
5686
5696
  `
5687
5697
  ${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
@@ -5694,7 +5704,7 @@ function isStandaloneBinary() {
5694
5704
  return !argv1.includes("node_modules");
5695
5705
  }
5696
5706
  async function cmdUpdate() {
5697
- const currentVersion = "0.1.23";
5707
+ const currentVersion = "0.1.25";
5698
5708
  process.stderr.write(
5699
5709
  ` ${ansi2.gray("Current version:")} ${currentVersion}
5700
5710
  `
@@ -5809,7 +5819,7 @@ async function cmdLogin(options) {
5809
5819
  process.stderr.write("\n");
5810
5820
  printLogo();
5811
5821
  process.stderr.write("\n");
5812
- const ver = "0.1.23";
5822
+ const ver = "0.1.25";
5813
5823
  process.stderr.write(
5814
5824
  ` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
5815
5825
  `
@@ -6032,7 +6042,13 @@ function parseStepFlags(argv) {
6032
6042
  const result = {};
6033
6043
  for (let i = 0; i < argv.length; i++) {
6034
6044
  const arg = argv[i];
6035
- if (arg.startsWith("--") && i + 1 < argv.length) {
6045
+ if (!arg.startsWith("--")) continue;
6046
+ if (GLOBAL_BOOLEAN_FLAGS.has(arg)) continue;
6047
+ if (GLOBAL_STRING_FLAGS.has(arg)) {
6048
+ i++;
6049
+ continue;
6050
+ }
6051
+ if (i + 1 < argv.length) {
6036
6052
  const key = arg.slice(2);
6037
6053
  result[kebabToCamel2(key)] = coerce(argv[++i]);
6038
6054
  }
@@ -6081,6 +6097,7 @@ async function main() {
6081
6097
  "thread-id": { type: "string" },
6082
6098
  "output-key": { type: "string" },
6083
6099
  "no-meta": { type: "boolean", default: false },
6100
+ "json-logs": { type: "boolean", default: false },
6084
6101
  workflow: { type: "string" },
6085
6102
  version: { type: "string" },
6086
6103
  type: { type: "string" },
@@ -6113,7 +6130,7 @@ async function main() {
6113
6130
  try {
6114
6131
  if (command === "version" || command === "-v") {
6115
6132
  process.stdout.write(
6116
- "0.1.23\n"
6133
+ "0.1.25\n"
6117
6134
  );
6118
6135
  return;
6119
6136
  }
@@ -6534,7 +6551,8 @@ async function main() {
6534
6551
  appId: values["app-id"],
6535
6552
  threadId: values["thread-id"],
6536
6553
  outputKey: values["output-key"],
6537
- noMeta: values["no-meta"]
6554
+ noMeta: values["no-meta"],
6555
+ jsonLogs: values["json-logs"]
6538
6556
  });
6539
6557
  } catch (err) {
6540
6558
  const message = err instanceof Error ? err.message : String(err);
@@ -6544,7 +6562,7 @@ async function main() {
6544
6562
  if (latestVersion) printUpdateNotice(latestVersion);
6545
6563
  }
6546
6564
  }
6547
- var HELP, MIME_TYPES2, ansi2, UPDATE_CHECK_INTERVAL, LOGO, DEFAULT_BASE_URL3, SPINNER_FRAMES, GLOBAL_STRING_FLAGS;
6565
+ var HELP, MIME_TYPES2, ansi2, UPDATE_CHECK_INTERVAL, LOGO, DEFAULT_BASE_URL3, SPINNER_FRAMES, GLOBAL_STRING_FLAGS, GLOBAL_BOOLEAN_FLAGS;
6548
6566
  var init_cli = __esm({
6549
6567
  "src/cli.ts"() {
6550
6568
  "use strict";
@@ -6594,6 +6612,7 @@ Options:
6594
6612
  --thread-id <id> Thread ID for state persistence
6595
6613
  --output-key <key> Extract a single field from the result
6596
6614
  --no-meta Strip $-prefixed metadata from output
6615
+ --json-logs Stream debug logs as JSONL to stderr
6597
6616
  --workflow <name> Workflow to execute (run-agent only)
6598
6617
  --version <ver> App version, e.g. "draft" (run-agent only)
6599
6618
  --json Output as JSON
@@ -6673,6 +6692,13 @@ Examples:
6673
6692
  "--workflow",
6674
6693
  "--version"
6675
6694
  ]);
6695
+ GLOBAL_BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
6696
+ "--no-meta",
6697
+ "--json-logs",
6698
+ "--json",
6699
+ "--summary",
6700
+ "--help"
6701
+ ]);
6676
6702
  main();
6677
6703
  }
6678
6704
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/agent",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "TypeScript SDK for MindStudio direct step execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",