@mindstudio-ai/agent 0.1.168 → 0.1.170

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.
@@ -1,8 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __esm = (fn, res) => function __init() {
5
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
4
+ var __esm = (fn, res, err) => function __init() {
5
+ if (err) throw err[0];
6
+ try {
7
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8
+ } catch (e) {
9
+ throw err = [e], e;
10
+ }
6
11
  };
7
12
  var __export = (target, all) => {
8
13
  for (var name in all)
@@ -3882,7 +3887,7 @@ var init_table = __esm({
3882
3887
  (item) => this._config.defaults ? { ...this._config.defaults, ...item } : item
3883
3888
  );
3884
3889
  const build = () => items.map((item) => {
3885
- this._checkManagedColumns(item);
3890
+ this._checkApiKeyWrite(item);
3886
3891
  return buildInsert(
3887
3892
  this._config.tableName,
3888
3893
  item,
@@ -3914,7 +3919,7 @@ var init_table = __esm({
3914
3919
  */
3915
3920
  update(id, data) {
3916
3921
  const build = () => {
3917
- this._checkManagedColumns(data);
3922
+ this._checkApiKeyWrite(data);
3918
3923
  return [
3919
3924
  buildUpdate(this._config.tableName, id, data, this._config.columns)
3920
3925
  ];
@@ -4021,7 +4026,7 @@ var init_table = __esm({
4021
4026
  }
4022
4027
  }
4023
4028
  const build = () => {
4024
- this._checkManagedColumns(withDefaults);
4029
+ this._checkApiKeyWrite(withDefaults);
4025
4030
  return [
4026
4031
  buildUpsert(
4027
4032
  this._config.tableName,
@@ -4050,22 +4055,19 @@ var init_table = __esm({
4050
4055
  // -------------------------------------------------------------------------
4051
4056
  // Internal helpers
4052
4057
  // -------------------------------------------------------------------------
4053
- /** @internal Throw if data includes a platform-managed read-only column. */
4054
- _checkManagedColumns(data) {
4055
- const mc = this._config.managedColumns;
4056
- if (!mc) {
4057
- return;
4058
- }
4059
- const keys = Object.keys(data);
4060
- for (const key of keys) {
4061
- if (mc.email && key === mc.email || mc.phone && key === mc.phone || mc.apiKey && key === mc.apiKey) {
4062
- const friendly = key === mc.email ? "email" : key === mc.phone ? "phone" : "API key";
4063
- throw new MindStudioError(
4064
- `Cannot write to "${key}" \u2014 this column is managed by auth. Use the auth API to change a user's ${friendly}.`,
4065
- "managed_column_write",
4066
- 400
4067
- );
4068
- }
4058
+ /**
4059
+ * @internal Throw if data writes the auth table's API key column, which holds
4060
+ * the masked key the platform issued. The other mapped columns are the app's
4061
+ * to write.
4062
+ */
4063
+ _checkApiKeyWrite(data) {
4064
+ const column = this._config.managedColumns?.apiKey;
4065
+ if (column && Object.keys(data).includes(column)) {
4066
+ throw new MindStudioError(
4067
+ `Cannot write to "${column}" \u2014 this column is managed by auth. Use the auth API to issue or revoke a user's API key.`,
4068
+ "managed_column_write",
4069
+ 400
4070
+ );
4069
4071
  }
4070
4072
  }
4071
4073
  /**
@@ -9467,7 +9469,7 @@ async function startMcpServer(options) {
9467
9469
  capabilities: { tools: {} },
9468
9470
  serverInfo: {
9469
9471
  name: "mindstudio-agent",
9470
- version: "0.1.168"
9472
+ version: "0.1.170"
9471
9473
  },
9472
9474
  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, pass its public image URL to `changeProfilePicture`.\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.'
9473
9475
  });
@@ -10409,7 +10411,7 @@ function isNewerVersion(current, latest) {
10409
10411
  return false;
10410
10412
  }
10411
10413
  async function checkForUpdate() {
10412
- const currentVersion = "0.1.168";
10414
+ const currentVersion = "0.1.170";
10413
10415
  if (!currentVersion || process.env.MINDSTUDIO_NO_UPDATE_CHECK) {
10414
10416
  return null;
10415
10417
  }
@@ -10444,7 +10446,7 @@ async function checkForUpdate() {
10444
10446
  }
10445
10447
  }
10446
10448
  function printUpdateNotice(latestVersion) {
10447
- const currentVersion = "0.1.168";
10449
+ const currentVersion = "0.1.170";
10448
10450
  process.stderr.write(
10449
10451
  `
10450
10452
  ${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
@@ -10457,7 +10459,7 @@ function isStandaloneBinary() {
10457
10459
  return !argv1.includes("node_modules");
10458
10460
  }
10459
10461
  async function cmdUpdate() {
10460
- const currentVersion = "0.1.168";
10462
+ const currentVersion = "0.1.170";
10461
10463
  process.stderr.write(
10462
10464
  ` ${ansi2.gray("Current version:")} ${currentVersion}
10463
10465
  `
@@ -10578,7 +10580,7 @@ async function cmdLogin(options) {
10578
10580
  process.stderr.write("\n");
10579
10581
  printLogo();
10580
10582
  process.stderr.write("\n");
10581
- const ver = "0.1.168";
10583
+ const ver = "0.1.170";
10582
10584
  process.stderr.write(
10583
10585
  ` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
10584
10586
  `
@@ -10890,7 +10892,7 @@ async function main() {
10890
10892
  const updatePromise = command !== "mcp" && command !== "login" && command !== "update" ? checkForUpdate() : Promise.resolve(null);
10891
10893
  try {
10892
10894
  if (command === "version" || command === "-v") {
10893
- process.stdout.write("0.1.168\n");
10895
+ process.stdout.write("0.1.170\n");
10894
10896
  return;
10895
10897
  }
10896
10898
  if (command === "login") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/agent",
3
- "version": "0.1.168",
3
+ "version": "0.1.170",
4
4
  "description": "TypeScript SDK for MindStudio direct step execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -69,7 +69,7 @@
69
69
  "@typescript/native": "npm:typescript@^7.0.2",
70
70
  "esbuild": "^0.28.2",
71
71
  "fast-check": "^4.10.2",
72
- "tsup": "^8",
72
+ "tsup": "^9",
73
73
  "tsx": "^4.23.15",
74
74
  "typescript": "npm:@typescript/typescript6@^6.0.2",
75
75
  "vitest": "^5.0.3"