@poolse/react-native 3.1.0 → 3.2.0-dev.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/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to `@poolse/react-native` are documented here.
4
4
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/);
5
5
  versions follow [semver](https://semver.org).
6
6
 
7
+ ## [3.2.0-dev.1] — 2026-11-04 (prerelease, npm tag `dev`)
8
+
9
+ ### Added
10
+
11
+ - `<ConversationView>` streams AI agent replies as they're written, like `@poolse/react-ui`: typing first, then a growing bubble, replaced by the finished message.
12
+
13
+ ## [3.2.0-dev.0] — 2026-11-04 (prerelease, npm tag `dev`)
14
+
15
+ ### Changed
16
+
17
+ - Moves with `@poolse/sdk` 3.2.0-dev.0.
18
+
7
19
  ## [3.1.0] — 2026-10-27
8
20
 
9
21
  ### Fixed
package/dist/index.cjs CHANGED
@@ -4279,7 +4279,16 @@ function ConversationView({
4279
4279
  markReadUpTo,
4280
4280
  refetch
4281
4281
  } = react$1.useMessages(conversationId);
4282
- const { typing, signalTyping } = react$1.useTyping(conversationId);
4282
+ const { typing: typingPeople, signalTyping } = react$1.useTyping(conversationId);
4283
+ const streams = react$1.useMessageStreams(conversationId);
4284
+ const typing = react.useMemo(() => {
4285
+ const thinking = streams.filter((s) => s.status === "streaming" && !s.text);
4286
+ if (thinking.length === 0) return typingPeople;
4287
+ const next = new Set(typingPeople);
4288
+ for (const s of thinking) if (s.sender_external_id) next.add(s.sender_external_id);
4289
+ return next;
4290
+ }, [typingPeople, streams]);
4291
+ const visibleStreams = streams.filter((s) => s.text || s.status === "failed");
4283
4292
  const realtimeStatus = react$1.useRealtimeStatus();
4284
4293
  react.useEffect(() => {
4285
4294
  const sub = reactNative.AppState.addEventListener("change", (next) => {
@@ -4503,7 +4512,37 @@ function ConversationView({
4503
4512
  hasMore,
4504
4513
  onLoadMore: loadMore,
4505
4514
  renderItem,
4506
- ListHeader: /* @__PURE__ */ jsxRuntime.jsx(TypingIndicator, { typing, ...labelFor ? { labelFor } : {} }),
4515
+ ListHeader: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
4516
+ visibleStreams.map(
4517
+ (stream) => stream.status === "failed" ? /* @__PURE__ */ jsxRuntime.jsx(
4518
+ reactNative.Text,
4519
+ {
4520
+ style: [styles22.streamFailed, { color: theme.colors.ink3 }],
4521
+ accessibilityRole: "alert",
4522
+ children: stream.error ? `The agent couldn't reply: ${stream.error}` : "The agent couldn't reply."
4523
+ },
4524
+ stream.id
4525
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
4526
+ MessageRow,
4527
+ {
4528
+ msg: streamingMessage(stream),
4529
+ meId,
4530
+ reactions: false,
4531
+ attachments: false,
4532
+ actions: false,
4533
+ threads: false,
4534
+ quotations: false,
4535
+ ...labelFor ? { labelFor } : {},
4536
+ ...avatarFor ? { avatarFor } : {},
4537
+ showSenderName: showSenderLabels,
4538
+ showAvatar: showAvatars,
4539
+ markdown
4540
+ },
4541
+ stream.id
4542
+ )
4543
+ ),
4544
+ /* @__PURE__ */ jsxRuntime.jsx(TypingIndicator, { typing, ...labelFor ? { labelFor } : {} })
4545
+ ] }),
4507
4546
  ...emptyState !== void 0 ? { emptyState } : {}
4508
4547
  }
4509
4548
  ),
@@ -4560,6 +4599,11 @@ var styles22 = reactNative.StyleSheet.create({
4560
4599
  root: {
4561
4600
  flex: 1
4562
4601
  },
4602
+ streamFailed: {
4603
+ fontSize: 12,
4604
+ marginHorizontal: 16,
4605
+ marginVertical: 4
4606
+ },
4563
4607
  listWrap: {
4564
4608
  flex: 1
4565
4609
  },
@@ -4572,6 +4616,27 @@ var styles22 = reactNative.StyleSheet.create({
4572
4616
  zIndex: 5
4573
4617
  }
4574
4618
  });
4619
+ function streamingMessage(stream) {
4620
+ const now = (/* @__PURE__ */ new Date()).toISOString();
4621
+ return {
4622
+ id: stream.id,
4623
+ tenant_id: "",
4624
+ conversation_id: stream.conversation_id,
4625
+ sender_id: stream.sender_id,
4626
+ sender_external_id: stream.sender_external_id,
4627
+ type: "text",
4628
+ body: `${stream.text} \u258D`,
4629
+ reply_to_id: null,
4630
+ thread_root_id: null,
4631
+ mentions: [],
4632
+ reactions: {},
4633
+ edited_at: null,
4634
+ deleted_at: null,
4635
+ sequence: Number.MAX_SAFE_INTEGER,
4636
+ inserted_at: now,
4637
+ updated_at: now
4638
+ };
4639
+ }
4575
4640
  function UserPickerSheet({
4576
4641
  visible,
4577
4642
  onClose,