@yeaft/webchat-agent 0.0.138 → 0.0.139
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/crew.js +16 -9
- package/package.json +1 -1
package/crew.js
CHANGED
|
@@ -1944,21 +1944,28 @@ function sendCrewOutput(session, roleName, outputType, rawMessage, extra = {}) {
|
|
|
1944
1944
|
for (const block of content) {
|
|
1945
1945
|
if (block.type === 'tool_use') {
|
|
1946
1946
|
// Save trimmed toolInput for restore — only key fields, skip large content
|
|
1947
|
+
// TodoWrite: preserve full input (todos array is small and needed for sticky banner)
|
|
1947
1948
|
const input = block.input || {};
|
|
1948
|
-
|
|
1949
|
-
if (
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1949
|
+
let savedInput;
|
|
1950
|
+
if (block.name === 'TodoWrite') {
|
|
1951
|
+
savedInput = input;
|
|
1952
|
+
} else {
|
|
1953
|
+
const trimmedInput = {};
|
|
1954
|
+
if (input.file_path) trimmedInput.file_path = input.file_path;
|
|
1955
|
+
if (input.command) trimmedInput.command = input.command.substring(0, 200);
|
|
1956
|
+
if (input.pattern) trimmedInput.pattern = input.pattern;
|
|
1957
|
+
if (input.old_string) trimmedInput.old_string = input.old_string.substring(0, 100);
|
|
1958
|
+
if (input.new_string) trimmedInput.new_string = input.new_string.substring(0, 100);
|
|
1959
|
+
if (input.url) trimmedInput.url = input.url;
|
|
1960
|
+
if (input.query) trimmedInput.query = input.query;
|
|
1961
|
+
savedInput = Object.keys(trimmedInput).length > 0 ? trimmedInput : null;
|
|
1962
|
+
}
|
|
1956
1963
|
session.uiMessages.push({
|
|
1957
1964
|
role: roleName, roleIcon, roleName: displayName,
|
|
1958
1965
|
type: 'tool',
|
|
1959
1966
|
toolName: block.name,
|
|
1960
1967
|
toolId: block.id,
|
|
1961
|
-
toolInput:
|
|
1968
|
+
toolInput: savedInput,
|
|
1962
1969
|
content: `${block.name} ${block.input?.file_path || block.input?.command?.substring(0, 60) || ''}`,
|
|
1963
1970
|
hasResult: false,
|
|
1964
1971
|
taskId, taskTitle,
|