@invergent/agent-chat-react 2.10.1 → 2.10.2

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.d.cts CHANGED
@@ -73,6 +73,11 @@ interface AgentChatMessage {
73
73
  iterationIndex?: number;
74
74
  iterationSummary?: AgentChatIterationSummary;
75
75
  turnSummary?: AgentChatTurnSummary;
76
+ loopResult?: {
77
+ runSessionId?: string;
78
+ scheduledSessionId?: string;
79
+ runCompletedAt?: string;
80
+ };
76
81
  }
77
82
  interface AgentChatIterationSummary {
78
83
  iterationIndex: number;
@@ -376,7 +381,7 @@ interface AgentChatInboxEventStream {
376
381
  close(): void;
377
382
  onerror: (() => void) | null;
378
383
  }
379
- type AgentChatEventType = "user.message" | "llm.request" | "llm.response" | "llm.thinking" | "llm.delta" | "tool.call" | "tool.result" | "session.start" | "session.pause" | "session.resume" | "session.complete" | "session.fail" | "session.done" | "harness.wake" | "harness.crash" | "context.compact" | "skill.invoked" | "policy.denied" | "stream.timeout" | "expert.delegation" | "expert.result" | "expert.failure" | "expert.endorse" | "expert.override" | "code.run_started" | "code.run_progress" | "code.run_result" | "user.feedback" | "artifact.created" | "artifact.updated" | "browser.provisioned" | "browser.destroyed" | "browser.control_granted" | "browser.control_returned" | "ask_user_question.response" | "iteration.summary" | "turn.summary";
384
+ type AgentChatEventType = "user.message" | "llm.request" | "llm.response" | "llm.thinking" | "llm.delta" | "tool.call" | "tool.result" | "session.start" | "session.pause" | "session.resume" | "session.complete" | "session.fail" | "session.done" | "harness.wake" | "harness.crash" | "context.compact" | "skill.invoked" | "policy.denied" | "stream.timeout" | "expert.delegation" | "expert.result" | "expert.failure" | "expert.endorse" | "expert.override" | "code.run_started" | "code.run_progress" | "code.run_result" | "user.feedback" | "artifact.created" | "artifact.updated" | "browser.provisioned" | "browser.destroyed" | "browser.control_granted" | "browser.control_returned" | "ask_user_question.response" | "iteration.summary" | "turn.summary" | "loop.result";
380
385
  interface AgentChatRuntimeEvent {
381
386
  type: AgentChatEventType;
382
387
  eventId: number;
package/dist/index.d.ts CHANGED
@@ -73,6 +73,11 @@ interface AgentChatMessage {
73
73
  iterationIndex?: number;
74
74
  iterationSummary?: AgentChatIterationSummary;
75
75
  turnSummary?: AgentChatTurnSummary;
76
+ loopResult?: {
77
+ runSessionId?: string;
78
+ scheduledSessionId?: string;
79
+ runCompletedAt?: string;
80
+ };
76
81
  }
77
82
  interface AgentChatIterationSummary {
78
83
  iterationIndex: number;
@@ -376,7 +381,7 @@ interface AgentChatInboxEventStream {
376
381
  close(): void;
377
382
  onerror: (() => void) | null;
378
383
  }
379
- type AgentChatEventType = "user.message" | "llm.request" | "llm.response" | "llm.thinking" | "llm.delta" | "tool.call" | "tool.result" | "session.start" | "session.pause" | "session.resume" | "session.complete" | "session.fail" | "session.done" | "harness.wake" | "harness.crash" | "context.compact" | "skill.invoked" | "policy.denied" | "stream.timeout" | "expert.delegation" | "expert.result" | "expert.failure" | "expert.endorse" | "expert.override" | "code.run_started" | "code.run_progress" | "code.run_result" | "user.feedback" | "artifact.created" | "artifact.updated" | "browser.provisioned" | "browser.destroyed" | "browser.control_granted" | "browser.control_returned" | "ask_user_question.response" | "iteration.summary" | "turn.summary";
384
+ type AgentChatEventType = "user.message" | "llm.request" | "llm.response" | "llm.thinking" | "llm.delta" | "tool.call" | "tool.result" | "session.start" | "session.pause" | "session.resume" | "session.complete" | "session.fail" | "session.done" | "harness.wake" | "harness.crash" | "context.compact" | "skill.invoked" | "policy.denied" | "stream.timeout" | "expert.delegation" | "expert.result" | "expert.failure" | "expert.endorse" | "expert.override" | "code.run_started" | "code.run_progress" | "code.run_result" | "user.feedback" | "artifact.created" | "artifact.updated" | "browser.provisioned" | "browser.destroyed" | "browser.control_granted" | "browser.control_returned" | "ask_user_question.response" | "iteration.summary" | "turn.summary" | "loop.result";
380
385
  interface AgentChatRuntimeEvent {
381
386
  type: AgentChatEventType;
382
387
  eventId: number;
package/dist/index.js CHANGED
@@ -9380,6 +9380,7 @@ function TextEntry({
9380
9380
  /* @__PURE__ */ jsx(TimelineIndicator, { className: "size-2 border-none bg-foreground/40" })
9381
9381
  ] }),
9382
9382
  /* @__PURE__ */ jsxs(TimelineContent, { children: [
9383
+ /* @__PURE__ */ jsx(LoopResultAffordance, { message: entry.msg }),
9383
9384
  /* @__PURE__ */ jsx(MessageResponse, { children: cleaned }),
9384
9385
  entry.isFinalTurnText && entry.msg.status === "complete" && /* @__PURE__ */ jsx(TurnFeedback, { msg: entry.msg })
9385
9386
  ] })
@@ -9865,6 +9866,15 @@ function deriveFileArtifactsFromMessages(messages) {
9865
9866
  }
9866
9867
  return out;
9867
9868
  }
9869
+ function LoopResultAffordance({ message }) {
9870
+ if (!message?.loopResult) return null;
9871
+ const completedAt = message.loopResult.runCompletedAt ? new Date(message.loopResult.runCompletedAt) : null;
9872
+ const time = completedAt && !Number.isNaN(completedAt.getTime()) ? completedAt.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : "";
9873
+ return /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground/70", children: [
9874
+ "From loop",
9875
+ time ? ` \xB7 ${time}` : ""
9876
+ ] });
9877
+ }
9868
9878
  function SimpleAssistantGroup({
9869
9879
  messages,
9870
9880
  isRunning,
@@ -9932,14 +9942,17 @@ function SimpleAssistantGroup({
9932
9942
  )
9933
9943
  ] }, message.id);
9934
9944
  }) }),
9935
- finalText && /* @__PURE__ */ jsx(
9936
- SimpleFinalAnswer,
9937
- {
9938
- text: finalText,
9939
- isStreaming: tail?.status === "streaming",
9940
- tail
9941
- }
9942
- ),
9945
+ finalText && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
9946
+ /* @__PURE__ */ jsx(LoopResultAffordance, { message: tail }),
9947
+ /* @__PURE__ */ jsx(
9948
+ SimpleFinalAnswer,
9949
+ {
9950
+ text: finalText,
9951
+ isStreaming: tail?.status === "streaming",
9952
+ tail
9953
+ }
9954
+ )
9955
+ ] }),
9943
9956
  effectiveTurnSummary && !hideTurnSummary && /* @__PURE__ */ jsx(
9944
9957
  TurnSummaryCard,
9945
9958
  {
@@ -10998,7 +11011,8 @@ var AGENT_CHAT_LISTENED_EVENTS = [
10998
11011
  "browser.control_returned",
10999
11012
  "ask_user_question.response",
11000
11013
  "iteration.summary",
11001
- "turn.summary"
11014
+ "turn.summary",
11015
+ "loop.result"
11002
11016
  ];
11003
11017
  var AGENT_CHAT_LISTENED_EVENT_SET = new Set(
11004
11018
  AGENT_CHAT_LISTENED_EVENTS
@@ -11065,6 +11079,22 @@ function applyAgentChatEvent(state, event) {
11065
11079
  }
11066
11080
  }
11067
11081
  ]);
11082
+ case "loop.result":
11083
+ return withMessages(nextState, [
11084
+ ...nextState.messages,
11085
+ {
11086
+ id: `evt-${event.eventId}`,
11087
+ role: "assistant",
11088
+ content: stringValue2(event.data.content),
11089
+ createdAt: /* @__PURE__ */ new Date(),
11090
+ status: "complete",
11091
+ loopResult: {
11092
+ runSessionId: stringValue2(event.data.run_session_id) || void 0,
11093
+ scheduledSessionId: stringValue2(event.data.scheduled_session_id) || void 0,
11094
+ runCompletedAt: stringValue2(event.data.run_completed_at) || void 0
11095
+ }
11096
+ }
11097
+ ]);
11068
11098
  case "artifact.created":
11069
11099
  case "artifact.updated":
11070
11100
  return withMessages(nextState, [