@mindstudio-ai/agent 0.1.42 → 0.1.44
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 +23 -7
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +23 -7
- package/package.json +1 -1
package/dist/postinstall.js
CHANGED
|
@@ -1541,6 +1541,12 @@ function deserializeRow(row, columns) {
|
|
|
1541
1541
|
} else if (col?.type === "number" && typeof value === "string") {
|
|
1542
1542
|
const num = Number(value);
|
|
1543
1543
|
result[key] = Number.isNaN(num) ? value : num;
|
|
1544
|
+
} else if (!col && typeof value === "string" && (value[0] === "[" || value[0] === "{")) {
|
|
1545
|
+
try {
|
|
1546
|
+
result[key] = JSON.parse(value);
|
|
1547
|
+
} catch {
|
|
1548
|
+
result[key] = value;
|
|
1549
|
+
}
|
|
1544
1550
|
} else {
|
|
1545
1551
|
result[key] = value;
|
|
1546
1552
|
}
|
|
@@ -3489,6 +3495,9 @@ function resolveStepType(name) {
|
|
|
3489
3495
|
return meta ? meta.stepType : name;
|
|
3490
3496
|
}
|
|
3491
3497
|
function resolveToken(provided, config) {
|
|
3498
|
+
const rctx = getRequestContext();
|
|
3499
|
+
if (rctx?.callbackToken)
|
|
3500
|
+
return { token: rctx.callbackToken, authType: "internal" };
|
|
3492
3501
|
if (process.env.CALLBACK_TOKEN)
|
|
3493
3502
|
return { token: process.env.CALLBACK_TOKEN, authType: "internal" };
|
|
3494
3503
|
if (provided) return { token: provided, authType: "apiKey" };
|
|
@@ -3592,7 +3601,8 @@ var init_client = __esm({
|
|
|
3592
3601
|
constructor(options = {}) {
|
|
3593
3602
|
const config = loadConfig();
|
|
3594
3603
|
const { token, authType } = resolveToken(options.apiKey, config);
|
|
3595
|
-
const
|
|
3604
|
+
const rctx = getRequestContext();
|
|
3605
|
+
const baseUrl = options.baseUrl ?? rctx?.remoteHostname ?? process.env.MINDSTUDIO_BASE_URL ?? process.env.REMOTE_HOSTNAME ?? config.baseUrl ?? DEFAULT_BASE_URL;
|
|
3596
3606
|
this._reuseThreadId = options.reuseThreadId ?? /^(true|1)$/i.test(process.env.MINDSTUDIO_REUSE_THREAD_ID ?? "");
|
|
3597
3607
|
this._appId = options.appId ?? process.env.MINDSTUDIO_APP_ID ?? void 0;
|
|
3598
3608
|
this._authType = authType;
|
|
@@ -4398,6 +4408,12 @@ var init_client = __esm({
|
|
|
4398
4408
|
(d) => d.tables.some((t) => t.name === name)
|
|
4399
4409
|
);
|
|
4400
4410
|
}
|
|
4411
|
+
if (tableConfig.columns.length === 0 && targetDb) {
|
|
4412
|
+
const tableSchema = targetDb.tables.find((t) => t.name === name);
|
|
4413
|
+
if (tableSchema) {
|
|
4414
|
+
tableConfig.columns = tableSchema.schema;
|
|
4415
|
+
}
|
|
4416
|
+
}
|
|
4401
4417
|
const databaseId = targetDb?.id ?? databases[0]?.id ?? "";
|
|
4402
4418
|
return agent._executeDbBatch(databaseId, queries);
|
|
4403
4419
|
}
|
|
@@ -5193,7 +5209,7 @@ async function startMcpServer(options) {
|
|
|
5193
5209
|
capabilities: { tools: {} },
|
|
5194
5210
|
serverInfo: {
|
|
5195
5211
|
name: "mindstudio-agent",
|
|
5196
|
-
version: "0.1.
|
|
5212
|
+
version: "0.1.44"
|
|
5197
5213
|
},
|
|
5198
5214
|
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 or icon, call `uploadFile` to upload it, then `changeProfilePicture` with the returned URL.\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.'
|
|
5199
5215
|
});
|
|
@@ -6054,7 +6070,7 @@ function isNewerVersion(current, latest) {
|
|
|
6054
6070
|
return false;
|
|
6055
6071
|
}
|
|
6056
6072
|
async function checkForUpdate() {
|
|
6057
|
-
const currentVersion = "0.1.
|
|
6073
|
+
const currentVersion = "0.1.44";
|
|
6058
6074
|
if (!currentVersion) return null;
|
|
6059
6075
|
try {
|
|
6060
6076
|
const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
@@ -6083,7 +6099,7 @@ async function checkForUpdate() {
|
|
|
6083
6099
|
}
|
|
6084
6100
|
}
|
|
6085
6101
|
function printUpdateNotice(latestVersion) {
|
|
6086
|
-
const currentVersion = "0.1.
|
|
6102
|
+
const currentVersion = "0.1.44";
|
|
6087
6103
|
process.stderr.write(
|
|
6088
6104
|
`
|
|
6089
6105
|
${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
|
|
@@ -6096,7 +6112,7 @@ function isStandaloneBinary() {
|
|
|
6096
6112
|
return !argv1.includes("node_modules");
|
|
6097
6113
|
}
|
|
6098
6114
|
async function cmdUpdate() {
|
|
6099
|
-
const currentVersion = "0.1.
|
|
6115
|
+
const currentVersion = "0.1.44";
|
|
6100
6116
|
process.stderr.write(
|
|
6101
6117
|
` ${ansi2.gray("Current version:")} ${currentVersion}
|
|
6102
6118
|
`
|
|
@@ -6211,7 +6227,7 @@ async function cmdLogin(options) {
|
|
|
6211
6227
|
process.stderr.write("\n");
|
|
6212
6228
|
printLogo();
|
|
6213
6229
|
process.stderr.write("\n");
|
|
6214
|
-
const ver = "0.1.
|
|
6230
|
+
const ver = "0.1.44";
|
|
6215
6231
|
process.stderr.write(
|
|
6216
6232
|
` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
|
|
6217
6233
|
`
|
|
@@ -6522,7 +6538,7 @@ async function main() {
|
|
|
6522
6538
|
try {
|
|
6523
6539
|
if (command === "version" || command === "-v") {
|
|
6524
6540
|
process.stdout.write(
|
|
6525
|
-
"0.1.
|
|
6541
|
+
"0.1.44\n"
|
|
6526
6542
|
);
|
|
6527
6543
|
return;
|
|
6528
6544
|
}
|