@dxos/plugin-thread 0.8.4-main.c1de068 → 0.8.4-main.c4373fc
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/lib/browser/ChannelContainer-BGDGZHV4.mjs +16 -0
- package/dist/lib/browser/ChatContainer-75KJZ4XR.mjs +15 -0
- package/dist/lib/browser/{app-graph-builder-N7BE5TYW.mjs → app-graph-builder-ODKIAXR7.mjs} +19 -19
- package/dist/lib/browser/app-graph-builder-ODKIAXR7.mjs.map +7 -0
- package/dist/lib/browser/{call-manager-NIPDYUVD.mjs → call-manager-BCKLI4QD.mjs} +7 -7
- package/dist/lib/browser/call-manager-BCKLI4QD.mjs.map +7 -0
- package/dist/lib/browser/chunk-2MUYQOQE.mjs +23 -0
- package/dist/lib/browser/{chunk-4OYAYON2.mjs.map → chunk-2MUYQOQE.mjs.map} +3 -3
- package/dist/lib/browser/chunk-B7YQ7QR2.mjs +376 -0
- package/dist/lib/browser/chunk-B7YQ7QR2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KWPRNHTK.mjs → chunk-CMCVHULC.mjs} +235 -233
- package/dist/lib/browser/chunk-CMCVHULC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GERVMFQW.mjs → chunk-CP7E2HRE.mjs} +2 -2
- package/dist/lib/browser/chunk-CP7E2HRE.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ERWASUQK.mjs → chunk-HDEQRBOC.mjs} +38 -6
- package/dist/lib/{node-esm/chunk-25ABSYP2.mjs.map → browser/chunk-HDEQRBOC.mjs.map} +4 -4
- package/dist/lib/browser/chunk-L326LSNS.mjs +18 -0
- package/dist/lib/browser/chunk-L326LSNS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EV4JWI7L.mjs → chunk-T4KJ5JR4.mjs} +5 -7
- package/dist/lib/browser/chunk-T4KJ5JR4.mjs.map +7 -0
- package/dist/lib/browser/chunk-VJMKS4CZ.mjs +619 -0
- package/dist/lib/browser/chunk-VJMKS4CZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GCLD5ESP.mjs → chunk-VTYX3SIM.mjs} +26 -16
- package/dist/lib/browser/chunk-VTYX3SIM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6NSMBO3B.mjs → chunk-XYUJXHYV.mjs} +55 -5
- package/dist/lib/browser/chunk-XYUJXHYV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZE7KWN36.mjs → chunk-ZCEU5K23.mjs} +461 -240
- package/dist/lib/browser/chunk-ZCEU5K23.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +23 -14
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-JFGLZ6VI.mjs → intent-resolver-VOQD3TQ2.mjs} +75 -17
- package/dist/lib/browser/intent-resolver-VOQD3TQ2.mjs.map +7 -0
- package/dist/lib/browser/{markdown-GEXBVJYN.mjs → markdown-R6MGRIA6.mjs} +7 -7
- package/dist/lib/browser/markdown-R6MGRIA6.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-UMSBTN6H.mjs +28 -0
- package/dist/lib/browser/react-root-UMSBTN6H.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-YCYEFBPM.mjs → react-surface-SXMQEWKE.mjs} +22 -22
- package/dist/lib/browser/react-surface-SXMQEWKE.mjs.map +7 -0
- package/dist/lib/browser/{settings-E32MTL7A.mjs → settings-TCNF54PN.mjs} +5 -5
- package/dist/lib/browser/{settings-E32MTL7A.mjs.map → settings-TCNF54PN.mjs.map} +1 -1
- package/dist/lib/browser/{state-H6CYONWE.mjs → state-ZQ4IPOJT.mjs} +5 -5
- package/dist/lib/browser/state-ZQ4IPOJT.mjs.map +7 -0
- package/dist/lib/browser/toolkit-JF4B4QIO.mjs +84 -0
- package/dist/lib/browser/toolkit-JF4B4QIO.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/ChannelContainer-OXC6BTU7.mjs +17 -0
- package/dist/lib/node-esm/{ChatContainer-IQUWU426.mjs → ChatContainer-SH6LTFQL.mjs} +6 -6
- package/dist/lib/node-esm/{app-graph-builder-VCW76Z6V.mjs → app-graph-builder-DMPT3MY6.mjs} +19 -19
- package/dist/lib/node-esm/app-graph-builder-DMPT3MY6.mjs.map +7 -0
- package/dist/lib/node-esm/{call-manager-D6O5ZJJ4.mjs → call-manager-Q7RY2YP4.mjs} +7 -7
- package/dist/lib/node-esm/call-manager-Q7RY2YP4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-C3XFMUAY.mjs → chunk-2KZ4ODHU.mjs} +235 -233
- package/dist/lib/node-esm/chunk-2KZ4ODHU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-25ABSYP2.mjs → chunk-2MMJF7DW.mjs} +38 -6
- package/dist/lib/node-esm/chunk-2MMJF7DW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OU5BYIDO.mjs → chunk-2V3WSLUZ.mjs} +55 -5
- package/dist/lib/node-esm/chunk-2V3WSLUZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-57XR3LEF.mjs → chunk-ABUFOZVX.mjs} +2 -2
- package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TDFHTCZZ.mjs → chunk-BAMZXJS4.mjs} +26 -16
- package/dist/lib/node-esm/chunk-BAMZXJS4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BTGKI5IK.mjs +377 -0
- package/dist/lib/node-esm/chunk-BTGKI5IK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GZ4WL2IS.mjs +25 -0
- package/dist/lib/node-esm/{chunk-GW37AAM4.mjs.map → chunk-GZ4WL2IS.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-LCHTNRK7.mjs +19 -0
- package/dist/lib/node-esm/chunk-LCHTNRK7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NHSIAEDW.mjs +620 -0
- package/dist/lib/node-esm/chunk-NHSIAEDW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GRLRWTRU.mjs → chunk-OBVAURUU.mjs} +5 -7
- package/dist/lib/node-esm/chunk-OBVAURUU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-IHDNQLLR.mjs → chunk-TIPIOH2J.mjs} +461 -240
- package/dist/lib/node-esm/chunk-TIPIOH2J.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +23 -14
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-OXGNQ44Y.mjs → intent-resolver-AKVH66PH.mjs} +75 -17
- package/dist/lib/node-esm/intent-resolver-AKVH66PH.mjs.map +7 -0
- package/dist/lib/node-esm/{markdown-LIJZDK2J.mjs → markdown-MYGTDXT6.mjs} +7 -7
- package/dist/lib/node-esm/markdown-MYGTDXT6.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-root-W6AVTL5M.mjs +29 -0
- package/dist/lib/node-esm/react-root-W6AVTL5M.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-IRSEKM42.mjs → react-surface-NLSZJGMO.mjs} +22 -22
- package/dist/lib/node-esm/react-surface-NLSZJGMO.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-SJ24YG7M.mjs → settings-ZQHGVFBY.mjs} +5 -5
- package/dist/lib/node-esm/{settings-SJ24YG7M.mjs.map → settings-ZQHGVFBY.mjs.map} +1 -1
- package/dist/lib/node-esm/{state-D7WNDT3N.mjs → state-FSLLJ5TZ.mjs} +5 -5
- package/dist/lib/node-esm/state-FSLLJ5TZ.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-DHPKJITO.mjs +85 -0
- package/dist/lib/node-esm/toolkit-DHPKJITO.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/ThreadPlugin.d.ts +1 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/calls/call-manager.d.ts.map +1 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
- package/dist/types/src/calls/media-manager.d.ts +1 -1
- package/dist/types/src/calls/media-manager.d.ts.map +1 -1
- package/dist/types/src/calls/types.d.ts +1 -1
- package/dist/types/src/calls/types.d.ts.map +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts +4 -2
- package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
- package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
- package/dist/types/src/calls-service.stories.d.ts +10 -9
- package/dist/types/src/calls-service.stories.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/call-manager.d.ts +1 -1
- package/dist/types/src/capabilities/call-manager.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +2 -2
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +11 -10
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +6 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/Call/Call.d.ts.map +1 -1
- package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/CallDebugPanel.d.ts +7 -0
- package/dist/types/src/components/CallDebugPanel.d.ts.map +1 -1
- package/dist/types/src/components/CallSidebar.d.ts.map +1 -1
- package/dist/types/src/components/ChannelContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +89 -5
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat.stories.d.ts +91 -5
- package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/Comments.stories.d.ts +160 -4
- package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
- package/dist/types/src/components/CommentsThreadContainer.d.ts +2 -2
- package/dist/types/src/components/CommentsThreadContainer.d.ts.map +1 -1
- package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.d.ts +2 -2
- package/dist/types/src/components/Media/VideoObject.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +18 -4
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
- package/dist/types/src/components/MessageContainer.d.ts +4 -1
- package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
- package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +155 -3
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +157 -4
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
- package/dist/types/src/components/ThreadComplementary.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings.d.ts +1 -1
- package/dist/types/src/components/ThreadSettings.d.ts.map +1 -1
- package/dist/types/src/components/command-extension.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +1 -0
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts +2 -2
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +2 -0
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +1 -0
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts +1 -1
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +126 -109
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +259 -172
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +62 -58
- package/src/ThreadPlugin.tsx +130 -124
- package/src/calls/call-manager.ts +2 -2
- package/src/calls/call-swarm-synchronizer.ts +1 -1
- package/src/calls/media-manager.ts +60 -34
- package/src/calls/types.ts +8 -4
- package/src/calls/util/calls-service.ts +65 -14
- package/src/calls/util/stub-media-streams.ts +62 -5
- package/src/calls-service.stories.tsx +78 -65
- package/src/capabilities/app-graph-builder.ts +18 -14
- package/src/capabilities/call-manager.ts +3 -2
- package/src/capabilities/capabilities.ts +7 -7
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +43 -9
- package/src/capabilities/markdown.ts +4 -3
- package/src/capabilities/react-root.tsx +2 -2
- package/src/capabilities/react-surface.tsx +14 -13
- package/src/capabilities/state.ts +2 -1
- package/src/capabilities/toolkit.ts +82 -0
- package/src/components/Call/Call.tsx +3 -2
- package/src/components/Call/Toolbar.tsx +5 -5
- package/src/components/CallDebugPanel.tsx +108 -49
- package/src/components/CallSidebar.tsx +2 -1
- package/src/components/ChannelContainer.stories.tsx +11 -10
- package/src/components/ChannelContainer.tsx +8 -7
- package/src/components/Chat.stories.tsx +34 -31
- package/src/components/ChatContainer.tsx +8 -4
- package/src/components/Comments.stories.tsx +39 -38
- package/src/components/CommentsContainer.tsx +2 -1
- package/src/components/CommentsThreadContainer.tsx +9 -7
- package/src/components/Lobby/Lobby.tsx +1 -1
- package/src/components/Media/VideoObject.stories.tsx +36 -28
- package/src/components/MessageContainer.tsx +43 -9
- package/src/components/Participant/Participant.tsx +13 -7
- package/src/components/Participant/ParticipantGrid.tsx +2 -1
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +8 -8
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +44 -42
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +1 -1
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +2 -2
- package/src/components/ThreadComplementary.tsx +37 -7
- package/src/components/ThreadSettings.tsx +6 -7
- package/src/components/command-extension.ts +5 -2
- package/src/components/testing.ts +22 -0
- package/src/extensions/threads.ts +6 -6
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useBlackCanvasStreamTrack.tsx +27 -0
- package/src/hooks/useDebugMode.ts +1 -1
- package/src/hooks/useVideoStreamTrack.tsx +6 -3
- package/src/meta.ts +3 -4
- package/src/testing/stories.ts +3 -3
- package/src/translations.ts +3 -1
- package/src/types/schema.ts +1 -1
- package/src/types/types.ts +22 -13
- package/src/typings/peermetrics-webrtc-stats.d.ts +17 -1
- package/src/typings.d.ts +8 -0
- package/src/util.ts +1 -1
- package/dist/lib/browser/ChannelContainer-IY2UIRLF.mjs +0 -16
- package/dist/lib/browser/ChatContainer-AIGIWAUG.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-N7BE5TYW.mjs.map +0 -7
- package/dist/lib/browser/call-manager-NIPDYUVD.mjs.map +0 -7
- package/dist/lib/browser/chunk-4OYAYON2.mjs +0 -21
- package/dist/lib/browser/chunk-6NSMBO3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-ERWASUQK.mjs.map +0 -7
- package/dist/lib/browser/chunk-EV4JWI7L.mjs.map +0 -7
- package/dist/lib/browser/chunk-GCLD5ESP.mjs.map +0 -7
- package/dist/lib/browser/chunk-GERVMFQW.mjs.map +0 -7
- package/dist/lib/browser/chunk-KWPRNHTK.mjs.map +0 -7
- package/dist/lib/browser/chunk-LGSDKXPF.mjs +0 -18
- package/dist/lib/browser/chunk-LGSDKXPF.mjs.map +0 -7
- package/dist/lib/browser/chunk-VUWC4IJM.mjs +0 -479
- package/dist/lib/browser/chunk-VUWC4IJM.mjs.map +0 -7
- package/dist/lib/browser/chunk-XLPJXUKO.mjs +0 -367
- package/dist/lib/browser/chunk-XLPJXUKO.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZE7KWN36.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-JFGLZ6VI.mjs.map +0 -7
- package/dist/lib/browser/markdown-GEXBVJYN.mjs.map +0 -7
- package/dist/lib/browser/react-root-X4UIVGTX.mjs +0 -28
- package/dist/lib/browser/react-root-X4UIVGTX.mjs.map +0 -7
- package/dist/lib/browser/react-surface-YCYEFBPM.mjs.map +0 -7
- package/dist/lib/browser/state-H6CYONWE.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-DET6T5N2.mjs +0 -17
- package/dist/lib/node-esm/app-graph-builder-VCW76Z6V.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-D6O5ZJJ4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2MFNK53T.mjs +0 -480
- package/dist/lib/node-esm/chunk-2MFNK53T.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-57XR3LEF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-75RJ5DJI.mjs +0 -19
- package/dist/lib/node-esm/chunk-75RJ5DJI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-C3XFMUAY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GRLRWTRU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GW37AAM4.mjs +0 -23
- package/dist/lib/node-esm/chunk-IHDNQLLR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J4NSON5Q.mjs +0 -368
- package/dist/lib/node-esm/chunk-J4NSON5Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OU5BYIDO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TDFHTCZZ.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-OXGNQ44Y.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-LIJZDK2J.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-M7J6PZVW.mjs +0 -29
- package/dist/lib/node-esm/react-root-M7J6PZVW.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-IRSEKM42.mjs.map +0 -7
- package/dist/lib/node-esm/state-D7WNDT3N.mjs.map +0 -7
- /package/dist/lib/browser/{ChannelContainer-IY2UIRLF.mjs.map → ChannelContainer-BGDGZHV4.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-AIGIWAUG.mjs.map → ChatContainer-75KJZ4XR.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChannelContainer-DET6T5N2.mjs.map → ChannelContainer-OXC6BTU7.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-IQUWU426.mjs.map → ChatContainer-SH6LTFQL.mjs.map} +0 -0
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
import { defineCapability } from '@dxos/app-framework';
|
|
6
6
|
import { type DeepReadonly } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
import { type
|
|
9
|
-
import {
|
|
10
|
-
import { type
|
|
8
|
+
import { type CallManager, type CallState, type MediaState } from '../calls';
|
|
9
|
+
import { meta } from '../meta';
|
|
10
|
+
import { type ChannelType, type ThreadState, type ViewState } from '../types';
|
|
11
11
|
|
|
12
12
|
export namespace ThreadCapabilities {
|
|
13
|
-
export const CallManager = defineCapability<CallManager>(`${
|
|
13
|
+
export const CallManager = defineCapability<CallManager>(`${meta.id}/capability/call-manager`);
|
|
14
14
|
|
|
15
15
|
// TODO(burdon): Better way to define specific extensions for meeting companions.
|
|
16
16
|
// TODO(burdon): This brings in deps from ../calls; how should we manage/minimize explicit type exposure to other plugins?
|
|
@@ -21,13 +21,13 @@ export namespace ThreadCapabilities {
|
|
|
21
21
|
onCallStateUpdated: (callState: CallState) => Promise<void>;
|
|
22
22
|
onMediaStateUpdated: ([mediaState, isSpeaking]: [MediaState, boolean]) => Promise<void>;
|
|
23
23
|
};
|
|
24
|
-
export const CallExtension = defineCapability<CallProperties>(`${
|
|
24
|
+
export const CallExtension = defineCapability<CallProperties>(`${meta.id}/capability/call-extension`);
|
|
25
25
|
|
|
26
26
|
type GetViewState = (subjectId: string) => ViewState;
|
|
27
27
|
export const State = defineCapability<{ state: DeepReadonly<ThreadState>; getViewState: GetViewState }>(
|
|
28
|
-
`${
|
|
28
|
+
`${meta.id}/capability/state`,
|
|
29
29
|
);
|
|
30
30
|
export const MutableState = defineCapability<{ state: ThreadState; getViewState: GetViewState }>(
|
|
31
|
-
`${
|
|
31
|
+
`${meta.id}/capability/state`,
|
|
32
32
|
);
|
|
33
33
|
}
|
|
@@ -12,5 +12,6 @@ export const ReactRoot = lazy(() => import('./react-root'));
|
|
|
12
12
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
13
13
|
export const ThreadSettings = lazy(() => import('./settings'));
|
|
14
14
|
export const ThreadState = lazy(() => import('./state'));
|
|
15
|
+
export const Toolkit = lazy(() => import('./toolkit'));
|
|
15
16
|
|
|
16
17
|
export * from './capabilities';
|
|
@@ -2,26 +2,27 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, createIntent, createResolver
|
|
7
|
+
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
8
|
import { sleep } from '@dxos/async';
|
|
9
9
|
import { Obj, Relation, Type } from '@dxos/echo';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
11
|
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
|
|
12
12
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
13
13
|
import { CollectionAction, SpaceAction } from '@dxos/plugin-space/types';
|
|
14
|
-
import { fullyQualifiedId, getSpace
|
|
14
|
+
import { Ref, fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
|
|
15
15
|
import { AnchoredTo, DataType } from '@dxos/schema';
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import { THREAD_PLUGIN } from '../meta';
|
|
17
|
+
import { meta } from '../meta';
|
|
19
18
|
import { ChannelType, ThreadAction, ThreadType } from '../types';
|
|
20
19
|
|
|
20
|
+
import { ThreadCapabilities } from './capabilities';
|
|
21
|
+
|
|
21
22
|
export default (context: PluginContext) =>
|
|
22
23
|
contributes(Capabilities.IntentResolver, [
|
|
23
24
|
createResolver({
|
|
24
|
-
intent: ThreadAction.
|
|
25
|
+
intent: ThreadAction.onCreateSpace,
|
|
25
26
|
resolve: ({ space, rootCollection }) =>
|
|
26
27
|
Effect.gen(function* () {
|
|
27
28
|
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
@@ -94,6 +95,39 @@ export default (context: PluginContext) =>
|
|
|
94
95
|
};
|
|
95
96
|
},
|
|
96
97
|
}),
|
|
98
|
+
createResolver({
|
|
99
|
+
intent: ThreadAction.AddProposal,
|
|
100
|
+
resolve: ({ text, anchor, sender, subject }) => {
|
|
101
|
+
const space = getSpace(subject);
|
|
102
|
+
invariant(space, 'Space not found');
|
|
103
|
+
|
|
104
|
+
const subjectId = fullyQualifiedId(subject);
|
|
105
|
+
const proposal = Obj.make(DataType.Message, {
|
|
106
|
+
created: new Date().toISOString(),
|
|
107
|
+
sender,
|
|
108
|
+
blocks: [{ _tag: 'proposal', text }],
|
|
109
|
+
});
|
|
110
|
+
const thread = Obj.make(ThreadType, { name: 'Proposal', messages: [Ref.make(proposal)], status: 'active' });
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
intents: [
|
|
114
|
+
createIntent(SpaceAction.AddObject, { object: thread, target: space, hidden: true }),
|
|
115
|
+
createIntent(SpaceAction.AddRelation, {
|
|
116
|
+
space,
|
|
117
|
+
schema: AnchoredTo,
|
|
118
|
+
source: thread,
|
|
119
|
+
target: subject,
|
|
120
|
+
fields: { anchor },
|
|
121
|
+
}),
|
|
122
|
+
createIntent(ThreadAction.Select, { current: fullyQualifiedId(thread) }),
|
|
123
|
+
createIntent(DeckAction.ChangeCompanion, {
|
|
124
|
+
primary: subjectId,
|
|
125
|
+
companion: `${subjectId}${ATTENDABLE_PATH_SEPARATOR}comments`,
|
|
126
|
+
}),
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
}),
|
|
97
131
|
createResolver({
|
|
98
132
|
intent: ThreadAction.Select,
|
|
99
133
|
resolve: ({ current }) => {
|
|
@@ -156,7 +190,7 @@ export default (context: PluginContext) =>
|
|
|
156
190
|
|
|
157
191
|
return {
|
|
158
192
|
undoable: {
|
|
159
|
-
message: ['thread deleted label', { ns:
|
|
193
|
+
message: ['thread deleted label', { ns: meta.id }],
|
|
160
194
|
data: { thread, anchor },
|
|
161
195
|
},
|
|
162
196
|
intents: [
|
|
@@ -197,7 +231,6 @@ export default (context: PluginContext) =>
|
|
|
197
231
|
const subjectId = fullyQualifiedId(subject);
|
|
198
232
|
const space = getSpace(subject);
|
|
199
233
|
invariant(space, 'Space not found');
|
|
200
|
-
const intents = [];
|
|
201
234
|
|
|
202
235
|
const message = Obj.make(DataType.Message, {
|
|
203
236
|
created: new Date().toISOString(),
|
|
@@ -208,6 +241,7 @@ export default (context: PluginContext) =>
|
|
|
208
241
|
});
|
|
209
242
|
thread.messages.push(Ref.make(message));
|
|
210
243
|
|
|
244
|
+
const intents = [];
|
|
211
245
|
const draft = state.drafts[subjectId]?.find((a) => a.id === anchor.id);
|
|
212
246
|
if (draft) {
|
|
213
247
|
// Move draft to document.
|
|
@@ -276,7 +310,7 @@ export default (context: PluginContext) =>
|
|
|
276
310
|
|
|
277
311
|
return {
|
|
278
312
|
undoable: {
|
|
279
|
-
message: ['message deleted label', { ns:
|
|
313
|
+
message: ['message deleted label', { ns: meta.id }],
|
|
280
314
|
data: { message, messageIndex },
|
|
281
315
|
},
|
|
282
316
|
intents: [
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { EditorView } from '@codemirror/view';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, createIntent
|
|
7
|
+
import { Capabilities, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
8
8
|
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
|
|
9
9
|
import { MarkdownCapabilities } from '@dxos/plugin-markdown';
|
|
10
10
|
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
11
|
-
import { commentClickedEffect, commentsState,
|
|
11
|
+
import { type EditorState, commentClickedEffect, commentsState, overlap } from '@dxos/react-ui-editor';
|
|
12
12
|
|
|
13
|
-
import { ThreadCapabilities } from './capabilities';
|
|
14
13
|
import { threads } from '../extensions';
|
|
15
14
|
|
|
15
|
+
import { ThreadCapabilities } from './capabilities';
|
|
16
|
+
|
|
16
17
|
export default (context: PluginContext) =>
|
|
17
18
|
contributes(MarkdownCapabilities.Extensions, [
|
|
18
19
|
({ document: doc }) => {
|
|
@@ -7,11 +7,11 @@ import React from 'react';
|
|
|
7
7
|
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
9
|
import { Call } from '../components';
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../meta';
|
|
11
11
|
|
|
12
12
|
export default () => {
|
|
13
13
|
return contributes(Capabilities.ReactRoot, {
|
|
14
|
-
id:
|
|
14
|
+
id: meta.id,
|
|
15
15
|
root: () => <Call.Audio />,
|
|
16
16
|
});
|
|
17
17
|
};
|
|
@@ -9,28 +9,29 @@ import { Obj, type Ref } from '@dxos/echo';
|
|
|
9
9
|
import { SettingsStore } from '@dxos/local-storage';
|
|
10
10
|
import { getSpace } from '@dxos/react-client/echo';
|
|
11
11
|
|
|
12
|
-
import { ThreadCapabilities } from './capabilities';
|
|
13
12
|
import {
|
|
14
|
-
CallSidebar,
|
|
15
13
|
CallDebugPanel,
|
|
14
|
+
CallSidebar,
|
|
16
15
|
ChannelContainer,
|
|
16
|
+
ChatContainer,
|
|
17
17
|
ThreadComplementary,
|
|
18
18
|
ThreadSettings,
|
|
19
|
-
ChatContainer,
|
|
20
19
|
} from '../components';
|
|
21
|
-
import {
|
|
22
|
-
import { ChannelType,
|
|
20
|
+
import { meta } from '../meta';
|
|
21
|
+
import { ChannelType, type ThreadSettingsProps, ThreadType } from '../types';
|
|
22
|
+
|
|
23
|
+
import { ThreadCapabilities } from './capabilities';
|
|
23
24
|
|
|
24
25
|
export default () =>
|
|
25
26
|
contributes(Capabilities.ReactSurface, [
|
|
26
27
|
createSurface({
|
|
27
|
-
id: `${
|
|
28
|
+
id: `${meta.id}/channel`,
|
|
28
29
|
role: 'article',
|
|
29
30
|
filter: (data): data is { subject: ChannelType } => Obj.instanceOf(ChannelType, data.subject),
|
|
30
31
|
component: ({ data: { subject: channel }, role }) => <ChannelContainer channel={channel} role={role} />,
|
|
31
32
|
}),
|
|
32
33
|
createSurface({
|
|
33
|
-
id: `${
|
|
34
|
+
id: `${meta.id}/chat-companion`,
|
|
34
35
|
role: 'article',
|
|
35
36
|
filter: (data): data is { companionTo: ChannelType; subject: 'chat' } =>
|
|
36
37
|
Obj.instanceOf(ChannelType, data.companionTo) && data.subject === 'chat',
|
|
@@ -45,7 +46,7 @@ export default () =>
|
|
|
45
46
|
},
|
|
46
47
|
}),
|
|
47
48
|
createSurface({
|
|
48
|
-
id: `${
|
|
49
|
+
id: `${meta.id}/thread`,
|
|
49
50
|
role: 'article',
|
|
50
51
|
filter: (data): data is { subject: ThreadType } => Obj.instanceOf(ThreadType, data.subject),
|
|
51
52
|
component: ({ data: { subject: thread } }) => {
|
|
@@ -58,7 +59,7 @@ export default () =>
|
|
|
58
59
|
},
|
|
59
60
|
}),
|
|
60
61
|
createSurface({
|
|
61
|
-
id: `${
|
|
62
|
+
id: `${meta.id}/comments`,
|
|
62
63
|
role: 'article',
|
|
63
64
|
filter: (data): data is { companionTo: { threads: Ref.Ref<ThreadType>[] } } =>
|
|
64
65
|
data.subject === 'comments' && Obj.isObject(data.companionTo),
|
|
@@ -66,19 +67,19 @@ export default () =>
|
|
|
66
67
|
component: ({ data }) => <ThreadComplementary subject={data.companionTo} />,
|
|
67
68
|
}),
|
|
68
69
|
createSurface({
|
|
69
|
-
id: `${
|
|
70
|
+
id: `${meta.id}/plugin-settings`,
|
|
70
71
|
role: 'article',
|
|
71
72
|
filter: (data): data is { subject: SettingsStore<ThreadSettingsProps> } =>
|
|
72
|
-
data.subject instanceof SettingsStore && data.subject.prefix ===
|
|
73
|
+
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
73
74
|
component: ({ data: { subject } }) => <ThreadSettings settings={subject.value} />,
|
|
74
75
|
}),
|
|
75
76
|
createSurface({
|
|
76
|
-
id: `${
|
|
77
|
+
id: `${meta.id}/assistant`,
|
|
77
78
|
role: 'deck-companion--active-call',
|
|
78
79
|
component: () => <CallSidebar />,
|
|
79
80
|
}),
|
|
80
81
|
createSurface({
|
|
81
|
-
id: `${
|
|
82
|
+
id: `${meta.id}/devtools-overview`,
|
|
82
83
|
role: 'devtools-overview',
|
|
83
84
|
component: () => {
|
|
84
85
|
const call = useCapability(ThreadCapabilities.CallManager);
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
import { contributes } from '@dxos/app-framework';
|
|
6
6
|
import { live } from '@dxos/live-object';
|
|
7
7
|
|
|
8
|
-
import { ThreadCapabilities } from './capabilities';
|
|
9
8
|
import { type ThreadState, type ViewStore } from '../types';
|
|
10
9
|
|
|
10
|
+
import { ThreadCapabilities } from './capabilities';
|
|
11
|
+
|
|
11
12
|
const initialViewState = { showResolvedThreads: false };
|
|
12
13
|
|
|
13
14
|
export default () => {
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Tool from '@effect/ai/Tool';
|
|
6
|
+
import * as Toolkit from '@effect/ai/Toolkit';
|
|
7
|
+
import * as Array from 'effect/Array';
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
9
|
+
import * as Function from 'effect/Function';
|
|
10
|
+
import * as Schema from 'effect/Schema';
|
|
11
|
+
|
|
12
|
+
import { Capabilities, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
13
|
+
import { ArtifactId, computeDiffsWithCursors } from '@dxos/assistant';
|
|
14
|
+
import { type SpaceId } from '@dxos/keys';
|
|
15
|
+
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
16
|
+
import { type Markdown } from '@dxos/plugin-markdown/types';
|
|
17
|
+
import { createDocAccessor } from '@dxos/react-client/echo';
|
|
18
|
+
import { trim } from '@dxos/util';
|
|
19
|
+
|
|
20
|
+
import { ThreadAction } from '../types';
|
|
21
|
+
|
|
22
|
+
// TODO(wittjosiah): How to make this work for more than Documents?
|
|
23
|
+
class ThreadToolkit extends Toolkit.make(
|
|
24
|
+
Tool.make('add-proposals', {
|
|
25
|
+
description: trim`
|
|
26
|
+
Proposes a set of changes to a document.
|
|
27
|
+
`,
|
|
28
|
+
parameters: {
|
|
29
|
+
id: ArtifactId,
|
|
30
|
+
diffs: Schema.Array(Schema.String).annotations({
|
|
31
|
+
description: 'The diffs to propose for the document.',
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
success: Schema.Any,
|
|
35
|
+
failure: Schema.Never,
|
|
36
|
+
}),
|
|
37
|
+
) {
|
|
38
|
+
static layer = (context: PluginContext) =>
|
|
39
|
+
ThreadToolkit.toLayer({
|
|
40
|
+
'add-proposals': ({ id, diffs: _diffs }) =>
|
|
41
|
+
Effect.gen(function* () {
|
|
42
|
+
// TODO(wittjosiah): Get capabilities via layers.
|
|
43
|
+
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
44
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
45
|
+
const state = context.getCapability(Capabilities.Layout);
|
|
46
|
+
|
|
47
|
+
const dxn = ArtifactId.toDXN(id, state.workspace as SpaceId);
|
|
48
|
+
|
|
49
|
+
const echoDxn = dxn.asEchoDXN();
|
|
50
|
+
if (!echoDxn) {
|
|
51
|
+
throw new Error(`Invalid object ID: ${id}`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const space = client.spaces.get(echoDxn.spaceId!);
|
|
55
|
+
const object = space?.db.getObjectById<Markdown.Document>(echoDxn.echoId);
|
|
56
|
+
if (!object) {
|
|
57
|
+
throw new Error(`Object not found: ${id}`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const content = yield* Effect.promise(() => object.content.load());
|
|
61
|
+
const accessor = createDocAccessor(content, ['content']);
|
|
62
|
+
yield* Function.pipe(
|
|
63
|
+
computeDiffsWithCursors(accessor, _diffs),
|
|
64
|
+
Array.map(({ cursor, text }) =>
|
|
65
|
+
createIntent(ThreadAction.AddProposal, {
|
|
66
|
+
subject: object,
|
|
67
|
+
sender: { role: 'assistant' },
|
|
68
|
+
anchor: cursor,
|
|
69
|
+
text,
|
|
70
|
+
}),
|
|
71
|
+
),
|
|
72
|
+
Array.map(dispatch),
|
|
73
|
+
Effect.allWith({ concurrency: 'unbounded' }),
|
|
74
|
+
);
|
|
75
|
+
}).pipe(Effect.orDie),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default (context: PluginContext) => [
|
|
80
|
+
contributes(Capabilities.Toolkit, ThreadToolkit),
|
|
81
|
+
contributes(Capabilities.ToolkitHandler, ThreadToolkit.layer(context)),
|
|
82
|
+
];
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { type
|
|
5
|
+
import React, { type FC, type PropsWithChildren } from 'react';
|
|
6
6
|
|
|
7
7
|
import { useCapability } from '@dxos/app-framework';
|
|
8
8
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
|
-
import { Toolbar, type ToolbarProps } from './Toolbar';
|
|
11
10
|
import { ThreadCapabilities } from '../../capabilities';
|
|
12
11
|
import { useDebugMode } from '../../hooks';
|
|
13
12
|
import { AudioStream } from '../Media';
|
|
14
13
|
import { ParticipantGrid } from '../Participant';
|
|
15
14
|
|
|
15
|
+
import { Toolbar, type ToolbarProps } from './Toolbar';
|
|
16
|
+
|
|
16
17
|
//
|
|
17
18
|
// Root
|
|
18
19
|
//
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { useAppGraph, useCapability } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
8
|
+
import { useActions, useNode } from '@dxos/plugin-graph';
|
|
9
9
|
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
10
10
|
import {
|
|
11
11
|
Icon,
|
|
12
12
|
IconButton,
|
|
13
13
|
type IconButtonProps,
|
|
14
|
+
Toolbar as NaturalToolbar,
|
|
14
15
|
type ThemedClassName,
|
|
15
|
-
Toolbar as NativeToolbar,
|
|
16
16
|
toLocalizedString,
|
|
17
17
|
useTranslation,
|
|
18
18
|
} from '@dxos/react-ui';
|
|
@@ -56,7 +56,7 @@ export const Toolbar = ({
|
|
|
56
56
|
// TODO(wittjosiah): In order to use toolbar, need to update to actually use the graph action callbacks directly.
|
|
57
57
|
return (
|
|
58
58
|
<div className={mx('z-20 flex justify-center m-8', autoHideControls && groupHoverControlItemWithTransition)}>
|
|
59
|
-
<
|
|
59
|
+
<NaturalToolbar.Root classNames={['p-2 bg-modalSurface rounded-md shadow-md', classNames]}>
|
|
60
60
|
<ToggleButton
|
|
61
61
|
active={call.media.audioEnabled}
|
|
62
62
|
state={{
|
|
@@ -95,7 +95,7 @@ export const Toolbar = ({
|
|
|
95
95
|
<Icon icon='ph--users--regular' size={4} />
|
|
96
96
|
<div>{participants}</div>
|
|
97
97
|
</div>
|
|
98
|
-
)) || <
|
|
98
|
+
)) || <NaturalToolbar.Separator variant='gap' />}
|
|
99
99
|
|
|
100
100
|
{call.joined && (
|
|
101
101
|
<>
|
|
@@ -151,7 +151,7 @@ export const Toolbar = ({
|
|
|
151
151
|
) : (
|
|
152
152
|
<IconButton variant='primary' icon='ph--phone-incoming--regular' label={t('join call')} onClick={onJoin} />
|
|
153
153
|
)}
|
|
154
|
-
</
|
|
154
|
+
</NaturalToolbar.Root>
|
|
155
155
|
</div>
|
|
156
156
|
);
|
|
157
157
|
};
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { WebRTCStats } from '@peermetrics/webrtc-stats';
|
|
5
|
+
import { WebRTCStats, type WebRTCStatsEvent } from '@peermetrics/webrtc-stats';
|
|
6
6
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { truncateKey } from '@dxos/debug';
|
|
9
|
+
import { JsonView, Panel } from '@dxos/devtools';
|
|
9
10
|
import { log } from '@dxos/log';
|
|
10
|
-
import {
|
|
11
|
-
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
11
|
+
import { IconButton, Input, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
12
12
|
|
|
13
|
-
import { type GlobalState } from '../calls';
|
|
13
|
+
import { type EncodedTrackName, type GlobalState } from '../calls';
|
|
14
14
|
import { meta } from '../meta';
|
|
15
15
|
|
|
16
16
|
export type CallDebugPanelProps = ThemedClassName<{
|
|
@@ -19,11 +19,16 @@ export type CallDebugPanelProps = ThemedClassName<{
|
|
|
19
19
|
|
|
20
20
|
export const CallDebugPanel = ({ state }: CallDebugPanelProps) => {
|
|
21
21
|
const { t } = useTranslation(meta.id);
|
|
22
|
-
const users = state?.call?.users;
|
|
23
|
-
const self = state?.call?.self;
|
|
24
22
|
|
|
25
23
|
const [open, setOpen] = useState(false);
|
|
26
24
|
const handleToggle = () => setOpen(!open);
|
|
25
|
+
const [showServiceHistory, setShowServiceHistory] = useState(false);
|
|
26
|
+
const handleToggleServiceHistory = () => setShowServiceHistory(!showServiceHistory);
|
|
27
|
+
|
|
28
|
+
const handleCopyRaw = async () => {
|
|
29
|
+
await navigator.clipboard.writeText(JSON.stringify({ users: state?.call?.users, stats }, null, 2));
|
|
30
|
+
};
|
|
31
|
+
|
|
27
32
|
const [showDetailedWebRTCStats, setShowDetailedWebRTCStats] = useState(false);
|
|
28
33
|
const handleShowDetailedWebRTCStats = () => setShowDetailedWebRTCStats(!showDetailedWebRTCStats);
|
|
29
34
|
|
|
@@ -34,22 +39,24 @@ export const CallDebugPanel = ({ state }: CallDebugPanelProps) => {
|
|
|
34
39
|
}),
|
|
35
40
|
[],
|
|
36
41
|
);
|
|
42
|
+
const [stats, setStats] = useState<WebRTCStatsEvent['data']>();
|
|
37
43
|
|
|
38
|
-
const [stats, setStats] = useState<Record<string, any>>({});
|
|
39
44
|
useEffect(() => {
|
|
40
45
|
const pc = state?.media.peer?.session?.peerConnection;
|
|
41
|
-
const handleStats = (stats:
|
|
46
|
+
const handleStats = (stats: WebRTCStatsEvent) => {
|
|
47
|
+
setStats(stats.data);
|
|
48
|
+
};
|
|
42
49
|
let added = false;
|
|
43
50
|
if (pc && showDetailedWebRTCStats) {
|
|
44
51
|
webrtcStats.addConnection({ pc, peerId: 1, connectionId: '1' });
|
|
45
|
-
webrtcStats.on('stats', handleStats);
|
|
52
|
+
webrtcStats.on('stats', handleStats as never);
|
|
46
53
|
added = true;
|
|
47
54
|
}
|
|
48
55
|
return () => {
|
|
49
56
|
try {
|
|
50
57
|
if (pc && added) {
|
|
51
58
|
webrtcStats.removeConnection({ pc });
|
|
52
|
-
webrtcStats.removeListener('stats', handleStats);
|
|
59
|
+
webrtcStats.removeListener('stats', handleStats as never);
|
|
53
60
|
}
|
|
54
61
|
} catch (error) {
|
|
55
62
|
log.error('error removing webrtc stats', { error, pc, peerId: 1, connectionId: '1' });
|
|
@@ -57,6 +64,8 @@ export const CallDebugPanel = ({ state }: CallDebugPanelProps) => {
|
|
|
57
64
|
};
|
|
58
65
|
}, [state?.media.peer?.session?.peerConnection, showDetailedWebRTCStats]);
|
|
59
66
|
|
|
67
|
+
const rows = useMemo(() => getCallStatusTable(state), [state?.call.users, state?.media.pulledAudioTracks]);
|
|
68
|
+
|
|
60
69
|
return (
|
|
61
70
|
<Panel
|
|
62
71
|
id='meeting-status'
|
|
@@ -65,51 +74,101 @@ export const CallDebugPanel = ({ state }: CallDebugPanelProps) => {
|
|
|
65
74
|
onToggle={handleToggle}
|
|
66
75
|
title={t('meeting status title')}
|
|
67
76
|
maxHeight={false}
|
|
68
|
-
info={
|
|
69
|
-
<div className='flex items-center gap-2'>
|
|
70
|
-
<span title='Joined'>{self?.joined ? 'Active' : 'Inactive'}</span>
|
|
71
|
-
{users?.length !== undefined && <span title='Users'>{users?.length ?? 0} User(s)</span>}
|
|
72
|
-
</div>
|
|
73
|
-
}
|
|
77
|
+
info={<div className='flex items-center gap-2'> {state?.call.joined ? 'Active' : 'Inactive'}</div>}
|
|
74
78
|
>
|
|
75
|
-
<div className='flex flex-col gap-2
|
|
76
|
-
<div className='flex items-
|
|
79
|
+
<div className='flex flex-col w-full gap-2 text-xs'>
|
|
80
|
+
<div className='flex items-center gap-2'>
|
|
77
81
|
<Input.Root>
|
|
78
82
|
<Input.Label classNames={'text-sm'}>{t('show webrtc stats title')}</Input.Label>
|
|
79
83
|
<Input.Checkbox checked={showDetailedWebRTCStats} onCheckedChange={handleShowDetailedWebRTCStats} />
|
|
80
84
|
</Input.Root>
|
|
81
85
|
</div>
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
: {}),
|
|
96
|
-
tracks: state?.media.peer?.session?.peerConnection.getTransceivers().map((transceiver) => {
|
|
97
|
-
const track =
|
|
98
|
-
transceiver.direction === 'recvonly' ? transceiver.receiver.track : transceiver.sender.track;
|
|
99
|
-
return {
|
|
100
|
-
id: track?.id,
|
|
101
|
-
kind: track?.kind,
|
|
102
|
-
direction: transceiver.direction,
|
|
103
|
-
enabled: track?.enabled,
|
|
104
|
-
muted: track?.muted,
|
|
105
|
-
readyState: track?.readyState,
|
|
106
|
-
settings: track?.getSettings(),
|
|
107
|
-
};
|
|
108
|
-
}),
|
|
109
|
-
callsServiceHistory: state?.media.peer?.history.get(),
|
|
110
|
-
}}
|
|
111
|
-
/>
|
|
86
|
+
<div className='flex items-center gap-2'>
|
|
87
|
+
<Input.Root>
|
|
88
|
+
<Input.Label classNames={'text-sm'}>{t('show calls history title')}</Input.Label>
|
|
89
|
+
<Input.Checkbox checked={showServiceHistory} onCheckedChange={handleToggleServiceHistory} />
|
|
90
|
+
</Input.Root>
|
|
91
|
+
</div>
|
|
92
|
+
<div className='flex items-center gap-2'>
|
|
93
|
+
<IconButton classNames={'text-sm'} icon='ph--copy--regular' label={'copy raw'} onClick={handleCopyRaw} />
|
|
94
|
+
</div>
|
|
95
|
+
<Table rows={rows} />
|
|
96
|
+
{showDetailedWebRTCStats && <JsonView data={{ stats }} />}
|
|
97
|
+
{showServiceHistory && <JsonView data={{ history: state?.media.peer?.history.get() }} />}
|
|
112
98
|
</div>
|
|
113
99
|
</Panel>
|
|
114
100
|
);
|
|
115
101
|
};
|
|
102
|
+
|
|
103
|
+
const getCallStatusTable = (state?: GlobalState): TableProps['rows'] => {
|
|
104
|
+
if (!state || !state.call?.users) {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const self = state.call.self;
|
|
109
|
+
const users = state.call.users
|
|
110
|
+
.filter((user) => user.id !== self!.id)
|
|
111
|
+
.map((user) => {
|
|
112
|
+
const isOk = {
|
|
113
|
+
audio:
|
|
114
|
+
user.tracks?.audio &&
|
|
115
|
+
state.media.pulledAudioTracks[user.tracks?.audio as EncodedTrackName]?.ctx.disposed === false,
|
|
116
|
+
video:
|
|
117
|
+
user.tracks?.video &&
|
|
118
|
+
state.media.pulledVideoStreams[user.tracks?.video as EncodedTrackName]?.ctx.disposed === false,
|
|
119
|
+
screenshare:
|
|
120
|
+
user.tracks?.screenshare &&
|
|
121
|
+
state.media.pulledVideoStreams[user.tracks?.screenshare as EncodedTrackName]?.ctx.disposed === false,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
...user,
|
|
126
|
+
isOk,
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
return [
|
|
131
|
+
['users', state.call.users.length ?? 0],
|
|
132
|
+
[
|
|
133
|
+
'*self* ' + (self?.name ?? truncateKey(self!.id, 8)),
|
|
134
|
+
self?.tracks?.audio && state.media.pushedAudioTrack ? 'AUD ✅' : 'AUD ❌',
|
|
135
|
+
self?.tracks?.video && state.media.pushedVideoTrack ? 'VID ✅' : 'VID ❌',
|
|
136
|
+
self?.tracks?.screenshareEnabled
|
|
137
|
+
? self.tracks.screenshareEnabled && state.media.pushedScreenshareTrack
|
|
138
|
+
? 'SCR ✅'
|
|
139
|
+
: 'SCR ❌'
|
|
140
|
+
: undefined,
|
|
141
|
+
],
|
|
142
|
+
|
|
143
|
+
...users.map((user) => [
|
|
144
|
+
user.name ?? truncateKey(user.id, 8),
|
|
145
|
+
user.isOk.audio ? 'AUD ✅' : 'AUD ❌',
|
|
146
|
+
user.isOk.video ? 'VID ✅' : 'VID ❌',
|
|
147
|
+
user.tracks?.screenshareEnabled ? (user.isOk.screenshare ? 'SCR ✅' : 'SCR ❌') : undefined,
|
|
148
|
+
]),
|
|
149
|
+
['ICE', state.media.peer?.session?.peerConnection.iceConnectionState ?? 'no connection'],
|
|
150
|
+
];
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export namespace Unit {
|
|
154
|
+
export const KB = (n?: number) => ((n ?? 0) / 1_000).toFixed(2);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export type TableProps = {
|
|
158
|
+
rows: (string | number | undefined)[][];
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const Table = ({ rows }: TableProps) => {
|
|
162
|
+
return (
|
|
163
|
+
<div className='w-full text-xs font-mono'>
|
|
164
|
+
{rows.map(([prefix, label, value, unit], i) => (
|
|
165
|
+
<div key={i} className='grid grid-cols-[3fr_1fr_1fr_1fr]'>
|
|
166
|
+
<div className='p-1'>{prefix}</div>
|
|
167
|
+
<div className='p-1'>{label}</div>
|
|
168
|
+
<div className='p-1'>{value}</div>
|
|
169
|
+
<div className='p-1'>{unit}</div>
|
|
170
|
+
</div>
|
|
171
|
+
))}
|
|
172
|
+
</div>
|
|
173
|
+
);
|
|
174
|
+
};
|
|
@@ -6,9 +6,10 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { useCapability } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
|
-
import { ChannelContainer } from './ChannelContainer';
|
|
10
9
|
import { ThreadCapabilities } from '../capabilities';
|
|
11
10
|
|
|
11
|
+
import { ChannelContainer } from './ChannelContainer';
|
|
12
|
+
|
|
12
13
|
export const CallSidebar = () => {
|
|
13
14
|
const call = useCapability(ThreadCapabilities.CallManager);
|
|
14
15
|
return <ChannelContainer roomId={call.roomId} />;
|