@yeaft/webchat-agent 0.1.789 → 0.1.790

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": "0.1.789",
3
+ "version": "0.1.790",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -109,9 +109,11 @@ Returns JSON: { ok, dispatched?, error?, detail? }.`,
109
109
  // task-707: hand off control. Successful forward means the originating
110
110
  // turn should NOT continue generating — the target VPs are now in
111
111
  // charge. Signal the engine to break the tool-loop after this batch.
112
- // The structured payload feeds web-bridge's `group_handoff` UX event
113
- // so the frontend can render "↪ 已转交给 @vp-x、@vp-y" without
114
- // re-parsing a string.
112
+ // The structured payload lands on `turn_end.detail` as audit metadata
113
+ // (kind, fromVpId, dispatched, broadcast, text, reason); the frontend
114
+ // renders the hand-off as a Route tool chip from the tool_call
115
+ // envelope already on the wire (see PR #793 — the previous
116
+ // `group_handoff` UI event was removed when its single consumer was).
115
117
  if (typeof ctx.requestEndTurn === 'function') {
116
118
  try {
117
119
  ctx.requestEndTurn({
@@ -1404,34 +1404,14 @@ function handleEngineEvent(event, hctx) {
1404
1404
  break;
1405
1405
 
1406
1406
  case 'turn_end':
1407
- // When a tool (currently only `route_forward`) signals
1408
- // requestEndTurn, the engine emits turn_end with
1409
- // stopReason='tool_handoff' and a structured `detail` payload.
1410
- // Surface that to the frontend as a `group_handoff` event so the
1411
- // originating VP's bubble can render "↪ 已转交给 @vp-b、@vp-c".
1412
- // Other turn_end variants are ignored (the outer loop handles
1413
- // result/end_turn semantics already).
1414
- //
1415
- // The `version` field is the wire schema version. Today there is
1416
- // only one shape. Future variants (e.g. a second hand-off tool)
1417
- // can bump it without breaking older frontends — they ignore
1418
- // unknown versions.
1419
- if (event.stopReason === 'tool_handoff' && event.detail && typeof event.detail === 'object') {
1420
- const detail = event.detail;
1421
- if (detail.kind === 'route_forward') {
1422
- sendUnifyEvent({
1423
- type: 'group_handoff',
1424
- version: 1,
1425
- kind: 'route_forward',
1426
- fromVpId: detail.fromVpId || hctx.vpId,
1427
- toVpIds: Array.isArray(detail.dispatched) ? detail.dispatched.slice() : [],
1428
- broadcast: Boolean(detail.broadcast),
1429
- text: typeof detail.text === 'string' ? detail.text : '',
1430
- reason: detail.reason || null,
1431
- ts: Date.now(),
1432
- }, envelope);
1433
- }
1434
- }
1407
+ // turn_end variants are handled by the outer loop (result /
1408
+ // end_turn semantics). PR #793 removed the `group_handoff`
1409
+ // wire event that the frontend used to render a "↪ 已转交给"
1410
+ // pill the Route tool chip (rendered from the tool_call
1411
+ // envelope already on the wire) is the single source of truth
1412
+ // for hand-off UX. If a future feature (notification toast,
1413
+ // typing-chain animation, ) needs the structured payload,
1414
+ // re-emit a wire event here from `event.detail`.
1435
1415
  break;
1436
1416
 
1437
1417
  case 'usage':