@mindstudio-ai/remy 0.1.195 → 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/index.js CHANGED
@@ -1627,26 +1627,59 @@ function getSubAgentMessagesForSummary(messages, subAgentName, endIndex) {
1627
1627
  return collected;
1628
1628
  }
1629
1629
  function serializeForSummary(messages) {
1630
- return messages.map((msg) => {
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
- return `[${msg.role}]: ${msg.content}`;
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
- return `[${msg.role}]: (empty)`;
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
- parts.push(
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
- return `[${msg.role}]: ${parts.join("\n")}`;
1649
- }).join("\n\n");
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");
@@ -6269,7 +6303,7 @@ function executeTool(name, input, context) {
6269
6303
  }
6270
6304
  return tool.execute(input, context);
6271
6305
  }
6272
- var ALL_TOOLS, CLEARABLE_TOOLS;
6306
+ var ALL_TOOLS, CLEARABLE_TOOLS, SUBAGENT_TOOL_NAMES;
6273
6307
  var init_tools6 = __esm({
6274
6308
  "src/tools/index.ts"() {
6275
6309
  "use strict";
@@ -6349,6 +6383,13 @@ var init_tools6 = __esm({
6349
6383
  CLEARABLE_TOOLS = new Set(
6350
6384
  ALL_TOOLS.filter((t) => t.clearable).map((t) => t.definition.name)
6351
6385
  );
6386
+ SUBAGENT_TOOL_NAMES = /* @__PURE__ */ new Set([
6387
+ "visualDesignExpert",
6388
+ "productVision",
6389
+ "codeSanityCheck",
6390
+ "runAutomatedBrowserTest",
6391
+ "askMindStudioSdk"
6392
+ ]);
6352
6393
  }
6353
6394
  });
6354
6395
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/remy",
3
- "version": "0.1.195",
3
+ "version": "0.1.196",
4
4
  "description": "MindStudio coding agent",
5
5
  "repository": {
6
6
  "type": "git",