@yeaft/webchat-agent 0.0.137 → 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/conversation.js CHANGED
@@ -395,6 +395,7 @@ export async function handleUserInput(msg) {
395
395
  state.turnActive = true;
396
396
  state.turnResultReceived = false; // 重置 per-turn 去重标志
397
397
  sendConversationList(); // 在 turnActive=true 后通知 server,确保 processing 状态正确
398
+ sendOutput(conversationId, userMessage);
398
399
  state.inputStream.enqueue(userMessage);
399
400
  }
400
401
 
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
- const trimmedInput = {};
1949
- if (input.file_path) trimmedInput.file_path = input.file_path;
1950
- if (input.command) trimmedInput.command = input.command.substring(0, 200);
1951
- if (input.pattern) trimmedInput.pattern = input.pattern;
1952
- if (input.old_string) trimmedInput.old_string = input.old_string.substring(0, 100);
1953
- if (input.new_string) trimmedInput.new_string = input.new_string.substring(0, 100);
1954
- if (input.url) trimmedInput.url = input.url;
1955
- if (input.query) trimmedInput.query = input.query;
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: Object.keys(trimmedInput).length > 0 ? trimmedInput : null,
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "0.0.137",
3
+ "version": "0.0.139",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",