@mindstudio-ai/agent 0.1.79 → 0.1.80

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 CHANGED
@@ -4118,6 +4118,9 @@ var init_client = __esm({
4118
4118
  _db;
4119
4119
  /** @internal Auth type — 'internal' for CALLBACK_TOKEN (managed mode), 'apiKey' otherwise. */
4120
4120
  _authType;
4121
+ /** @internal Usage source sent on step executions (from MINDSTUDIO_REQUEST_SOURCE).
4122
+ * Only set for api-key (CLI) auth so in-app/managed runtime is unaffected. */
4123
+ _requestSource;
4121
4124
  /**
4122
4125
  * @internal Resolve the current auth token. Checks ALS request context
4123
4126
  * first, then CALLBACK_TOKEN env var, then static config token.
@@ -4173,6 +4176,7 @@ var init_client = __esm({
4173
4176
  this._reuseThreadId = options.reuseThreadId ?? /^(true|1)$/i.test(process.env.MINDSTUDIO_REUSE_THREAD_ID ?? "");
4174
4177
  this._appId = options.appId ?? process.env.MINDSTUDIO_APP_ID ?? void 0;
4175
4178
  this._authType = authType;
4179
+ this._requestSource = authType === "apiKey" ? process.env.MINDSTUDIO_REQUEST_SOURCE || void 0 : void 0;
4176
4180
  this._httpConfig = {
4177
4181
  baseUrl,
4178
4182
  token,
@@ -4206,7 +4210,8 @@ var init_client = __esm({
4206
4210
  step,
4207
4211
  ...options?.appId != null && { appId: options.appId },
4208
4212
  ...threadId != null && { threadId },
4209
- ...this._currentStreamId != null && { streamId: this._currentStreamId }
4213
+ ...this._currentStreamId != null && { streamId: this._currentStreamId },
4214
+ ...this._requestSource != null && { requestSource: this._requestSource }
4210
4215
  });
4211
4216
  const remaining = headers.get("x-ratelimit-remaining");
4212
4217
  const returnedThreadId = asyncData.threadId ?? "";
@@ -4289,7 +4294,8 @@ var init_client = __esm({
4289
4294
  step,
4290
4295
  ...options.appId != null && { appId: options.appId },
4291
4296
  ...threadId != null && { threadId },
4292
- ...this._currentStreamId != null && { streamId: this._currentStreamId }
4297
+ ...this._currentStreamId != null && { streamId: this._currentStreamId },
4298
+ ...this._requestSource != null && { requestSource: this._requestSource }
4293
4299
  };
4294
4300
  await this._httpConfig.rateLimiter.acquire();
4295
4301
  let res;
@@ -4475,7 +4481,8 @@ var init_client = __esm({
4475
4481
  stepType: resolveStepType2(s.stepType)
4476
4482
  })),
4477
4483
  ...options?.appId != null && { appId: options.appId },
4478
- ...threadId != null && { threadId }
4484
+ ...threadId != null && { threadId },
4485
+ ...this._requestSource != null && { requestSource: this._requestSource }
4479
4486
  });
4480
4487
  const pollUrl = `${this._currentHttpConfig.baseUrl}/developer/v2/steps/execute-batch-async/poll/${asyncData.batchToken}`;
4481
4488
  let pollDelay = 300;
@@ -6224,7 +6231,7 @@ async function startMcpServer(options) {
6224
6231
  capabilities: { tools: {} },
6225
6232
  serverInfo: {
6226
6233
  name: "mindstudio-agent",
6227
- version: "0.1.79"
6234
+ version: "0.1.80"
6228
6235
  },
6229
6236
  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.'
6230
6237
  });
@@ -7197,7 +7204,7 @@ function isNewerVersion(current, latest) {
7197
7204
  return false;
7198
7205
  }
7199
7206
  async function checkForUpdate() {
7200
- const currentVersion = "0.1.79";
7207
+ const currentVersion = "0.1.80";
7201
7208
  if (!currentVersion) return null;
7202
7209
  try {
7203
7210
  const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -7226,7 +7233,7 @@ async function checkForUpdate() {
7226
7233
  }
7227
7234
  }
7228
7235
  function printUpdateNotice(latestVersion) {
7229
- const currentVersion = "0.1.79";
7236
+ const currentVersion = "0.1.80";
7230
7237
  process.stderr.write(
7231
7238
  `
7232
7239
  ${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
@@ -7239,7 +7246,7 @@ function isStandaloneBinary() {
7239
7246
  return !argv1.includes("node_modules");
7240
7247
  }
7241
7248
  async function cmdUpdate() {
7242
- const currentVersion = "0.1.79";
7249
+ const currentVersion = "0.1.80";
7243
7250
  process.stderr.write(
7244
7251
  ` ${ansi2.gray("Current version:")} ${currentVersion}
7245
7252
  `
@@ -7374,7 +7381,7 @@ async function cmdLogin(options) {
7374
7381
  process.stderr.write("\n");
7375
7382
  printLogo();
7376
7383
  process.stderr.write("\n");
7377
- const ver = "0.1.79";
7384
+ const ver = "0.1.80";
7378
7385
  process.stderr.write(
7379
7386
  ` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
7380
7387
  `
@@ -7701,7 +7708,7 @@ async function main() {
7701
7708
  try {
7702
7709
  if (command === "version" || command === "-v") {
7703
7710
  process.stdout.write(
7704
- "0.1.79\n"
7711
+ "0.1.80\n"
7705
7712
  );
7706
7713
  return;
7707
7714
  }
package/dist/index.d.ts CHANGED
@@ -1431,6 +1431,9 @@ declare class MindStudioAgent$1 {
1431
1431
  private _db;
1432
1432
  /** @internal Auth type — 'internal' for CALLBACK_TOKEN (managed mode), 'apiKey' otherwise. */
1433
1433
  private _authType;
1434
+ /** @internal Usage source sent on step executions (from MINDSTUDIO_REQUEST_SOURCE).
1435
+ * Only set for api-key (CLI) auth so in-app/managed runtime is unaffected. */
1436
+ private _requestSource;
1434
1437
  /**
1435
1438
  * @internal Resolve the current auth token. Checks ALS request context
1436
1439
  * first, then CALLBACK_TOKEN env var, then static config token.
package/dist/index.js CHANGED
@@ -3928,6 +3928,9 @@ var MindStudioAgent = class {
3928
3928
  _db;
3929
3929
  /** @internal Auth type — 'internal' for CALLBACK_TOKEN (managed mode), 'apiKey' otherwise. */
3930
3930
  _authType;
3931
+ /** @internal Usage source sent on step executions (from MINDSTUDIO_REQUEST_SOURCE).
3932
+ * Only set for api-key (CLI) auth so in-app/managed runtime is unaffected. */
3933
+ _requestSource;
3931
3934
  /**
3932
3935
  * @internal Resolve the current auth token. Checks ALS request context
3933
3936
  * first, then CALLBACK_TOKEN env var, then static config token.
@@ -3983,6 +3986,7 @@ var MindStudioAgent = class {
3983
3986
  this._reuseThreadId = options.reuseThreadId ?? /^(true|1)$/i.test(process.env.MINDSTUDIO_REUSE_THREAD_ID ?? "");
3984
3987
  this._appId = options.appId ?? process.env.MINDSTUDIO_APP_ID ?? void 0;
3985
3988
  this._authType = authType;
3989
+ this._requestSource = authType === "apiKey" ? process.env.MINDSTUDIO_REQUEST_SOURCE || void 0 : void 0;
3986
3990
  this._httpConfig = {
3987
3991
  baseUrl,
3988
3992
  token,
@@ -4016,7 +4020,8 @@ var MindStudioAgent = class {
4016
4020
  step,
4017
4021
  ...options?.appId != null && { appId: options.appId },
4018
4022
  ...threadId != null && { threadId },
4019
- ...this._currentStreamId != null && { streamId: this._currentStreamId }
4023
+ ...this._currentStreamId != null && { streamId: this._currentStreamId },
4024
+ ...this._requestSource != null && { requestSource: this._requestSource }
4020
4025
  });
4021
4026
  const remaining = headers.get("x-ratelimit-remaining");
4022
4027
  const returnedThreadId = asyncData.threadId ?? "";
@@ -4099,7 +4104,8 @@ var MindStudioAgent = class {
4099
4104
  step,
4100
4105
  ...options.appId != null && { appId: options.appId },
4101
4106
  ...threadId != null && { threadId },
4102
- ...this._currentStreamId != null && { streamId: this._currentStreamId }
4107
+ ...this._currentStreamId != null && { streamId: this._currentStreamId },
4108
+ ...this._requestSource != null && { requestSource: this._requestSource }
4103
4109
  };
4104
4110
  await this._httpConfig.rateLimiter.acquire();
4105
4111
  let res;
@@ -4285,7 +4291,8 @@ var MindStudioAgent = class {
4285
4291
  stepType: resolveStepType2(s.stepType)
4286
4292
  })),
4287
4293
  ...options?.appId != null && { appId: options.appId },
4288
- ...threadId != null && { threadId }
4294
+ ...threadId != null && { threadId },
4295
+ ...this._requestSource != null && { requestSource: this._requestSource }
4289
4296
  });
4290
4297
  const pollUrl = `${this._currentHttpConfig.baseUrl}/developer/v2/steps/execute-batch-async/poll/${asyncData.batchToken}`;
4291
4298
  let pollDelay = 300;