@dxos/plugin-thread 0.8.4-main.dedc0f3 → 0.8.4-main.e8ec1fe
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-NDIH62Q4.mjs +17 -0
- package/dist/lib/browser/ChatContainer-6FVFME3R.mjs +16 -0
- package/dist/lib/browser/{app-graph-builder-FHAOPO57.mjs → app-graph-builder-URVQHGMR.mjs} +32 -32
- package/dist/lib/browser/app-graph-builder-URVQHGMR.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-TQ4JFMZZ.mjs +101 -0
- package/dist/lib/browser/blueprint-definition-TQ4JFMZZ.mjs.map +7 -0
- package/dist/lib/browser/{call-manager-RMPTWSTF.mjs → call-manager-4YFT4XA6.mjs} +8 -7
- package/dist/lib/{node-esm/call-manager-QAREJFVX.mjs.map → browser/call-manager-4YFT4XA6.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-PBMNFG3B.mjs → chunk-6LWKNZUV.mjs} +18 -17
- package/dist/lib/browser/chunk-6LWKNZUV.mjs.map +7 -0
- package/dist/lib/browser/chunk-CFC7LEPD.mjs +18 -0
- package/dist/lib/browser/chunk-CFC7LEPD.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-7W7QK5ZP.mjs → chunk-F36NHPJG.mjs} +37 -34
- package/dist/lib/browser/chunk-F36NHPJG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZH2WPTNP.mjs → chunk-HKI7FUMB.mjs} +65 -72
- package/dist/lib/browser/chunk-HKI7FUMB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XYUJXHYV.mjs → chunk-ISCHODBV.mjs} +1 -1
- package/dist/lib/browser/{chunk-XYUJXHYV.mjs.map → chunk-ISCHODBV.mjs.map} +2 -2
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-JDFDDUTH.mjs +23 -0
- package/dist/lib/browser/chunk-JDFDDUTH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RI3Z6MK3.mjs → chunk-KOBXMDCI.mjs} +68 -67
- package/dist/lib/browser/chunk-KOBXMDCI.mjs.map +7 -0
- package/dist/lib/browser/chunk-QM34EZQK.mjs +20 -0
- package/dist/lib/browser/chunk-QM34EZQK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KTWYVC5X.mjs → chunk-R5UOPOO7.mjs} +44 -49
- package/dist/lib/browser/chunk-R5UOPOO7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZCEU5K23.mjs → chunk-ZCW3NSDZ.mjs} +139 -236
- package/dist/lib/browser/chunk-ZCW3NSDZ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +41 -42
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-J7OCP2P6.mjs → intent-resolver-S3F7DVFM.mjs} +33 -99
- package/dist/lib/browser/intent-resolver-S3F7DVFM.mjs.map +7 -0
- package/dist/lib/browser/{markdown-Z677YORA.mjs → markdown-454GFKEZ.mjs} +25 -23
- package/dist/lib/browser/markdown-454GFKEZ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-ZB5ZA4I6.mjs +29 -0
- package/dist/lib/browser/react-root-ZB5ZA4I6.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-GVGZRBDK.mjs → react-surface-MBLTXSOC.mjs} +38 -36
- package/dist/lib/browser/react-surface-MBLTXSOC.mjs.map +7 -0
- package/dist/lib/browser/{settings-GRKEID73.mjs → settings-JN2HHORY.mjs} +6 -5
- package/dist/lib/{node-esm/settings-F2ODVNNW.mjs.map → browser/settings-JN2HHORY.mjs.map} +1 -1
- package/dist/lib/browser/{state-2T4KDWBX.mjs → state-UYPLBGZJ.mjs} +6 -5
- package/dist/lib/{node-esm/state-62TQKQVB.mjs.map → browser/state-UYPLBGZJ.mjs.map} +1 -1
- package/dist/lib/browser/types/index.mjs +7 -10
- package/dist/lib/node-esm/ChannelContainer-NGSDMNEE.mjs +18 -0
- package/dist/lib/node-esm/ChatContainer-KWNON7EN.mjs +17 -0
- package/dist/lib/node-esm/ChatContainer-KWNON7EN.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-XEYWX5FC.mjs → app-graph-builder-2IH5RPR7.mjs} +32 -32
- package/dist/lib/node-esm/app-graph-builder-2IH5RPR7.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-TSX5HHW7.mjs +102 -0
- package/dist/lib/node-esm/blueprint-definition-TSX5HHW7.mjs.map +7 -0
- package/dist/lib/node-esm/{call-manager-QAREJFVX.mjs → call-manager-UMUXEYH5.mjs} +8 -7
- package/dist/lib/{browser/call-manager-RMPTWSTF.mjs.map → node-esm/call-manager-UMUXEYH5.mjs.map} +1 -1
- package/dist/lib/node-esm/chunk-2AEIN5MI.mjs +22 -0
- package/dist/lib/node-esm/chunk-2AEIN5MI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3VRYXHKX.mjs +25 -0
- package/dist/lib/node-esm/chunk-3VRYXHKX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TIPIOH2J.mjs → chunk-7KZWZS2U.mjs} +139 -236
- package/dist/lib/node-esm/chunk-7KZWZS2U.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-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-P6E247RF.mjs → chunk-MEIWWPR2.mjs} +44 -49
- package/dist/lib/node-esm/chunk-MEIWWPR2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LE2LIYGX.mjs → chunk-MM6HOX5W.mjs} +65 -72
- package/dist/lib/node-esm/chunk-MM6HOX5W.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JNPKMT7O.mjs → chunk-PZH2EDU5.mjs} +68 -67
- package/dist/lib/node-esm/chunk-PZH2EDU5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RT6NRL2I.mjs +19 -0
- package/dist/lib/node-esm/chunk-RT6NRL2I.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2V3WSLUZ.mjs → chunk-VBI32FGI.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-2V3WSLUZ.mjs.map → chunk-VBI32FGI.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-SNKFZQST.mjs → chunk-Y3F2SGNH.mjs} +37 -34
- package/dist/lib/node-esm/chunk-Y3F2SGNH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DKCQCENK.mjs → chunk-Z4GUSLWL.mjs} +18 -17
- package/dist/lib/node-esm/chunk-Z4GUSLWL.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +41 -42
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-SR2LW4HF.mjs → intent-resolver-UES35EMJ.mjs} +33 -99
- package/dist/lib/node-esm/intent-resolver-UES35EMJ.mjs.map +7 -0
- package/dist/lib/node-esm/{markdown-FL4IXLRP.mjs → markdown-7JUG6J7B.mjs} +25 -23
- package/dist/lib/node-esm/markdown-7JUG6J7B.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-root-3XXULWUN.mjs +30 -0
- package/dist/lib/node-esm/react-root-3XXULWUN.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-WLQUVRAX.mjs → react-surface-DCF4DD7B.mjs} +38 -36
- package/dist/lib/node-esm/react-surface-DCF4DD7B.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-F2ODVNNW.mjs → settings-VSPM3BIM.mjs} +6 -5
- package/dist/lib/{browser/settings-GRKEID73.mjs.map → node-esm/settings-VSPM3BIM.mjs.map} +1 -1
- package/dist/lib/node-esm/{state-62TQKQVB.mjs → state-XNWOLBNE.mjs} +6 -5
- package/dist/lib/{browser/state-2T4KDWBX.mjs.map → node-esm/state-XNWOLBNE.mjs.map} +1 -1
- package/dist/lib/node-esm/types/index.mjs +7 -10
- package/dist/types/src/ThreadPlugin.d.ts +1 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/calls/media-manager.d.ts.map +1 -1
- package/dist/types/src/calls-service.stories.d.ts +0 -1
- package/dist/types/src/calls-service.stories.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- 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 +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Call/Toolbar.d.ts +2 -2
- package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/CallDebugPanel.d.ts.map +1 -1
- package/dist/types/src/components/ChannelContainer.d.ts +2 -2
- package/dist/types/src/components/ChannelContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +73 -8
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat.stories.d.ts +73 -6
- package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +6 -5
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/Comments.stories.d.ts +1 -2
- package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/components/CommentsContainer.d.ts +2 -2
- package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
- package/dist/types/src/components/CommentsThreadContainer.d.ts +8 -8
- package/dist/types/src/components/CommentsThreadContainer.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 +5 -3
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
- package/dist/types/src/components/MessageContainer.d.ts +2 -2
- package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +2 -2
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +2 -2
- 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/ThreadCompanion.d.ts +5 -0
- package/dist/types/src/components/ThreadCompanion.d.ts.map +1 -0
- 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/index.d.ts +3 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +3 -3
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/functions/create-proposals.d.ts +6 -0
- package/dist/types/src/functions/create-proposals.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +2 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/hooks/analytics.d.ts +2 -2
- package/dist/types/src/hooks/analytics.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -2
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- 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/testing/stories.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +72 -6
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Channel.d.ts +16 -0
- package/dist/types/src/types/Channel.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +30 -117
- 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 +139 -132
- package/src/calls/media-manager.ts +9 -6
- package/src/calls/util/stub-media-streams.ts +2 -2
- package/src/calls-service.stories.tsx +2 -5
- package/src/capabilities/app-graph-builder.ts +41 -30
- package/src/capabilities/blueprint-definition.ts +38 -0
- package/src/capabilities/capabilities.ts +7 -7
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/intent-resolver.ts +22 -59
- package/src/capabilities/markdown.ts +5 -3
- package/src/capabilities/react-root.tsx +2 -2
- package/src/capabilities/react-surface.tsx +25 -23
- package/src/components/Call/Call.tsx +1 -1
- package/src/components/Call/Toolbar.tsx +5 -5
- package/src/components/CallDebugPanel.tsx +12 -14
- package/src/components/CallSidebar.tsx +1 -1
- package/src/components/ChannelContainer.stories.tsx +10 -10
- package/src/components/ChannelContainer.tsx +19 -15
- package/src/components/Chat.stories.tsx +14 -19
- package/src/components/ChatContainer.tsx +29 -21
- package/src/components/Comments.stories.tsx +11 -17
- package/src/components/CommentsContainer.tsx +5 -7
- package/src/components/CommentsThreadContainer.tsx +31 -27
- package/src/components/Lobby/Lobby.tsx +1 -1
- package/src/components/Media/VideoObject.stories.tsx +12 -7
- package/src/components/Media/VideoObject.tsx +1 -1
- package/src/components/MessageContainer.tsx +6 -6
- package/src/components/Participant/Participant.tsx +1 -1
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +3 -4
- package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +2 -2
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +4 -5
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +5 -5
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +5 -2
- package/src/components/{ThreadComplementary.tsx → ThreadCompanion.tsx} +41 -34
- package/src/components/ThreadSettings.tsx +4 -5
- package/src/components/index.ts +4 -4
- package/src/components/testing.ts +7 -9
- package/src/extensions/threads.ts +25 -16
- package/src/functions/create-proposals.ts +56 -0
- package/src/functions/index.ts +5 -0
- package/src/hooks/analytics.ts +4 -7
- package/src/hooks/index.ts +3 -2
- package/src/hooks/useVideoStreamTrack.tsx +1 -1
- package/src/meta.ts +9 -5
- package/src/testing/stories.ts +3 -6
- package/src/translations.ts +4 -3
- package/src/types/Channel.ts +26 -0
- package/src/types/index.ts +1 -1
- package/src/types/types.ts +18 -27
- package/src/util.ts +1 -1
- package/dist/lib/browser/ChannelContainer-4PYFOIDK.mjs +0 -16
- package/dist/lib/browser/ChatContainer-EXNNREYB.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-FHAOPO57.mjs.map +0 -7
- package/dist/lib/browser/chunk-4APCDRSH.mjs +0 -18
- package/dist/lib/browser/chunk-4APCDRSH.mjs.map +0 -7
- package/dist/lib/browser/chunk-7W7QK5ZP.mjs.map +0 -7
- package/dist/lib/browser/chunk-EV4JWI7L.mjs +0 -17
- package/dist/lib/browser/chunk-EV4JWI7L.mjs.map +0 -7
- package/dist/lib/browser/chunk-G4CNILRR.mjs +0 -23
- package/dist/lib/browser/chunk-G4CNILRR.mjs.map +0 -7
- package/dist/lib/browser/chunk-GERVMFQW.mjs.map +0 -7
- package/dist/lib/browser/chunk-KTWYVC5X.mjs.map +0 -7
- package/dist/lib/browser/chunk-PBMNFG3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-RI3Z6MK3.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZCEU5K23.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZH2WPTNP.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-J7OCP2P6.mjs.map +0 -7
- package/dist/lib/browser/markdown-Z677YORA.mjs.map +0 -7
- package/dist/lib/browser/react-root-XKOD4KRB.mjs +0 -28
- package/dist/lib/browser/react-root-XKOD4KRB.mjs.map +0 -7
- package/dist/lib/browser/react-surface-GVGZRBDK.mjs.map +0 -7
- package/dist/lib/browser/toolkit-KUPIIFC6.mjs +0 -80
- package/dist/lib/browser/toolkit-KUPIIFC6.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelContainer-KQQEZWUN.mjs +0 -17
- package/dist/lib/node-esm/ChatContainer-QVQKFBWA.mjs +0 -16
- package/dist/lib/node-esm/app-graph-builder-XEYWX5FC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4T45PCKP.mjs +0 -25
- package/dist/lib/node-esm/chunk-4T45PCKP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-57XR3LEF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DKCQCENK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GRLRWTRU.mjs +0 -19
- package/dist/lib/node-esm/chunk-GRLRWTRU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JNPKMT7O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LE2LIYGX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P6E247RF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PYTVBN5J.mjs +0 -19
- package/dist/lib/node-esm/chunk-PYTVBN5J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SNKFZQST.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TIPIOH2J.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-SR2LW4HF.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-FL4IXLRP.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-4JWDRIQB.mjs +0 -29
- package/dist/lib/node-esm/react-root-4JWDRIQB.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-WLQUVRAX.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-KZIS7G36.mjs +0 -81
- package/dist/lib/node-esm/toolkit-KZIS7G36.mjs.map +0 -7
- package/dist/types/src/capabilities/toolkit.d.ts +0 -5
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/ThreadComplementary.d.ts +0 -5
- package/dist/types/src/components/ThreadComplementary.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -177
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/toolkit.ts +0 -78
- package/src/types/schema.ts +0 -33
- /package/dist/lib/browser/{ChannelContainer-4PYFOIDK.mjs.map → ChannelContainer-NDIH62Q4.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-EXNNREYB.mjs.map → ChatContainer-6FVFME3R.mjs.map} +0 -0
- /package/dist/lib/{node-esm/ChannelContainer-KQQEZWUN.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-QVQKFBWA.mjs.map → ChannelContainer-NGSDMNEE.mjs.map} +0 -0
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
7
8
|
|
|
8
9
|
import { Capabilities, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
9
10
|
import { Obj } from '@dxos/echo';
|
|
10
11
|
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
11
12
|
import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
12
|
-
import { ROOT_ID,
|
|
13
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
13
|
+
import { ROOT_ID, atomFromSignal, createExtension } from '@dxos/plugin-graph';
|
|
14
14
|
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { meta } from '../meta';
|
|
16
|
+
import { Channel, ThreadAction } from '../types';
|
|
17
17
|
import { getAnchor } from '../util';
|
|
18
18
|
|
|
19
19
|
import { ThreadCapabilities } from './capabilities';
|
|
@@ -26,16 +26,16 @@ export default (context: PluginContext) => {
|
|
|
26
26
|
|
|
27
27
|
return contributes(Capabilities.AppGraphBuilder, [
|
|
28
28
|
createExtension({
|
|
29
|
-
id: `${
|
|
29
|
+
id: `${meta.id}/active-call`,
|
|
30
30
|
connector: (node) =>
|
|
31
|
-
|
|
32
|
-
pipe(
|
|
31
|
+
Atom.make((get) =>
|
|
32
|
+
Function.pipe(
|
|
33
33
|
get(node),
|
|
34
34
|
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
35
35
|
Option.map((node) => {
|
|
36
36
|
const [call] = get(context.capabilities(ThreadCapabilities.CallManager));
|
|
37
37
|
return get(
|
|
38
|
-
|
|
38
|
+
atomFromSignal(() =>
|
|
39
39
|
call?.joined
|
|
40
40
|
? [
|
|
41
41
|
{
|
|
@@ -43,7 +43,7 @@ export default (context: PluginContext) => {
|
|
|
43
43
|
type: DECK_COMPANION_TYPE,
|
|
44
44
|
data: null,
|
|
45
45
|
properties: {
|
|
46
|
-
label: ['call panel label', { ns:
|
|
46
|
+
label: ['call panel label', { ns: meta.id }],
|
|
47
47
|
icon: 'ph--video-conference--regular',
|
|
48
48
|
position: 'hoist',
|
|
49
49
|
disposition: 'hidden',
|
|
@@ -61,16 +61,18 @@ export default (context: PluginContext) => {
|
|
|
61
61
|
// TODO(wittjosiah): The channel shouldn't become the companion during a call.
|
|
62
62
|
// Alternative: the call/meeting/thread should be a child node of the channel and that should be opened.
|
|
63
63
|
createExtension({
|
|
64
|
-
id: `${
|
|
64
|
+
id: `${meta.id}/channel-chat-companion`,
|
|
65
65
|
connector: (node) => {
|
|
66
|
-
return
|
|
67
|
-
return pipe(
|
|
66
|
+
return Atom.make((get) => {
|
|
67
|
+
return Function.pipe(
|
|
68
68
|
get(node),
|
|
69
|
-
Option.flatMap((node) =>
|
|
69
|
+
Option.flatMap((node) =>
|
|
70
|
+
Obj.instanceOf(Channel.Channel, node.data) ? Option.some(node.data) : Option.none(),
|
|
71
|
+
),
|
|
70
72
|
Option.map((channel) => {
|
|
71
73
|
const callManager = context.getCapability(ThreadCapabilities.CallManager);
|
|
72
74
|
const joined = get(
|
|
73
|
-
|
|
75
|
+
atomFromSignal(() => callManager.joined && callManager.roomId === Obj.getDXN(channel).toString()),
|
|
74
76
|
);
|
|
75
77
|
if (!joined) {
|
|
76
78
|
return [];
|
|
@@ -78,11 +80,11 @@ export default (context: PluginContext) => {
|
|
|
78
80
|
|
|
79
81
|
return [
|
|
80
82
|
{
|
|
81
|
-
id: `${
|
|
83
|
+
id: `${Obj.getDXN(channel).toString()}${ATTENDABLE_PATH_SEPARATOR}chat`,
|
|
82
84
|
type: PLANK_COMPANION_TYPE,
|
|
83
85
|
data: 'chat',
|
|
84
86
|
properties: {
|
|
85
|
-
label: ['channel companion label', { ns:
|
|
87
|
+
label: ['channel companion label', { ns: meta.id }],
|
|
86
88
|
icon: 'ph--hash--regular',
|
|
87
89
|
position: 'hoist',
|
|
88
90
|
disposition: 'hidden',
|
|
@@ -98,11 +100,11 @@ export default (context: PluginContext) => {
|
|
|
98
100
|
createExtension({
|
|
99
101
|
id: `${meta.id}/comments-companion`,
|
|
100
102
|
connector: (node) =>
|
|
101
|
-
|
|
102
|
-
pipe(
|
|
103
|
+
Atom.make((get) =>
|
|
104
|
+
Function.pipe(
|
|
103
105
|
get(node),
|
|
104
106
|
Option.flatMap((node) => {
|
|
105
|
-
if (!Obj.isObject(node.data) || Obj.instanceOf(
|
|
107
|
+
if (!Obj.isObject(node.data) || Obj.instanceOf(Channel.Channel, node.data)) {
|
|
106
108
|
return Option.none();
|
|
107
109
|
}
|
|
108
110
|
const metadata = resolve(Obj.getTypename(node.data)!);
|
|
@@ -128,11 +130,11 @@ export default (context: PluginContext) => {
|
|
|
128
130
|
createExtension({
|
|
129
131
|
id: `${meta.id}/comment-toolbar`,
|
|
130
132
|
actions: (node) =>
|
|
131
|
-
|
|
132
|
-
pipe(
|
|
133
|
+
Atom.make((get) =>
|
|
134
|
+
Function.pipe(
|
|
133
135
|
get(node),
|
|
134
136
|
Option.flatMap((node) => {
|
|
135
|
-
if (!Obj.isObject(node.data) || Obj.instanceOf(
|
|
137
|
+
if (!Obj.isObject(node.data) || Obj.instanceOf(Channel.Channel, node.data)) {
|
|
136
138
|
return Option.none();
|
|
137
139
|
}
|
|
138
140
|
const metadata = resolve(Obj.getTypename(node.data)!);
|
|
@@ -142,28 +144,37 @@ export default (context: PluginContext) => {
|
|
|
142
144
|
const selectionManager = context.getCapability(AttentionCapabilities.Selection);
|
|
143
145
|
const toolbar = get(context.capabilities(ThreadCapabilities.State))[0]?.state.toolbar ?? {};
|
|
144
146
|
const disabled = get(
|
|
145
|
-
|
|
147
|
+
atomFromSignal(() => {
|
|
146
148
|
const metadata = resolve(Obj.getTypename(object)!);
|
|
147
|
-
const selection = selectionManager.getSelection(
|
|
149
|
+
const selection = selectionManager.getSelection(
|
|
150
|
+
Obj.getDXN(object).toString(),
|
|
151
|
+
metadata.selectionMode,
|
|
152
|
+
);
|
|
148
153
|
const anchor = getAnchor(selection);
|
|
149
154
|
const invalidSelection = !anchor;
|
|
150
|
-
const overlappingComment = toolbar[
|
|
155
|
+
const overlappingComment = toolbar[Obj.getDXN(object).toString()];
|
|
151
156
|
return (metadata.comments === 'anchored' && invalidSelection) || overlappingComment;
|
|
152
157
|
}),
|
|
153
158
|
);
|
|
154
159
|
|
|
155
160
|
return [
|
|
156
161
|
{
|
|
157
|
-
id: `${
|
|
162
|
+
id: `${Obj.getDXN(object).toString()}/comment`,
|
|
158
163
|
data: () => {
|
|
159
164
|
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
160
165
|
const metadata = resolve(Obj.getTypename(object)!);
|
|
161
|
-
const selection = selectionManager.getSelection(
|
|
166
|
+
const selection = selectionManager.getSelection(Obj.getDXN(object).toString());
|
|
162
167
|
// TODO(wittjosiah): Use presence of selection to determine if the comment should be anchored.
|
|
163
168
|
// Requires all components which support selection (e.g. table/kanban) to support anchored comments.
|
|
164
169
|
const anchor = metadata.comments === 'anchored' ? getAnchor(selection) : Date.now().toString();
|
|
165
170
|
const name = metadata.getAnchorLabel?.(object, anchor);
|
|
166
|
-
void dispatch(
|
|
171
|
+
void dispatch(
|
|
172
|
+
createIntent(ThreadAction.Create, {
|
|
173
|
+
anchor,
|
|
174
|
+
name,
|
|
175
|
+
subject: object,
|
|
176
|
+
}),
|
|
177
|
+
);
|
|
167
178
|
},
|
|
168
179
|
properties: {
|
|
169
180
|
label: ['add comment label', { ns: meta.id }],
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
6
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
7
|
+
import { type FunctionDefinition } from '@dxos/functions';
|
|
8
|
+
import { trim } from '@dxos/util';
|
|
9
|
+
|
|
10
|
+
import { createProposals } from '../functions';
|
|
11
|
+
|
|
12
|
+
const functions: FunctionDefinition[] = [createProposals];
|
|
13
|
+
|
|
14
|
+
export const ASSISTANT_BLUEPRINT_KEY = 'dxos.org/blueprint/thread';
|
|
15
|
+
|
|
16
|
+
export default (): Capability<any>[] => [
|
|
17
|
+
contributes(Capabilities.Functions, functions),
|
|
18
|
+
contributes(
|
|
19
|
+
Capabilities.BlueprintDefinition,
|
|
20
|
+
Blueprint.make({
|
|
21
|
+
key: ASSISTANT_BLUEPRINT_KEY,
|
|
22
|
+
name: 'Thread',
|
|
23
|
+
tools: Blueprint.toolDefinitions({ functions }),
|
|
24
|
+
instructions: Template.make({
|
|
25
|
+
// TODO(wittjosiah): Move example to function input schema annotation.
|
|
26
|
+
source: trim`
|
|
27
|
+
You can update markdown documents via proposals.
|
|
28
|
+
For each diff, respond with the smallest possible matching span.
|
|
29
|
+
For example:
|
|
30
|
+
- "There is a tyop in this sentence."
|
|
31
|
+
+ "There is a typo in this sentence."
|
|
32
|
+
- "This id goof."
|
|
33
|
+
+ "This is good."
|
|
34
|
+
`,
|
|
35
|
+
}),
|
|
36
|
+
}),
|
|
37
|
+
),
|
|
38
|
+
];
|
|
@@ -6,28 +6,28 @@ import { defineCapability } from '@dxos/app-framework';
|
|
|
6
6
|
import { type DeepReadonly } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
import { type CallManager, type CallState, type MediaState } from '../calls';
|
|
9
|
-
import {
|
|
10
|
-
import { type
|
|
9
|
+
import { meta } from '../meta';
|
|
10
|
+
import { type Channel, 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?
|
|
17
17
|
// TODO(wittjosiah): These callbacks could be intents once we support broadcast.
|
|
18
18
|
export type CallProperties = {
|
|
19
|
-
onJoin: (state: { channel?:
|
|
19
|
+
onJoin: (state: { channel?: Channel.Channel; roomId?: string }) => Promise<void>;
|
|
20
20
|
onLeave: (roomId?: string) => Promise<void>;
|
|
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
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { lazy } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
8
|
+
export const BlueprintDefinition = lazy(() => import('./blueprint-definition'));
|
|
8
9
|
export const CallManager = lazy(() => import('./call-manager'));
|
|
9
10
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
10
11
|
export const Markdown = lazy(() => import('./markdown'));
|
|
@@ -12,6 +13,5 @@ export const ReactRoot = lazy(() => import('./react-root'));
|
|
|
12
13
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
13
14
|
export const ThreadSettings = lazy(() => import('./settings'));
|
|
14
15
|
export const ThreadState = lazy(() => import('./state'));
|
|
15
|
-
export const Toolkit = lazy(() => import('./toolkit'));
|
|
16
16
|
|
|
17
17
|
export * from './capabilities';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
8
|
import { sleep } from '@dxos/async';
|
|
@@ -11,23 +11,23 @@ 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 { Ref,
|
|
15
|
-
import { AnchoredTo,
|
|
14
|
+
import { Ref, getSpace } from '@dxos/react-client/echo';
|
|
15
|
+
import { AnchoredTo, Message, Thread } from '@dxos/types';
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { meta } from '../meta';
|
|
18
|
+
import { Channel, ThreadAction } from '../types';
|
|
19
19
|
|
|
20
20
|
import { ThreadCapabilities } from './capabilities';
|
|
21
21
|
|
|
22
22
|
export default (context: PluginContext) =>
|
|
23
23
|
contributes(Capabilities.IntentResolver, [
|
|
24
24
|
createResolver({
|
|
25
|
-
intent: ThreadAction.
|
|
25
|
+
intent: ThreadAction.onCreateSpace,
|
|
26
26
|
resolve: ({ space, rootCollection }) =>
|
|
27
27
|
Effect.gen(function* () {
|
|
28
28
|
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
29
29
|
const { object: collection } = yield* dispatch(
|
|
30
|
-
createIntent(CollectionAction.CreateQueryCollection, { typename: Type.getTypename(
|
|
30
|
+
createIntent(CollectionAction.CreateQueryCollection, { typename: Type.getTypename(Channel.Channel) }),
|
|
31
31
|
);
|
|
32
32
|
rootCollection.objects.push(Ref.make(collection));
|
|
33
33
|
|
|
@@ -41,18 +41,14 @@ export default (context: PluginContext) =>
|
|
|
41
41
|
intent: ThreadAction.CreateChannel,
|
|
42
42
|
resolve: ({ name }) => ({
|
|
43
43
|
data: {
|
|
44
|
-
object:
|
|
45
|
-
name,
|
|
46
|
-
defaultThread: Ref.make(Obj.make(ThreadType, { messages: [], status: 'active' })),
|
|
47
|
-
threads: [],
|
|
48
|
-
}),
|
|
44
|
+
object: Channel.make({ name }),
|
|
49
45
|
},
|
|
50
46
|
}),
|
|
51
47
|
}),
|
|
52
48
|
createResolver({
|
|
53
49
|
intent: ThreadAction.CreateChannelThread,
|
|
54
50
|
resolve: ({ channel }) => {
|
|
55
|
-
const thread =
|
|
51
|
+
const thread = Thread.make({ status: 'active' });
|
|
56
52
|
channel.threads.push(Ref.make(thread));
|
|
57
53
|
return {
|
|
58
54
|
data: {
|
|
@@ -69,9 +65,9 @@ export default (context: PluginContext) =>
|
|
|
69
65
|
invariant(space, 'Space not found');
|
|
70
66
|
|
|
71
67
|
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
72
|
-
const subjectId =
|
|
73
|
-
const thread =
|
|
74
|
-
const anchor = Relation.make(AnchoredTo, {
|
|
68
|
+
const subjectId = Obj.getDXN(subject).toString();
|
|
69
|
+
const thread = Thread.make({ name });
|
|
70
|
+
const anchor = Relation.make(AnchoredTo.AnchoredTo, {
|
|
75
71
|
[Relation.Source]: thread,
|
|
76
72
|
[Relation.Target]: subject,
|
|
77
73
|
anchor: _anchor,
|
|
@@ -86,40 +82,7 @@ export default (context: PluginContext) =>
|
|
|
86
82
|
|
|
87
83
|
return {
|
|
88
84
|
intents: [
|
|
89
|
-
createIntent(ThreadAction.Select, { current:
|
|
90
|
-
createIntent(DeckAction.ChangeCompanion, {
|
|
91
|
-
primary: subjectId,
|
|
92
|
-
companion: `${subjectId}${ATTENDABLE_PATH_SEPARATOR}comments`,
|
|
93
|
-
}),
|
|
94
|
-
],
|
|
95
|
-
};
|
|
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) }),
|
|
85
|
+
createIntent(ThreadAction.Select, { current: Obj.getDXN(thread).toString() }),
|
|
123
86
|
createIntent(DeckAction.ChangeCompanion, {
|
|
124
87
|
primary: subjectId,
|
|
125
88
|
companion: `${subjectId}${ATTENDABLE_PATH_SEPARATOR}comments`,
|
|
@@ -164,9 +127,9 @@ export default (context: PluginContext) =>
|
|
|
164
127
|
createResolver({
|
|
165
128
|
intent: ThreadAction.Delete,
|
|
166
129
|
resolve: async ({ subject, anchor, thread: _thread }, undo) => {
|
|
167
|
-
const thread = _thread ?? (Relation.getSource(anchor) as
|
|
130
|
+
const thread = _thread ?? (Relation.getSource(anchor) as Thread.Thread);
|
|
168
131
|
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
169
|
-
const subjectId =
|
|
132
|
+
const subjectId = Obj.getDXN(subject).toString();
|
|
170
133
|
const draft = state.drafts[subjectId];
|
|
171
134
|
if (draft) {
|
|
172
135
|
// Check if we're deleting a draft; if so, remo ve it.
|
|
@@ -190,7 +153,7 @@ export default (context: PluginContext) =>
|
|
|
190
153
|
|
|
191
154
|
return {
|
|
192
155
|
undoable: {
|
|
193
|
-
message: ['thread deleted label', { ns:
|
|
156
|
+
message: ['thread deleted label', { ns: meta.id }],
|
|
194
157
|
data: { thread, anchor },
|
|
195
158
|
},
|
|
196
159
|
intents: [
|
|
@@ -226,13 +189,13 @@ export default (context: PluginContext) =>
|
|
|
226
189
|
createResolver({
|
|
227
190
|
intent: ThreadAction.AddMessage,
|
|
228
191
|
resolve: ({ anchor, subject, sender, text }) => {
|
|
229
|
-
const thread = Relation.getSource(anchor) as
|
|
192
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
230
193
|
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
231
|
-
const subjectId =
|
|
194
|
+
const subjectId = Obj.getDXN(subject).toString();
|
|
232
195
|
const space = getSpace(subject);
|
|
233
196
|
invariant(space, 'Space not found');
|
|
234
197
|
|
|
235
|
-
const message = Obj.make(
|
|
198
|
+
const message = Obj.make(Message.Message, {
|
|
236
199
|
created: new Date().toISOString(),
|
|
237
200
|
sender,
|
|
238
201
|
blocks: [{ _tag: 'text', text }],
|
|
@@ -252,7 +215,7 @@ export default (context: PluginContext) =>
|
|
|
252
215
|
intents.push(
|
|
253
216
|
createIntent(SpaceAction.AddRelation, {
|
|
254
217
|
space,
|
|
255
|
-
schema: AnchoredTo,
|
|
218
|
+
schema: AnchoredTo.AnchoredTo,
|
|
256
219
|
source: thread,
|
|
257
220
|
target: subject,
|
|
258
221
|
fields: { anchor: draft.anchor },
|
|
@@ -288,7 +251,7 @@ export default (context: PluginContext) =>
|
|
|
288
251
|
createResolver({
|
|
289
252
|
intent: ThreadAction.DeleteMessage,
|
|
290
253
|
resolve: ({ subject, anchor, messageId, message, messageIndex }, undo) => {
|
|
291
|
-
const thread = Relation.getSource(anchor) as
|
|
254
|
+
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
292
255
|
const space = getSpace(subject);
|
|
293
256
|
invariant(space, 'Space not found');
|
|
294
257
|
|
|
@@ -310,7 +273,7 @@ export default (context: PluginContext) =>
|
|
|
310
273
|
|
|
311
274
|
return {
|
|
312
275
|
undoable: {
|
|
313
|
-
message: ['message deleted label', { ns:
|
|
276
|
+
message: ['message deleted label', { ns: meta.id }],
|
|
314
277
|
data: { message, messageIndex },
|
|
315
278
|
},
|
|
316
279
|
intents: [
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import { EditorView } from '@codemirror/view';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
8
9
|
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
|
|
9
10
|
import { MarkdownCapabilities } from '@dxos/plugin-markdown';
|
|
10
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
11
11
|
import { type EditorState, commentClickedEffect, commentsState, overlap } from '@dxos/react-ui-editor';
|
|
12
12
|
|
|
13
13
|
import { threads } from '../extensions';
|
|
@@ -22,17 +22,19 @@ export default (context: PluginContext) =>
|
|
|
22
22
|
return threads(state, doc, dispatch);
|
|
23
23
|
},
|
|
24
24
|
({ document: doc }) => {
|
|
25
|
+
if (!doc) return [];
|
|
25
26
|
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
26
27
|
|
|
27
28
|
return EditorView.updateListener.of((update) => {
|
|
28
29
|
if (update.docChanged || update.selectionSet) {
|
|
29
|
-
state.toolbar[
|
|
30
|
+
state.toolbar[Obj.getDXN(doc).toString()] = selectionOverlapsComment(update.state);
|
|
30
31
|
}
|
|
31
32
|
});
|
|
32
33
|
},
|
|
33
34
|
({ document: doc }) => {
|
|
35
|
+
if (!doc) return [];
|
|
34
36
|
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
35
|
-
const id =
|
|
37
|
+
const id = Obj.getDXN(doc).toString();
|
|
36
38
|
|
|
37
39
|
return EditorView.updateListener.of((update) => {
|
|
38
40
|
update.transactions.forEach((transaction) => {
|
|
@@ -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
|
};
|
|
@@ -4,37 +4,39 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, createSurface
|
|
7
|
+
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
+
import { useCapability } from '@dxos/app-framework/react';
|
|
8
9
|
import { Obj, type Ref } from '@dxos/echo';
|
|
9
10
|
import { SettingsStore } from '@dxos/local-storage';
|
|
10
11
|
import { getSpace } from '@dxos/react-client/echo';
|
|
12
|
+
import { Thread } from '@dxos/types';
|
|
11
13
|
|
|
12
14
|
import {
|
|
13
15
|
CallDebugPanel,
|
|
14
16
|
CallSidebar,
|
|
15
17
|
ChannelContainer,
|
|
16
18
|
ChatContainer,
|
|
17
|
-
|
|
19
|
+
ThreadCompanion,
|
|
18
20
|
ThreadSettings,
|
|
19
21
|
} from '../components';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
+
import { meta } from '../meta';
|
|
23
|
+
import { Channel, type ThreadSettingsProps } from '../types';
|
|
22
24
|
|
|
23
25
|
import { ThreadCapabilities } from './capabilities';
|
|
24
26
|
|
|
25
27
|
export default () =>
|
|
26
28
|
contributes(Capabilities.ReactSurface, [
|
|
27
29
|
createSurface({
|
|
28
|
-
id: `${
|
|
30
|
+
id: `${meta.id}/channel`,
|
|
29
31
|
role: 'article',
|
|
30
|
-
filter: (data): data is { subject:
|
|
31
|
-
component: ({ data: { subject
|
|
32
|
+
filter: (data): data is { subject: Channel.Channel } => Obj.instanceOf(Channel.Channel, data.subject),
|
|
33
|
+
component: ({ data: { subject }, role }) => <ChannelContainer channel={subject} role={role} />,
|
|
32
34
|
}),
|
|
33
35
|
createSurface({
|
|
34
|
-
id: `${
|
|
36
|
+
id: `${meta.id}/chat-companion`,
|
|
35
37
|
role: 'article',
|
|
36
|
-
filter: (data): data is { companionTo:
|
|
37
|
-
Obj.instanceOf(
|
|
38
|
+
filter: (data): data is { companionTo: Channel.Channel; subject: 'chat' } =>
|
|
39
|
+
Obj.instanceOf(Channel.Channel, data.companionTo) && data.subject === 'chat',
|
|
38
40
|
component: ({ data: { companionTo: channel } }) => {
|
|
39
41
|
const space = getSpace(channel);
|
|
40
42
|
const thread = channel.defaultThread.target;
|
|
@@ -46,40 +48,40 @@ export default () =>
|
|
|
46
48
|
},
|
|
47
49
|
}),
|
|
48
50
|
createSurface({
|
|
49
|
-
id: `${
|
|
51
|
+
id: `${meta.id}/thread`,
|
|
50
52
|
role: 'article',
|
|
51
|
-
filter: (data): data is { subject:
|
|
52
|
-
component: ({ data: { subject
|
|
53
|
-
const space = getSpace(
|
|
54
|
-
if (!space || !
|
|
53
|
+
filter: (data): data is { subject: Thread.Thread } => Obj.instanceOf(Thread.Thread, data.subject),
|
|
54
|
+
component: ({ data: { subject } }) => {
|
|
55
|
+
const space = getSpace(subject);
|
|
56
|
+
if (!space || !subject) {
|
|
55
57
|
return null;
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
return <ChatContainer thread={
|
|
60
|
+
return <ChatContainer thread={subject} space={space} />;
|
|
59
61
|
},
|
|
60
62
|
}),
|
|
61
63
|
createSurface({
|
|
62
|
-
id: `${
|
|
64
|
+
id: `${meta.id}/comments`,
|
|
63
65
|
role: 'article',
|
|
64
|
-
filter: (data): data is { companionTo: { threads: Ref.Ref<
|
|
66
|
+
filter: (data): data is { companionTo: { threads: Ref.Ref<Thread.Thread>[] } } =>
|
|
65
67
|
data.subject === 'comments' && Obj.isObject(data.companionTo),
|
|
66
68
|
// TODO(wittjosiah): This isn't scrolling properly in a plank.
|
|
67
|
-
component: ({ data }) => <
|
|
69
|
+
component: ({ data }) => <ThreadCompanion subject={data.companionTo} />,
|
|
68
70
|
}),
|
|
69
71
|
createSurface({
|
|
70
|
-
id: `${
|
|
72
|
+
id: `${meta.id}/plugin-settings`,
|
|
71
73
|
role: 'article',
|
|
72
74
|
filter: (data): data is { subject: SettingsStore<ThreadSettingsProps> } =>
|
|
73
|
-
data.subject instanceof SettingsStore && data.subject.prefix ===
|
|
75
|
+
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
74
76
|
component: ({ data: { subject } }) => <ThreadSettings settings={subject.value} />,
|
|
75
77
|
}),
|
|
76
78
|
createSurface({
|
|
77
|
-
id: `${
|
|
79
|
+
id: `${meta.id}/assistant`,
|
|
78
80
|
role: 'deck-companion--active-call',
|
|
79
81
|
component: () => <CallSidebar />,
|
|
80
82
|
}),
|
|
81
83
|
createSurface({
|
|
82
|
-
id: `${
|
|
84
|
+
id: `${meta.id}/devtools-overview`,
|
|
83
85
|
role: 'devtools-overview',
|
|
84
86
|
component: () => {
|
|
85
87
|
const call = useCapability(ThreadCapabilities.CallManager);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type FC, type PropsWithChildren } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useCapability } from '@dxos/app-framework';
|
|
7
|
+
import { useCapability } from '@dxos/app-framework/react';
|
|
8
8
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
10
|
import { ThreadCapabilities } from '../../capabilities';
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { useAppGraph, useCapability } from '@dxos/app-framework';
|
|
7
|
+
import { useAppGraph, useCapability } from '@dxos/app-framework/react';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
8
9
|
import { useActions, useNode } from '@dxos/plugin-graph';
|
|
9
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
10
10
|
import {
|
|
11
11
|
Icon,
|
|
12
12
|
IconButton,
|
|
@@ -20,10 +20,10 @@ import { groupHoverControlItemWithTransition, mx } from '@dxos/react-ui-theme';
|
|
|
20
20
|
|
|
21
21
|
import { ThreadCapabilities } from '../../capabilities';
|
|
22
22
|
import { meta } from '../../meta';
|
|
23
|
-
import { type
|
|
23
|
+
import { type Channel } from '../../types';
|
|
24
24
|
|
|
25
25
|
export type ToolbarProps = ThemedClassName<{
|
|
26
|
-
channel?:
|
|
26
|
+
channel?: Channel.Channel;
|
|
27
27
|
participants?: number;
|
|
28
28
|
autoHideControls?: boolean;
|
|
29
29
|
isInRoom?: boolean;
|
|
@@ -45,7 +45,7 @@ export const Toolbar = ({
|
|
|
45
45
|
const call = useCapability(ThreadCapabilities.CallManager);
|
|
46
46
|
|
|
47
47
|
// Channel app graph node.
|
|
48
|
-
const node = useNode(graph, channel &&
|
|
48
|
+
const node = useNode(graph, channel && Obj.getDXN(channel).toString());
|
|
49
49
|
const actions = useActions(graph, node?.id).filter((action) => action.properties.disposition === 'toolbar');
|
|
50
50
|
|
|
51
51
|
// Screen sharing.
|