@yeaft/webchat-agent 1.0.262 → 1.0.263

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "1.0.262",
3
+ "version": "1.0.263",
4
4
  "description": "Remote worker agent for Yeaft Web Code Agent — connects the native Yeaft engine, CLI providers, and workbench tools",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -326,13 +326,15 @@ function parseAskUserResult(toolCall, toolResult) {
326
326
  };
327
327
  }
328
328
 
329
+ const FAILED_RESPONSE_REASONS = new Set(['aborted', 'errored', 'error', 'cancelled', 'canceled']);
330
+
329
331
  function projectedResponseKind(row) {
332
+ if (row?.incomplete === true || FAILED_RESPONSE_REASONS.has(row?.stopReason)) {
333
+ return 'progress';
334
+ }
330
335
  if (row?.responseKind === 'progress' || row?.responseKind === 'result') {
331
336
  return row.responseKind;
332
337
  }
333
- if (row?.incomplete === true || row?.stopReason === 'aborted' || row?.stopReason === 'error') {
334
- return 'progress';
335
- }
336
338
  if (row?.stopReason === 'end_turn') return 'result';
337
339
  return null;
338
340
  }
@@ -1190,6 +1190,8 @@ function projectPersistedToHistoryEntry(m, { includeReflections = false } = {})
1190
1190
  if (m.turnId) entry.turnId = m.turnId;
1191
1191
  if (m.imageAssetAnchor) entry.imageAssetAnchor = true;
1192
1192
  if (m.responseKind === 'progress' || m.responseKind === 'result') entry.responseKind = m.responseKind;
1193
+ if (m.incomplete === true) entry.incomplete = true;
1194
+ if (typeof m.stopReason === 'string' && m.stopReason) entry.stopReason = m.stopReason;
1193
1195
  if (m.sessionId) entry.sessionId = m.sessionId;
1194
1196
  if (m.clientMessageId) entry.clientMessageId = m.clientMessageId;
1195
1197
  if (m.speakerVpId) entry.speakerVpId = m.speakerVpId;
@@ -1310,6 +1312,8 @@ function projectVisibleHistoryChunkMessages(messages = []) {
1310
1312
  ...(Array.isArray(m.images) && m.images.length > 0 ? { images: m.images } : {}),
1311
1313
  ...(m.speakerVpId ? { speakerVpId: m.speakerVpId } : {}),
1312
1314
  ...(m.responseKind === 'progress' || m.responseKind === 'result' ? { responseKind: m.responseKind } : {}),
1315
+ ...(m.incomplete === true ? { incomplete: true } : {}),
1316
+ ...(typeof m.stopReason === 'string' && m.stopReason ? { stopReason: m.stopReason } : {}),
1313
1317
  ...(Array.isArray(m.todos) ? { todos: m.todos } : {}),
1314
1318
  ...(Array.isArray(m.askUserResults) && m.askUserResults.length > 0 ? { askUserResults: m.askUserResults } : {}),
1315
1319
  ...(Number.isFinite(m.toolSummaryCount) && m.toolSummaryCount > 0