@mindstudio-ai/remy 0.1.128 → 0.1.129
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 +9 -4
- package/dist/index.js +9 -4
- package/package.json +1 -1
package/dist/headless.js
CHANGED
|
@@ -2822,10 +2822,12 @@ Current date: ${dateStr}`;
|
|
|
2822
2822
|
const excludeToolsFromClearing = tools2.filter((t) => t.clearable === false).map((t) => t.name);
|
|
2823
2823
|
let turns = 0;
|
|
2824
2824
|
const run = async () => {
|
|
2825
|
+
const historyLen = (history ?? []).length;
|
|
2825
2826
|
const messages = [
|
|
2826
2827
|
...history ?? [],
|
|
2827
2828
|
{ role: "user", content: task }
|
|
2828
2829
|
];
|
|
2830
|
+
const thisInvocation = () => messages.slice(historyLen);
|
|
2829
2831
|
function getPartialText(blocks) {
|
|
2830
2832
|
return blocks.filter((b) => b.type === "text").map((b) => b.text).join("");
|
|
2831
2833
|
}
|
|
@@ -2836,10 +2838,10 @@ Current date: ${dateStr}`;
|
|
|
2836
2838
|
text: partial ? `[INTERRUPTED - PARTIAL OUTPUT RETRIEVED] Note that partial output may include thinking text or other unfinalized decisions. It is NOT an authoritative response from this agent.
|
|
2837
2839
|
|
|
2838
2840
|
${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
|
|
2839
|
-
messages
|
|
2841
|
+
messages: thisInvocation()
|
|
2840
2842
|
};
|
|
2841
2843
|
}
|
|
2842
|
-
return { text: "Error: cancelled", messages };
|
|
2844
|
+
return { text: "Error: cancelled", messages: thisInvocation() };
|
|
2843
2845
|
}
|
|
2844
2846
|
let lastToolResult = "";
|
|
2845
2847
|
while (true) {
|
|
@@ -2946,7 +2948,10 @@ ${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
|
|
|
2946
2948
|
stopReason = event.stopReason;
|
|
2947
2949
|
break;
|
|
2948
2950
|
case "error":
|
|
2949
|
-
return {
|
|
2951
|
+
return {
|
|
2952
|
+
text: `Error: ${event.error}`,
|
|
2953
|
+
messages: thisInvocation()
|
|
2954
|
+
};
|
|
2950
2955
|
}
|
|
2951
2956
|
}
|
|
2952
2957
|
} catch (err) {
|
|
@@ -2968,7 +2973,7 @@ ${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
|
|
|
2968
2973
|
if (stopReason !== "tool_use" || toolCalls.length === 0) {
|
|
2969
2974
|
statusWatcher.stop();
|
|
2970
2975
|
const text = getPartialText(contentBlocks);
|
|
2971
|
-
return { text, messages };
|
|
2976
|
+
return { text, messages: thisInvocation() };
|
|
2972
2977
|
}
|
|
2973
2978
|
log5.info("Tools executing", {
|
|
2974
2979
|
requestId,
|
package/dist/index.js
CHANGED
|
@@ -2535,10 +2535,12 @@ Current date: ${dateStr}`;
|
|
|
2535
2535
|
const excludeToolsFromClearing = tools2.filter((t) => t.clearable === false).map((t) => t.name);
|
|
2536
2536
|
let turns = 0;
|
|
2537
2537
|
const run = async () => {
|
|
2538
|
+
const historyLen = (history ?? []).length;
|
|
2538
2539
|
const messages = [
|
|
2539
2540
|
...history ?? [],
|
|
2540
2541
|
{ role: "user", content: task }
|
|
2541
2542
|
];
|
|
2543
|
+
const thisInvocation = () => messages.slice(historyLen);
|
|
2542
2544
|
function getPartialText(blocks) {
|
|
2543
2545
|
return blocks.filter((b) => b.type === "text").map((b) => b.text).join("");
|
|
2544
2546
|
}
|
|
@@ -2549,10 +2551,10 @@ Current date: ${dateStr}`;
|
|
|
2549
2551
|
text: partial ? `[INTERRUPTED - PARTIAL OUTPUT RETRIEVED] Note that partial output may include thinking text or other unfinalized decisions. It is NOT an authoritative response from this agent.
|
|
2550
2552
|
|
|
2551
2553
|
${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
|
|
2552
|
-
messages
|
|
2554
|
+
messages: thisInvocation()
|
|
2553
2555
|
};
|
|
2554
2556
|
}
|
|
2555
|
-
return { text: "Error: cancelled", messages };
|
|
2557
|
+
return { text: "Error: cancelled", messages: thisInvocation() };
|
|
2556
2558
|
}
|
|
2557
2559
|
let lastToolResult = "";
|
|
2558
2560
|
while (true) {
|
|
@@ -2659,7 +2661,10 @@ ${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
|
|
|
2659
2661
|
stopReason = event.stopReason;
|
|
2660
2662
|
break;
|
|
2661
2663
|
case "error":
|
|
2662
|
-
return {
|
|
2664
|
+
return {
|
|
2665
|
+
text: `Error: ${event.error}`,
|
|
2666
|
+
messages: thisInvocation()
|
|
2667
|
+
};
|
|
2663
2668
|
}
|
|
2664
2669
|
}
|
|
2665
2670
|
} catch (err) {
|
|
@@ -2681,7 +2686,7 @@ ${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
|
|
|
2681
2686
|
if (stopReason !== "tool_use" || toolCalls.length === 0) {
|
|
2682
2687
|
statusWatcher.stop();
|
|
2683
2688
|
const text = getPartialText(contentBlocks);
|
|
2684
|
-
return { text, messages };
|
|
2689
|
+
return { text, messages: thisInvocation() };
|
|
2685
2690
|
}
|
|
2686
2691
|
log3.info("Tools executing", {
|
|
2687
2692
|
requestId,
|