@mindstudio-ai/remy 0.1.299 → 0.1.300
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 +42 -17
- package/dist/index.js +42 -17
- package/dist/subagents/codeSanityCheck/prompt.md +2 -1
- package/package.json +1 -1
package/dist/headless.js
CHANGED
|
@@ -942,9 +942,9 @@ function buildBackgroundResultsMessage(results) {
|
|
|
942
942
|
${r.result}
|
|
943
943
|
</tool_result>`
|
|
944
944
|
).join("\n\n");
|
|
945
|
-
const
|
|
946
|
-
|
|
947
|
-
|
|
945
|
+
const body = `<background_results>
|
|
946
|
+
Automated delivery of results from background tool calls that completed while other work was in progress. This block is not from the user \u2014 anything outside it is.
|
|
947
|
+
|
|
948
948
|
${xml}
|
|
949
949
|
</background_results>`;
|
|
950
950
|
return automatedMessage("background_results", body);
|
|
@@ -1848,7 +1848,7 @@ var askMindStudioSdkTool = {
|
|
|
1848
1848
|
async execute(input, context) {
|
|
1849
1849
|
const query = input.query;
|
|
1850
1850
|
const result = await runCli("mindstudio", ["ask", query], {
|
|
1851
|
-
timeout:
|
|
1851
|
+
timeout: 48e4,
|
|
1852
1852
|
maxBuffer: 512 * 1024,
|
|
1853
1853
|
onLog: context?.onLog
|
|
1854
1854
|
});
|
|
@@ -4570,7 +4570,7 @@ async function runBrowserAutomation(task, context, opts) {
|
|
|
4570
4570
|
task,
|
|
4571
4571
|
tools: BROWSER_TOOLS,
|
|
4572
4572
|
externalTools: BROWSER_EXTERNAL_TOOLS,
|
|
4573
|
-
executeTool: async (name, _input,
|
|
4573
|
+
executeTool: async (name, _input, toolCallId, onLog) => {
|
|
4574
4574
|
if (name === "setupBrowser") {
|
|
4575
4575
|
try {
|
|
4576
4576
|
const result2 = await sidecarRequest(
|
|
@@ -4587,7 +4587,11 @@ async function runBrowserAutomation(task, context, opts) {
|
|
|
4587
4587
|
}
|
|
4588
4588
|
}
|
|
4589
4589
|
if (COMMON_READ_TOOL_NAMES.has(name) || name === readSpecTool.definition.name) {
|
|
4590
|
-
return executeTool(
|
|
4590
|
+
return executeTool(
|
|
4591
|
+
name,
|
|
4592
|
+
_input,
|
|
4593
|
+
toolCallId ? deriveContext(context, toolCallId, onLog) : context
|
|
4594
|
+
);
|
|
4591
4595
|
}
|
|
4592
4596
|
return `Error: unknown local tool "${name}"`;
|
|
4593
4597
|
},
|
|
@@ -5556,7 +5560,13 @@ var copyEditorTool = {
|
|
|
5556
5560
|
task: input.task,
|
|
5557
5561
|
tools: COPY_EDITOR_TOOLS,
|
|
5558
5562
|
externalTools: /* @__PURE__ */ new Set(),
|
|
5559
|
-
executeTool: (name, toolInput
|
|
5563
|
+
executeTool: (name, toolInput, toolCallId, onLog, sams) => {
|
|
5564
|
+
const childCtx = toolCallId ? {
|
|
5565
|
+
...deriveContext(context, toolCallId, onLog),
|
|
5566
|
+
subAgentMessages: sams
|
|
5567
|
+
} : context;
|
|
5568
|
+
return executeTool(name, toolInput, childCtx);
|
|
5569
|
+
},
|
|
5560
5570
|
apiConfig: context.apiConfig,
|
|
5561
5571
|
model: resolveModel("copyEditor", context.models, context.model),
|
|
5562
5572
|
subAgentId: "copyEditor",
|
|
@@ -5824,7 +5834,7 @@ async function executeDesignExpertTool(name, input, context, toolCallId, onLog)
|
|
|
5824
5834
|
if (!tool) {
|
|
5825
5835
|
return `Error: unknown tool "${name}"`;
|
|
5826
5836
|
}
|
|
5827
|
-
const childContext = context && toolCallId ? deriveContext(context, toolCallId) : context;
|
|
5837
|
+
const childContext = context && toolCallId ? deriveContext(context, toolCallId, onLog) : context;
|
|
5828
5838
|
return tool.execute(input, onLog, childContext);
|
|
5829
5839
|
}
|
|
5830
5840
|
|
|
@@ -6112,7 +6122,10 @@ async function runDesignExpert(opts, context) {
|
|
|
6112
6122
|
tools: opts.render ? DESIGN_EXPERT_RENDER_TOOLS : DESIGN_EXPERT_TOOLS,
|
|
6113
6123
|
externalTools: /* @__PURE__ */ new Set(),
|
|
6114
6124
|
executeTool: (name, input, toolCallId, onLog, sams) => {
|
|
6115
|
-
const childCtx = toolCallId ? {
|
|
6125
|
+
const childCtx = toolCallId ? {
|
|
6126
|
+
...deriveContext(context, toolCallId, onLog),
|
|
6127
|
+
subAgentMessages: sams
|
|
6128
|
+
} : { ...context, subAgentMessages: sams };
|
|
6116
6129
|
if (COMMON_READ_TOOL_NAMES.has(name)) {
|
|
6117
6130
|
return executeTool(name, input, childCtx);
|
|
6118
6131
|
}
|
|
@@ -6380,8 +6393,11 @@ var productVisionTool = {
|
|
|
6380
6393
|
cachePolicy: "conversation",
|
|
6381
6394
|
tools: VISION_TOOLS,
|
|
6382
6395
|
externalTools: /* @__PURE__ */ new Set(),
|
|
6383
|
-
executeTool: (name, input2, toolCallId,
|
|
6384
|
-
const childCtx = toolCallId ? {
|
|
6396
|
+
executeTool: (name, input2, toolCallId, onLog, sams) => {
|
|
6397
|
+
const childCtx = toolCallId ? {
|
|
6398
|
+
...deriveContext(context, toolCallId, onLog),
|
|
6399
|
+
subAgentMessages: sams
|
|
6400
|
+
} : { ...context, subAgentMessages: sams };
|
|
6385
6401
|
if (COMMON_READ_TOOL_NAMES.has(name)) {
|
|
6386
6402
|
return executeTool(name, input2, childCtx);
|
|
6387
6403
|
}
|
|
@@ -6493,7 +6509,13 @@ var codeSanityCheckTool = {
|
|
|
6493
6509
|
task: input.task,
|
|
6494
6510
|
tools: SANITY_CHECK_TOOLS,
|
|
6495
6511
|
externalTools: /* @__PURE__ */ new Set(),
|
|
6496
|
-
executeTool: (name, toolInput
|
|
6512
|
+
executeTool: (name, toolInput, toolCallId, onLog, sams) => {
|
|
6513
|
+
const childCtx = toolCallId ? {
|
|
6514
|
+
...deriveContext(context, toolCallId, onLog),
|
|
6515
|
+
subAgentMessages: sams
|
|
6516
|
+
} : context;
|
|
6517
|
+
return executeTool(name, toolInput, childCtx);
|
|
6518
|
+
},
|
|
6497
6519
|
apiConfig: context.apiConfig,
|
|
6498
6520
|
model: resolveModel("codeSanityCheck", context.models, context.model),
|
|
6499
6521
|
subAgentId: "codeSanityCheck",
|
|
@@ -6703,16 +6725,19 @@ After reconciling the spec, refresh the Build Overview: author the complete upda
|
|
|
6703
6725
|
task,
|
|
6704
6726
|
tools: tools2,
|
|
6705
6727
|
externalTools: /* @__PURE__ */ new Set(),
|
|
6706
|
-
executeTool: (name, toolInput, toolCallId,
|
|
6728
|
+
executeTool: (name, toolInput, toolCallId, onLog, sams) => {
|
|
6729
|
+
const childCtx = toolCallId ? {
|
|
6730
|
+
...deriveContext(context, toolCallId, onLog),
|
|
6731
|
+
subAgentMessages: sams
|
|
6732
|
+
} : { ...context, subAgentMessages: sams };
|
|
6707
6733
|
if (name === "writeBuildOverview") {
|
|
6708
|
-
const childCtx = toolCallId ? { ...deriveContext(context, toolCallId), subAgentMessages: sams } : { ...context, subAgentMessages: sams };
|
|
6709
6734
|
return renderBuildOverview(
|
|
6710
6735
|
String(toolInput.content ?? "").trim(),
|
|
6711
6736
|
childCtx,
|
|
6712
6737
|
{ background: false }
|
|
6713
6738
|
);
|
|
6714
6739
|
}
|
|
6715
|
-
return executeTool(name, toolInput,
|
|
6740
|
+
return executeTool(name, toolInput, childCtx);
|
|
6716
6741
|
},
|
|
6717
6742
|
apiConfig: context.apiConfig,
|
|
6718
6743
|
model: resolveModel("specSync", context.models, context.model),
|
|
@@ -6786,8 +6811,8 @@ var scrapeWebUrlTool = {
|
|
|
6786
6811
|
};
|
|
6787
6812
|
|
|
6788
6813
|
// src/tools/index.ts
|
|
6789
|
-
function deriveContext(parent, toolCallId) {
|
|
6790
|
-
return { ...parent, toolCallId };
|
|
6814
|
+
function deriveContext(parent, toolCallId, onLog) {
|
|
6815
|
+
return { ...parent, toolCallId, onLog };
|
|
6791
6816
|
}
|
|
6792
6817
|
var ALL_TOOLS = [
|
|
6793
6818
|
// Common
|
package/dist/index.js
CHANGED
|
@@ -1379,7 +1379,7 @@ var init_sdkConsultant = __esm({
|
|
|
1379
1379
|
async execute(input, context) {
|
|
1380
1380
|
const query = input.query;
|
|
1381
1381
|
const result = await runCli("mindstudio", ["ask", query], {
|
|
1382
|
-
timeout:
|
|
1382
|
+
timeout: 48e4,
|
|
1383
1383
|
maxBuffer: 512 * 1024,
|
|
1384
1384
|
onLog: context?.onLog
|
|
1385
1385
|
});
|
|
@@ -1660,9 +1660,9 @@ function buildBackgroundResultsMessage(results) {
|
|
|
1660
1660
|
${r.result}
|
|
1661
1661
|
</tool_result>`
|
|
1662
1662
|
).join("\n\n");
|
|
1663
|
-
const
|
|
1664
|
-
|
|
1665
|
-
|
|
1663
|
+
const body = `<background_results>
|
|
1664
|
+
Automated delivery of results from background tool calls that completed while other work was in progress. This block is not from the user \u2014 anything outside it is.
|
|
1665
|
+
|
|
1666
1666
|
${xml}
|
|
1667
1667
|
</background_results>`;
|
|
1668
1668
|
return automatedMessage("background_results", body);
|
|
@@ -5648,7 +5648,7 @@ async function runBrowserAutomation(task, context, opts) {
|
|
|
5648
5648
|
task,
|
|
5649
5649
|
tools: BROWSER_TOOLS,
|
|
5650
5650
|
externalTools: BROWSER_EXTERNAL_TOOLS,
|
|
5651
|
-
executeTool: async (name, _input,
|
|
5651
|
+
executeTool: async (name, _input, toolCallId, onLog) => {
|
|
5652
5652
|
if (name === "setupBrowser") {
|
|
5653
5653
|
try {
|
|
5654
5654
|
const result2 = await sidecarRequest(
|
|
@@ -5665,7 +5665,11 @@ async function runBrowserAutomation(task, context, opts) {
|
|
|
5665
5665
|
}
|
|
5666
5666
|
}
|
|
5667
5667
|
if (COMMON_READ_TOOL_NAMES.has(name) || name === readSpecTool.definition.name) {
|
|
5668
|
-
return executeTool(
|
|
5668
|
+
return executeTool(
|
|
5669
|
+
name,
|
|
5670
|
+
_input,
|
|
5671
|
+
toolCallId ? deriveContext(context, toolCallId, onLog) : context
|
|
5672
|
+
);
|
|
5669
5673
|
}
|
|
5670
5674
|
return `Error: unknown local tool "${name}"`;
|
|
5671
5675
|
},
|
|
@@ -6752,7 +6756,13 @@ var init_copyEditor = __esm({
|
|
|
6752
6756
|
task: input.task,
|
|
6753
6757
|
tools: COPY_EDITOR_TOOLS,
|
|
6754
6758
|
externalTools: /* @__PURE__ */ new Set(),
|
|
6755
|
-
executeTool: (name, toolInput
|
|
6759
|
+
executeTool: (name, toolInput, toolCallId, onLog, sams) => {
|
|
6760
|
+
const childCtx = toolCallId ? {
|
|
6761
|
+
...deriveContext(context, toolCallId, onLog),
|
|
6762
|
+
subAgentMessages: sams
|
|
6763
|
+
} : context;
|
|
6764
|
+
return executeTool(name, toolInput, childCtx);
|
|
6765
|
+
},
|
|
6756
6766
|
apiConfig: context.apiConfig,
|
|
6757
6767
|
model: resolveModel("copyEditor", context.models, context.model),
|
|
6758
6768
|
subAgentId: "copyEditor",
|
|
@@ -7034,7 +7044,7 @@ async function executeDesignExpertTool(name, input, context, toolCallId, onLog)
|
|
|
7034
7044
|
if (!tool) {
|
|
7035
7045
|
return `Error: unknown tool "${name}"`;
|
|
7036
7046
|
}
|
|
7037
|
-
const childContext = context && toolCallId ? deriveContext(context, toolCallId) : context;
|
|
7047
|
+
const childContext = context && toolCallId ? deriveContext(context, toolCallId, onLog) : context;
|
|
7038
7048
|
return tool.execute(input, onLog, childContext);
|
|
7039
7049
|
}
|
|
7040
7050
|
var tools, DESIGN_EXPERT_TOOLS;
|
|
@@ -7466,7 +7476,10 @@ async function runDesignExpert(opts, context) {
|
|
|
7466
7476
|
tools: opts.render ? DESIGN_EXPERT_RENDER_TOOLS : DESIGN_EXPERT_TOOLS,
|
|
7467
7477
|
externalTools: /* @__PURE__ */ new Set(),
|
|
7468
7478
|
executeTool: (name, input, toolCallId, onLog, sams) => {
|
|
7469
|
-
const childCtx = toolCallId ? {
|
|
7479
|
+
const childCtx = toolCallId ? {
|
|
7480
|
+
...deriveContext(context, toolCallId, onLog),
|
|
7481
|
+
subAgentMessages: sams
|
|
7482
|
+
} : { ...context, subAgentMessages: sams };
|
|
7470
7483
|
if (COMMON_READ_TOOL_NAMES.has(name)) {
|
|
7471
7484
|
return executeTool(name, input, childCtx);
|
|
7472
7485
|
}
|
|
@@ -7794,8 +7807,11 @@ var init_productVision = __esm({
|
|
|
7794
7807
|
cachePolicy: "conversation",
|
|
7795
7808
|
tools: VISION_TOOLS,
|
|
7796
7809
|
externalTools: /* @__PURE__ */ new Set(),
|
|
7797
|
-
executeTool: (name, input2, toolCallId,
|
|
7798
|
-
const childCtx = toolCallId ? {
|
|
7810
|
+
executeTool: (name, input2, toolCallId, onLog, sams) => {
|
|
7811
|
+
const childCtx = toolCallId ? {
|
|
7812
|
+
...deriveContext(context, toolCallId, onLog),
|
|
7813
|
+
subAgentMessages: sams
|
|
7814
|
+
} : { ...context, subAgentMessages: sams };
|
|
7799
7815
|
if (COMMON_READ_TOOL_NAMES.has(name)) {
|
|
7800
7816
|
return executeTool(name, input2, childCtx);
|
|
7801
7817
|
}
|
|
@@ -7926,7 +7942,13 @@ var init_codeSanityCheck = __esm({
|
|
|
7926
7942
|
task: input.task,
|
|
7927
7943
|
tools: SANITY_CHECK_TOOLS,
|
|
7928
7944
|
externalTools: /* @__PURE__ */ new Set(),
|
|
7929
|
-
executeTool: (name, toolInput
|
|
7945
|
+
executeTool: (name, toolInput, toolCallId, onLog, sams) => {
|
|
7946
|
+
const childCtx = toolCallId ? {
|
|
7947
|
+
...deriveContext(context, toolCallId, onLog),
|
|
7948
|
+
subAgentMessages: sams
|
|
7949
|
+
} : context;
|
|
7950
|
+
return executeTool(name, toolInput, childCtx);
|
|
7951
|
+
},
|
|
7930
7952
|
apiConfig: context.apiConfig,
|
|
7931
7953
|
model: resolveModel("codeSanityCheck", context.models, context.model),
|
|
7932
7954
|
subAgentId: "codeSanityCheck",
|
|
@@ -8173,16 +8195,19 @@ After reconciling the spec, refresh the Build Overview: author the complete upda
|
|
|
8173
8195
|
task,
|
|
8174
8196
|
tools: tools2,
|
|
8175
8197
|
externalTools: /* @__PURE__ */ new Set(),
|
|
8176
|
-
executeTool: (name, toolInput, toolCallId,
|
|
8198
|
+
executeTool: (name, toolInput, toolCallId, onLog, sams) => {
|
|
8199
|
+
const childCtx = toolCallId ? {
|
|
8200
|
+
...deriveContext(context, toolCallId, onLog),
|
|
8201
|
+
subAgentMessages: sams
|
|
8202
|
+
} : { ...context, subAgentMessages: sams };
|
|
8177
8203
|
if (name === "writeBuildOverview") {
|
|
8178
|
-
const childCtx = toolCallId ? { ...deriveContext(context, toolCallId), subAgentMessages: sams } : { ...context, subAgentMessages: sams };
|
|
8179
8204
|
return renderBuildOverview(
|
|
8180
8205
|
String(toolInput.content ?? "").trim(),
|
|
8181
8206
|
childCtx,
|
|
8182
8207
|
{ background: false }
|
|
8183
8208
|
);
|
|
8184
8209
|
}
|
|
8185
|
-
return executeTool(name, toolInput,
|
|
8210
|
+
return executeTool(name, toolInput, childCtx);
|
|
8186
8211
|
},
|
|
8187
8212
|
apiConfig: context.apiConfig,
|
|
8188
8213
|
model: resolveModel("specSync", context.models, context.model),
|
|
@@ -8266,8 +8291,8 @@ var init_scrapeWebUrl2 = __esm({
|
|
|
8266
8291
|
});
|
|
8267
8292
|
|
|
8268
8293
|
// src/tools/index.ts
|
|
8269
|
-
function deriveContext(parent, toolCallId) {
|
|
8270
|
-
return { ...parent, toolCallId };
|
|
8294
|
+
function deriveContext(parent, toolCallId, onLog) {
|
|
8295
|
+
return { ...parent, toolCallId, onLog };
|
|
8271
8296
|
}
|
|
8272
8297
|
function getToolDefinitions() {
|
|
8273
8298
|
return ALL_TOOLS.map((t) => t.definition);
|
|
@@ -38,7 +38,8 @@ These are things we already know about and have decided to accept:
|
|
|
38
38
|
- Preferences:
|
|
39
39
|
- use [wouter](https://github.com/molefrog/wouter) for React routing instead of reaching for react-router
|
|
40
40
|
- uploading user files should always happen via `platform.uploadFile()` from `@mindstudio-ai/interface` — not custom S3 code, not FormData to a method endpoint
|
|
41
|
-
- for
|
|
41
|
+
- for build-time prerendering of purely static sites (marketing pages with no dynamic content — distinct from the platform's crawler prerendering, below), roll your own with a post-build `renderToString` script — do not use `vite-prerender-plugin` (it bundles the prerender script as a client chunk, adding ~800KB to the user-facing bundle with no way to prevent it)
|
|
42
|
+
- **Prerendering for crawlers/unfurlers is a platform feature — don't design around it.** For SEO / link-unfurl / AI-crawler visibility on a non-static SPA, the platform already handles it: routes opt in via `web.json` (`{ "web": { "prerender": { "paths": ["/blog/*"] } } }`), the SPA signals readiness by setting `data-prerender-ready` on the html element, deploys invalidate the snapshot cache automatically, and content that changes outside deploys is invalidated at runtime with `await prerender.invalidate([...])` from `@mindstudio-ai/agent` (called from the mutating method). It serves cached headless snapshots of the live SPA to bots — it is NOT build-time rendering. Do not recommend post-build render scripts, rebuild-on-content-change, or third-party prerender services for this. The developer's main context carries the full interfaces reference with exact semantics — tell them to consult it rather than improvising.
|
|
42
43
|
|
|
43
44
|
### Common pitfalls (always flag these)
|
|
44
45
|
|