@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.
- package/dist/cli.js +38 -14
- package/dist/index.d.ts +7 -4
- package/dist/index.js +34 -10
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +38 -14
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -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([
|
|
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
|
|
3611
|
-
|
|
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(
|
|
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.
|
|
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
|
});
|
|
@@ -4776,7 +4800,7 @@ function isNewerVersion(current, latest) {
|
|
|
4776
4800
|
return false;
|
|
4777
4801
|
}
|
|
4778
4802
|
async function checkForUpdate() {
|
|
4779
|
-
const currentVersion = "0.1.
|
|
4803
|
+
const currentVersion = "0.1.12";
|
|
4780
4804
|
if (!currentVersion) return null;
|
|
4781
4805
|
try {
|
|
4782
4806
|
const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
@@ -4805,7 +4829,7 @@ async function checkForUpdate() {
|
|
|
4805
4829
|
}
|
|
4806
4830
|
}
|
|
4807
4831
|
function printUpdateNotice(latestVersion) {
|
|
4808
|
-
const currentVersion = "0.1.
|
|
4832
|
+
const currentVersion = "0.1.12";
|
|
4809
4833
|
process.stderr.write(
|
|
4810
4834
|
`
|
|
4811
4835
|
${ansi.cyanBright("Update available")} ${ansi.gray(currentVersion + " \u2192")} ${ansi.cyanBold(latestVersion)}
|
|
@@ -4880,7 +4904,7 @@ async function cmdLogin(options) {
|
|
|
4880
4904
|
process.stderr.write("\n");
|
|
4881
4905
|
printLogo();
|
|
4882
4906
|
process.stderr.write("\n");
|
|
4883
|
-
const ver = "0.1.
|
|
4907
|
+
const ver = "0.1.12";
|
|
4884
4908
|
process.stderr.write(
|
|
4885
4909
|
` ${ansi.bold("MindStudio Agent")} ${ver ? " " + ansi.gray("v" + ver) : ""}
|
|
4886
4910
|
`
|
package/dist/index.d.ts
CHANGED
|
@@ -535,11 +535,14 @@ declare const Roles: Record<string, string>;
|
|
|
535
535
|
* Names of columns that the platform manages automatically.
|
|
536
536
|
*
|
|
537
537
|
* - `id`: UUID primary key, generated on INSERT
|
|
538
|
-
* - `
|
|
539
|
-
* - `
|
|
540
|
-
* - `
|
|
538
|
+
* - `created_at`: unix timestamp (ms), set on INSERT
|
|
539
|
+
* - `updated_at`: unix timestamp (ms), set on INSERT and every UPDATE
|
|
540
|
+
* - `last_updated_by`: reference to the run ID that last wrote this row
|
|
541
|
+
*
|
|
542
|
+
* Both snake_case (platform convention) and camelCase (legacy) are
|
|
543
|
+
* stripped to support either naming convention in table interfaces.
|
|
541
544
|
*/
|
|
542
|
-
type SystemFields = 'id' | 'createdAt' | 'updatedAt' | 'lastUpdatedBy';
|
|
545
|
+
type SystemFields = 'id' | 'created_at' | 'createdAt' | 'updated_at' | 'updatedAt' | 'last_updated_by' | 'lastUpdatedBy';
|
|
543
546
|
/**
|
|
544
547
|
* Input type for `Table.push()`. Excludes system-managed fields.
|
|
545
548
|
* Optional fields in T remain optional.
|
package/dist/index.js
CHANGED
|
@@ -302,7 +302,15 @@ function buildDelete(table, where, whereParams) {
|
|
|
302
302
|
if (where) sql += ` WHERE ${where}`;
|
|
303
303
|
return { sql, params: whereParams?.length ? whereParams : void 0 };
|
|
304
304
|
}
|
|
305
|
-
var SYSTEM_COLUMNS = /* @__PURE__ */ new Set([
|
|
305
|
+
var SYSTEM_COLUMNS = /* @__PURE__ */ new Set([
|
|
306
|
+
"id",
|
|
307
|
+
"created_at",
|
|
308
|
+
"createdAt",
|
|
309
|
+
"updated_at",
|
|
310
|
+
"updatedAt",
|
|
311
|
+
"last_updated_by",
|
|
312
|
+
"lastUpdatedBy"
|
|
313
|
+
]);
|
|
306
314
|
function stripSystemColumns(data) {
|
|
307
315
|
const result = {};
|
|
308
316
|
for (const [key, value] of Object.entries(data)) {
|
|
@@ -2050,10 +2058,12 @@ var MindStudioAgent = class {
|
|
|
2050
2058
|
);
|
|
2051
2059
|
}
|
|
2052
2060
|
if (!res.ok) {
|
|
2061
|
+
const errorBody = await res.json().catch(() => ({}));
|
|
2053
2062
|
throw new MindStudioError(
|
|
2054
|
-
`Poll request failed: ${res.status} ${res.statusText}`,
|
|
2055
|
-
"poll_error",
|
|
2056
|
-
res.status
|
|
2063
|
+
errorBody.message ?? errorBody.error ?? `Poll request failed: ${res.status} ${res.statusText}`,
|
|
2064
|
+
errorBody.code ?? "poll_error",
|
|
2065
|
+
res.status,
|
|
2066
|
+
errorBody
|
|
2057
2067
|
);
|
|
2058
2068
|
}
|
|
2059
2069
|
const poll = await res.json();
|
|
@@ -2318,12 +2328,24 @@ var MindStudioAgent = class {
|
|
|
2318
2328
|
});
|
|
2319
2329
|
if (!res.ok) {
|
|
2320
2330
|
let message = `Database query failed: ${res.status} ${res.statusText}`;
|
|
2331
|
+
let code = "db_query_error";
|
|
2321
2332
|
try {
|
|
2322
|
-
const
|
|
2323
|
-
|
|
2333
|
+
const text = await res.text();
|
|
2334
|
+
try {
|
|
2335
|
+
const body = JSON.parse(text);
|
|
2336
|
+
const errMsg = body.error ?? body.message ?? body.details;
|
|
2337
|
+
if (errMsg) message = errMsg;
|
|
2338
|
+
if (body.code) code = body.code;
|
|
2339
|
+
} catch {
|
|
2340
|
+
if (text && text.length < 500) message = text;
|
|
2341
|
+
}
|
|
2324
2342
|
} catch {
|
|
2325
2343
|
}
|
|
2326
|
-
throw new MindStudioError(
|
|
2344
|
+
throw new MindStudioError(
|
|
2345
|
+
`[db] ${message}`,
|
|
2346
|
+
code,
|
|
2347
|
+
res.status
|
|
2348
|
+
);
|
|
2327
2349
|
}
|
|
2328
2350
|
const data = await res.json();
|
|
2329
2351
|
return data.results;
|
|
@@ -2507,10 +2529,12 @@ var MindStudioAgent = class {
|
|
|
2507
2529
|
headers: options.type ? { "Content-Type": options.type } : {}
|
|
2508
2530
|
});
|
|
2509
2531
|
if (!res.ok) {
|
|
2532
|
+
const errorBody = await res.json().catch(() => ({}));
|
|
2510
2533
|
throw new MindStudioError(
|
|
2511
|
-
`Upload failed: ${res.status} ${res.statusText}`,
|
|
2512
|
-
"upload_error",
|
|
2513
|
-
res.status
|
|
2534
|
+
errorBody.message ?? errorBody.error ?? `Upload failed: ${res.status} ${res.statusText}`,
|
|
2535
|
+
errorBody.code ?? "upload_error",
|
|
2536
|
+
res.status,
|
|
2537
|
+
errorBody
|
|
2514
2538
|
);
|
|
2515
2539
|
}
|
|
2516
2540
|
return { url: data.url };
|