@poolse/react 3.2.0-dev.0 → 3.2.0-dev.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/CHANGELOG.md CHANGED
@@ -4,6 +4,19 @@ All notable changes to `@poolse/react` are documented here. Format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
5
5
  [semver](https://semver.org).
6
6
 
7
+ ## [3.2.0-dev.2] — 2026-11-16 (prerelease, npm tag `dev`)
8
+
9
+ ### Added
10
+
11
+ - `useCallRoom` returns `screenSharing`, `sharingParticipant`, `canShareScreen`,
12
+ `setScreenShareEnabled()` and `toggleScreenShare()`.
13
+
14
+ ## [3.2.0-dev.1] — 2026-11-04 (prerelease, npm tag `dev`)
15
+
16
+ ### Added
17
+
18
+ - `useMessageStreams` exposes the tool an agent is running as `stream.tool`.
19
+
7
20
  ## [3.2.0-dev.0] — 2026-11-04 (prerelease, npm tag `dev`)
8
21
 
9
22
  ### Added
package/dist/index.cjs CHANGED
@@ -891,7 +891,11 @@ function useMessageStreams(conversationId) {
891
891
  status: "streaming"
892
892
  };
893
893
  let next;
894
- if (evt.status === "delta") next = { ...base, text: base.text + (evt.delta ?? "") };
894
+ if (evt.status === "delta") {
895
+ const { tool: _done, ...rest } = base;
896
+ next = { ...rest, text: base.text + (evt.delta ?? "") };
897
+ } else if (evt.status === "tool")
898
+ next = { ...base, ...evt.tool ? { tool: evt.tool } : {} };
895
899
  else if (evt.status === "failed")
896
900
  next = { ...base, status: "failed", ...evt.error ? { error: evt.error } : {} };
897
901
  else
@@ -1157,6 +1161,8 @@ function useCallRoom(conversationId, opts) {
1157
1161
  const [participants, setParticipants] = react.useState([]);
1158
1162
  const [cameraEnabled, setCamera] = react.useState(false);
1159
1163
  const [micEnabled, setMic] = react.useState(false);
1164
+ const [screenSharing, setScreen] = react.useState(false);
1165
+ const [canShareScreen, setCanShare] = react.useState(false);
1160
1166
  const [facingMode, setFacing] = react.useState(opts.facing ?? "user");
1161
1167
  const [alone, setAlone] = react.useState(false);
1162
1168
  const [devices, setDevices] = react.useState({
@@ -1200,6 +1206,8 @@ function useCallRoom(conversationId, opts) {
1200
1206
  if (!target) return;
1201
1207
  setCamera(target.isCameraEnabled());
1202
1208
  setMic(target.isMicrophoneEnabled());
1209
+ setScreen(target.isScreenShareEnabled());
1210
+ setCanShare(target.canShareScreen());
1203
1211
  setFacing(target.getFacingMode());
1204
1212
  }, []);
1205
1213
  react.useEffect(() => {
@@ -1283,6 +1291,22 @@ function useCallRoom(conversationId, opts) {
1283
1291
  if (!room) return;
1284
1292
  await setMicrophoneEnabled(!room.isMicrophoneEnabled());
1285
1293
  }, [room, setMicrophoneEnabled]);
1294
+ const setScreenShareEnabled = react.useCallback(
1295
+ async (enabled) => {
1296
+ if (!room) return;
1297
+ await room.setScreenShareEnabled(enabled);
1298
+ sync(room);
1299
+ },
1300
+ [room, sync]
1301
+ );
1302
+ const toggleScreenShare = react.useCallback(async () => {
1303
+ if (!room) return;
1304
+ await setScreenShareEnabled(!room.isScreenShareEnabled());
1305
+ }, [room, setScreenShareEnabled]);
1306
+ const sharingParticipant = react.useMemo(
1307
+ () => participants.find((p) => p.screenSharing) ?? null,
1308
+ [participants]
1309
+ );
1286
1310
  const switchCamera = react.useCallback(async () => {
1287
1311
  if (!room) return;
1288
1312
  await room.switchCamera();
@@ -1307,6 +1331,9 @@ function useCallRoom(conversationId, opts) {
1307
1331
  participants,
1308
1332
  cameraEnabled,
1309
1333
  micEnabled,
1334
+ screenSharing,
1335
+ sharingParticipant,
1336
+ canShareScreen,
1310
1337
  facingMode,
1311
1338
  alone,
1312
1339
  devices,
@@ -1321,7 +1348,9 @@ function useCallRoom(conversationId, opts) {
1321
1348
  switchCamera,
1322
1349
  selectDevice,
1323
1350
  setMicrophoneEnabled,
1324
- toggleMic
1351
+ toggleMic,
1352
+ setScreenShareEnabled,
1353
+ toggleScreenShare
1325
1354
  };
1326
1355
  }
1327
1356
  function useLiveCall(conversationId) {