@mindstudio-ai/agent 0.1.49 → 0.1.51

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.
@@ -1287,15 +1287,25 @@ var init_http = __esm({
1287
1287
  });
1288
1288
 
1289
1289
  // src/context.ts
1290
- import { AsyncLocalStorage } from "async_hooks";
1291
1290
  function getRequestContext() {
1292
1291
  return als.getStore();
1293
1292
  }
1294
- var als;
1293
+ var noopAls, als;
1295
1294
  var init_context = __esm({
1296
- "src/context.ts"() {
1295
+ async "src/context.ts"() {
1297
1296
  "use strict";
1298
- als = new AsyncLocalStorage();
1297
+ noopAls = {
1298
+ getStore: () => void 0,
1299
+ run: (_store, fn) => fn()
1300
+ };
1301
+ als = noopAls;
1302
+ try {
1303
+ if (typeof process !== "undefined" && process.versions?.node) {
1304
+ const mod = await import("async_hooks");
1305
+ als = new mod.AsyncLocalStorage();
1306
+ }
1307
+ } catch {
1308
+ }
1299
1309
  }
1300
1310
  });
1301
1311
 
@@ -3198,11 +3208,11 @@ async function runTaskStream(httpConfig, body, onEvent) {
3198
3208
  return result;
3199
3209
  }
3200
3210
  var init_task = __esm({
3201
- "src/task/index.ts"() {
3211
+ async "src/task/index.ts"() {
3202
3212
  "use strict";
3203
3213
  init_http();
3204
3214
  init_errors();
3205
- init_context();
3215
+ await init_context();
3206
3216
  init_metadata();
3207
3217
  }
3208
3218
  });
@@ -3732,16 +3742,16 @@ function resolveToken(provided, config) {
3732
3742
  }
3733
3743
  var DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, MindStudioAgent;
3734
3744
  var init_client = __esm({
3735
- "src/client.ts"() {
3745
+ async "src/client.ts"() {
3736
3746
  "use strict";
3737
3747
  init_http();
3738
3748
  init_errors();
3739
- init_context();
3749
+ await init_context();
3740
3750
  init_rate_limit();
3741
3751
  init_config();
3742
3752
  init_auth();
3743
3753
  init_db();
3744
- init_task();
3754
+ await init_task();
3745
3755
  init_steps();
3746
3756
  init_metadata();
3747
3757
  DEFAULT_BASE_URL = "https://v1.mindstudio-api.com";
@@ -5481,10 +5491,10 @@ async function cmdAsk(question, options) {
5481
5491
  }
5482
5492
  var DEFAULT_BASE_URL2, ansi;
5483
5493
  var init_ask = __esm({
5484
- "src/ask/index.ts"() {
5494
+ async "src/ask/index.ts"() {
5485
5495
  "use strict";
5486
5496
  init_config();
5487
- init_client();
5497
+ await init_client();
5488
5498
  init_sse();
5489
5499
  init_tools();
5490
5500
  init_prompt2();
@@ -5559,7 +5569,7 @@ async function startMcpServer(options) {
5559
5569
  capabilities: { tools: {} },
5560
5570
  serverInfo: {
5561
5571
  name: "mindstudio-agent",
5562
- version: "0.1.49"
5572
+ version: "0.1.51"
5563
5573
  },
5564
5574
  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.'
5565
5575
  });
@@ -5575,7 +5585,7 @@ async function startMcpServer(options) {
5575
5585
  try {
5576
5586
  let result;
5577
5587
  if (toolName === "ask") {
5578
- const { runAsk: runAsk2 } = await Promise.resolve().then(() => (init_ask(), ask_exports));
5588
+ const { runAsk: runAsk2 } = await init_ask().then(() => ask_exports);
5579
5589
  result = await runAsk2(
5580
5590
  args.question,
5581
5591
  options
@@ -5709,9 +5719,9 @@ async function startMcpServer(options) {
5709
5719
  }
5710
5720
  var MCP_PROTOCOL_VERSION, MIME_TYPES, ASK_TOOL, HELPER_DESCRIPTIONS, HELPER_TOOLS;
5711
5721
  var init_mcp = __esm({
5712
- "src/mcp.ts"() {
5722
+ async "src/mcp.ts"() {
5713
5723
  "use strict";
5714
- init_client();
5724
+ await init_client();
5715
5725
  init_errors();
5716
5726
  MCP_PROTOCOL_VERSION = "2024-11-05";
5717
5727
  MIME_TYPES = {
@@ -6179,7 +6189,7 @@ function formatPropType(prop) {
6179
6189
  return "string";
6180
6190
  }
6181
6191
  async function cmdExec(method, input, options) {
6182
- const { MindStudioAgent: MindStudioAgent2 } = await Promise.resolve().then(() => (init_client(), client_exports));
6192
+ const { MindStudioAgent: MindStudioAgent2 } = await init_client().then(() => client_exports);
6183
6193
  await Promise.resolve().then(() => (init_steps(), steps_exports)).then(
6184
6194
  (m) => m.applyStepMethods(MindStudioAgent2)
6185
6195
  );
@@ -6232,7 +6242,7 @@ async function cmdExec(method, input, options) {
6232
6242
  }
6233
6243
  }
6234
6244
  async function cmdAgents(asJson, options) {
6235
- const { MindStudioAgent: MindStudioAgent2 } = await Promise.resolve().then(() => (init_client(), client_exports));
6245
+ const { MindStudioAgent: MindStudioAgent2 } = await init_client().then(() => client_exports);
6236
6246
  const agent = new MindStudioAgent2({
6237
6247
  apiKey: options.apiKey,
6238
6248
  baseUrl: options.baseUrl
@@ -6261,7 +6271,7 @@ async function cmdAgents(asJson, options) {
6261
6271
  }
6262
6272
  }
6263
6273
  function createAgent(options) {
6264
- return Promise.resolve().then(() => (init_client(), client_exports)).then(
6274
+ return init_client().then(() => client_exports).then(
6265
6275
  ({ MindStudioAgent: MindStudioAgent2 }) => new MindStudioAgent2({
6266
6276
  apiKey: options.apiKey,
6267
6277
  baseUrl: options.baseUrl
@@ -6317,7 +6327,7 @@ async function cmdChangeProfilePicture(url, options) {
6317
6327
  `);
6318
6328
  }
6319
6329
  async function cmdRun(appId, variables, options) {
6320
- const { MindStudioAgent: MindStudioAgent2 } = await Promise.resolve().then(() => (init_client(), client_exports));
6330
+ const { MindStudioAgent: MindStudioAgent2 } = await init_client().then(() => client_exports);
6321
6331
  const agent = new MindStudioAgent2({
6322
6332
  apiKey: options.apiKey,
6323
6333
  baseUrl: options.baseUrl
@@ -6397,7 +6407,7 @@ async function cmdUpload(filePath, options) {
6397
6407
  if (!ext) fatal("Cannot determine file extension. Please provide a file with an extension.");
6398
6408
  const content = readFileSync3(filePath);
6399
6409
  const mimeType = MIME_TYPES2[ext];
6400
- const { MindStudioAgent: MindStudioAgent2 } = await Promise.resolve().then(() => (init_client(), client_exports));
6410
+ const { MindStudioAgent: MindStudioAgent2 } = await init_client().then(() => client_exports);
6401
6411
  const agent = new MindStudioAgent2({
6402
6412
  apiKey: options.apiKey,
6403
6413
  baseUrl: options.baseUrl
@@ -6420,7 +6430,7 @@ function isNewerVersion(current, latest) {
6420
6430
  return false;
6421
6431
  }
6422
6432
  async function checkForUpdate() {
6423
- const currentVersion = "0.1.49";
6433
+ const currentVersion = "0.1.51";
6424
6434
  if (!currentVersion) return null;
6425
6435
  try {
6426
6436
  const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -6449,7 +6459,7 @@ async function checkForUpdate() {
6449
6459
  }
6450
6460
  }
6451
6461
  function printUpdateNotice(latestVersion) {
6452
- const currentVersion = "0.1.49";
6462
+ const currentVersion = "0.1.51";
6453
6463
  process.stderr.write(
6454
6464
  `
6455
6465
  ${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
@@ -6462,7 +6472,7 @@ function isStandaloneBinary() {
6462
6472
  return !argv1.includes("node_modules");
6463
6473
  }
6464
6474
  async function cmdUpdate() {
6465
- const currentVersion = "0.1.49";
6475
+ const currentVersion = "0.1.51";
6466
6476
  process.stderr.write(
6467
6477
  ` ${ansi2.gray("Current version:")} ${currentVersion}
6468
6478
  `
@@ -6577,7 +6587,7 @@ async function cmdLogin(options) {
6577
6587
  process.stderr.write("\n");
6578
6588
  printLogo();
6579
6589
  process.stderr.write("\n");
6580
- const ver = "0.1.49";
6590
+ const ver = "0.1.51";
6581
6591
  process.stderr.write(
6582
6592
  ` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
6583
6593
  `
@@ -6727,7 +6737,7 @@ async function cmdWhoami(options) {
6727
6737
  for (const line of detail) process.stderr.write(line + "\n");
6728
6738
  process.stderr.write(` ${ansi2.gray("Verifying...")} `);
6729
6739
  try {
6730
- const { MindStudioAgent: MindStudioAgent2 } = await Promise.resolve().then(() => (init_client(), client_exports));
6740
+ const { MindStudioAgent: MindStudioAgent2 } = await init_client().then(() => client_exports);
6731
6741
  const agent = new MindStudioAgent2({
6732
6742
  apiKey: options.apiKey,
6733
6743
  baseUrl: options.baseUrl
@@ -6888,7 +6898,7 @@ async function main() {
6888
6898
  try {
6889
6899
  if (command === "version" || command === "-v") {
6890
6900
  process.stdout.write(
6891
- "0.1.49\n"
6901
+ "0.1.51\n"
6892
6902
  );
6893
6903
  return;
6894
6904
  }
@@ -6939,7 +6949,7 @@ async function main() {
6939
6949
  ` mindstudio ask "what's the difference between generateText and userMessage?"`
6940
6950
  ]);
6941
6951
  }
6942
- const { cmdAsk: cmdAsk2 } = await Promise.resolve().then(() => (init_ask(), ask_exports));
6952
+ const { cmdAsk: cmdAsk2 } = await init_ask().then(() => ask_exports);
6943
6953
  await cmdAsk2(question, {
6944
6954
  apiKey: values["api-key"],
6945
6955
  baseUrl: values["base-url"]
@@ -7225,7 +7235,7 @@ async function main() {
7225
7235
  return;
7226
7236
  }
7227
7237
  if (command === "mcp") {
7228
- const { startMcpServer: startMcpServer2 } = await Promise.resolve().then(() => (init_mcp(), mcp_exports));
7238
+ const { startMcpServer: startMcpServer2 } = await init_mcp().then(() => mcp_exports);
7229
7239
  await startMcpServer2({
7230
7240
  apiKey: values["api-key"],
7231
7241
  baseUrl: values["base-url"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/agent",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "description": "TypeScript SDK for MindStudio direct step execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",