@mindstudio-ai/agent 0.1.184 → 0.1.186

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,18 @@ 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.186
8
+
9
+ ### Fixed
10
+
11
+ - A filter predicate with a comment inside its expression compiles to SQL. The method bundle keeps a comment that sits before an operand, an argument or an array element, and the predicate compiler read it as code, so any such predicate (`filter`, `findOne`, `count`, `some`, `every`, `removeAll`) ran in JS over every row of the table, logging `unsupported syntax` or `could not parse expression`. Results were the same; the query was slow on a large table. Check: nothing. A comment moved out of a predicate to work around this can go back.
12
+
13
+ ## 0.1.185
14
+
15
+ ### New
16
+
17
+ - `@mindstudio-ai/agent/snippets` exports `monacoSnippets` and `blockTypeAliases` by themselves: plain data with no imports, for a code editor that runs in a browser. The main entry still exports both, but it's Node code, and a browser bundle of it has failed since 0.1.144, on its file imports. Check: browser code that imports either from `@mindstudio-ai/agent` imports it from `@mindstudio-ai/agent/snippets`.
18
+
7
19
  ## 0.1.184
8
20
 
9
21
  ### New
package/README.md CHANGED
@@ -675,10 +675,10 @@ import type {
675
675
 
676
676
  ## Snippets
677
677
 
678
- A `monacoSnippets` object is exported with field metadata and output keys for every method:
678
+ A `monacoSnippets` object is exported with field metadata and output keys for every method. It's for a code editor's completions, and an editor runs in a browser, so it has an entry of its own, `@mindstudio-ai/agent/snippets`: plain data with no imports, which any bundler can take. The main entry exports it too, but that entry is Node code and won't bundle for a browser.
679
679
 
680
680
  ```typescript
681
- import { monacoSnippets } from '@mindstudio-ai/agent';
681
+ import { monacoSnippets } from '@mindstudio-ai/agent/snippets';
682
682
 
683
683
  monacoSnippets.generateText;
684
684
  // {
@@ -690,7 +690,7 @@ monacoSnippets.generateText;
690
690
  For the 2 renamed step types, both the alias and original name appear as keys. A `blockTypeAliases` map is also exported for reverse-mapping:
691
691
 
692
692
  ```typescript
693
- import { blockTypeAliases } from '@mindstudio-ai/agent';
693
+ import { blockTypeAliases } from '@mindstudio-ai/agent/snippets';
694
694
  // { userMessage: "generateText", generatePdf: "generateAsset" }
695
695
  ```
696
696
 
package/dist/cli.js CHANGED
@@ -2294,6 +2294,19 @@ function tokenize(expr) {
2294
2294
  i++;
2295
2295
  continue;
2296
2296
  }
2297
+ if (ch === "/" && expr[i + 1] === "/") {
2298
+ const lineEnd = expr.slice(i).search(/[\n\r\u2028\u2029]/);
2299
+ i = lineEnd === -1 ? expr.length : i + lineEnd + 1;
2300
+ continue;
2301
+ }
2302
+ if (ch === "/" && expr[i + 1] === "*") {
2303
+ const close = expr.indexOf("*/", i + 2);
2304
+ if (close === -1) {
2305
+ throw new Unreadable("unterminated comment");
2306
+ }
2307
+ i = close + 2;
2308
+ continue;
2309
+ }
2297
2310
  if (ch === "'" || ch === '"' || ch === "`") {
2298
2311
  const read = readString(expr, i);
2299
2312
  tokens.push({ type: "string", value: read.value });
@@ -10258,7 +10271,7 @@ async function startMcpServer(options) {
10258
10271
  capabilities: { tools: {} },
10259
10272
  serverInfo: {
10260
10273
  name: "mindstudio-agent",
10261
- version: "0.1.184"
10274
+ version: "0.1.186"
10262
10275
  },
10263
10276
  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.'
10264
10277
  });
@@ -11298,7 +11311,7 @@ function isNewerVersion(current, latest) {
11298
11311
  return false;
11299
11312
  }
11300
11313
  async function checkForUpdate() {
11301
- const currentVersion = "0.1.184";
11314
+ const currentVersion = "0.1.186";
11302
11315
  if (!currentVersion || process.env.MINDSTUDIO_NO_UPDATE_CHECK) {
11303
11316
  return null;
11304
11317
  }
@@ -11333,7 +11346,7 @@ async function checkForUpdate() {
11333
11346
  }
11334
11347
  }
11335
11348
  function printUpdateNotice(latestVersion) {
11336
- const currentVersion = "0.1.184";
11349
+ const currentVersion = "0.1.186";
11337
11350
  process.stderr.write(
11338
11351
  `
11339
11352
  ${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
@@ -11346,7 +11359,7 @@ function isStandaloneBinary() {
11346
11359
  return !argv1.includes("node_modules");
11347
11360
  }
11348
11361
  async function cmdUpdate() {
11349
- const currentVersion = "0.1.184";
11362
+ const currentVersion = "0.1.186";
11350
11363
  process.stderr.write(
11351
11364
  ` ${ansi2.gray("Current version:")} ${currentVersion}
11352
11365
  `
@@ -11487,7 +11500,7 @@ async function cmdLogin(options) {
11487
11500
  process.stderr.write("\n");
11488
11501
  printLogo();
11489
11502
  process.stderr.write("\n");
11490
- const ver = "0.1.184";
11503
+ const ver = "0.1.186";
11491
11504
  process.stderr.write(
11492
11505
  ` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
11493
11506
  `
@@ -11817,7 +11830,7 @@ async function main() {
11817
11830
  const updatePromise = command !== "mcp" && command !== "login" && command !== "update" ? checkForUpdate() : Promise.resolve(null);
11818
11831
  try {
11819
11832
  if (command === "version" || command === "-v") {
11820
- process.stdout.write("0.1.184\n");
11833
+ process.stdout.write("0.1.186\n");
11821
11834
  return;
11822
11835
  }
11823
11836
  if (command === "login") {
@@ -27,8 +27,9 @@
27
27
  * no `NOT` ever meets an unknown.
28
28
  * - **The source isn't the author's.** A method's code is bundled by esbuild,
29
29
  * so `fn.toString()` is esbuild's printing of it: `5000` is `5e3`, `'Zürich'`
30
- * is `"Z\xFCrich"`, `undefined` is `void 0`, and a string holding both quote
31
- * kinds is a template literal. The tokenizer reads all of those as JS would.
30
+ * is `"Z\xFCrich"`, `undefined` is `void 0`, a string holding both quote
31
+ * kinds is a template literal, and a comment that leads an expression is
32
+ * still there. The tokenizer reads all of those as JS would.
32
33
  *
33
34
  * ## How it works
34
35
  *
package/dist/index.js CHANGED
@@ -1002,6 +1002,19 @@ function tokenize(expr) {
1002
1002
  i++;
1003
1003
  continue;
1004
1004
  }
1005
+ if (ch === "/" && expr[i + 1] === "/") {
1006
+ const lineEnd = expr.slice(i).search(/[\n\r\u2028\u2029]/);
1007
+ i = lineEnd === -1 ? expr.length : i + lineEnd + 1;
1008
+ continue;
1009
+ }
1010
+ if (ch === "/" && expr[i + 1] === "*") {
1011
+ const close = expr.indexOf("*/", i + 2);
1012
+ if (close === -1) {
1013
+ throw new Unreadable("unterminated comment");
1014
+ }
1015
+ i = close + 2;
1016
+ continue;
1017
+ }
1005
1018
  if (ch === "'" || ch === '"' || ch === "`") {
1006
1019
  const read = readString(expr, i);
1007
1020
  tokens.push({ type: "string", value: read.value });