@invergent/agent-chat-react 2.1.9 → 2.2.1

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 CHANGED
@@ -8570,6 +8570,18 @@ function TextEntry({
8570
8570
  ] })
8571
8571
  ] });
8572
8572
  }
8573
+ function SimpleFinalAnswer({
8574
+ text,
8575
+ isStreaming,
8576
+ tail
8577
+ }) {
8578
+ const content = useSmoothStream(text, isStreaming);
8579
+ const revealComplete = content.length >= text.length;
8580
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3", children: [
8581
+ /* @__PURE__ */ jsxRuntime.jsx(MessageResponse, { children: content }),
8582
+ tail?.status === "complete" && revealComplete && /* @__PURE__ */ jsxRuntime.jsx(TurnFeedback, { msg: tail })
8583
+ ] });
8584
+ }
8573
8585
  function deriveIterationLabel(message) {
8574
8586
  const calls = visibleToolCalls(message);
8575
8587
  if (calls.length === 0) {
@@ -8946,6 +8958,7 @@ function SimpleAssistantGroup({
8946
8958
  lastGlobalIndex,
8947
8959
  totalMessages,
8948
8960
  isRunning,
8961
+ terminal,
8949
8962
  sessionId,
8950
8963
  artifactFallbacks,
8951
8964
  onFileSelect,
@@ -9002,10 +9015,14 @@ function SimpleAssistantGroup({
9002
9015
  }),
9003
9016
  showThinkingShim && /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { duration: 3, spread: 3, className: "text-sm", children: "Working on it..." })
9004
9017
  ] }),
9005
- finalText && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3", children: [
9006
- /* @__PURE__ */ jsxRuntime.jsx(MessageResponse, { children: finalText }),
9007
- tail?.status === "complete" && /* @__PURE__ */ jsxRuntime.jsx(TurnFeedback, { msg: tail })
9008
- ] }),
9018
+ finalText && /* @__PURE__ */ jsxRuntime.jsx(
9019
+ SimpleFinalAnswer,
9020
+ {
9021
+ text: finalText,
9022
+ isStreaming: tail?.status === "streaming",
9023
+ tail
9024
+ }
9025
+ ),
9009
9026
  effectiveTurnSummary ? /* @__PURE__ */ jsxRuntime.jsx(
9010
9027
  TurnSummaryCard,
9011
9028
  {
@@ -9018,10 +9035,12 @@ function SimpleAssistantGroup({
9018
9035
  // The harness summarizer runs after the last assistant
9019
9036
  // response and before ``session.complete``. Show a pending
9020
9037
  // placeholder during that window so users aren't surprised
9021
- // when the Summary card pops in. Gated on the tail group +
9022
- // a complete final answer + still-running session so the
9023
- // placeholder doesn't show on historic turns or mid-stream.
9024
- isTailGroup && isRunning && !!finalText && tail?.status === "complete" && /* @__PURE__ */ jsxRuntime.jsx(TurnSummaryPending, {})
9038
+ // when the Summary card pops in. Gated on ``!terminal``
9039
+ // rather than ``isRunning`` because the text-only final
9040
+ // ``llm.response`` already flips ``isRunning`` to false —
9041
+ // the summarizer then runs in the gap before
9042
+ // ``session.complete`` (which is what sets ``terminal``).
9043
+ isTailGroup && !terminal && !!finalText && tail?.status === "complete" && /* @__PURE__ */ jsxRuntime.jsx(TurnSummaryPending, {})
9025
9044
  ),
9026
9045
  showErrorInfo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorMessage, { errorInfo: tail.errorInfo, onRetry }) })
9027
9046
  ] }) });
@@ -9031,6 +9050,7 @@ function AssistantGroup({
9031
9050
  lastGlobalIndex,
9032
9051
  totalMessages,
9033
9052
  isRunning,
9053
+ terminal,
9034
9054
  sessionId,
9035
9055
  artifactFallbacks,
9036
9056
  onFileSelect,
@@ -9045,6 +9065,7 @@ function AssistantGroup({
9045
9065
  lastGlobalIndex,
9046
9066
  totalMessages,
9047
9067
  isRunning,
9068
+ terminal,
9048
9069
  sessionId,
9049
9070
  artifactFallbacks,
9050
9071
  onFileSelect,
@@ -9126,6 +9147,7 @@ function ChatThread({
9126
9147
  sessionId,
9127
9148
  messages,
9128
9149
  isRunning,
9150
+ terminal,
9129
9151
  isLoadingHistory = false,
9130
9152
  onSend,
9131
9153
  onStop,
@@ -9230,6 +9252,7 @@ function ChatThread({
9230
9252
  lastGlobalIndex: group.lastGlobalIndex,
9231
9253
  totalMessages: messages.length,
9232
9254
  isRunning,
9255
+ terminal,
9233
9256
  sessionId,
9234
9257
  artifactFallbacks,
9235
9258
  onFileSelect,
@@ -11298,6 +11321,7 @@ function useAgentChatRuntime({
11298
11321
  session,
11299
11322
  messages: state.messages,
11300
11323
  isRunning: state.isRunning,
11324
+ terminal: state.terminal,
11301
11325
  isLoadingHistory: state.isLoadingHistory,
11302
11326
  tokenUsage: state.tokenUsage,
11303
11327
  retryIndicator: state.retryIndicator,
@@ -11487,6 +11511,7 @@ function AgentChat({
11487
11511
  sessionId,
11488
11512
  messages: runtime.messages,
11489
11513
  isRunning: runtime.isRunning,
11514
+ terminal: runtime.terminal,
11490
11515
  isLoadingHistory: runtime.isLoadingHistory,
11491
11516
  onSend: (content, images, attachments) => runtime.send(content, images, attachments),
11492
11517
  onStop: () => runtime.stop(),