@mindstudio-ai/agent 0.1.37 → 0.1.38
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 +14 -6
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +14 -6
- package/package.json +1 -1
package/dist/postinstall.js
CHANGED
|
@@ -1516,6 +1516,11 @@ function deserializeRow(row, columns) {
|
|
|
1516
1516
|
} catch {
|
|
1517
1517
|
result[key] = value;
|
|
1518
1518
|
}
|
|
1519
|
+
} else if (col?.type === "boolean" && typeof value === "number") {
|
|
1520
|
+
result[key] = value !== 0;
|
|
1521
|
+
} else if (col?.type === "number" && typeof value === "string") {
|
|
1522
|
+
const num = Number(value);
|
|
1523
|
+
result[key] = Number.isNaN(num) ? value : num;
|
|
1519
1524
|
} else {
|
|
1520
1525
|
result[key] = value;
|
|
1521
1526
|
}
|
|
@@ -4718,6 +4723,8 @@ function buildReferenceDocs(data) {
|
|
|
4718
4723
|
|
|
4719
4724
|
Database queries (Query, Mutation) support both \`await\` and \`.then()/.catch()\` \u2014 use standard try/catch with await or chain \`.catch()\` directly.
|
|
4720
4725
|
|
|
4726
|
+
Auth + DB identity: When an app has auth enabled, the authenticated user IS a row in the app's users table. \`auth.userId\` is the row's \`id\` \u2014 do NOT add a separate \`userId\` column. Access user data with \`Users.get(auth.userId)\`. The platform creates the user row on first login and manages the \`email\`, \`phone\`, and \`roles\` columns automatically.
|
|
4727
|
+
|
|
4721
4728
|
Table options: \`db.defineTable<T>(name, { unique, defaults })\`.
|
|
4722
4729
|
- \`unique: [['email'], ['userId', 'orgId']]\` \u2014 declares unique constraints (SDK communicates to platform, enables upsert).
|
|
4723
4730
|
- \`defaults: { status: 'pending' }\` \u2014 client-side defaults applied in push() and upsert().
|
|
@@ -4793,6 +4800,7 @@ var init_instructions = __esm({
|
|
|
4793
4800
|
- **Missing MindStudioError handling** \u2014 the SDK has structured errors with \`code\`, \`status\`, \`details\`. Catching generic \`Error\` loses actionable information. Always include \`MindStudioError\` handling in code examples.
|
|
4794
4801
|
- **One-at-a-time db writes when batch exists** \u2014 N sequential \`update()\` or \`push()\` calls should be a single \`db.batch()\` call. One round trip instead of N.
|
|
4795
4802
|
- **Hardcoded model IDs without context** \u2014 model IDs can change. When writing code with a specific model, include a comment noting which model it is and why it was chosen, so the caller can swap it later.
|
|
4803
|
+
- **Adding a userId column to the auth users table** \u2014 \`auth.userId\` IS the row's \`id\` in the users table. The platform creates the row on login. Don't add a separate \`userId\` column \u2014 just use \`Users.get(auth.userId)\` to access the user's row.
|
|
4796
4804
|
- Do not recommend using thread persistence. This is an advanced feature - if someone needs this they will discover it on their own.
|
|
4797
4805
|
- Generate text is great for one-off text generation requests to models. For sustained conversations, conversations that require history, persistence, or multiple threads or tool use, recommend that the developer add an Agent interface to their MindStudio app and use that directly. They will understand what you mean by this.
|
|
4798
4806
|
</anti_patterns>
|
|
@@ -5114,7 +5122,7 @@ async function startMcpServer(options) {
|
|
|
5114
5122
|
capabilities: { tools: {} },
|
|
5115
5123
|
serverInfo: {
|
|
5116
5124
|
name: "mindstudio-agent",
|
|
5117
|
-
version: "0.1.
|
|
5125
|
+
version: "0.1.38"
|
|
5118
5126
|
},
|
|
5119
5127
|
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.'
|
|
5120
5128
|
});
|
|
@@ -5975,7 +5983,7 @@ function isNewerVersion(current, latest) {
|
|
|
5975
5983
|
return false;
|
|
5976
5984
|
}
|
|
5977
5985
|
async function checkForUpdate() {
|
|
5978
|
-
const currentVersion = "0.1.
|
|
5986
|
+
const currentVersion = "0.1.38";
|
|
5979
5987
|
if (!currentVersion) return null;
|
|
5980
5988
|
try {
|
|
5981
5989
|
const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
@@ -6004,7 +6012,7 @@ async function checkForUpdate() {
|
|
|
6004
6012
|
}
|
|
6005
6013
|
}
|
|
6006
6014
|
function printUpdateNotice(latestVersion) {
|
|
6007
|
-
const currentVersion = "0.1.
|
|
6015
|
+
const currentVersion = "0.1.38";
|
|
6008
6016
|
process.stderr.write(
|
|
6009
6017
|
`
|
|
6010
6018
|
${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
|
|
@@ -6017,7 +6025,7 @@ function isStandaloneBinary() {
|
|
|
6017
6025
|
return !argv1.includes("node_modules");
|
|
6018
6026
|
}
|
|
6019
6027
|
async function cmdUpdate() {
|
|
6020
|
-
const currentVersion = "0.1.
|
|
6028
|
+
const currentVersion = "0.1.38";
|
|
6021
6029
|
process.stderr.write(
|
|
6022
6030
|
` ${ansi2.gray("Current version:")} ${currentVersion}
|
|
6023
6031
|
`
|
|
@@ -6132,7 +6140,7 @@ async function cmdLogin(options) {
|
|
|
6132
6140
|
process.stderr.write("\n");
|
|
6133
6141
|
printLogo();
|
|
6134
6142
|
process.stderr.write("\n");
|
|
6135
|
-
const ver = "0.1.
|
|
6143
|
+
const ver = "0.1.38";
|
|
6136
6144
|
process.stderr.write(
|
|
6137
6145
|
` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
|
|
6138
6146
|
`
|
|
@@ -6443,7 +6451,7 @@ async function main() {
|
|
|
6443
6451
|
try {
|
|
6444
6452
|
if (command === "version" || command === "-v") {
|
|
6445
6453
|
process.stdout.write(
|
|
6446
|
-
"0.1.
|
|
6454
|
+
"0.1.38\n"
|
|
6447
6455
|
);
|
|
6448
6456
|
return;
|
|
6449
6457
|
}
|