@dudousxd/nestjs-agent-react 0.8.0 → 0.9.0

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/README.md CHANGED
@@ -417,6 +417,8 @@ const initialMessages = storedThreadToUiMessages(detail.messages);
417
417
  calls persists as "thinking…" + tool calls, then a separate final-answer row) into ONE `UIMessage` per
418
418
  conversational turn, matching how the live stream renders — and stamps `metadata.usage` on any turn it
419
419
  merged. For a single already-atomic row, `storedMessageToUiMessage` maps it 1:1 with no merging.
420
+ Persisted reasoning comes back as a `reasoning` part before the text (with its duration), and
421
+ persisted pushed components as `data-ui` parts, so a reloaded thread shows what the live one did.
420
422
 
421
423
  ### Attachments and the raw client
422
424
 
@@ -452,6 +454,19 @@ Reasoning frames arrive as `reasoning` parts on the message (the transport maps
452
454
  each run behind a disclosure toggle — open while it streams, folded once the answer lands — with
453
455
  `renderReasoning` and `reasoningLabel` slots to override the body and the label.
454
456
 
457
+ Thinking is timed and persisted: the backend reports each step's `reasoningMs` on `step-finish`, the
458
+ transport stamps it on the reasoning part, and the stored message keeps it, so a reasoning block's
459
+ `durationMs` reads the same live and after a reload. `useElapsed(running)` is the headless ticker
460
+ for while it still streams, and `formatElapsed(ms)` the label:
461
+
462
+ ```tsx
463
+ function ThoughtFor({ block }: { block: TranscriptReasoningBlock }) {
464
+ const elapsed = useElapsed(block.isStreaming);
465
+ const ms = block.isStreaming ? elapsed : block.durationMs;
466
+ return ms === null ? null : <span>Thought for {formatElapsed(ms)}</span>;
467
+ }
468
+ ```
469
+
455
470
  `ChatInput` surfaces cancel next to send:
456
471
 
457
472
  ```tsx