@mindstudio-ai/agent 0.1.27 → 0.1.29

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.
@@ -3355,6 +3355,17 @@ var init_client = __esm({
3355
3355
  _db;
3356
3356
  /** @internal Auth type — 'internal' for CALLBACK_TOKEN (managed mode), 'apiKey' otherwise. */
3357
3357
  _authType;
3358
+ /**
3359
+ * @internal Resolve the current auth token. For internal (CALLBACK_TOKEN)
3360
+ * auth, re-reads the env var each time so that long-lived singleton
3361
+ * instances pick up token rotations from the host process.
3362
+ */
3363
+ get _token() {
3364
+ if (this._authType === "internal" && process.env.CALLBACK_TOKEN) {
3365
+ return process.env.CALLBACK_TOKEN;
3366
+ }
3367
+ return this._httpConfig.token;
3368
+ }
3358
3369
  constructor(options = {}) {
3359
3370
  const config = loadConfig();
3360
3371
  const { token, authType } = resolveToken(options.apiKey, config);
@@ -3453,7 +3464,7 @@ var init_client = __esm({
3453
3464
  res = await fetch(url, {
3454
3465
  method: "POST",
3455
3466
  headers: {
3456
- Authorization: `Bearer ${this._httpConfig.token}`,
3467
+ Authorization: `Bearer ${this._token}`,
3457
3468
  "Content-Type": "application/json",
3458
3469
  "User-Agent": "@mindstudio-ai/agent",
3459
3470
  Accept: "text/event-stream"
@@ -3874,7 +3885,7 @@ var init_client = __esm({
3874
3885
  method: "POST",
3875
3886
  headers: {
3876
3887
  "Content-Type": "application/json",
3877
- Authorization: this._httpConfig.token
3888
+ Authorization: this._token
3878
3889
  },
3879
3890
  body: JSON.stringify(body)
3880
3891
  });
@@ -4029,7 +4040,7 @@ var init_client = __esm({
4029
4040
  method: "POST",
4030
4041
  headers: {
4031
4042
  "Content-Type": "application/json",
4032
- Authorization: this._httpConfig.token
4043
+ Authorization: this._token
4033
4044
  },
4034
4045
  body: JSON.stringify({ databaseId, queries })
4035
4046
  });
@@ -4563,6 +4574,8 @@ async function buildSystemPrompt(agent) {
4563
4574
  - **Popularity scores**: 1.0 = most used in its category, 0.5\u20130.9 = commonly used, 0.1\u20130.4 = niche, 0.0 = rarely used, null = new model with no data yet.
4564
4575
  - **Prefer popular models as defaults** in code examples unless the caller has a reason to use something specific. A model with popularity 0.9 is a safer recommendation than one with 0.2.
4565
4576
  - **Always recommend latest-generation models**: For Anthropic, this is Claude 4 family, GPT-5 for OpenAI, Gemini 3 for Google, etc. MindStudio supports a ton of different models, including legacy models - but they are there for niche uses or backward compatibility/existing user requirements - they should NOT be used for new projects.
4577
+ - Any image generation model that supports source images in its config supports "remixing" or "image editing". All flagship image models support image remixing and editing. Ignore the tags when recommending image models for editing - all of them support it, especially if their tags say things like "Source Image" etc.
4578
+ - For image generation/editing, prefer to recommend Seedream 4.5 or Google Gemini 3.1
4566
4579
  </model_guidance>
4567
4580
 
4568
4581
  <tools>
@@ -4807,7 +4820,7 @@ async function startMcpServer(options) {
4807
4820
  capabilities: { tools: {} },
4808
4821
  serverInfo: {
4809
4822
  name: "mindstudio-agent",
4810
- version: "0.1.27"
4823
+ version: "0.1.29"
4811
4824
  },
4812
4825
  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.'
4813
4826
  });
@@ -5667,7 +5680,7 @@ function isNewerVersion(current, latest) {
5667
5680
  return false;
5668
5681
  }
5669
5682
  async function checkForUpdate() {
5670
- const currentVersion = "0.1.27";
5683
+ const currentVersion = "0.1.29";
5671
5684
  if (!currentVersion) return null;
5672
5685
  try {
5673
5686
  const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -5696,7 +5709,7 @@ async function checkForUpdate() {
5696
5709
  }
5697
5710
  }
5698
5711
  function printUpdateNotice(latestVersion) {
5699
- const currentVersion = "0.1.27";
5712
+ const currentVersion = "0.1.29";
5700
5713
  process.stderr.write(
5701
5714
  `
5702
5715
  ${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
@@ -5709,7 +5722,7 @@ function isStandaloneBinary() {
5709
5722
  return !argv1.includes("node_modules");
5710
5723
  }
5711
5724
  async function cmdUpdate() {
5712
- const currentVersion = "0.1.27";
5725
+ const currentVersion = "0.1.29";
5713
5726
  process.stderr.write(
5714
5727
  ` ${ansi2.gray("Current version:")} ${currentVersion}
5715
5728
  `
@@ -5824,7 +5837,7 @@ async function cmdLogin(options) {
5824
5837
  process.stderr.write("\n");
5825
5838
  printLogo();
5826
5839
  process.stderr.write("\n");
5827
- const ver = "0.1.27";
5840
+ const ver = "0.1.29";
5828
5841
  process.stderr.write(
5829
5842
  ` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
5830
5843
  `
@@ -6135,7 +6148,7 @@ async function main() {
6135
6148
  try {
6136
6149
  if (command === "version" || command === "-v") {
6137
6150
  process.stdout.write(
6138
- "0.1.27\n"
6151
+ "0.1.29\n"
6139
6152
  );
6140
6153
  return;
6141
6154
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/agent",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "TypeScript SDK for MindStudio direct step execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",