@dxos/plugin-thread 0.8.4-main.fd6878d → 0.8.4-staging.60fe92afc8
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/LICENSE +102 -5
- package/PLUGIN.mdl +75 -0
- package/README.md +1 -1
- package/dist/lib/neutral/ChannelArticle-H633OM3U.mjs +57 -0
- package/dist/lib/neutral/ChannelArticle-H633OM3U.mjs.map +7 -0
- package/dist/lib/neutral/ChannelCreatePanel-NUXXKHZQ.mjs +38 -0
- package/dist/lib/neutral/ChannelCreatePanel-NUXXKHZQ.mjs.map +7 -0
- package/dist/lib/neutral/ThreadArticle-ROQXQLEZ.mjs +57 -0
- package/dist/lib/neutral/ThreadArticle-ROQXQLEZ.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.mjs +67 -0
- package/dist/lib/neutral/ThreadPlugin.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.node.mjs +29 -0
- package/dist/lib/neutral/ThreadPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.workerd.mjs +27 -0
- package/dist/lib/neutral/ThreadPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-OLKN3VTB.mjs +50 -0
- package/dist/lib/neutral/app-graph-builder-OLKN3VTB.mjs.map +7 -0
- package/dist/lib/neutral/append-channel-message-J6DXDPBH.mjs +34 -0
- package/dist/lib/neutral/append-channel-message-J6DXDPBH.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +19 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/channel-backend-feed-FCXGAIEC.mjs +58 -0
- package/dist/lib/neutral/channel-backend-feed-FCXGAIEC.mjs.map +7 -0
- package/dist/lib/neutral/chunk-AWAQTEU6.mjs +10 -0
- package/dist/lib/neutral/chunk-AWAQTEU6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-HJHK5O6F.mjs +109 -0
- package/dist/lib/neutral/chunk-HJHK5O6F.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-OOC6EQ7X.mjs +36 -0
- package/dist/lib/neutral/chunk-OOC6EQ7X.mjs.map +7 -0
- package/dist/lib/neutral/chunk-P4RSGFS4.mjs +69 -0
- package/dist/lib/neutral/chunk-P4RSGFS4.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SZXFLBZL.mjs +8 -0
- package/dist/lib/neutral/chunk-SZXFLBZL.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +93 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +13 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-channel-UW2LSL4G.mjs +41 -0
- package/dist/lib/neutral/create-channel-UW2LSL4G.mjs.map +7 -0
- package/dist/lib/neutral/create-object-RLCOUVAW.mjs +46 -0
- package/dist/lib/neutral/create-object-RLCOUVAW.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +11 -0
- package/dist/lib/neutral/index.mjs +34 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +10 -0
- package/dist/lib/neutral/navigation-resolver-4X4HCQYX.mjs +14 -0
- package/dist/lib/neutral/navigation-resolver-4X4HCQYX.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs +13 -0
- package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-G6KT7TSU.mjs +48 -0
- package/dist/lib/neutral/react-surface-G6KT7TSU.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +91 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +16 -0
- package/dist/types/src/ThreadPlugin.d.ts +3 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/ThreadPlugin.node.d.ts +4 -0
- package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ThreadPlugin.test.d.ts +2 -0
- package/dist/types/src/ThreadPlugin.test.d.ts.map +1 -0
- package/dist/types/src/ThreadPlugin.workerd.d.ts +4 -0
- package/dist/types/src/ThreadPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/channel-backend-feed.d.ts +13 -0
- package/dist/types/src/capabilities/channel-backend-feed.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +12 -14
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/navigation-resolver.d.ts +6 -0
- package/dist/types/src/capabilities/navigation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +43 -0
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
- package/dist/types/src/components/Chat/index.d.ts +2 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -10
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts +19 -0
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts +162 -0
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ChannelArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelCreatePanel/ChannelCreatePanel.d.ts +11 -0
- package/dist/types/src/containers/ChannelCreatePanel/ChannelCreatePanel.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelCreatePanel/index.d.ts +2 -0
- package/dist/types/src/containers/ChannelCreatePanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadArticle/ThreadArticle.d.ts +20 -0
- package/dist/types/src/containers/ThreadArticle/ThreadArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadArticle/ThreadArticle.stories.d.ts +162 -0
- package/dist/types/src/containers/ThreadArticle/ThreadArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ThreadArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -4
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useMessages.d.ts +4 -0
- package/dist/types/src/hooks/useMessages.d.ts.map +1 -0
- package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/append-channel-message.d.ts +5 -0
- package/dist/types/src/operations/append-channel-message.d.ts.map +1 -0
- package/dist/types/src/operations/create-channel.d.ts +5 -0
- package/dist/types/src/operations/create-channel.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/paths.d.ts +3 -0
- package/dist/types/src/paths.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +142 -72
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/ThreadCapabilities.d.ts +37 -0
- package/dist/types/src/types/ThreadCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/ThreadOperation.d.ts +91 -0
- package/dist/types/src/types/ThreadOperation.d.ts.map +1 -0
- package/dist/types/src/types/channel-backend.d.ts +16 -0
- package/dist/types/src/types/channel-backend.d.ts.map +1 -0
- package/dist/types/src/types/channel-backend.test.d.ts +2 -0
- package/dist/types/src/types/channel-backend.test.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +4 -20
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +108 -81
- package/src/ThreadPlugin.node.ts +26 -0
- package/src/ThreadPlugin.test.ts +27 -0
- package/src/ThreadPlugin.tsx +38 -144
- package/src/ThreadPlugin.workerd.ts +25 -0
- package/src/capabilities/app-graph-builder.ts +44 -174
- package/src/capabilities/channel-backend-feed.ts +60 -0
- package/src/capabilities/create-object.ts +46 -0
- package/src/capabilities/index.ts +11 -11
- package/src/capabilities/navigation-resolver.ts +18 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +39 -79
- package/src/components/Chat/Chat.tsx +119 -0
- package/src/components/Chat/index.ts +5 -0
- package/src/components/index.ts +1 -14
- package/src/containers/ChannelArticle/ChannelArticle.stories.tsx +108 -0
- package/src/containers/ChannelArticle/ChannelArticle.tsx +83 -0
- package/src/containers/ChannelArticle/index.ts +5 -0
- package/src/containers/ChannelCreatePanel/ChannelCreatePanel.tsx +52 -0
- package/src/containers/ChannelCreatePanel/index.ts +5 -0
- package/src/containers/ThreadArticle/ThreadArticle.stories.tsx +86 -0
- package/src/containers/ThreadArticle/ThreadArticle.tsx +75 -0
- package/src/containers/ThreadArticle/index.ts +5 -0
- package/src/containers/index.ts +9 -0
- package/src/hooks/index.ts +1 -4
- package/src/hooks/useMessages.ts +37 -0
- package/src/index.ts +4 -4
- package/src/meta.ts +27 -9
- package/src/operations/append-channel-message.ts +31 -0
- package/src/operations/create-channel.ts +30 -0
- package/src/operations/index.ts +10 -0
- package/src/paths.ts +10 -0
- package/src/plugin.ts +11 -0
- package/src/translations.ts +75 -73
- package/src/types/ThreadCapabilities.ts +47 -0
- package/src/types/ThreadOperation.ts +49 -0
- package/src/types/channel-backend.test.ts +48 -0
- package/src/types/channel-backend.ts +54 -0
- package/src/types/index.ts +3 -2
- package/src/util.ts +35 -18
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/ChannelContainer-O2SFQJU7.mjs +0 -16
- package/dist/lib/browser/ChatContainer-PVT3DUZJ.mjs +0 -15
- package/dist/lib/browser/app-graph-builder-AF3M7UWN.mjs +0 -171
- package/dist/lib/browser/app-graph-builder-AF3M7UWN.mjs.map +0 -7
- package/dist/lib/browser/call-manager-XRRCAVLI.mjs +0 -24
- package/dist/lib/browser/call-manager-XRRCAVLI.mjs.map +0 -7
- package/dist/lib/browser/chunk-2CWJBXBH.mjs +0 -21
- package/dist/lib/browser/chunk-2CWJBXBH.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-DW7JD64V.mjs +0 -137
- package/dist/lib/browser/chunk-DW7JD64V.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-FY4ZRD5X.mjs +0 -367
- package/dist/lib/browser/chunk-FY4ZRD5X.mjs.map +0 -7
- package/dist/lib/browser/chunk-GERVMFQW.mjs +0 -31
- package/dist/lib/browser/chunk-GERVMFQW.mjs.map +0 -7
- package/dist/lib/browser/chunk-J3JO5NWO.mjs +0 -477
- package/dist/lib/browser/chunk-J3JO5NWO.mjs.map +0 -7
- package/dist/lib/browser/chunk-JGKMMI65.mjs +0 -56
- package/dist/lib/browser/chunk-JGKMMI65.mjs.map +0 -7
- package/dist/lib/browser/chunk-TUFWPOVS.mjs +0 -1698
- package/dist/lib/browser/chunk-TUFWPOVS.mjs.map +0 -7
- package/dist/lib/browser/chunk-X5PIP5YR.mjs +0 -149
- package/dist/lib/browser/chunk-X5PIP5YR.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZJ7QBXK6.mjs +0 -984
- package/dist/lib/browser/chunk-ZJ7QBXK6.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -302
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-DCY4P4OX.mjs +0 -369
- package/dist/lib/browser/intent-resolver-DCY4P4OX.mjs.map +0 -7
- package/dist/lib/browser/markdown-WZSXCEZJ.mjs +0 -169
- package/dist/lib/browser/markdown-WZSXCEZJ.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-root-QXPALOUQ.mjs +0 -28
- package/dist/lib/browser/react-root-QXPALOUQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-PYAMIADB.mjs +0 -109
- package/dist/lib/browser/react-surface-PYAMIADB.mjs.map +0 -7
- package/dist/lib/browser/settings-AC6YSASL.mjs +0 -22
- package/dist/lib/browser/settings-AC6YSASL.mjs.map +0 -7
- package/dist/lib/browser/state-2T4KDWBX.mjs +0 -34
- package/dist/lib/browser/state-2T4KDWBX.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -16
- package/dist/lib/node-esm/ChannelContainer-B2ZGAE4P.mjs +0 -17
- package/dist/lib/node-esm/ChatContainer-2CT4PJ7I.mjs +0 -16
- package/dist/lib/node-esm/app-graph-builder-OLSJVCWY.mjs +0 -172
- package/dist/lib/node-esm/app-graph-builder-OLSJVCWY.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-EI7FXRAU.mjs +0 -25
- package/dist/lib/node-esm/call-manager-EI7FXRAU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4TME3BR4.mjs +0 -1699
- package/dist/lib/node-esm/chunk-4TME3BR4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-57XR3LEF.mjs +0 -33
- package/dist/lib/node-esm/chunk-57XR3LEF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6CRHHOST.mjs +0 -23
- package/dist/lib/node-esm/chunk-6CRHHOST.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BF4UKS55.mjs +0 -368
- package/dist/lib/node-esm/chunk-BF4UKS55.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-PYTVBN5J.mjs +0 -19
- package/dist/lib/node-esm/chunk-PYTVBN5J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QBHKLWGR.mjs +0 -58
- package/dist/lib/node-esm/chunk-QBHKLWGR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SED3O2XO.mjs +0 -150
- package/dist/lib/node-esm/chunk-SED3O2XO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VNG6M2IY.mjs +0 -478
- package/dist/lib/node-esm/chunk-VNG6M2IY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XVKWHTH4.mjs +0 -138
- package/dist/lib/node-esm/chunk-XVKWHTH4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YIDU3DXK.mjs +0 -985
- package/dist/lib/node-esm/chunk-YIDU3DXK.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -303
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-QGTPU6QB.mjs +0 -370
- package/dist/lib/node-esm/intent-resolver-QGTPU6QB.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-3MZXUGUA.mjs +0 -170
- package/dist/lib/node-esm/markdown-3MZXUGUA.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-root-7ZFJYVUZ.mjs +0 -29
- package/dist/lib/node-esm/react-root-7ZFJYVUZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UJFCSFNO.mjs +0 -110
- package/dist/lib/node-esm/react-surface-UJFCSFNO.mjs.map +0 -7
- package/dist/lib/node-esm/settings-N52O7MLS.mjs +0 -23
- package/dist/lib/node-esm/settings-N52O7MLS.mjs.map +0 -7
- package/dist/lib/node-esm/state-62TQKQVB.mjs +0 -35
- package/dist/lib/node-esm/state-62TQKQVB.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -17
- package/dist/types/src/calls/call-manager.d.ts +0 -77
- package/dist/types/src/calls/call-manager.d.ts.map +0 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts +0 -66
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +0 -1
- package/dist/types/src/calls/index.d.ts +0 -7
- package/dist/types/src/calls/index.d.ts.map +0 -1
- package/dist/types/src/calls/media-manager.d.ts +0 -60
- package/dist/types/src/calls/media-manager.d.ts.map +0 -1
- package/dist/types/src/calls/speaking-monitor.d.ts +0 -24
- package/dist/types/src/calls/speaking-monitor.d.ts.map +0 -1
- package/dist/types/src/calls/types.d.ts +0 -45
- package/dist/types/src/calls/types.d.ts.map +0 -1
- package/dist/types/src/calls/util/audio.d.ts +0 -6
- package/dist/types/src/calls/util/audio.d.ts.map +0 -1
- package/dist/types/src/calls/util/calls-service.d.ts +0 -75
- package/dist/types/src/calls/util/calls-service.d.ts.map +0 -1
- package/dist/types/src/calls/util/history-cache.d.ts +0 -11
- package/dist/types/src/calls/util/history-cache.d.ts.map +0 -1
- package/dist/types/src/calls/util/index.d.ts +0 -5
- package/dist/types/src/calls/util/index.d.ts.map +0 -1
- package/dist/types/src/calls/util/media.d.ts +0 -6
- package/dist/types/src/calls/util/media.d.ts.map +0 -1
- package/dist/types/src/calls/util/stub-media-streams.d.ts +0 -18
- package/dist/types/src/calls/util/stub-media-streams.d.ts.map +0 -1
- package/dist/types/src/calls/util/task-scheduling.d.ts +0 -17
- package/dist/types/src/calls/util/task-scheduling.d.ts.map +0 -1
- package/dist/types/src/calls-service.stories.d.ts +0 -22
- package/dist/types/src/calls-service.stories.d.ts.map +0 -1
- package/dist/types/src/capabilities/call-manager.d.ts +0 -5
- package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -27
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown.d.ts +0 -4
- package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -7
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -7
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/components/Call/Call.d.ts +0 -17
- package/dist/types/src/components/Call/Call.d.ts.map +0 -1
- package/dist/types/src/components/Call/Toolbar.d.ts +0 -16
- package/dist/types/src/components/Call/Toolbar.d.ts.map +0 -1
- package/dist/types/src/components/Call/index.d.ts +0 -3
- package/dist/types/src/components/Call/index.d.ts.map +0 -1
- package/dist/types/src/components/CallDebugPanel.d.ts +0 -8
- package/dist/types/src/components/CallDebugPanel.d.ts.map +0 -1
- package/dist/types/src/components/CallSidebar.d.ts +0 -4
- package/dist/types/src/components/CallSidebar.d.ts.map +0 -1
- package/dist/types/src/components/ChannelContainer.d.ts +0 -14
- package/dist/types/src/components/ChannelContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts +0 -10
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Chat.stories.d.ts +0 -7
- package/dist/types/src/components/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -17
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/Comments.stories.d.ts +0 -6
- package/dist/types/src/components/Comments.stories.d.ts.map +0 -1
- package/dist/types/src/components/CommentsContainer.d.ts +0 -13
- package/dist/types/src/components/CommentsContainer.d.ts.map +0 -1
- package/dist/types/src/components/CommentsThreadContainer.d.ts +0 -14
- package/dist/types/src/components/CommentsThreadContainer.d.ts.map +0 -1
- package/dist/types/src/components/Lobby/Lobby.d.ts +0 -15
- package/dist/types/src/components/Lobby/Lobby.d.ts.map +0 -1
- package/dist/types/src/components/Lobby/index.d.ts +0 -2
- package/dist/types/src/components/Lobby/index.d.ts.map +0 -1
- package/dist/types/src/components/Media/AudioStream.d.ts +0 -6
- package/dist/types/src/components/Media/AudioStream.d.ts.map +0 -1
- package/dist/types/src/components/Media/VideoObject.d.ts +0 -15
- package/dist/types/src/components/Media/VideoObject.d.ts.map +0 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +0 -8
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +0 -1
- package/dist/types/src/components/Media/index.d.ts +0 -3
- package/dist/types/src/components/Media/index.d.ts.map +0 -1
- package/dist/types/src/components/MessageContainer.d.ts +0 -11
- package/dist/types/src/components/MessageContainer.d.ts.map +0 -1
- package/dist/types/src/components/Participant/Participant.d.ts +0 -6
- package/dist/types/src/components/Participant/Participant.d.ts.map +0 -1
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts +0 -11
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +0 -1
- package/dist/types/src/components/Participant/index.d.ts +0 -3
- package/dist/types/src/components/Participant/index.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.d.ts +0 -12
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +0 -10
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts +0 -32
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +0 -23
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts +0 -21
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/index.d.ts +0 -4
- package/dist/types/src/components/ResponsiveGrid/index.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/components/ThreadSettings.d.ts +0 -6
- package/dist/types/src/components/ThreadSettings.d.ts.map +0 -1
- package/dist/types/src/components/command-extension.d.ts +0 -3
- package/dist/types/src/components/command-extension.d.ts.map +0 -1
- package/dist/types/src/components/testing.d.ts +0 -4
- package/dist/types/src/components/testing.d.ts.map +0 -1
- package/dist/types/src/extensions/index.d.ts +0 -2
- package/dist/types/src/extensions/index.d.ts.map +0 -1
- package/dist/types/src/extensions/threads.d.ts +0 -9
- package/dist/types/src/extensions/threads.d.ts.map +0 -1
- package/dist/types/src/hooks/analytics.d.ts +0 -4
- package/dist/types/src/hooks/analytics.d.ts.map +0 -1
- package/dist/types/src/hooks/useDebugMode.d.ts +0 -2
- package/dist/types/src/hooks/useDebugMode.d.ts.map +0 -1
- package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts +0 -2
- package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts.map +0 -1
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts +0 -3
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -2
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/dist/types/src/testing/stories.d.ts +0 -2
- package/dist/types/src/testing/stories.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -164
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -388
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/calls/call-manager.ts +0 -246
- package/src/calls/call-swarm-synchronizer.ts +0 -350
- package/src/calls/index.ts +0 -10
- package/src/calls/media-manager.ts +0 -349
- package/src/calls/speaking-monitor.ts +0 -85
- package/src/calls/types.ts +0 -70
- package/src/calls/util/audio.ts +0 -58
- package/src/calls/util/calls-service.ts +0 -531
- package/src/calls/util/history-cache.ts +0 -27
- package/src/calls/util/index.ts +0 -8
- package/src/calls/util/media.ts +0 -52
- package/src/calls/util/stub-media-streams.ts +0 -70
- package/src/calls/util/task-scheduling.ts +0 -92
- package/src/calls-service.stories.tsx +0 -216
- package/src/capabilities/call-manager.ts +0 -20
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -315
- package/src/capabilities/markdown.ts +0 -69
- package/src/capabilities/react-root.tsx +0 -17
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -26
- package/src/components/Call/Call.tsx +0 -89
- package/src/components/Call/Toolbar.tsx +0 -182
- package/src/components/Call/index.ts +0 -6
- package/src/components/CallDebugPanel.tsx +0 -115
- package/src/components/CallSidebar.tsx +0 -18
- package/src/components/ChannelContainer.stories.tsx +0 -59
- package/src/components/ChannelContainer.tsx +0 -201
- package/src/components/Chat.stories.tsx +0 -89
- package/src/components/ChatContainer.tsx +0 -142
- package/src/components/Comments.stories.tsx +0 -93
- package/src/components/CommentsContainer.tsx +0 -72
- package/src/components/CommentsThreadContainer.tsx +0 -168
- package/src/components/Lobby/Lobby.tsx +0 -119
- package/src/components/Lobby/index.ts +0 -5
- package/src/components/Media/AudioStream.tsx +0 -67
- package/src/components/Media/VideoObject.stories.tsx +0 -53
- package/src/components/Media/VideoObject.tsx +0 -58
- package/src/components/Media/index.ts +0 -6
- package/src/components/MessageContainer.tsx +0 -152
- package/src/components/Participant/Participant.tsx +0 -57
- package/src/components/Participant/ParticipantGrid.tsx +0 -89
- package/src/components/Participant/index.ts +0 -6
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +0 -55
- package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +0 -31
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +0 -157
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +0 -341
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +0 -131
- package/src/components/ResponsiveGrid/index.ts +0 -7
- package/src/components/ThreadComplementary.tsx +0 -151
- package/src/components/ThreadSettings.tsx +0 -17
- package/src/components/command-extension.ts +0 -33
- package/src/components/testing.ts +0 -29
- package/src/extensions/index.ts +0 -5
- package/src/extensions/threads.ts +0 -126
- package/src/hooks/analytics.ts +0 -40
- package/src/hooks/useDebugMode.ts +0 -25
- package/src/hooks/useInaudibleAudioStreamTrack.tsx +0 -27
- package/src/hooks/useVideoStreamTrack.tsx +0 -33
- package/src/testing/index.ts +0 -5
- package/src/testing/stories.ts +0 -54
- package/src/types/schema.ts +0 -33
- package/src/types/types.ts +0 -119
- package/src/typings/peermetrics-webrtc-stats.d.ts +0 -30
- package/src/typings.d.ts +0 -8
- /package/dist/lib/{browser/ChannelContainer-O2SFQJU7.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/hooks}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{browser/ChatContainer-PVT3DUZJ.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/ChannelContainer-B2ZGAE4P.mjs.map → neutral/operations/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/ChatContainer-2CT4PJ7I.mjs.map → neutral/types/index.mjs.map} +0 -0
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
const DefaultBatchSizeLimit = 64;
|
|
6
|
-
|
|
7
|
-
type Task<Value = unknown> = () => Promise<Value>;
|
|
8
|
-
|
|
9
|
-
export class FIFOScheduler {
|
|
10
|
-
#schedulerChain: Promise<void>;
|
|
11
|
-
|
|
12
|
-
constructor() {
|
|
13
|
-
this.#schedulerChain = Promise.resolve();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
schedule<T>(task: Task<T>): Promise<T> {
|
|
17
|
-
return new Promise((resolve, reject) => {
|
|
18
|
-
this.#schedulerChain = this.#schedulerChain.then(async () => {
|
|
19
|
-
try {
|
|
20
|
-
resolve(await task());
|
|
21
|
-
} catch (error: any) {
|
|
22
|
-
reject(error);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// TODO(mykola): Reconcile with @dxos/async task scheduling.
|
|
30
|
-
export class BulkRequestDispatcher<RequestEntryParams, BulkResponse> {
|
|
31
|
-
#currentBatch: RequestEntryParams[];
|
|
32
|
-
#currentBulkResponse: Promise<BulkResponse> | null;
|
|
33
|
-
#batchSizeLimit: number;
|
|
34
|
-
|
|
35
|
-
constructor(batchSizeLimit: number = DefaultBatchSizeLimit) {
|
|
36
|
-
this.#currentBatch = [];
|
|
37
|
-
this.#currentBulkResponse = null;
|
|
38
|
-
this.#batchSizeLimit = batchSizeLimit;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Returns a bulk response promise.
|
|
43
|
-
* At the event loop iteration end, the accumulated entries will be dispatched as a bulk request.
|
|
44
|
-
*/
|
|
45
|
-
doBulkRequest(
|
|
46
|
-
params: RequestEntryParams,
|
|
47
|
-
bulkRequestFunc: (bulkCopy: RequestEntryParams[]) => Promise<BulkResponse>,
|
|
48
|
-
): Promise<BulkResponse> {
|
|
49
|
-
if (this.#currentBatch.length >= this.#batchSizeLimit) {
|
|
50
|
-
// If it reaches the batch size limit, we make another bulk request.
|
|
51
|
-
this.#currentBatch = [];
|
|
52
|
-
this.#currentBulkResponse = null;
|
|
53
|
-
}
|
|
54
|
-
this.#currentBatch.push(params);
|
|
55
|
-
if (this.#currentBulkResponse != null) {
|
|
56
|
-
return this.#currentBulkResponse;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Save the current batch list reference in the function scope because this.#currentBatch could be reset
|
|
60
|
-
// if the batch limit is reached.
|
|
61
|
-
const batch = this.#currentBatch;
|
|
62
|
-
this.#currentBulkResponse = new Promise((resolve, reject) => {
|
|
63
|
-
// script
|
|
64
|
-
// |
|
|
65
|
-
// V
|
|
66
|
-
// microtasks (Promise)
|
|
67
|
-
// |
|
|
68
|
-
// V
|
|
69
|
-
// macrotasks (setTimeout)
|
|
70
|
-
//
|
|
71
|
-
// macrotasks are run in the event loop iteration end, so we use that moment to make the bulkRequestFunc call.
|
|
72
|
-
setTimeout(() => {
|
|
73
|
-
// When the bulk request happens, the batch list and the response is reset to start another batch.
|
|
74
|
-
// Coming callers will wait for a new response promise.
|
|
75
|
-
this.#currentBulkResponse = null;
|
|
76
|
-
|
|
77
|
-
// We cut here to make the bulk request.
|
|
78
|
-
const batchCopy = batch.splice(0, batch.length);
|
|
79
|
-
bulkRequestFunc(batchCopy)
|
|
80
|
-
.then((result) => {
|
|
81
|
-
resolve(result);
|
|
82
|
-
})
|
|
83
|
-
.catch((err) => {
|
|
84
|
-
reject(err);
|
|
85
|
-
});
|
|
86
|
-
}, 0);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
// This bulk response needs to be processed to extract the the result for the entry.
|
|
90
|
-
return this.#currentBulkResponse;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
8
|
-
|
|
9
|
-
import { scheduleTask, sleep } from '@dxos/async';
|
|
10
|
-
import { Context } from '@dxos/context';
|
|
11
|
-
import { invariant } from '@dxos/invariant';
|
|
12
|
-
import { log } from '@dxos/log';
|
|
13
|
-
import { Config, useConfig } from '@dxos/react-client';
|
|
14
|
-
import { withClientProvider } from '@dxos/react-client/testing';
|
|
15
|
-
import { Button } from '@dxos/react-ui';
|
|
16
|
-
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
17
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
18
|
-
|
|
19
|
-
import video from '../testing/video.mp4?raw';
|
|
20
|
-
|
|
21
|
-
import { CALLS_URL, CallsServicePeer, type TrackObject } from './calls';
|
|
22
|
-
import { useInaudibleAudioStreamTrack, useVideoStreamTrack } from './hooks';
|
|
23
|
-
|
|
24
|
-
const pushAndPullTrack = (mediaStreamTrack?: MediaStreamTrack) => {
|
|
25
|
-
const config = useConfig();
|
|
26
|
-
const callsConfig = {
|
|
27
|
-
iceServers: config.get('runtime.services.ice'),
|
|
28
|
-
apiBase: `${CALLS_URL}/api/calls`,
|
|
29
|
-
};
|
|
30
|
-
const peerPush = useMemo(() => new CallsServicePeer(callsConfig), []);
|
|
31
|
-
const peerPull = useMemo(() => new CallsServicePeer(callsConfig), []);
|
|
32
|
-
const [metrics, setMetrics] = useState<Record<string, any>>({});
|
|
33
|
-
const trackInfo = useRef<TrackObject | undefined>(undefined);
|
|
34
|
-
const pullCtx = useRef<Context | undefined>(undefined);
|
|
35
|
-
const [pulledTrack, setPulledTrack] = useState<MediaStreamTrack | undefined>(undefined);
|
|
36
|
-
const hadRun = useRef(false);
|
|
37
|
-
|
|
38
|
-
// Push/pull video stream track to cloudflare.
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (hadRun.current || !mediaStreamTrack || !peerPush || !peerPull) {
|
|
41
|
-
log.info('not running', { hadRun: hadRun.current, mediaStreamTrack, peerPush, peerPull });
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
hadRun.current = true;
|
|
45
|
-
const ctx = Context.default();
|
|
46
|
-
ctx.onDispose(() => {
|
|
47
|
-
log.info('disposing ctx', { ctx });
|
|
48
|
-
});
|
|
49
|
-
scheduleTask(
|
|
50
|
-
ctx,
|
|
51
|
-
async () => {
|
|
52
|
-
log.info('starting push/pull', { mediaStreamTrack });
|
|
53
|
-
await peerPush.open();
|
|
54
|
-
await peerPull.open();
|
|
55
|
-
ctx.onDispose(() => {
|
|
56
|
-
void peerPush.close();
|
|
57
|
-
void peerPull.close();
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// Push track to cloudflare.
|
|
61
|
-
performance.mark('push:begin');
|
|
62
|
-
log.info('pushing track', { track: mediaStreamTrack });
|
|
63
|
-
trackInfo.current = await peerPush.pushTrack({ track: mediaStreamTrack });
|
|
64
|
-
performance.mark('push:end');
|
|
65
|
-
const pushTime = performance.measure('push', 'push:begin', 'push:end').duration;
|
|
66
|
-
log.info('successfully pushed track', { pushTime, trackInfo: trackInfo.current });
|
|
67
|
-
setMetrics((prev) => ({ ...prev, 'time to push track [ms]': Math.round(pushTime) }));
|
|
68
|
-
|
|
69
|
-
// Wait for cloudflare to process the track.
|
|
70
|
-
await sleep(1000);
|
|
71
|
-
|
|
72
|
-
// Pull track from cloudflare.
|
|
73
|
-
performance.mark('pullTrack:begin');
|
|
74
|
-
pullCtx.current = Context.default();
|
|
75
|
-
let retries = 0;
|
|
76
|
-
let pulledTrack: MediaStreamTrack | undefined;
|
|
77
|
-
while (!pulledTrack && retries < 3) {
|
|
78
|
-
retries++;
|
|
79
|
-
log.info('pulling track', {
|
|
80
|
-
trackData: { ...trackInfo.current!, mid: undefined },
|
|
81
|
-
retries,
|
|
82
|
-
pulledTrack,
|
|
83
|
-
});
|
|
84
|
-
pulledTrack = await peerPull.pullTrack({
|
|
85
|
-
trackData: { ...trackInfo.current!, mid: undefined },
|
|
86
|
-
ctx: pullCtx.current,
|
|
87
|
-
});
|
|
88
|
-
await sleep(200);
|
|
89
|
-
}
|
|
90
|
-
invariant(pulledTrack);
|
|
91
|
-
setPulledTrack(pulledTrack);
|
|
92
|
-
performance.mark('pullTrack:end');
|
|
93
|
-
const pullTime = performance.measure('pullTrack', 'pullTrack:begin', 'pullTrack:end').duration;
|
|
94
|
-
setMetrics((prev) => ({ ...prev, 'time to pull track [ms]': Math.round(pullTime) }));
|
|
95
|
-
log.info('successfully pulled track', { pullTime, pulledTrack });
|
|
96
|
-
},
|
|
97
|
-
1000,
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
return () => {
|
|
101
|
-
void ctx.dispose();
|
|
102
|
-
};
|
|
103
|
-
}, [mediaStreamTrack, peerPush, peerPull]);
|
|
104
|
-
|
|
105
|
-
const rePullTrack = useCallback(async () => {
|
|
106
|
-
performance.mark('rePullVideo:begin');
|
|
107
|
-
invariant(pulledTrack);
|
|
108
|
-
pulledTrack.stop();
|
|
109
|
-
await pullCtx.current!.dispose();
|
|
110
|
-
pullCtx.current = Context.default();
|
|
111
|
-
const newPulledTrack = await peerPull.pullTrack({
|
|
112
|
-
trackData: { ...trackInfo.current!, mid: undefined },
|
|
113
|
-
ctx: pullCtx.current,
|
|
114
|
-
});
|
|
115
|
-
invariant(newPulledTrack);
|
|
116
|
-
setPulledTrack(newPulledTrack);
|
|
117
|
-
performance.mark('rePullVideo:end');
|
|
118
|
-
const rePullTime = performance.measure('rePullVideo', 'rePullVideo:begin', 'rePullVideo:end').duration;
|
|
119
|
-
setMetrics((prev) => ({ ...prev, 'time to re-pull video [ms]': Math.round(rePullTime) }));
|
|
120
|
-
}, [peerPull, trackInfo.current, pullCtx.current, pulledTrack]);
|
|
121
|
-
|
|
122
|
-
return {
|
|
123
|
-
pulledTrack,
|
|
124
|
-
rePullTrack,
|
|
125
|
-
metrics,
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const meta = {
|
|
130
|
-
title: 'plugins/plugin-thread/calls-service',
|
|
131
|
-
decorators: [
|
|
132
|
-
withClientProvider({
|
|
133
|
-
config: new Config({
|
|
134
|
-
runtime: {
|
|
135
|
-
services: {
|
|
136
|
-
iceProviders: [{ urls: 'https://edge.dxos.workers.dev/ice' }],
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
}),
|
|
140
|
-
}),
|
|
141
|
-
withTheme,
|
|
142
|
-
withLayout(),
|
|
143
|
-
],
|
|
144
|
-
parameters: {
|
|
145
|
-
layout: 'centered',
|
|
146
|
-
},
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
export default meta;
|
|
150
|
-
|
|
151
|
-
export const Default = {
|
|
152
|
-
render: ({ videoSrc }: { videoSrc: string }) => {
|
|
153
|
-
const pushVideoElement = useRef<HTMLVideoElement>(null);
|
|
154
|
-
const pullVideoElement = useRef<HTMLVideoElement>(null);
|
|
155
|
-
// Get video stream track.
|
|
156
|
-
const videoStreamTrack = useVideoStreamTrack(pushVideoElement, videoSrc);
|
|
157
|
-
const { pulledTrack, rePullTrack, metrics } = pushAndPullTrack(videoStreamTrack);
|
|
158
|
-
const hadRun = useRef(false);
|
|
159
|
-
|
|
160
|
-
// Push/pull video stream track to cloudflare.
|
|
161
|
-
useEffect(() => {
|
|
162
|
-
if (!pulledTrack || hadRun.current) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
hadRun.current = true;
|
|
166
|
-
const ctx = Context.default();
|
|
167
|
-
scheduleTask(ctx, async () => {
|
|
168
|
-
pullVideoElement.current!.srcObject = new MediaStream([pulledTrack]);
|
|
169
|
-
await pullVideoElement.current!.play();
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
return () => {
|
|
173
|
-
void ctx.dispose();
|
|
174
|
-
};
|
|
175
|
-
}, [pulledTrack]);
|
|
176
|
-
|
|
177
|
-
return (
|
|
178
|
-
<div className='grid grid-rows-3 gap-4 items-center'>
|
|
179
|
-
<video ref={pushVideoElement} muted autoPlay loop />
|
|
180
|
-
<div className='flex flex-col gap-4'>
|
|
181
|
-
<video ref={pullVideoElement} muted />
|
|
182
|
-
<Button
|
|
183
|
-
disabled={
|
|
184
|
-
!(
|
|
185
|
-
pullVideoElement?.current?.srcObject instanceof MediaStream &&
|
|
186
|
-
pullVideoElement.current.srcObject.getTracks()[0]
|
|
187
|
-
)
|
|
188
|
-
}
|
|
189
|
-
onClick={rePullTrack}
|
|
190
|
-
>
|
|
191
|
-
Re-pull video
|
|
192
|
-
</Button>
|
|
193
|
-
</div>
|
|
194
|
-
<Json data={metrics} />
|
|
195
|
-
</div>
|
|
196
|
-
);
|
|
197
|
-
},
|
|
198
|
-
args: {
|
|
199
|
-
videoSrc: video,
|
|
200
|
-
},
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
export const InaudibleAudioStreamTrack = {
|
|
204
|
-
render: () => {
|
|
205
|
-
const audioStreamTrack = useInaudibleAudioStreamTrack();
|
|
206
|
-
|
|
207
|
-
const { rePullTrack, metrics } = pushAndPullTrack(audioStreamTrack);
|
|
208
|
-
|
|
209
|
-
return (
|
|
210
|
-
<div className='flex flex-col gap-4 items-center'>
|
|
211
|
-
<Json data={metrics} />
|
|
212
|
-
<Button onClick={rePullTrack}>Re-pull audio</Button>
|
|
213
|
-
</div>
|
|
214
|
-
);
|
|
215
|
-
},
|
|
216
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
7
|
-
|
|
8
|
-
import { CallManager } from '../calls';
|
|
9
|
-
|
|
10
|
-
import { ThreadCapabilities } from './capabilities';
|
|
11
|
-
|
|
12
|
-
export default async (context: PluginContext) => {
|
|
13
|
-
const client = context.getCapability(ClientCapabilities.Client);
|
|
14
|
-
const callManager = new CallManager(client);
|
|
15
|
-
await callManager.open();
|
|
16
|
-
|
|
17
|
-
return contributes(ThreadCapabilities.CallManager, callManager, () => {
|
|
18
|
-
void callManager.close();
|
|
19
|
-
});
|
|
20
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type DeepReadonly } from '@dxos/util';
|
|
7
|
-
|
|
8
|
-
import { type CallManager, type CallState, type MediaState } from '../calls';
|
|
9
|
-
import { THREAD_PLUGIN } from '../meta';
|
|
10
|
-
import { type ChannelType, type ThreadState, type ViewState } from '../types';
|
|
11
|
-
|
|
12
|
-
export namespace ThreadCapabilities {
|
|
13
|
-
export const CallManager = defineCapability<CallManager>(`${THREAD_PLUGIN}/capability/call-manager`);
|
|
14
|
-
|
|
15
|
-
// TODO(burdon): Better way to define specific extensions for meeting companions.
|
|
16
|
-
// TODO(burdon): This brings in deps from ../calls; how should we manage/minimize explicit type exposure to other plugins?
|
|
17
|
-
// TODO(wittjosiah): These callbacks could be intents once we support broadcast.
|
|
18
|
-
export type CallProperties = {
|
|
19
|
-
onJoin: (state: { channel?: ChannelType; roomId?: string }) => Promise<void>;
|
|
20
|
-
onLeave: (roomId?: string) => Promise<void>;
|
|
21
|
-
onCallStateUpdated: (callState: CallState) => Promise<void>;
|
|
22
|
-
onMediaStateUpdated: ([mediaState, isSpeaking]: [MediaState, boolean]) => Promise<void>;
|
|
23
|
-
};
|
|
24
|
-
export const CallExtension = defineCapability<CallProperties>(`${THREAD_PLUGIN}/capability/call-extension`);
|
|
25
|
-
|
|
26
|
-
type GetViewState = (subjectId: string) => ViewState;
|
|
27
|
-
export const State = defineCapability<{ state: DeepReadonly<ThreadState>; getViewState: GetViewState }>(
|
|
28
|
-
`${THREAD_PLUGIN}/capability/state`,
|
|
29
|
-
);
|
|
30
|
-
export const MutableState = defineCapability<{ state: ThreadState; getViewState: GetViewState }>(
|
|
31
|
-
`${THREAD_PLUGIN}/capability/state`,
|
|
32
|
-
);
|
|
33
|
-
}
|
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Effect } from 'effect';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
|
-
import { sleep } from '@dxos/async';
|
|
9
|
-
import { Obj, Relation, Type } from '@dxos/echo';
|
|
10
|
-
import { invariant } from '@dxos/invariant';
|
|
11
|
-
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
|
|
12
|
-
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
13
|
-
import { CollectionAction, SpaceAction } from '@dxos/plugin-space/types';
|
|
14
|
-
import { Ref, fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
|
|
15
|
-
import { AnchoredTo, DataType } from '@dxos/schema';
|
|
16
|
-
|
|
17
|
-
import { THREAD_PLUGIN } from '../meta';
|
|
18
|
-
import { ChannelType, ThreadAction, ThreadType } from '../types';
|
|
19
|
-
|
|
20
|
-
import { ThreadCapabilities } from './capabilities';
|
|
21
|
-
|
|
22
|
-
export default (context: PluginContext) =>
|
|
23
|
-
contributes(Capabilities.IntentResolver, [
|
|
24
|
-
createResolver({
|
|
25
|
-
intent: ThreadAction.OnSpaceCreated,
|
|
26
|
-
resolve: ({ space, rootCollection }) =>
|
|
27
|
-
Effect.gen(function* () {
|
|
28
|
-
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
29
|
-
const { object: collection } = yield* dispatch(
|
|
30
|
-
createIntent(CollectionAction.CreateQueryCollection, { typename: Type.getTypename(ChannelType) }),
|
|
31
|
-
);
|
|
32
|
-
rootCollection.objects.push(Ref.make(collection));
|
|
33
|
-
|
|
34
|
-
const { object: channel } = yield* dispatch(
|
|
35
|
-
createIntent(ThreadAction.CreateChannel, { name: 'General', spaceId: space.id }),
|
|
36
|
-
);
|
|
37
|
-
space.db.add(channel);
|
|
38
|
-
}),
|
|
39
|
-
}),
|
|
40
|
-
createResolver({
|
|
41
|
-
intent: ThreadAction.CreateChannel,
|
|
42
|
-
resolve: ({ name }) => ({
|
|
43
|
-
data: {
|
|
44
|
-
object: Obj.make(ChannelType, {
|
|
45
|
-
name,
|
|
46
|
-
defaultThread: Ref.make(Obj.make(ThreadType, { messages: [], status: 'active' })),
|
|
47
|
-
threads: [],
|
|
48
|
-
}),
|
|
49
|
-
},
|
|
50
|
-
}),
|
|
51
|
-
}),
|
|
52
|
-
createResolver({
|
|
53
|
-
intent: ThreadAction.CreateChannelThread,
|
|
54
|
-
resolve: ({ channel }) => {
|
|
55
|
-
const thread = Obj.make(ThreadType, { messages: [], status: 'active' });
|
|
56
|
-
channel.threads.push(Ref.make(thread));
|
|
57
|
-
return {
|
|
58
|
-
data: {
|
|
59
|
-
object: thread,
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
},
|
|
63
|
-
}),
|
|
64
|
-
// TODO(wittjosiah): Break this up into more composable pieces.
|
|
65
|
-
createResolver({
|
|
66
|
-
intent: ThreadAction.Create,
|
|
67
|
-
resolve: ({ name, anchor: _anchor, subject }) => {
|
|
68
|
-
const space = getSpace(subject);
|
|
69
|
-
invariant(space, 'Space not found');
|
|
70
|
-
|
|
71
|
-
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
72
|
-
const subjectId = fullyQualifiedId(subject);
|
|
73
|
-
const thread = Obj.make(ThreadType, { name, messages: [], status: 'staged' });
|
|
74
|
-
const anchor = Relation.make(AnchoredTo, {
|
|
75
|
-
[Relation.Source]: thread,
|
|
76
|
-
[Relation.Target]: subject,
|
|
77
|
-
anchor: _anchor,
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
const draft = state.drafts[subjectId];
|
|
81
|
-
if (draft) {
|
|
82
|
-
draft.push(anchor);
|
|
83
|
-
} else {
|
|
84
|
-
state.drafts[subjectId] = [anchor];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return {
|
|
88
|
-
intents: [
|
|
89
|
-
createIntent(ThreadAction.Select, { current: fullyQualifiedId(thread) }),
|
|
90
|
-
createIntent(DeckAction.ChangeCompanion, {
|
|
91
|
-
primary: subjectId,
|
|
92
|
-
companion: `${subjectId}${ATTENDABLE_PATH_SEPARATOR}comments`,
|
|
93
|
-
}),
|
|
94
|
-
],
|
|
95
|
-
};
|
|
96
|
-
},
|
|
97
|
-
}),
|
|
98
|
-
createResolver({
|
|
99
|
-
intent: ThreadAction.Select,
|
|
100
|
-
resolve: ({ current }) => {
|
|
101
|
-
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
102
|
-
state.current = current;
|
|
103
|
-
},
|
|
104
|
-
}),
|
|
105
|
-
createResolver({
|
|
106
|
-
intent: ThreadAction.ToggleResolved,
|
|
107
|
-
resolve: ({ thread }) => {
|
|
108
|
-
if (thread.status === 'active' || thread.status === undefined) {
|
|
109
|
-
thread.status = 'resolved';
|
|
110
|
-
} else if (thread.status === 'resolved') {
|
|
111
|
-
thread.status = 'active';
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const space = getSpace(thread);
|
|
115
|
-
invariant(space, 'Space not found');
|
|
116
|
-
const spaceId = space.id;
|
|
117
|
-
|
|
118
|
-
return {
|
|
119
|
-
intents: [
|
|
120
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
121
|
-
name: 'threads.toggle-resolved',
|
|
122
|
-
properties: {
|
|
123
|
-
spaceId,
|
|
124
|
-
threadId: thread.id,
|
|
125
|
-
},
|
|
126
|
-
}),
|
|
127
|
-
],
|
|
128
|
-
};
|
|
129
|
-
},
|
|
130
|
-
}),
|
|
131
|
-
createResolver({
|
|
132
|
-
intent: ThreadAction.Delete,
|
|
133
|
-
resolve: async ({ subject, anchor, thread: _thread }, undo) => {
|
|
134
|
-
const thread = _thread ?? (Relation.getSource(anchor) as ThreadType);
|
|
135
|
-
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
136
|
-
const subjectId = fullyQualifiedId(subject);
|
|
137
|
-
const draft = state.drafts[subjectId];
|
|
138
|
-
if (draft) {
|
|
139
|
-
// Check if we're deleting a draft; if so, remo ve it.
|
|
140
|
-
const index = draft.findIndex((a) => a.id === anchor.id);
|
|
141
|
-
if (index !== -1) {
|
|
142
|
-
draft.splice(index, 1);
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const space = getSpace(anchor);
|
|
148
|
-
if (!space) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (!undo) {
|
|
153
|
-
// TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.
|
|
154
|
-
space.db.remove(anchor);
|
|
155
|
-
await sleep(100);
|
|
156
|
-
space.db.remove(thread);
|
|
157
|
-
|
|
158
|
-
return {
|
|
159
|
-
undoable: {
|
|
160
|
-
message: ['thread deleted label', { ns: THREAD_PLUGIN }],
|
|
161
|
-
data: { thread, anchor },
|
|
162
|
-
},
|
|
163
|
-
intents: [
|
|
164
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
165
|
-
name: 'threads.delete',
|
|
166
|
-
properties: {
|
|
167
|
-
spaceId: space.id,
|
|
168
|
-
threadId: thread.id,
|
|
169
|
-
},
|
|
170
|
-
}),
|
|
171
|
-
],
|
|
172
|
-
};
|
|
173
|
-
} else {
|
|
174
|
-
// TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.
|
|
175
|
-
space.db.add(thread);
|
|
176
|
-
await sleep(100);
|
|
177
|
-
space.db.add(anchor);
|
|
178
|
-
|
|
179
|
-
return {
|
|
180
|
-
intents: [
|
|
181
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
182
|
-
name: 'threads.undo-delete',
|
|
183
|
-
properties: {
|
|
184
|
-
spaceId: space.id,
|
|
185
|
-
threadId: thread.id,
|
|
186
|
-
},
|
|
187
|
-
}),
|
|
188
|
-
],
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
}),
|
|
193
|
-
createResolver({
|
|
194
|
-
intent: ThreadAction.AddMessage,
|
|
195
|
-
resolve: ({ anchor, subject, sender, text }) => {
|
|
196
|
-
const thread = Relation.getSource(anchor) as ThreadType;
|
|
197
|
-
const { state } = context.getCapability(ThreadCapabilities.MutableState);
|
|
198
|
-
const subjectId = fullyQualifiedId(subject);
|
|
199
|
-
const space = getSpace(subject);
|
|
200
|
-
invariant(space, 'Space not found');
|
|
201
|
-
const intents = [];
|
|
202
|
-
|
|
203
|
-
const message = Obj.make(DataType.Message, {
|
|
204
|
-
created: new Date().toISOString(),
|
|
205
|
-
sender,
|
|
206
|
-
blocks: [{ _tag: 'text', text }],
|
|
207
|
-
// TODO(wittjosiah): Context based on attention.
|
|
208
|
-
// context: context ? Ref.make(context) : undefined,
|
|
209
|
-
});
|
|
210
|
-
thread.messages.push(Ref.make(message));
|
|
211
|
-
|
|
212
|
-
const draft = state.drafts[subjectId]?.find((a) => a.id === anchor.id);
|
|
213
|
-
if (draft) {
|
|
214
|
-
// Move draft to document.
|
|
215
|
-
thread.status = 'active';
|
|
216
|
-
// TODO(wittjosiah): This causes the thread to flash as it transitions from draft to db.
|
|
217
|
-
state.drafts[subjectId] = state.drafts[subjectId]?.filter((a) => a.id !== anchor.id);
|
|
218
|
-
intents.push(createIntent(SpaceAction.AddObject, { object: thread, target: space, hidden: true }));
|
|
219
|
-
intents.push(
|
|
220
|
-
createIntent(SpaceAction.AddRelation, {
|
|
221
|
-
space,
|
|
222
|
-
schema: AnchoredTo,
|
|
223
|
-
source: thread,
|
|
224
|
-
target: subject,
|
|
225
|
-
fields: { anchor: draft.anchor },
|
|
226
|
-
}),
|
|
227
|
-
);
|
|
228
|
-
intents.push(
|
|
229
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
230
|
-
name: 'threads.create',
|
|
231
|
-
properties: {
|
|
232
|
-
spaceId: space.id,
|
|
233
|
-
threadId: thread.id,
|
|
234
|
-
},
|
|
235
|
-
}),
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
intents.push(
|
|
240
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
241
|
-
name: 'threads.message.add',
|
|
242
|
-
properties: {
|
|
243
|
-
spaceId: space.id,
|
|
244
|
-
threadId: thread.id,
|
|
245
|
-
threadLength: thread.messages.length,
|
|
246
|
-
messageId: message.id,
|
|
247
|
-
messageLength: text.length,
|
|
248
|
-
},
|
|
249
|
-
}),
|
|
250
|
-
);
|
|
251
|
-
|
|
252
|
-
return { intents };
|
|
253
|
-
},
|
|
254
|
-
}),
|
|
255
|
-
createResolver({
|
|
256
|
-
intent: ThreadAction.DeleteMessage,
|
|
257
|
-
resolve: ({ subject, anchor, messageId, message, messageIndex }, undo) => {
|
|
258
|
-
const thread = Relation.getSource(anchor) as ThreadType;
|
|
259
|
-
const space = getSpace(subject);
|
|
260
|
-
invariant(space, 'Space not found');
|
|
261
|
-
|
|
262
|
-
if (!undo) {
|
|
263
|
-
const messageIndex = thread.messages.findIndex(Ref.hasObjectId(messageId));
|
|
264
|
-
const message = thread.messages[messageIndex]?.target;
|
|
265
|
-
if (!message) {
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
if (messageIndex === 0 && thread.messages.length === 1) {
|
|
270
|
-
// If the message is the only message in the thread, delete the thread.
|
|
271
|
-
return {
|
|
272
|
-
intents: [createIntent(ThreadAction.Delete, { subject, anchor })],
|
|
273
|
-
};
|
|
274
|
-
} else {
|
|
275
|
-
thread.messages.splice(messageIndex, 1);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
return {
|
|
279
|
-
undoable: {
|
|
280
|
-
message: ['message deleted label', { ns: THREAD_PLUGIN }],
|
|
281
|
-
data: { message, messageIndex },
|
|
282
|
-
},
|
|
283
|
-
intents: [
|
|
284
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
285
|
-
name: 'threads.message.delete',
|
|
286
|
-
properties: {
|
|
287
|
-
spaceId: space.id,
|
|
288
|
-
threadId: thread.id,
|
|
289
|
-
messageId: message.id,
|
|
290
|
-
},
|
|
291
|
-
}),
|
|
292
|
-
],
|
|
293
|
-
};
|
|
294
|
-
} else {
|
|
295
|
-
if (messageIndex === undefined || !message) {
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
thread.messages.splice(messageIndex, 0, Ref.make(message));
|
|
300
|
-
return {
|
|
301
|
-
intents: [
|
|
302
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
303
|
-
name: 'threads.message.undo-delete',
|
|
304
|
-
properties: {
|
|
305
|
-
spaceId: space.id,
|
|
306
|
-
threadId: thread.id,
|
|
307
|
-
messageId: message.id,
|
|
308
|
-
},
|
|
309
|
-
}),
|
|
310
|
-
],
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
|
-
}),
|
|
315
|
-
]);
|