@dxos/plugin-thread 0.8.4-main.f5c0578 → 0.8.4-main.fcfe5033a5
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/add-message-VPPFFLFL.mjs +97 -0
- package/dist/lib/browser/add-message-VPPFFLFL.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +37 -0
- package/dist/lib/browser/blueprints/index.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-MESW3R4Q.mjs +61 -0
- package/dist/lib/browser/chunk-MESW3R4Q.mjs.map +7 -0
- package/dist/lib/browser/chunk-VPM44Z35.mjs +259 -0
- package/dist/lib/browser/chunk-VPM44Z35.mjs.map +7 -0
- package/dist/lib/browser/create-OQKG4S47.mjs +55 -0
- package/dist/lib/browser/create-OQKG4S47.mjs.map +7 -0
- package/dist/lib/browser/create-channel-EF67LCS6.mjs +21 -0
- package/dist/lib/browser/create-channel-EF67LCS6.mjs.map +7 -0
- package/dist/lib/browser/create-channel-thread-CCZTSWQ6.mjs +28 -0
- package/dist/lib/browser/create-channel-thread-CCZTSWQ6.mjs.map +7 -0
- package/dist/lib/browser/create-proposals-CMK7S7VS.mjs +57 -0
- package/dist/lib/browser/create-proposals-CMK7S7VS.mjs.map +7 -0
- package/dist/lib/browser/delete-FSFVU6ZA.mjs +59 -0
- package/dist/lib/browser/delete-FSFVU6ZA.mjs.map +7 -0
- package/dist/lib/browser/delete-message-XL5M5J33.mjs +64 -0
- package/dist/lib/browser/delete-message-XL5M5J33.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2253 -221
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/on-create-space-VYS2JGVT.mjs +25 -0
- package/dist/lib/browser/on-create-space-VYS2JGVT.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +14 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/restore-2ZGMKUSD.mjs +33 -0
- package/dist/lib/browser/restore-2ZGMKUSD.mjs.map +7 -0
- package/dist/lib/browser/restore-message-OYEGWPII.mjs +42 -0
- package/dist/lib/browser/restore-message-OYEGWPII.mjs.map +7 -0
- package/dist/lib/browser/select-VG2XLULE.mjs +26 -0
- package/dist/lib/browser/select-VG2XLULE.mjs.map +7 -0
- package/dist/lib/browser/toggle-resolved-MM6YC5BU.mjs +45 -0
- package/dist/lib/browser/toggle-resolved-MM6YC5BU.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -12
- package/dist/lib/node-esm/add-message-XWKHLNS6.mjs +98 -0
- package/dist/lib/node-esm/add-message-XWKHLNS6.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +38 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-JTHXNWKJ.mjs +260 -0
- package/dist/lib/node-esm/chunk-JTHXNWKJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SDRAQNSQ.mjs +62 -0
- package/dist/lib/node-esm/chunk-SDRAQNSQ.mjs.map +7 -0
- package/dist/lib/node-esm/create-6ZOFMMYA.mjs +56 -0
- package/dist/lib/node-esm/create-6ZOFMMYA.mjs.map +7 -0
- package/dist/lib/node-esm/create-channel-UYWUNB3L.mjs +22 -0
- package/dist/lib/node-esm/create-channel-UYWUNB3L.mjs.map +7 -0
- package/dist/lib/node-esm/create-channel-thread-UQF2SBHS.mjs +29 -0
- package/dist/lib/node-esm/create-channel-thread-UQF2SBHS.mjs.map +7 -0
- package/dist/lib/node-esm/create-proposals-5FJNURKH.mjs +58 -0
- package/dist/lib/node-esm/create-proposals-5FJNURKH.mjs.map +7 -0
- package/dist/lib/node-esm/delete-WRODXR3E.mjs +60 -0
- package/dist/lib/node-esm/delete-WRODXR3E.mjs.map +7 -0
- package/dist/lib/node-esm/delete-message-TAHCYTW2.mjs +65 -0
- package/dist/lib/node-esm/delete-message-TAHCYTW2.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +2253 -221
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/on-create-space-XDY2YXPV.mjs +26 -0
- package/dist/lib/node-esm/on-create-space-XDY2YXPV.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +15 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/restore-T3QA7TSL.mjs +34 -0
- package/dist/lib/node-esm/restore-T3QA7TSL.mjs.map +7 -0
- package/dist/lib/node-esm/restore-message-WFTEVBEV.mjs +43 -0
- package/dist/lib/node-esm/restore-message-WFTEVBEV.mjs.map +7 -0
- package/dist/lib/node-esm/select-Q4UDWJJF.mjs +27 -0
- package/dist/lib/node-esm/select-Q4UDWJJF.mjs.map +7 -0
- package/dist/lib/node-esm/toggle-resolved-33XTAK2H.mjs +46 -0
- package/dist/lib/node-esm/toggle-resolved-33XTAK2H.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -12
- package/dist/types/src/ThreadPlugin.d.ts +2 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -0
- package/dist/types/src/calls/call-manager.d.ts +40 -30
- package/dist/types/src/calls/call-manager.d.ts.map +1 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts +2 -2
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
- package/dist/types/src/calls/media-manager.d.ts +2 -2
- package/dist/types/src/calls/media-manager.d.ts.map +1 -1
- package/dist/types/src/calls/types.d.ts.map +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts +4 -2
- package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
- package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
- package/dist/types/src/calls/util/task-scheduling.d.ts +2 -2
- package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
- package/dist/types/src/calls-service.stories.d.ts +10 -9
- package/dist/types/src/calls-service.stories.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/call-manager.d.ts +3 -2
- package/dist/types/src/capabilities/call-manager.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +13 -13
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +3 -2
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- 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-root.d.ts +4 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- 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/capabilities/settings.d.ts +5 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +5 -5
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
- package/dist/types/src/components/Call/Call.d.ts.map +1 -1
- package/dist/types/src/components/Call/Toolbar.d.ts +2 -2
- package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts +13 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +160 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts +14 -0
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/index.d.ts +3 -0
- package/dist/types/src/components/CommentsPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.d.ts +3 -3
- package/dist/types/src/components/Media/VideoObject.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +18 -4
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts +15 -0
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -0
- package/dist/types/src/components/MessagePanel/index.d.ts +2 -0
- package/dist/types/src/components/MessagePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +160 -5
- 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/ResponsiveGrid/{ResponsiveContainer.d.ts → ResponsivePanel.d.ts} +4 -4
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +164 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +1 -0
- package/dist/types/src/components/ResponsiveGrid/index.d.ts +1 -1
- package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts +6 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +161 -0
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ThreadSettings/index.d.ts +2 -0
- package/dist/types/src/components/ThreadSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +4 -9
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts +15 -0
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +1 -0
- package/dist/types/src/containers/CallDebugPanel/index.d.ts +2 -0
- package/dist/types/src/containers/CallDebugPanel/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/CallSidebar}/CallSidebar.d.ts +0 -1
- package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +1 -0
- package/dist/types/src/containers/CallSidebar/index.d.ts +2 -0
- package/dist/types/src/containers/CallSidebar/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +12 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +162 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/index.d.ts +2 -0
- package/dist/types/src/containers/ChannelContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +16 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts +162 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts +4 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts +8 -0
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadCompanion/index.d.ts +2 -0
- package/dist/types/src/containers/ThreadCompanion/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +7 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/{components/command-extension.d.ts → extensions/command.d.ts} +1 -1
- package/dist/types/src/extensions/command.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +1 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts +8 -3
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/hooks/analytics.d.ts +2 -3
- package/dist/types/src/hooks/analytics.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +2 -0
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +1 -0
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts +1 -1
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- 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/add-message.d.ts +5 -0
- package/dist/types/src/operations/add-message.d.ts.map +1 -0
- package/dist/types/src/operations/create-channel-thread.d.ts +5 -0
- package/dist/types/src/operations/create-channel-thread.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/create-proposals.d.ts +5 -0
- package/dist/types/src/operations/create-proposals.d.ts.map +1 -0
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +2804 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/delete-message.d.ts +5 -0
- package/dist/types/src/operations/delete-message.d.ts.map +1 -0
- package/dist/types/src/operations/delete.d.ts +5 -0
- package/dist/types/src/operations/delete.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/on-create-space.d.ts +5 -0
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
- package/dist/types/src/operations/restore-message.d.ts +5 -0
- package/dist/types/src/operations/restore-message.d.ts.map +1 -0
- package/dist/types/src/operations/restore.d.ts +5 -0
- package/dist/types/src/operations/restore.d.ts.map +1 -0
- package/dist/types/src/operations/select.d.ts +5 -0
- package/dist/types/src/operations/select.d.ts.map +1 -0
- package/dist/types/src/operations/toggle-resolved.d.ts +5 -0
- package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -0
- package/dist/types/src/testing/data.d.ts +5 -0
- package/dist/types/src/testing/data.d.ts.map +1 -0
- package/dist/types/src/testing/stories.d.ts +2 -1
- package/dist/types/src/testing/stories.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +142 -72
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Channel.d.ts +715 -0
- package/dist/types/src/types/Channel.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +5 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +24 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +4 -374
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +112 -67
- package/src/ThreadPlugin.tsx +108 -132
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/thread-blueprint.ts +37 -0
- package/src/calls/call-manager.ts +77 -53
- package/src/calls/call-swarm-synchronizer.ts +2 -2
- package/src/calls/media-manager.ts +65 -36
- package/src/calls/types.ts +7 -3
- package/src/calls/util/calls-service.ts +62 -13
- package/src/calls/util/stub-media-streams.ts +62 -5
- package/src/calls/util/task-scheduling.ts +4 -4
- package/src/calls-service.stories.tsx +79 -65
- package/src/capabilities/app-graph-builder.ts +175 -163
- package/src/capabilities/blueprint-definition.ts +17 -0
- package/src/capabilities/call-manager.ts +19 -12
- package/src/capabilities/index.ts +15 -11
- package/src/capabilities/markdown.ts +50 -37
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-root.tsx +12 -9
- package/src/capabilities/react-surface.tsx +80 -78
- package/src/capabilities/settings.ts +28 -12
- package/src/capabilities/state.ts +14 -18
- package/src/capabilities/undo-mappings.ts +46 -0
- package/src/components/Call/Call.tsx +11 -7
- package/src/components/Call/Toolbar.tsx +61 -44
- package/src/components/CommentsPanel/CommentsPanel.stories.tsx +93 -0
- package/src/components/CommentsPanel/CommentsPanel.tsx +71 -0
- package/src/components/{CommentsThreadContainer.tsx → CommentsPanel/CommentsThread.tsx} +66 -62
- package/src/components/CommentsPanel/index.ts +6 -0
- package/src/components/Lobby/Lobby.tsx +15 -12
- package/src/components/Media/AudioStream.tsx +2 -2
- package/src/components/Media/VideoObject.stories.tsx +37 -31
- package/src/components/Media/VideoObject.tsx +1 -1
- package/src/components/MessagePanel/MessagePanel.tsx +222 -0
- package/src/components/MessagePanel/index.ts +5 -0
- package/src/components/Participant/Participant.tsx +35 -15
- package/src/components/Participant/ParticipantGrid.tsx +0 -1
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +48 -48
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +5 -5
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +12 -9
- package/src/components/ResponsiveGrid/{ResponsiveContainer.stories.tsx → ResponsivePanel.stories.tsx} +9 -11
- package/src/components/ResponsiveGrid/{ResponsiveContainer.tsx → ResponsivePanel.tsx} +5 -5
- package/src/components/ResponsiveGrid/index.ts +1 -1
- package/src/components/ThreadSettings/ThreadSettings.stories.tsx +31 -0
- package/src/components/ThreadSettings/ThreadSettings.tsx +20 -0
- package/src/components/ThreadSettings/index.ts +5 -0
- package/src/components/index.ts +5 -12
- package/src/containers/CallDebugPanel/CallDebugPanel.tsx +173 -0
- package/src/containers/CallDebugPanel/index.ts +5 -0
- package/src/containers/CallSidebar/CallSidebar.tsx +18 -0
- package/src/containers/CallSidebar/index.ts +5 -0
- package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +61 -0
- package/src/{components → containers/ChannelContainer}/ChannelContainer.tsx +93 -71
- package/src/containers/ChannelContainer/index.ts +5 -0
- package/src/containers/ChatContainer/ChatContainer.stories.tsx +87 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +131 -0
- package/src/containers/ChatContainer/index.ts +8 -0
- package/src/containers/ThreadCompanion/ThreadCompanion.tsx +217 -0
- package/src/containers/ThreadCompanion/index.ts +5 -0
- package/src/containers/index.ts +11 -0
- package/src/{components/command-extension.ts → extensions/command.ts} +6 -3
- package/src/extensions/index.ts +1 -0
- package/src/extensions/threads.ts +87 -42
- package/src/hooks/analytics.ts +22 -21
- package/src/hooks/index.ts +3 -1
- package/src/hooks/useBlackCanvasStreamTrack.tsx +27 -0
- package/src/hooks/useVideoStreamTrack.tsx +6 -3
- package/src/index.ts +1 -1
- package/src/meta.ts +11 -7
- package/src/operations/add-message.ts +81 -0
- package/src/operations/create-channel-thread.ts +26 -0
- package/src/operations/create-channel.ts +20 -0
- package/src/operations/create-proposals.ts +49 -0
- package/src/operations/create.ts +48 -0
- package/src/operations/definitions.ts +177 -0
- package/src/operations/delete-message.ts +53 -0
- package/src/operations/delete.ts +63 -0
- package/src/operations/index.ts +22 -0
- package/src/operations/on-create-space.ts +27 -0
- package/src/operations/restore-message.ts +38 -0
- package/src/operations/restore.ts +38 -0
- package/src/operations/select.ts +24 -0
- package/src/operations/toggle-resolved.ts +41 -0
- package/src/testing/data.ts +49 -0
- package/src/testing/stories.ts +18 -21
- package/src/translations.ts +74 -73
- package/src/types/Channel.ts +37 -0
- package/src/types/Settings.ts +10 -0
- package/src/types/capabilities.ts +36 -0
- package/src/types/index.ts +2 -1
- package/src/types/types.ts +5 -100
- package/src/typings/peermetrics-webrtc-stats.d.ts +17 -1
- package/src/util.ts +2 -2
- 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/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/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/node-esm/ChannelContainer-B2ZGAE4P.mjs +0 -17
- package/dist/lib/node-esm/ChannelContainer-B2ZGAE4P.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-2CT4PJ7I.mjs +0 -16
- package/dist/lib/node-esm/ChatContainer-2CT4PJ7I.mjs.map +0 -7
- 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/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/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/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/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.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/MessageContainer.d.ts +0 -11
- package/dist/types/src/components/MessageContainer.d.ts.map +0 -1
- 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/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.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/types/schema.d.ts +0 -164
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -315
- 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/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/MessageContainer.tsx +0 -152
- package/src/components/ThreadComplementary.tsx +0 -151
- package/src/components/ThreadSettings.tsx +0 -17
- package/src/components/testing.ts +0 -29
- package/src/types/schema.ts +0 -33
- /package/dist/lib/browser/{ChannelContainer-O2SFQJU7.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/ChatContainer-PVT3DUZJ.mjs.map → node-esm/chunk-HSLMI22Q.mjs.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommentsThreadContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/CommentsThreadContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAQtE,OAAO,EAAoD,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAY/C,eAAO,MAAM,wBAAwB,4BAA4B,CAAC;AAElE,MAAM,MAAM,4BAA4B,GAAG;IACzC,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAClE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CAC/C,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;AAErC,eAAO,MAAM,uBAAuB,GAAI,uFAQrC,4BAA4B,sBA2H9B,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type SpaceMember } from '@dxos/react-client/echo';
|
|
3
|
-
import { type DataType } from '@dxos/schema';
|
|
4
|
-
export type MessageContainerProps = {
|
|
5
|
-
message: DataType.Message;
|
|
6
|
-
members: SpaceMember[];
|
|
7
|
-
editable?: boolean;
|
|
8
|
-
onDelete?: (id: string) => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const MessageContainer: ({ message, members, editable, onDelete }: MessageContainerProps) => React.JSX.Element;
|
|
11
|
-
//# sourceMappingURL=MessageContainer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MessageContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/MessageContainer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAKpF,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAM3D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAS7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC1B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,0CAAkD,qBAAqB,sBAkDvG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/ResponsiveGrid/ResponsiveContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAItD;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAAI,cAAc,iBAAiB,sBAalE,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import '@dxos-theme';
|
|
2
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
3
|
-
import { ResponsiveContainer } from './ResponsiveContainer';
|
|
4
|
-
declare const meta: Meta<typeof ResponsiveContainer>;
|
|
5
|
-
export default meta;
|
|
6
|
-
type Story = StoryObj<typeof ResponsiveContainer>;
|
|
7
|
-
export declare const Image: Story;
|
|
8
|
-
export declare const Video: Story;
|
|
9
|
-
export declare const VideoObject: Story;
|
|
10
|
-
//# sourceMappingURL=ResponsiveContainer.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveContainer.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,mBAAmB,CAO1C,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAElD,eAAO,MAAM,KAAK,EAAE,KAInB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAanB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadComplementary.d.ts","sourceRoot":"","sources":["../../../../src/components/ThreadComplementary.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAwBpD,eAAO,MAAM,mBAAmB,GAAI,aAAa;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,sBA0HhE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/ThreadSettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,eAAO,MAAM,cAAc,GAAI,cAAc;IAAE,QAAQ,EAAE,mBAAmB,CAAA;CAAE,sBAI7E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command-extension.d.ts","sourceRoot":"","sources":["../../../../src/components/command-extension.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AA2BnD,eAAO,MAAM,OAAO,EAAE,SAAgD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,eAAO,MAAM,mBAAmB,GAAI,UAAU,QAAQ,KAAG,UAgBxD,CAAC"}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { Schema } from 'effect';
|
|
2
|
-
import { Type } from '@dxos/echo';
|
|
3
|
-
export declare const ThreadStatus: Schema.Union<[Schema.Literal<["staged"]>, Schema.Literal<["active"]>, Schema.Literal<["resolved"]>]>;
|
|
4
|
-
declare const _ThreadType: Type.obj<Schema.Struct<{
|
|
5
|
-
name: Schema.optional<typeof Schema.String>;
|
|
6
|
-
status: Schema.optional<Schema.Union<[Schema.Literal<["staged"]>, Schema.Literal<["active"]>, Schema.Literal<["resolved"]>]>>;
|
|
7
|
-
messages: Schema.mutable<Schema.Array$<Type.ref<Type.obj<Schema.Struct<{
|
|
8
|
-
id: import("@dxos/keys").ObjectIdClass;
|
|
9
|
-
parentMessage: import("effect/Schema").optional<import("@dxos/keys").ObjectIdClass>;
|
|
10
|
-
created: import("effect/Schema").SchemaClass<string, string, never>;
|
|
11
|
-
sender: import("effect/Schema").mutable<import("effect/Schema").Struct<{
|
|
12
|
-
contact: import("effect/Schema").optional<import("@dxos/echo/Type").ref<import("@dxos/echo/Type").obj<import("effect/Schema").Struct<{
|
|
13
|
-
fullName: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
14
|
-
preferredName: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
15
|
-
nickname: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
16
|
-
image: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
17
|
-
organization: import("effect/Schema").optional<import("effect/Schema").Schema<import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
18
|
-
id: string;
|
|
19
|
-
name?: string | undefined;
|
|
20
|
-
description?: string | undefined;
|
|
21
|
-
status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
|
|
22
|
-
image?: string | undefined;
|
|
23
|
-
website?: string | undefined;
|
|
24
|
-
}>, import("@dxos/echo-protocol").EncodedReference, never>>;
|
|
25
|
-
jobTitle: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
26
|
-
department: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
27
|
-
notes: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
28
|
-
emails: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
29
|
-
label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
30
|
-
value: import("effect/Schema").refine<string, typeof import("effect/Schema").String>;
|
|
31
|
-
}>>>>;
|
|
32
|
-
identities: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
33
|
-
label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
34
|
-
value: typeof import("effect/Schema").String;
|
|
35
|
-
}>>>>;
|
|
36
|
-
phoneNumbers: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
37
|
-
label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
38
|
-
value: typeof import("effect/Schema").String;
|
|
39
|
-
}>>>>;
|
|
40
|
-
addresses: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
41
|
-
label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
42
|
-
value: import("effect/Schema").Struct<{
|
|
43
|
-
street: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
44
|
-
extended: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
45
|
-
locality: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
46
|
-
region: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
47
|
-
postalCode: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
48
|
-
postOfficeBoxNumber: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
49
|
-
country: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
50
|
-
}>;
|
|
51
|
-
}>>>>;
|
|
52
|
-
urls: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
53
|
-
label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
54
|
-
value: import("effect/Schema").refine<string, typeof import("effect/Schema").String>;
|
|
55
|
-
}>>>>;
|
|
56
|
-
birthday: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
|
|
57
|
-
fields: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
58
|
-
category: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
59
|
-
label: typeof import("effect/Schema").String;
|
|
60
|
-
value: typeof import("effect/Schema").String;
|
|
61
|
-
}>>>>;
|
|
62
|
-
}>>>>;
|
|
63
|
-
identityDid: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
64
|
-
identityKey: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
65
|
-
email: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
66
|
-
name: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
67
|
-
role: import("effect/Schema").optional<import("effect/Schema").Literal<["user", "assistant"]>>;
|
|
68
|
-
}>>;
|
|
69
|
-
blocks: import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Union<[import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"anchor", {
|
|
70
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
71
|
-
objectId: import("@dxos/keys").ObjectIdClass;
|
|
72
|
-
version: typeof import("effect/Schema").Unknown;
|
|
73
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"file", {
|
|
74
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
75
|
-
url: typeof import("effect/Schema").String;
|
|
76
|
-
name: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
77
|
-
mediaType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
78
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"image", {
|
|
79
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
80
|
-
id: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
81
|
-
source: import("effect/Schema").optional<import("effect/Schema").Union<[import("effect/Schema").mutable<import("effect/Schema").Struct<{
|
|
82
|
-
type: import("effect/Schema").Literal<["base64"]>;
|
|
83
|
-
mediaType: typeof import("effect/Schema").String;
|
|
84
|
-
data: typeof import("effect/Schema").String;
|
|
85
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").Struct<{
|
|
86
|
-
type: import("effect/Schema").Literal<["http"]>;
|
|
87
|
-
url: typeof import("effect/Schema").String;
|
|
88
|
-
}>>]>>;
|
|
89
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"json", {
|
|
90
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
91
|
-
disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
92
|
-
data: typeof import("effect/Schema").String;
|
|
93
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"proposal", {
|
|
94
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
95
|
-
text: typeof import("effect/Schema").String;
|
|
96
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"reasoning", {
|
|
97
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
98
|
-
reasoningText: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
99
|
-
redactedText: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
100
|
-
signature: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
101
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"reference", {
|
|
102
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
103
|
-
reference: import("@dxos/echo/Type").ref<import("effect/Schema").Schema<import("@dxos/echo/Type").Expando, {
|
|
104
|
-
[x: string]: any;
|
|
105
|
-
id: string;
|
|
106
|
-
}, never>>;
|
|
107
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"select", {
|
|
108
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
109
|
-
options: import("effect/Schema").Array$<typeof import("effect/Schema").String>;
|
|
110
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"status", {
|
|
111
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
112
|
-
statusText: typeof import("effect/Schema").String;
|
|
113
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"suggest", {
|
|
114
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
115
|
-
text: typeof import("effect/Schema").String;
|
|
116
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"text", {
|
|
117
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
118
|
-
mimeType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
119
|
-
text: typeof import("effect/Schema").String;
|
|
120
|
-
disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
121
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"toolkit", {
|
|
122
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
123
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"toolCall", {
|
|
124
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
125
|
-
toolCallId: typeof import("effect/Schema").String;
|
|
126
|
-
name: typeof import("effect/Schema").String;
|
|
127
|
-
input: typeof import("effect/Schema").String;
|
|
128
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"toolResult", {
|
|
129
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
130
|
-
toolCallId: typeof import("effect/Schema").String;
|
|
131
|
-
name: typeof import("effect/Schema").String;
|
|
132
|
-
result: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
133
|
-
error: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
134
|
-
}>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"transcript", {
|
|
135
|
-
pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
136
|
-
started: typeof import("effect/Schema").String;
|
|
137
|
-
text: typeof import("effect/Schema").String;
|
|
138
|
-
}>>]>>>;
|
|
139
|
-
properties: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Any>>>;
|
|
140
|
-
}>>>>>;
|
|
141
|
-
}>>;
|
|
142
|
-
export interface ThreadType extends Schema.Schema.Type<typeof _ThreadType> {
|
|
143
|
-
}
|
|
144
|
-
export declare const ThreadType: Type.obj<Schema.Schema<ThreadType, Schema.Schema.Encoded<typeof _ThreadType>, never>>;
|
|
145
|
-
declare const _ChannelType: Type.obj<Schema.Struct<{
|
|
146
|
-
name: Schema.optional<typeof Schema.String>;
|
|
147
|
-
defaultThread: Type.ref<Type.obj<Schema.Schema<ThreadType, {
|
|
148
|
-
id: string;
|
|
149
|
-
messages: import("@dxos/echo-protocol").EncodedReference[];
|
|
150
|
-
name?: string | undefined;
|
|
151
|
-
status?: "staged" | "active" | "resolved" | undefined;
|
|
152
|
-
}, never>>>;
|
|
153
|
-
threads: Schema.mutable<Schema.Array$<Type.ref<Type.obj<Schema.Schema<ThreadType, {
|
|
154
|
-
id: string;
|
|
155
|
-
messages: import("@dxos/echo-protocol").EncodedReference[];
|
|
156
|
-
name?: string | undefined;
|
|
157
|
-
status?: "staged" | "active" | "resolved" | undefined;
|
|
158
|
-
}, never>>>>>;
|
|
159
|
-
}>>;
|
|
160
|
-
export interface ChannelType extends Schema.Schema.Type<typeof _ChannelType> {
|
|
161
|
-
}
|
|
162
|
-
export declare const ChannelType: Type.obj<Schema.Schema<ChannelType, Schema.Schema.Encoded<typeof _ChannelType>, never>>;
|
|
163
|
-
export {};
|
|
164
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGlC,eAAO,MAAM,YAAY,sGAIxB,CAAC;AAEF,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;wBAkBk2kB,CAAC;+BAAqD,CAAC;0BAAgD,CAAC;yBAAkG,CAAC;2BAAiD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAdvilB,CAAC;AAC1E,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC;CAAG;AAC7E,eAAO,MAAM,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,EAAE,KAAK,CAAC,CAChG,CAAC;AAEd,QAAA,MAAM,YAAY;;;;;;;;;;;;;;GAKwD,CAAC;AAC3E,MAAM,WAAW,WAAY,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC;CAAG;AAC/E,eAAO,MAAM,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,YAAY,CAAC,EAAE,KAAK,CAAC,CAClG,CAAC"}
|
|
@@ -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
|
-
]);
|