@mindstudio-ai/remy 0.1.194 → 0.1.196
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/compaction/conversation.md +8 -3
- package/dist/compaction/subagent.md +10 -4
- package/dist/headless.js +529 -488
- package/dist/index.js +51 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1627,26 +1627,59 @@ function getSubAgentMessagesForSummary(messages, subAgentName, endIndex) {
|
|
|
1627
1627
|
return collected;
|
|
1628
1628
|
}
|
|
1629
1629
|
function serializeForSummary(messages) {
|
|
1630
|
-
|
|
1630
|
+
const toolNameById = /* @__PURE__ */ new Map();
|
|
1631
|
+
for (const msg of messages) {
|
|
1632
|
+
if (!Array.isArray(msg.content)) {
|
|
1633
|
+
continue;
|
|
1634
|
+
}
|
|
1635
|
+
for (const block of msg.content) {
|
|
1636
|
+
if (block.type === "tool") {
|
|
1637
|
+
toolNameById.set(block.id, block.name);
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
const lines = [];
|
|
1642
|
+
for (const msg of messages) {
|
|
1643
|
+
if (msg.role === "user" && msg.toolCallId) {
|
|
1644
|
+
const toolName = toolNameById.get(msg.toolCallId);
|
|
1645
|
+
if (toolName && SUBAGENT_TOOL_NAMES.has(toolName)) {
|
|
1646
|
+
const content = typeof msg.content === "string" ? msg.content : Array.isArray(msg.content) ? msg.content.filter(
|
|
1647
|
+
(b) => b.type === "text"
|
|
1648
|
+
).map((b) => b.text).join("\n") : "";
|
|
1649
|
+
if (content.trim()) {
|
|
1650
|
+
lines.push(`[${toolName} result]: ${content}`);
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
continue;
|
|
1654
|
+
}
|
|
1631
1655
|
if (typeof msg.content === "string") {
|
|
1632
|
-
|
|
1656
|
+
if (msg.content.trim()) {
|
|
1657
|
+
lines.push(`[${msg.role}]: ${msg.content}`);
|
|
1658
|
+
}
|
|
1659
|
+
continue;
|
|
1633
1660
|
}
|
|
1634
1661
|
if (!Array.isArray(msg.content)) {
|
|
1635
|
-
|
|
1662
|
+
continue;
|
|
1636
1663
|
}
|
|
1637
1664
|
const blocks = msg.content;
|
|
1638
1665
|
const parts = [];
|
|
1666
|
+
let toolCount = 0;
|
|
1639
1667
|
for (const block of blocks) {
|
|
1640
1668
|
if (block.type === "text") {
|
|
1641
1669
|
parts.push(block.text);
|
|
1642
1670
|
} else if (block.type === "tool") {
|
|
1643
|
-
|
|
1644
|
-
`[tool: ${block.name}(${JSON.stringify(block.input).slice(0, 200)})] \u2192 ${(block.result ?? "").slice(0, 500)}`
|
|
1645
|
-
);
|
|
1671
|
+
toolCount++;
|
|
1646
1672
|
}
|
|
1647
1673
|
}
|
|
1648
|
-
|
|
1649
|
-
|
|
1674
|
+
if (toolCount > 0) {
|
|
1675
|
+
parts.push(`[used ${toolCount} tool${toolCount === 1 ? "" : "s"}]`);
|
|
1676
|
+
}
|
|
1677
|
+
const body = parts.join("\n").trim();
|
|
1678
|
+
if (body) {
|
|
1679
|
+
lines.push(`[${msg.role}]: ${body}`);
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
return lines.join("\n\n");
|
|
1650
1683
|
}
|
|
1651
1684
|
async function generateSummary(apiConfig, name, compactionPrompt, messagesToSummarize, mainSystem, mainTools, model) {
|
|
1652
1685
|
const serialized = serializeForSummary(messagesToSummarize);
|
|
@@ -1742,6 +1775,7 @@ var init_compaction = __esm({
|
|
|
1742
1775
|
"use strict";
|
|
1743
1776
|
init_api();
|
|
1744
1777
|
init_assets();
|
|
1778
|
+
init_tools6();
|
|
1745
1779
|
init_logger();
|
|
1746
1780
|
init_usageLedger();
|
|
1747
1781
|
log2 = createLogger("compaction");
|
|
@@ -2112,6 +2146,7 @@ var init_surfaces = __esm({
|
|
|
2112
2146
|
"claude-4-7-opus",
|
|
2113
2147
|
"claude-4-6-opus",
|
|
2114
2148
|
"claude-4-6-sonnet",
|
|
2149
|
+
"claude-fable-5",
|
|
2115
2150
|
"gpt-5.5",
|
|
2116
2151
|
"gemini-3-pro",
|
|
2117
2152
|
"gemini-3.1-pro",
|
|
@@ -6268,7 +6303,7 @@ function executeTool(name, input, context) {
|
|
|
6268
6303
|
}
|
|
6269
6304
|
return tool.execute(input, context);
|
|
6270
6305
|
}
|
|
6271
|
-
var ALL_TOOLS, CLEARABLE_TOOLS;
|
|
6306
|
+
var ALL_TOOLS, CLEARABLE_TOOLS, SUBAGENT_TOOL_NAMES;
|
|
6272
6307
|
var init_tools6 = __esm({
|
|
6273
6308
|
"src/tools/index.ts"() {
|
|
6274
6309
|
"use strict";
|
|
@@ -6348,6 +6383,13 @@ var init_tools6 = __esm({
|
|
|
6348
6383
|
CLEARABLE_TOOLS = new Set(
|
|
6349
6384
|
ALL_TOOLS.filter((t) => t.clearable).map((t) => t.definition.name)
|
|
6350
6385
|
);
|
|
6386
|
+
SUBAGENT_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
6387
|
+
"visualDesignExpert",
|
|
6388
|
+
"productVision",
|
|
6389
|
+
"codeSanityCheck",
|
|
6390
|
+
"runAutomatedBrowserTest",
|
|
6391
|
+
"askMindStudioSdk"
|
|
6392
|
+
]);
|
|
6351
6393
|
}
|
|
6352
6394
|
});
|
|
6353
6395
|
|