@invergent/agent-chat-react 2.10.1 → 2.10.3
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/dist/index.cjs +39 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +39 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9690,6 +9690,7 @@ function TextEntry({
|
|
|
9690
9690
|
/* @__PURE__ */ jsxRuntime.jsx(TimelineIndicator, { className: "size-2 border-none bg-foreground/40" })
|
|
9691
9691
|
] }),
|
|
9692
9692
|
/* @__PURE__ */ jsxRuntime.jsxs(TimelineContent, { children: [
|
|
9693
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoopResultAffordance, { message: entry.msg }),
|
|
9693
9694
|
/* @__PURE__ */ jsxRuntime.jsx(MessageResponse, { children: cleaned }),
|
|
9694
9695
|
entry.isFinalTurnText && entry.msg.status === "complete" && /* @__PURE__ */ jsxRuntime.jsx(TurnFeedback, { msg: entry.msg })
|
|
9695
9696
|
] })
|
|
@@ -10175,6 +10176,15 @@ function deriveFileArtifactsFromMessages(messages) {
|
|
|
10175
10176
|
}
|
|
10176
10177
|
return out;
|
|
10177
10178
|
}
|
|
10179
|
+
function LoopResultAffordance({ message }) {
|
|
10180
|
+
if (!message?.loopResult) return null;
|
|
10181
|
+
const completedAt = message.loopResult.runCompletedAt ? new Date(message.loopResult.runCompletedAt) : null;
|
|
10182
|
+
const time = completedAt && !Number.isNaN(completedAt.getTime()) ? completedAt.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : "";
|
|
10183
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-muted-foreground/70", children: [
|
|
10184
|
+
"From loop",
|
|
10185
|
+
time ? ` \xB7 ${time}` : ""
|
|
10186
|
+
] });
|
|
10187
|
+
}
|
|
10178
10188
|
function SimpleAssistantGroup({
|
|
10179
10189
|
messages,
|
|
10180
10190
|
isRunning,
|
|
@@ -10242,14 +10252,17 @@ function SimpleAssistantGroup({
|
|
|
10242
10252
|
)
|
|
10243
10253
|
] }, message.id);
|
|
10244
10254
|
}) }),
|
|
10245
|
-
finalText && /* @__PURE__ */ jsxRuntime.
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10255
|
+
finalText && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
10256
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoopResultAffordance, { message: tail }),
|
|
10257
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10258
|
+
SimpleFinalAnswer,
|
|
10259
|
+
{
|
|
10260
|
+
text: finalText,
|
|
10261
|
+
isStreaming: tail?.status === "streaming",
|
|
10262
|
+
tail
|
|
10263
|
+
}
|
|
10264
|
+
)
|
|
10265
|
+
] }),
|
|
10253
10266
|
effectiveTurnSummary && !hideTurnSummary && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10254
10267
|
TurnSummaryCard,
|
|
10255
10268
|
{
|
|
@@ -11317,7 +11330,8 @@ var AGENT_CHAT_LISTENED_EVENTS = [
|
|
|
11317
11330
|
"browser.control_returned",
|
|
11318
11331
|
"ask_user_question.response",
|
|
11319
11332
|
"iteration.summary",
|
|
11320
|
-
"turn.summary"
|
|
11333
|
+
"turn.summary",
|
|
11334
|
+
"loop.result"
|
|
11321
11335
|
];
|
|
11322
11336
|
var AGENT_CHAT_LISTENED_EVENT_SET = new Set(
|
|
11323
11337
|
AGENT_CHAT_LISTENED_EVENTS
|
|
@@ -11384,6 +11398,22 @@ function applyAgentChatEvent(state, event) {
|
|
|
11384
11398
|
}
|
|
11385
11399
|
}
|
|
11386
11400
|
]);
|
|
11401
|
+
case "loop.result":
|
|
11402
|
+
return withMessages(nextState, [
|
|
11403
|
+
...nextState.messages,
|
|
11404
|
+
{
|
|
11405
|
+
id: `evt-${event.eventId}`,
|
|
11406
|
+
role: "assistant",
|
|
11407
|
+
content: stringValue2(event.data.content),
|
|
11408
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
11409
|
+
status: "complete",
|
|
11410
|
+
loopResult: {
|
|
11411
|
+
runSessionId: stringValue2(event.data.run_session_id) || void 0,
|
|
11412
|
+
scheduledSessionId: stringValue2(event.data.scheduled_session_id) || void 0,
|
|
11413
|
+
runCompletedAt: stringValue2(event.data.run_completed_at) || void 0
|
|
11414
|
+
}
|
|
11415
|
+
}
|
|
11416
|
+
]);
|
|
11387
11417
|
case "artifact.created":
|
|
11388
11418
|
case "artifact.updated":
|
|
11389
11419
|
return withMessages(nextState, [
|