@webless/agent 0.6.7 → 0.6.8

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.
@@ -1303,8 +1303,7 @@ function applyMessageEvent(event, rendered, handlers, workItems) {
1303
1303
  if (event.type === "message.completed") {
1304
1304
  handlers.onComplete?.();
1305
1305
  }
1306
- if (event.type === "action.result") emitActionResult(event, handlers);
1307
- if (event.type === "input.requested") emitInputRequests(event, handlers);
1306
+ emitVisitorInteractionEvent(event, handlers);
1308
1307
  if (event.type !== "message.appended") return rendered;
1309
1308
  const { messageDelta, messageSoFar } = event.data;
1310
1309
  let delta = messageDelta;
@@ -1354,6 +1353,13 @@ function emitInputRequests(event, handlers) {
1354
1353
  })
1355
1354
  );
1356
1355
  }
1356
+ function emitVisitorInteractionEvent(event, handlers) {
1357
+ if (event.type === "action.result") emitActionResult(event, handlers);
1358
+ if (event.type === "input.requested") emitInputRequests(event, handlers);
1359
+ if (event.type === "subagent.event") {
1360
+ emitVisitorInteractionEvent(event.data.event, handlers);
1361
+ }
1362
+ }
1357
1363
  function isResumeTurnMessage(received, candidate) {
1358
1364
  if (received === candidate) return true;
1359
1365
  return Boolean(candidate) && received.endsWith(`
@@ -1684,8 +1690,7 @@ var AgentSession = class {
1684
1690
  const workItems = /* @__PURE__ */ new Map();
1685
1691
  for (const event of turnEvents) {
1686
1692
  applyWorkEvent(event, handlers, workItems);
1687
- if (event.type === "input.requested") emitInputRequests(event, handlers);
1688
- if (event.type === "action.result") emitActionResult(event, handlers);
1693
+ emitVisitorInteractionEvent(event, handlers);
1689
1694
  }
1690
1695
  if (rendered.startsWith(initialText)) {
1691
1696
  const missedText = rendered.slice(initialText.length);
@@ -5414,4 +5419,4 @@ export {
5414
5419
  AssistEdgeTab,
5415
5420
  AgentWidget
5416
5421
  };
5417
- //# sourceMappingURL=chunk-U5IPERNA.js.map
5422
+ //# sourceMappingURL=chunk-CXIKIQJL.js.map