@mindstudio-ai/agent 0.1.11 → 0.1.12

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.
@@ -1523,7 +1523,15 @@ var init_sql = __esm({
1523
1523
  "src/db/sql.ts"() {
1524
1524
  "use strict";
1525
1525
  USER_PREFIX = "@@user@@";
1526
- SYSTEM_COLUMNS = /* @__PURE__ */ new Set(["id", "createdAt", "updatedAt", "lastUpdatedBy"]);
1526
+ SYSTEM_COLUMNS = /* @__PURE__ */ new Set([
1527
+ "id",
1528
+ "created_at",
1529
+ "createdAt",
1530
+ "updated_at",
1531
+ "updatedAt",
1532
+ "last_updated_by",
1533
+ "lastUpdatedBy"
1534
+ ]);
1527
1535
  }
1528
1536
  });
1529
1537
 
@@ -3338,10 +3346,12 @@ var init_client = __esm({
3338
3346
  );
3339
3347
  }
3340
3348
  if (!res.ok) {
3349
+ const errorBody = await res.json().catch(() => ({}));
3341
3350
  throw new MindStudioError(
3342
- `Poll request failed: ${res.status} ${res.statusText}`,
3343
- "poll_error",
3344
- res.status
3351
+ errorBody.message ?? errorBody.error ?? `Poll request failed: ${res.status} ${res.statusText}`,
3352
+ errorBody.code ?? "poll_error",
3353
+ res.status,
3354
+ errorBody
3345
3355
  );
3346
3356
  }
3347
3357
  const poll = await res.json();
@@ -3606,12 +3616,24 @@ var init_client = __esm({
3606
3616
  });
3607
3617
  if (!res.ok) {
3608
3618
  let message = `Database query failed: ${res.status} ${res.statusText}`;
3619
+ let code = "db_query_error";
3609
3620
  try {
3610
- const body = await res.json();
3611
- if (body.error) message = body.error;
3621
+ const text = await res.text();
3622
+ try {
3623
+ const body = JSON.parse(text);
3624
+ const errMsg = body.error ?? body.message ?? body.details;
3625
+ if (errMsg) message = errMsg;
3626
+ if (body.code) code = body.code;
3627
+ } catch {
3628
+ if (text && text.length < 500) message = text;
3629
+ }
3612
3630
  } catch {
3613
3631
  }
3614
- throw new MindStudioError(message, "db_query_error", res.status);
3632
+ throw new MindStudioError(
3633
+ `[db] ${message}`,
3634
+ code,
3635
+ res.status
3636
+ );
3615
3637
  }
3616
3638
  const data = await res.json();
3617
3639
  return data.results;
@@ -3795,10 +3817,12 @@ var init_client = __esm({
3795
3817
  headers: options.type ? { "Content-Type": options.type } : {}
3796
3818
  });
3797
3819
  if (!res.ok) {
3820
+ const errorBody = await res.json().catch(() => ({}));
3798
3821
  throw new MindStudioError(
3799
- `Upload failed: ${res.status} ${res.statusText}`,
3800
- "upload_error",
3801
- res.status
3822
+ errorBody.message ?? errorBody.error ?? `Upload failed: ${res.status} ${res.statusText}`,
3823
+ errorBody.code ?? "upload_error",
3824
+ res.status,
3825
+ errorBody
3802
3826
  );
3803
3827
  }
3804
3828
  return { url: data.url };
@@ -3868,7 +3892,7 @@ async function startMcpServer(options) {
3868
3892
  capabilities: { tools: {} },
3869
3893
  serverInfo: {
3870
3894
  name: "mindstudio-agent",
3871
- version: "0.1.11"
3895
+ version: "0.1.12"
3872
3896
  },
3873
3897
  instructions: "Welcome to MindStudio \u2014 a platform with 200+ AI models, 850+ third-party integrations, and pre-built agents.\n\nGetting started:\n1. Call `listAgents` to verify your connection and see available agents.\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. This helps users identify your requests in their logs.\n4. 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."
3874
3898
  });
@@ -4688,7 +4712,7 @@ function isNewerVersion(current, latest) {
4688
4712
  return false;
4689
4713
  }
4690
4714
  async function checkForUpdate() {
4691
- const currentVersion = "0.1.11";
4715
+ const currentVersion = "0.1.12";
4692
4716
  if (!currentVersion) return null;
4693
4717
  try {
4694
4718
  const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -4717,7 +4741,7 @@ async function checkForUpdate() {
4717
4741
  }
4718
4742
  }
4719
4743
  function printUpdateNotice(latestVersion) {
4720
- const currentVersion = "0.1.11";
4744
+ const currentVersion = "0.1.12";
4721
4745
  process.stderr.write(
4722
4746
  `
4723
4747
  ${ansi.cyanBright("Update available")} ${ansi.gray(currentVersion + " \u2192")} ${ansi.cyanBold(latestVersion)}
@@ -4772,7 +4796,7 @@ async function cmdLogin(options) {
4772
4796
  process.stderr.write("\n");
4773
4797
  printLogo();
4774
4798
  process.stderr.write("\n");
4775
- const ver = "0.1.11";
4799
+ const ver = "0.1.12";
4776
4800
  process.stderr.write(
4777
4801
  ` ${ansi.bold("MindStudio Agent")} ${ver ? " " + ansi.gray("v" + ver) : ""}
4778
4802
  `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/agent",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "TypeScript SDK for MindStudio direct step execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",