@mindstudio-ai/remy 0.1.167 → 0.1.169
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/headless.js +103 -20
- package/dist/index.js +103 -20
- package/package.json +1 -1
package/dist/headless.js
CHANGED
|
@@ -1574,12 +1574,15 @@ var confirmDestructiveActionTool = {
|
|
|
1574
1574
|
|
|
1575
1575
|
// src/subagents/common/runCli.ts
|
|
1576
1576
|
import { spawn } from "child_process";
|
|
1577
|
-
function runCli(
|
|
1577
|
+
function runCli(command, args, options) {
|
|
1578
1578
|
return new Promise((resolve2) => {
|
|
1579
1579
|
const timeout = options?.timeout ?? 6e4;
|
|
1580
1580
|
const maxBuffer = options?.maxBuffer ?? 1024 * 1024;
|
|
1581
|
-
|
|
1582
|
-
|
|
1581
|
+
let finalArgs = args;
|
|
1582
|
+
if (options?.jsonLogs && !args.includes("--json-logs")) {
|
|
1583
|
+
finalArgs = args.length > 0 ? [args[0], "--json-logs", ...args.slice(1)] : ["--json-logs"];
|
|
1584
|
+
}
|
|
1585
|
+
const child = spawn(command, finalArgs, {
|
|
1583
1586
|
stdio: [options?.stdin ? "pipe" : "ignore", "pipe", "pipe"]
|
|
1584
1587
|
});
|
|
1585
1588
|
if (options?.stdin) {
|
|
@@ -1673,7 +1676,7 @@ var askMindStudioSdkTool = {
|
|
|
1673
1676
|
},
|
|
1674
1677
|
async execute(input, context) {
|
|
1675
1678
|
const query = input.query;
|
|
1676
|
-
return runCli(
|
|
1679
|
+
return runCli("mindstudio", ["ask", query], {
|
|
1677
1680
|
timeout: 2e5,
|
|
1678
1681
|
maxBuffer: 512 * 1024,
|
|
1679
1682
|
onLog: context?.onLog
|
|
@@ -1701,7 +1704,17 @@ var searchGoogleTool = {
|
|
|
1701
1704
|
async execute(input, context) {
|
|
1702
1705
|
const query = input.query;
|
|
1703
1706
|
return runCli(
|
|
1704
|
-
|
|
1707
|
+
"mindstudio",
|
|
1708
|
+
[
|
|
1709
|
+
"search-google",
|
|
1710
|
+
"--query",
|
|
1711
|
+
query,
|
|
1712
|
+
"--export-type",
|
|
1713
|
+
"json",
|
|
1714
|
+
"--output-key",
|
|
1715
|
+
"results",
|
|
1716
|
+
"--no-meta"
|
|
1717
|
+
],
|
|
1705
1718
|
{ maxBuffer: 512 * 1024, onLog: context?.onLog }
|
|
1706
1719
|
);
|
|
1707
1720
|
}
|
|
@@ -2649,7 +2662,19 @@ var VISION_MODEL_OVERRIDE = JSON.stringify({
|
|
|
2649
2662
|
async function analyzeImage(params) {
|
|
2650
2663
|
const { prompt, imageUrl, timeout = 2e5, onLog } = params;
|
|
2651
2664
|
return runCli(
|
|
2652
|
-
|
|
2665
|
+
"mindstudio",
|
|
2666
|
+
[
|
|
2667
|
+
"analyze-image",
|
|
2668
|
+
"--prompt",
|
|
2669
|
+
prompt,
|
|
2670
|
+
"--image-url",
|
|
2671
|
+
imageUrl,
|
|
2672
|
+
"--vision-model-override",
|
|
2673
|
+
JSON.stringify(VISION_MODEL_OVERRIDE),
|
|
2674
|
+
"--output-key",
|
|
2675
|
+
"analysis",
|
|
2676
|
+
"--no-meta"
|
|
2677
|
+
],
|
|
2653
2678
|
{ timeout, onLog }
|
|
2654
2679
|
);
|
|
2655
2680
|
}
|
|
@@ -3595,7 +3620,8 @@ var browserAutomationTool = {
|
|
|
3595
3620
|
}
|
|
3596
3621
|
}));
|
|
3597
3622
|
const batchResult = await runCli(
|
|
3598
|
-
|
|
3623
|
+
"mindstudio",
|
|
3624
|
+
["batch", "--no-meta", JSON.stringify(batchInput)],
|
|
3599
3625
|
{ timeout: 2e5 }
|
|
3600
3626
|
);
|
|
3601
3627
|
try {
|
|
@@ -3625,11 +3651,9 @@ var browserAutomationTool = {
|
|
|
3625
3651
|
context.subAgentMessages?.set(context.toolCallId, result.messages);
|
|
3626
3652
|
const ss = result.artifacts?.screenshotFullPage;
|
|
3627
3653
|
if (ss?.url) {
|
|
3628
|
-
return
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
...ss.styleMap ? { styleMap: ss.styleMap } : {}
|
|
3632
|
-
});
|
|
3654
|
+
return `${result.text}
|
|
3655
|
+
|
|
3656
|
+
`;
|
|
3633
3657
|
}
|
|
3634
3658
|
return result.text;
|
|
3635
3659
|
} finally {
|
|
@@ -3822,7 +3846,17 @@ var definition = {
|
|
|
3822
3846
|
};
|
|
3823
3847
|
async function execute(input, onLog) {
|
|
3824
3848
|
return runCli(
|
|
3825
|
-
|
|
3849
|
+
"mindstudio",
|
|
3850
|
+
[
|
|
3851
|
+
"search-google",
|
|
3852
|
+
"--query",
|
|
3853
|
+
input.query,
|
|
3854
|
+
"--export-type",
|
|
3855
|
+
"json",
|
|
3856
|
+
"--output-key",
|
|
3857
|
+
"results",
|
|
3858
|
+
"--no-meta"
|
|
3859
|
+
],
|
|
3826
3860
|
{ onLog }
|
|
3827
3861
|
);
|
|
3828
3862
|
}
|
|
@@ -3854,7 +3888,15 @@ async function execute2(input, onLog) {
|
|
|
3854
3888
|
pageOptions.screenshot = true;
|
|
3855
3889
|
}
|
|
3856
3890
|
return runCli(
|
|
3857
|
-
|
|
3891
|
+
"mindstudio",
|
|
3892
|
+
[
|
|
3893
|
+
"scrape-url",
|
|
3894
|
+
"--url",
|
|
3895
|
+
input.url,
|
|
3896
|
+
"--page-options",
|
|
3897
|
+
JSON.stringify(pageOptions),
|
|
3898
|
+
"--no-meta"
|
|
3899
|
+
],
|
|
3858
3900
|
{ onLog }
|
|
3859
3901
|
);
|
|
3860
3902
|
}
|
|
@@ -3914,7 +3956,21 @@ async function execute3(input, onLog) {
|
|
|
3914
3956
|
let imageUrl = url;
|
|
3915
3957
|
if (!isImageUrl) {
|
|
3916
3958
|
const ssUrl = await runCli(
|
|
3917
|
-
|
|
3959
|
+
"mindstudio",
|
|
3960
|
+
[
|
|
3961
|
+
"screenshot-url",
|
|
3962
|
+
"--url",
|
|
3963
|
+
url,
|
|
3964
|
+
"--mode",
|
|
3965
|
+
"viewport",
|
|
3966
|
+
"--width",
|
|
3967
|
+
"1440",
|
|
3968
|
+
"--delay",
|
|
3969
|
+
"2000",
|
|
3970
|
+
"--output-key",
|
|
3971
|
+
"screenshotUrl",
|
|
3972
|
+
"--no-meta"
|
|
3973
|
+
],
|
|
3918
3974
|
{ timeout: 12e4, onLog }
|
|
3919
3975
|
);
|
|
3920
3976
|
if (ssUrl.startsWith("Error")) {
|
|
@@ -4074,7 +4130,17 @@ ${context}
|
|
|
4074
4130
|
${brief}
|
|
4075
4131
|
</brief>`;
|
|
4076
4132
|
const enhanced = await runCli(
|
|
4077
|
-
|
|
4133
|
+
"mindstudio",
|
|
4134
|
+
[
|
|
4135
|
+
"generate-text",
|
|
4136
|
+
"--message",
|
|
4137
|
+
message,
|
|
4138
|
+
"--model-override",
|
|
4139
|
+
JSON.stringify(MODEL_OVERRIDE),
|
|
4140
|
+
"--output-key",
|
|
4141
|
+
"content",
|
|
4142
|
+
"--no-meta"
|
|
4143
|
+
],
|
|
4078
4144
|
{ timeout: 6e4, onLog }
|
|
4079
4145
|
);
|
|
4080
4146
|
return enhanced.trim();
|
|
@@ -4112,7 +4178,8 @@ async function generateImageAssets(opts) {
|
|
|
4112
4178
|
}
|
|
4113
4179
|
});
|
|
4114
4180
|
const url = await runCli(
|
|
4115
|
-
|
|
4181
|
+
"mindstudio",
|
|
4182
|
+
["generate-image", "--output-key", "imageUrl", "--no-meta"],
|
|
4116
4183
|
{ jsonLogs: true, timeout: 2e5, onLog, stdin: step }
|
|
4117
4184
|
);
|
|
4118
4185
|
imageUrls = [url];
|
|
@@ -4127,7 +4194,7 @@ async function generateImageAssets(opts) {
|
|
|
4127
4194
|
}
|
|
4128
4195
|
}
|
|
4129
4196
|
}));
|
|
4130
|
-
const batchResult = await runCli(
|
|
4197
|
+
const batchResult = await runCli("mindstudio", ["batch", "--no-meta"], {
|
|
4131
4198
|
jsonLogs: true,
|
|
4132
4199
|
timeout: 2e5,
|
|
4133
4200
|
onLog,
|
|
@@ -4149,7 +4216,15 @@ async function generateImageAssets(opts) {
|
|
|
4149
4216
|
return url;
|
|
4150
4217
|
}
|
|
4151
4218
|
const result = await runCli(
|
|
4152
|
-
|
|
4219
|
+
"mindstudio",
|
|
4220
|
+
[
|
|
4221
|
+
"remove-background-from-image",
|
|
4222
|
+
"--image-url",
|
|
4223
|
+
url,
|
|
4224
|
+
"--output-key",
|
|
4225
|
+
"imageUrl",
|
|
4226
|
+
"--no-meta"
|
|
4227
|
+
],
|
|
4153
4228
|
{ timeout: 2e5, onLog }
|
|
4154
4229
|
);
|
|
4155
4230
|
return result.startsWith("Error") ? url : result;
|
|
@@ -5116,7 +5191,15 @@ var scrapeWebUrlTool = {
|
|
|
5116
5191
|
pageOptions.screenshot = true;
|
|
5117
5192
|
}
|
|
5118
5193
|
return runCli(
|
|
5119
|
-
|
|
5194
|
+
"mindstudio",
|
|
5195
|
+
[
|
|
5196
|
+
"scrape-url",
|
|
5197
|
+
"--url",
|
|
5198
|
+
url,
|
|
5199
|
+
"--page-options",
|
|
5200
|
+
JSON.stringify(pageOptions),
|
|
5201
|
+
"--no-meta"
|
|
5202
|
+
],
|
|
5120
5203
|
{ onLog: context?.onLog }
|
|
5121
5204
|
);
|
|
5122
5205
|
}
|
package/dist/index.js
CHANGED
|
@@ -1115,12 +1115,15 @@ var init_confirmDestructiveAction = __esm({
|
|
|
1115
1115
|
|
|
1116
1116
|
// src/subagents/common/runCli.ts
|
|
1117
1117
|
import { spawn } from "child_process";
|
|
1118
|
-
function runCli(
|
|
1118
|
+
function runCli(command, args2, options) {
|
|
1119
1119
|
return new Promise((resolve2) => {
|
|
1120
1120
|
const timeout = options?.timeout ?? 6e4;
|
|
1121
1121
|
const maxBuffer = options?.maxBuffer ?? 1024 * 1024;
|
|
1122
|
-
|
|
1123
|
-
|
|
1122
|
+
let finalArgs = args2;
|
|
1123
|
+
if (options?.jsonLogs && !args2.includes("--json-logs")) {
|
|
1124
|
+
finalArgs = args2.length > 0 ? [args2[0], "--json-logs", ...args2.slice(1)] : ["--json-logs"];
|
|
1125
|
+
}
|
|
1126
|
+
const child = spawn(command, finalArgs, {
|
|
1124
1127
|
stdio: [options?.stdin ? "pipe" : "ignore", "pipe", "pipe"]
|
|
1125
1128
|
});
|
|
1126
1129
|
if (options?.stdin) {
|
|
@@ -1224,7 +1227,7 @@ var init_sdkConsultant = __esm({
|
|
|
1224
1227
|
},
|
|
1225
1228
|
async execute(input, context) {
|
|
1226
1229
|
const query = input.query;
|
|
1227
|
-
return runCli(
|
|
1230
|
+
return runCli("mindstudio", ["ask", query], {
|
|
1228
1231
|
timeout: 2e5,
|
|
1229
1232
|
maxBuffer: 512 * 1024,
|
|
1230
1233
|
onLog: context?.onLog
|
|
@@ -1259,7 +1262,17 @@ var init_searchGoogle = __esm({
|
|
|
1259
1262
|
async execute(input, context) {
|
|
1260
1263
|
const query = input.query;
|
|
1261
1264
|
return runCli(
|
|
1262
|
-
|
|
1265
|
+
"mindstudio",
|
|
1266
|
+
[
|
|
1267
|
+
"search-google",
|
|
1268
|
+
"--query",
|
|
1269
|
+
query,
|
|
1270
|
+
"--export-type",
|
|
1271
|
+
"json",
|
|
1272
|
+
"--output-key",
|
|
1273
|
+
"results",
|
|
1274
|
+
"--no-meta"
|
|
1275
|
+
],
|
|
1263
1276
|
{ maxBuffer: 512 * 1024, onLog: context?.onLog }
|
|
1264
1277
|
);
|
|
1265
1278
|
}
|
|
@@ -2928,7 +2941,19 @@ var init_queryDatabase = __esm({
|
|
|
2928
2941
|
async function analyzeImage(params) {
|
|
2929
2942
|
const { prompt, imageUrl, timeout = 2e5, onLog } = params;
|
|
2930
2943
|
return runCli(
|
|
2931
|
-
|
|
2944
|
+
"mindstudio",
|
|
2945
|
+
[
|
|
2946
|
+
"analyze-image",
|
|
2947
|
+
"--prompt",
|
|
2948
|
+
prompt,
|
|
2949
|
+
"--image-url",
|
|
2950
|
+
imageUrl,
|
|
2951
|
+
"--vision-model-override",
|
|
2952
|
+
JSON.stringify(VISION_MODEL_OVERRIDE),
|
|
2953
|
+
"--output-key",
|
|
2954
|
+
"analysis",
|
|
2955
|
+
"--no-meta"
|
|
2956
|
+
],
|
|
2932
2957
|
{ timeout, onLog }
|
|
2933
2958
|
);
|
|
2934
2959
|
}
|
|
@@ -3951,7 +3976,8 @@ var init_browserAutomation = __esm({
|
|
|
3951
3976
|
}
|
|
3952
3977
|
}));
|
|
3953
3978
|
const batchResult = await runCli(
|
|
3954
|
-
|
|
3979
|
+
"mindstudio",
|
|
3980
|
+
["batch", "--no-meta", JSON.stringify(batchInput)],
|
|
3955
3981
|
{ timeout: 2e5 }
|
|
3956
3982
|
);
|
|
3957
3983
|
try {
|
|
@@ -3981,11 +4007,9 @@ var init_browserAutomation = __esm({
|
|
|
3981
4007
|
context.subAgentMessages?.set(context.toolCallId, result.messages);
|
|
3982
4008
|
const ss = result.artifacts?.screenshotFullPage;
|
|
3983
4009
|
if (ss?.url) {
|
|
3984
|
-
return
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
...ss.styleMap ? { styleMap: ss.styleMap } : {}
|
|
3988
|
-
});
|
|
4010
|
+
return `${result.text}
|
|
4011
|
+
|
|
4012
|
+
`;
|
|
3989
4013
|
}
|
|
3990
4014
|
return result.text;
|
|
3991
4015
|
} finally {
|
|
@@ -4180,7 +4204,17 @@ __export(searchGoogle_exports, {
|
|
|
4180
4204
|
});
|
|
4181
4205
|
async function execute(input, onLog) {
|
|
4182
4206
|
return runCli(
|
|
4183
|
-
|
|
4207
|
+
"mindstudio",
|
|
4208
|
+
[
|
|
4209
|
+
"search-google",
|
|
4210
|
+
"--query",
|
|
4211
|
+
input.query,
|
|
4212
|
+
"--export-type",
|
|
4213
|
+
"json",
|
|
4214
|
+
"--output-key",
|
|
4215
|
+
"results",
|
|
4216
|
+
"--no-meta"
|
|
4217
|
+
],
|
|
4184
4218
|
{ onLog }
|
|
4185
4219
|
);
|
|
4186
4220
|
}
|
|
@@ -4219,7 +4253,15 @@ async function execute2(input, onLog) {
|
|
|
4219
4253
|
pageOptions.screenshot = true;
|
|
4220
4254
|
}
|
|
4221
4255
|
return runCli(
|
|
4222
|
-
|
|
4256
|
+
"mindstudio",
|
|
4257
|
+
[
|
|
4258
|
+
"scrape-url",
|
|
4259
|
+
"--url",
|
|
4260
|
+
input.url,
|
|
4261
|
+
"--page-options",
|
|
4262
|
+
JSON.stringify(pageOptions),
|
|
4263
|
+
"--no-meta"
|
|
4264
|
+
],
|
|
4223
4265
|
{ onLog }
|
|
4224
4266
|
);
|
|
4225
4267
|
}
|
|
@@ -4259,7 +4301,21 @@ async function execute3(input, onLog) {
|
|
|
4259
4301
|
let imageUrl = url;
|
|
4260
4302
|
if (!isImageUrl) {
|
|
4261
4303
|
const ssUrl = await runCli(
|
|
4262
|
-
|
|
4304
|
+
"mindstudio",
|
|
4305
|
+
[
|
|
4306
|
+
"screenshot-url",
|
|
4307
|
+
"--url",
|
|
4308
|
+
url,
|
|
4309
|
+
"--mode",
|
|
4310
|
+
"viewport",
|
|
4311
|
+
"--width",
|
|
4312
|
+
"1440",
|
|
4313
|
+
"--delay",
|
|
4314
|
+
"2000",
|
|
4315
|
+
"--output-key",
|
|
4316
|
+
"screenshotUrl",
|
|
4317
|
+
"--no-meta"
|
|
4318
|
+
],
|
|
4263
4319
|
{ timeout: 12e4, onLog }
|
|
4264
4320
|
);
|
|
4265
4321
|
if (ssUrl.startsWith("Error")) {
|
|
@@ -4471,7 +4527,17 @@ ${context}
|
|
|
4471
4527
|
${brief}
|
|
4472
4528
|
</brief>`;
|
|
4473
4529
|
const enhanced = await runCli(
|
|
4474
|
-
|
|
4530
|
+
"mindstudio",
|
|
4531
|
+
[
|
|
4532
|
+
"generate-text",
|
|
4533
|
+
"--message",
|
|
4534
|
+
message,
|
|
4535
|
+
"--model-override",
|
|
4536
|
+
JSON.stringify(MODEL_OVERRIDE),
|
|
4537
|
+
"--output-key",
|
|
4538
|
+
"content",
|
|
4539
|
+
"--no-meta"
|
|
4540
|
+
],
|
|
4475
4541
|
{ timeout: 6e4, onLog }
|
|
4476
4542
|
);
|
|
4477
4543
|
return enhanced.trim();
|
|
@@ -4524,7 +4590,8 @@ async function generateImageAssets(opts) {
|
|
|
4524
4590
|
}
|
|
4525
4591
|
});
|
|
4526
4592
|
const url = await runCli(
|
|
4527
|
-
|
|
4593
|
+
"mindstudio",
|
|
4594
|
+
["generate-image", "--output-key", "imageUrl", "--no-meta"],
|
|
4528
4595
|
{ jsonLogs: true, timeout: 2e5, onLog, stdin: step }
|
|
4529
4596
|
);
|
|
4530
4597
|
imageUrls = [url];
|
|
@@ -4539,7 +4606,7 @@ async function generateImageAssets(opts) {
|
|
|
4539
4606
|
}
|
|
4540
4607
|
}
|
|
4541
4608
|
}));
|
|
4542
|
-
const batchResult = await runCli(
|
|
4609
|
+
const batchResult = await runCli("mindstudio", ["batch", "--no-meta"], {
|
|
4543
4610
|
jsonLogs: true,
|
|
4544
4611
|
timeout: 2e5,
|
|
4545
4612
|
onLog,
|
|
@@ -4561,7 +4628,15 @@ async function generateImageAssets(opts) {
|
|
|
4561
4628
|
return url;
|
|
4562
4629
|
}
|
|
4563
4630
|
const result = await runCli(
|
|
4564
|
-
|
|
4631
|
+
"mindstudio",
|
|
4632
|
+
[
|
|
4633
|
+
"remove-background-from-image",
|
|
4634
|
+
"--image-url",
|
|
4635
|
+
url,
|
|
4636
|
+
"--output-key",
|
|
4637
|
+
"imageUrl",
|
|
4638
|
+
"--no-meta"
|
|
4639
|
+
],
|
|
4565
4640
|
{ timeout: 2e5, onLog }
|
|
4566
4641
|
);
|
|
4567
4642
|
return result.startsWith("Error") ? url : result;
|
|
@@ -5698,7 +5773,15 @@ var init_scrapeWebUrl2 = __esm({
|
|
|
5698
5773
|
pageOptions.screenshot = true;
|
|
5699
5774
|
}
|
|
5700
5775
|
return runCli(
|
|
5701
|
-
|
|
5776
|
+
"mindstudio",
|
|
5777
|
+
[
|
|
5778
|
+
"scrape-url",
|
|
5779
|
+
"--url",
|
|
5780
|
+
url,
|
|
5781
|
+
"--page-options",
|
|
5782
|
+
JSON.stringify(pageOptions),
|
|
5783
|
+
"--no-meta"
|
|
5784
|
+
],
|
|
5702
5785
|
{ onLog: context?.onLog }
|
|
5703
5786
|
);
|
|
5704
5787
|
}
|