@mindstudio-ai/agent 0.1.179 → 0.1.180

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/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ What changed in `@mindstudio-ai/agent`, newest first, each version under its own
4
4
 
5
5
  Versions before 0.1.163 aren't recorded here.
6
6
 
7
+ ## 0.1.180
8
+
9
+ ### Changed behavior
10
+
11
+ - Internal functions renamed to say what they do. Nothing exported changed, and nothing behaves differently. App code isn't affected.
12
+
7
13
  ## 0.1.179
8
14
 
9
15
  ### Changed behavior
package/dist/cli.js CHANGED
@@ -1399,7 +1399,7 @@ function clearPendingTimer(p) {
1399
1399
  p.timer = null;
1400
1400
  }
1401
1401
  }
1402
- function forget(self, id) {
1402
+ function dropSettledRequest(self, id) {
1403
1403
  self.pending.delete(id);
1404
1404
  self.inbound.delete(id);
1405
1405
  if (self.retired && self.pending.size === 0) {
@@ -1433,7 +1433,7 @@ function retire(self, reason) {
1433
1433
  function armIdleTimer(self, id, p) {
1434
1434
  clearPendingTimer(p);
1435
1435
  p.timer = setTimeout(() => {
1436
- forget(self, id);
1436
+ dropSettledRequest(self, id);
1437
1437
  retire(self, "a reply went silent");
1438
1438
  p.reject(new DbWsTransportError("ws reply went silent", true));
1439
1439
  }, WS_IDLE_TIMEOUT_MS);
@@ -1444,7 +1444,7 @@ function deliver(self, msg) {
1444
1444
  return;
1445
1445
  }
1446
1446
  clearPendingTimer(p);
1447
- forget(self, msg.id);
1447
+ dropSettledRequest(self, msg.id);
1448
1448
  if (msg.error) {
1449
1449
  p.reject(
1450
1450
  new MindStudioError(
@@ -1465,7 +1465,7 @@ function failTransport(self, id, err) {
1465
1465
  return;
1466
1466
  }
1467
1467
  clearPendingTimer(p);
1468
- forget(self, id);
1468
+ dropSettledRequest(self, id);
1469
1469
  p.reject(err);
1470
1470
  }
1471
1471
  function getOrOpen(url, token) {
@@ -1618,7 +1618,7 @@ async function executeDbBatchOverWs(url, token, databaseId, queries) {
1618
1618
  return await new Promise((resolve, reject) => {
1619
1619
  const pending = { resolve, reject, timer: null, acked: false };
1620
1620
  pending.timer = setTimeout(() => {
1621
- forget(self, id);
1621
+ dropSettledRequest(self, id);
1622
1622
  retire(self, "a request went unacknowledged");
1623
1623
  reject(new DbWsTransportError("ws ack timed out", true));
1624
1624
  }, WS_ACK_TIMEOUT_MS);
@@ -1633,7 +1633,7 @@ async function executeDbBatchOverWs(url, token, databaseId, queries) {
1633
1633
  complete = true;
1634
1634
  } catch (err) {
1635
1635
  clearPendingTimer(pending);
1636
- forget(self, id);
1636
+ dropSettledRequest(self, id);
1637
1637
  if (started) {
1638
1638
  retire(self, "a partial request upload failed");
1639
1639
  }
@@ -2463,7 +2463,7 @@ function nestedComparison(node, negated, params) {
2463
2463
  function withNulls(core, field, nullsMatch) {
2464
2464
  return nullsMatch ? `(${core} OR ${field.sql} IS NULL)` : core;
2465
2465
  }
2466
- function readsBackAsWritten(value) {
2466
+ function isNonJsonString(value) {
2467
2467
  if (typeof value !== "string") {
2468
2468
  return false;
2469
2469
  }
@@ -2501,7 +2501,7 @@ function compileNode(node, negated, columns, params) {
2501
2501
  const type = column(node.field)?.type;
2502
2502
  if (type === "json") {
2503
2503
  const strictEquals = node.op === "===" ? !negated : node.op === "!==" ? negated : null;
2504
- return strictEquals !== null && readsBackAsWritten(node.value) ? jsonColumnIn(node.field, [node.value], !strictEquals, params) : null;
2504
+ return strictEquals !== null && isNonJsonString(node.value) ? jsonColumnIn(node.field, [node.value], !strictEquals, params) : null;
2505
2505
  }
2506
2506
  if (!type || typeof node.value !== VALUE_KIND[type]) {
2507
2507
  return null;
@@ -2531,7 +2531,7 @@ function compileNode(node, negated, columns, params) {
2531
2531
  case "in": {
2532
2532
  const type = column(node.field)?.type;
2533
2533
  if (type === "json") {
2534
- return node.values.every(readsBackAsWritten) ? jsonColumnIn(node.field, node.values, negated, params) : null;
2534
+ return node.values.every(isNonJsonString) ? jsonColumnIn(node.field, node.values, negated, params) : null;
2535
2535
  }
2536
2536
  if (!type || node.values.some(
2537
2537
  (v) => v !== null && v !== void 0 && typeof v !== VALUE_KIND[type]
@@ -10086,7 +10086,7 @@ async function startMcpServer(options) {
10086
10086
  capabilities: { tools: {} },
10087
10087
  serverInfo: {
10088
10088
  name: "mindstudio-agent",
10089
- version: "0.1.179"
10089
+ version: "0.1.180"
10090
10090
  },
10091
10091
  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.'
10092
10092
  });
@@ -10680,7 +10680,7 @@ function fatal(message) {
10680
10680
  process.stderr.write(JSON.stringify({ error: { message } }) + "\n");
10681
10681
  process.exit(1);
10682
10682
  }
10683
- function usageBlock(lines) {
10683
+ function exitWithUsage(lines) {
10684
10684
  process.stderr.write("\n" + lines.map((l) => " " + l).join("\n") + "\n\n");
10685
10685
  process.exit(1);
10686
10686
  }
@@ -11126,7 +11126,7 @@ function isNewerVersion(current, latest) {
11126
11126
  return false;
11127
11127
  }
11128
11128
  async function checkForUpdate() {
11129
- const currentVersion = "0.1.179";
11129
+ const currentVersion = "0.1.180";
11130
11130
  if (!currentVersion || process.env.MINDSTUDIO_NO_UPDATE_CHECK) {
11131
11131
  return null;
11132
11132
  }
@@ -11161,7 +11161,7 @@ async function checkForUpdate() {
11161
11161
  }
11162
11162
  }
11163
11163
  function printUpdateNotice(latestVersion) {
11164
- const currentVersion = "0.1.179";
11164
+ const currentVersion = "0.1.180";
11165
11165
  process.stderr.write(
11166
11166
  `
11167
11167
  ${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
@@ -11174,7 +11174,7 @@ function isStandaloneBinary() {
11174
11174
  return !argv1.includes("node_modules");
11175
11175
  }
11176
11176
  async function cmdUpdate() {
11177
- const currentVersion = "0.1.179";
11177
+ const currentVersion = "0.1.180";
11178
11178
  process.stderr.write(
11179
11179
  ` ${ansi2.gray("Current version:")} ${currentVersion}
11180
11180
  `
@@ -11315,7 +11315,7 @@ async function cmdLogin(options) {
11315
11315
  process.stderr.write("\n");
11316
11316
  printLogo();
11317
11317
  process.stderr.write("\n");
11318
- const ver = "0.1.179";
11318
+ const ver = "0.1.180";
11319
11319
  process.stderr.write(
11320
11320
  ` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
11321
11321
  `
@@ -11643,7 +11643,7 @@ async function main() {
11643
11643
  const updatePromise = command !== "mcp" && command !== "login" && command !== "update" ? checkForUpdate() : Promise.resolve(null);
11644
11644
  try {
11645
11645
  if (command === "version" || command === "-v") {
11646
- process.stdout.write("0.1.179\n");
11646
+ process.stdout.write("0.1.180\n");
11647
11647
  return;
11648
11648
  }
11649
11649
  if (command === "login") {
@@ -11673,7 +11673,7 @@ async function main() {
11673
11673
  question = (await readStdin()).trim();
11674
11674
  }
11675
11675
  if (!question) {
11676
- usageBlock([
11676
+ exitWithUsage([
11677
11677
  "ask \u2014 Built-in SDK assistant",
11678
11678
  "",
11679
11679
  "Returns working code with real model IDs, config options,",
@@ -11733,7 +11733,7 @@ async function main() {
11733
11733
  }
11734
11734
  }
11735
11735
  if (input2 === void 0) {
11736
- usageBlock([
11736
+ exitWithUsage([
11737
11737
  "batch \u2014 Execute multiple actions in parallel",
11738
11738
  "",
11739
11739
  "Usage:",
@@ -11770,7 +11770,7 @@ async function main() {
11770
11770
  if (command === "run-agent") {
11771
11771
  const appId = positionals[1];
11772
11772
  if (!appId) {
11773
- usageBlock([
11773
+ exitWithUsage([
11774
11774
  "run-agent \u2014 Run a pre-built agent and wait for the result",
11775
11775
  "",
11776
11776
  "Usage:",
@@ -11838,7 +11838,7 @@ async function main() {
11838
11838
  if (command === "upload" || command === "upload-file") {
11839
11839
  const filePath = positionals[1];
11840
11840
  if (!filePath) {
11841
- usageBlock([
11841
+ exitWithUsage([
11842
11842
  "upload \u2014 Upload a file to the MindStudio CDN (alias: upload-file)",
11843
11843
  "",
11844
11844
  "Usage:",
@@ -11869,7 +11869,7 @@ async function main() {
11869
11869
  if (command === "list-models-by-type" || command === "list-models-summary-by-type") {
11870
11870
  type = positionals[1];
11871
11871
  if (!type) {
11872
- usageBlock([
11872
+ exitWithUsage([
11873
11873
  `${command} \u2014 List AI models filtered by type`,
11874
11874
  "",
11875
11875
  "Usage:",
@@ -11924,7 +11924,7 @@ async function main() {
11924
11924
  if (command === "estimate-cost") {
11925
11925
  const stepMethod = positionals[1];
11926
11926
  if (!stepMethod) {
11927
- usageBlock([
11927
+ exitWithUsage([
11928
11928
  "estimate-cost \u2014 Estimate the cost of an action before running it",
11929
11929
  "",
11930
11930
  "Usage:",
@@ -11962,7 +11962,7 @@ async function main() {
11962
11962
  if (command === "change-name") {
11963
11963
  const name = positionals[1];
11964
11964
  if (!name) {
11965
- usageBlock([
11965
+ exitWithUsage([
11966
11966
  "change-name \u2014 Update your display name",
11967
11967
  "",
11968
11968
  "Usage:",
@@ -11981,7 +11981,7 @@ async function main() {
11981
11981
  if (command === "change-profile-picture") {
11982
11982
  const url = positionals[1];
11983
11983
  if (!url) {
11984
- usageBlock([
11984
+ exitWithUsage([
11985
11985
  "change-profile-picture \u2014 Update your profile picture",
11986
11986
  "",
11987
11987
  "Usage:",
@@ -12010,7 +12010,7 @@ async function main() {
12010
12010
  if (command === "info") {
12011
12011
  const rawMethod2 = positionals[1];
12012
12012
  if (!rawMethod2) {
12013
- usageBlock([
12013
+ exitWithUsage([
12014
12014
  "info \u2014 Show action details and parameters",
12015
12015
  "",
12016
12016
  "Usage:",
@@ -12031,7 +12031,7 @@ async function main() {
12031
12031
  }
12032
12032
  const split = findMethodSplit(process.argv.slice(2));
12033
12033
  if (!split) {
12034
- usageBlock([
12034
+ exitWithUsage([
12035
12035
  "Run an action directly",
12036
12036
  "",
12037
12037
  "Usage:",
package/dist/index.js CHANGED
@@ -169,7 +169,7 @@ function clearPendingTimer(p) {
169
169
  p.timer = null;
170
170
  }
171
171
  }
172
- function forget(self, id) {
172
+ function dropSettledRequest(self, id) {
173
173
  self.pending.delete(id);
174
174
  self.inbound.delete(id);
175
175
  if (self.retired && self.pending.size === 0) {
@@ -203,7 +203,7 @@ function retire(self, reason) {
203
203
  function armIdleTimer(self, id, p) {
204
204
  clearPendingTimer(p);
205
205
  p.timer = setTimeout(() => {
206
- forget(self, id);
206
+ dropSettledRequest(self, id);
207
207
  retire(self, "a reply went silent");
208
208
  p.reject(new DbWsTransportError("ws reply went silent", true));
209
209
  }, WS_IDLE_TIMEOUT_MS);
@@ -214,7 +214,7 @@ function deliver(self, msg) {
214
214
  return;
215
215
  }
216
216
  clearPendingTimer(p);
217
- forget(self, msg.id);
217
+ dropSettledRequest(self, msg.id);
218
218
  if (msg.error) {
219
219
  p.reject(
220
220
  new MindStudioError(
@@ -235,7 +235,7 @@ function failTransport(self, id, err) {
235
235
  return;
236
236
  }
237
237
  clearPendingTimer(p);
238
- forget(self, id);
238
+ dropSettledRequest(self, id);
239
239
  p.reject(err);
240
240
  }
241
241
  function getOrOpen(url, token) {
@@ -388,7 +388,7 @@ async function executeDbBatchOverWs(url, token, databaseId, queries) {
388
388
  return await new Promise((resolve, reject) => {
389
389
  const pending = { resolve, reject, timer: null, acked: false };
390
390
  pending.timer = setTimeout(() => {
391
- forget(self, id);
391
+ dropSettledRequest(self, id);
392
392
  retire(self, "a request went unacknowledged");
393
393
  reject(new DbWsTransportError("ws ack timed out", true));
394
394
  }, WS_ACK_TIMEOUT_MS);
@@ -403,7 +403,7 @@ async function executeDbBatchOverWs(url, token, databaseId, queries) {
403
403
  complete = true;
404
404
  } catch (err) {
405
405
  clearPendingTimer(pending);
406
- forget(self, id);
406
+ dropSettledRequest(self, id);
407
407
  if (started) {
408
408
  retire(self, "a partial request upload failed");
409
409
  }
@@ -1608,7 +1608,7 @@ function nestedComparison(node, negated, params) {
1608
1608
  function withNulls(core, field, nullsMatch) {
1609
1609
  return nullsMatch ? `(${core} OR ${field.sql} IS NULL)` : core;
1610
1610
  }
1611
- function readsBackAsWritten(value) {
1611
+ function isNonJsonString(value) {
1612
1612
  if (typeof value !== "string") {
1613
1613
  return false;
1614
1614
  }
@@ -1646,7 +1646,7 @@ function compileNode(node, negated, columns, params) {
1646
1646
  const type = column(node.field)?.type;
1647
1647
  if (type === "json") {
1648
1648
  const strictEquals = node.op === "===" ? !negated : node.op === "!==" ? negated : null;
1649
- return strictEquals !== null && readsBackAsWritten(node.value) ? jsonColumnIn(node.field, [node.value], !strictEquals, params) : null;
1649
+ return strictEquals !== null && isNonJsonString(node.value) ? jsonColumnIn(node.field, [node.value], !strictEquals, params) : null;
1650
1650
  }
1651
1651
  if (!type || typeof node.value !== VALUE_KIND[type]) {
1652
1652
  return null;
@@ -1676,7 +1676,7 @@ function compileNode(node, negated, columns, params) {
1676
1676
  case "in": {
1677
1677
  const type = column(node.field)?.type;
1678
1678
  if (type === "json") {
1679
- return node.values.every(readsBackAsWritten) ? jsonColumnIn(node.field, node.values, negated, params) : null;
1679
+ return node.values.every(isNonJsonString) ? jsonColumnIn(node.field, node.values, negated, params) : null;
1680
1680
  }
1681
1681
  if (!type || node.values.some(
1682
1682
  (v) => v !== null && v !== void 0 && typeof v !== VALUE_KIND[type]