@mindstudio-ai/agent 0.1.27 → 0.1.28
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 +20 -9
- package/dist/index.d.ts +6 -0
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +20 -9
- package/package.json +1 -1
package/dist/postinstall.js
CHANGED
|
@@ -3355,6 +3355,17 @@ var init_client = __esm({
|
|
|
3355
3355
|
_db;
|
|
3356
3356
|
/** @internal Auth type — 'internal' for CALLBACK_TOKEN (managed mode), 'apiKey' otherwise. */
|
|
3357
3357
|
_authType;
|
|
3358
|
+
/**
|
|
3359
|
+
* @internal Resolve the current auth token. For internal (CALLBACK_TOKEN)
|
|
3360
|
+
* auth, re-reads the env var each time so that long-lived singleton
|
|
3361
|
+
* instances pick up token rotations from the host process.
|
|
3362
|
+
*/
|
|
3363
|
+
get _token() {
|
|
3364
|
+
if (this._authType === "internal" && process.env.CALLBACK_TOKEN) {
|
|
3365
|
+
return process.env.CALLBACK_TOKEN;
|
|
3366
|
+
}
|
|
3367
|
+
return this._httpConfig.token;
|
|
3368
|
+
}
|
|
3358
3369
|
constructor(options = {}) {
|
|
3359
3370
|
const config = loadConfig();
|
|
3360
3371
|
const { token, authType } = resolveToken(options.apiKey, config);
|
|
@@ -3453,7 +3464,7 @@ var init_client = __esm({
|
|
|
3453
3464
|
res = await fetch(url, {
|
|
3454
3465
|
method: "POST",
|
|
3455
3466
|
headers: {
|
|
3456
|
-
Authorization: `Bearer ${this.
|
|
3467
|
+
Authorization: `Bearer ${this._token}`,
|
|
3457
3468
|
"Content-Type": "application/json",
|
|
3458
3469
|
"User-Agent": "@mindstudio-ai/agent",
|
|
3459
3470
|
Accept: "text/event-stream"
|
|
@@ -3874,7 +3885,7 @@ var init_client = __esm({
|
|
|
3874
3885
|
method: "POST",
|
|
3875
3886
|
headers: {
|
|
3876
3887
|
"Content-Type": "application/json",
|
|
3877
|
-
Authorization: this.
|
|
3888
|
+
Authorization: this._token
|
|
3878
3889
|
},
|
|
3879
3890
|
body: JSON.stringify(body)
|
|
3880
3891
|
});
|
|
@@ -4029,7 +4040,7 @@ var init_client = __esm({
|
|
|
4029
4040
|
method: "POST",
|
|
4030
4041
|
headers: {
|
|
4031
4042
|
"Content-Type": "application/json",
|
|
4032
|
-
Authorization: this.
|
|
4043
|
+
Authorization: this._token
|
|
4033
4044
|
},
|
|
4034
4045
|
body: JSON.stringify({ databaseId, queries })
|
|
4035
4046
|
});
|
|
@@ -4807,7 +4818,7 @@ async function startMcpServer(options) {
|
|
|
4807
4818
|
capabilities: { tools: {} },
|
|
4808
4819
|
serverInfo: {
|
|
4809
4820
|
name: "mindstudio-agent",
|
|
4810
|
-
version: "0.1.
|
|
4821
|
+
version: "0.1.28"
|
|
4811
4822
|
},
|
|
4812
4823
|
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.'
|
|
4813
4824
|
});
|
|
@@ -5667,7 +5678,7 @@ function isNewerVersion(current, latest) {
|
|
|
5667
5678
|
return false;
|
|
5668
5679
|
}
|
|
5669
5680
|
async function checkForUpdate() {
|
|
5670
|
-
const currentVersion = "0.1.
|
|
5681
|
+
const currentVersion = "0.1.28";
|
|
5671
5682
|
if (!currentVersion) return null;
|
|
5672
5683
|
try {
|
|
5673
5684
|
const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
@@ -5696,7 +5707,7 @@ async function checkForUpdate() {
|
|
|
5696
5707
|
}
|
|
5697
5708
|
}
|
|
5698
5709
|
function printUpdateNotice(latestVersion) {
|
|
5699
|
-
const currentVersion = "0.1.
|
|
5710
|
+
const currentVersion = "0.1.28";
|
|
5700
5711
|
process.stderr.write(
|
|
5701
5712
|
`
|
|
5702
5713
|
${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
|
|
@@ -5709,7 +5720,7 @@ function isStandaloneBinary() {
|
|
|
5709
5720
|
return !argv1.includes("node_modules");
|
|
5710
5721
|
}
|
|
5711
5722
|
async function cmdUpdate() {
|
|
5712
|
-
const currentVersion = "0.1.
|
|
5723
|
+
const currentVersion = "0.1.28";
|
|
5713
5724
|
process.stderr.write(
|
|
5714
5725
|
` ${ansi2.gray("Current version:")} ${currentVersion}
|
|
5715
5726
|
`
|
|
@@ -5824,7 +5835,7 @@ async function cmdLogin(options) {
|
|
|
5824
5835
|
process.stderr.write("\n");
|
|
5825
5836
|
printLogo();
|
|
5826
5837
|
process.stderr.write("\n");
|
|
5827
|
-
const ver = "0.1.
|
|
5838
|
+
const ver = "0.1.28";
|
|
5828
5839
|
process.stderr.write(
|
|
5829
5840
|
` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
|
|
5830
5841
|
`
|
|
@@ -6135,7 +6146,7 @@ async function main() {
|
|
|
6135
6146
|
try {
|
|
6136
6147
|
if (command === "version" || command === "-v") {
|
|
6137
6148
|
process.stdout.write(
|
|
6138
|
-
"0.1.
|
|
6149
|
+
"0.1.28\n"
|
|
6139
6150
|
);
|
|
6140
6151
|
return;
|
|
6141
6152
|
}
|