@dxos/plugin-thread 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef
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-A33GVGQX.mjs → add-message-LRVGIHDH.mjs} +9 -17
- package/dist/lib/browser/add-message-LRVGIHDH.mjs.map +7 -0
- package/dist/lib/browser/append-channel-message-CO3M6FSA.mjs +40 -0
- package/dist/lib/browser/append-channel-message-CO3M6FSA.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +1 -1
- package/dist/lib/browser/blueprints/index.mjs.map +3 -3
- package/dist/lib/browser/chunk-E4GG3NX2.mjs +29 -0
- package/dist/lib/browser/chunk-E4GG3NX2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-2QNKWX4H.mjs → chunk-TPNZ43NB.mjs} +15 -16
- package/dist/lib/browser/chunk-TPNZ43NB.mjs.map +7 -0
- package/dist/lib/browser/{create-N2ZVTONJ.mjs → create-BTGLHLBA.mjs} +9 -9
- package/dist/lib/browser/create-BTGLHLBA.mjs.map +7 -0
- package/dist/lib/browser/{create-channel-Y4H3535D.mjs → create-channel-ZXKSLHGN.mjs} +5 -7
- package/dist/lib/browser/create-channel-ZXKSLHGN.mjs.map +7 -0
- package/dist/lib/browser/{create-proposals-VTOSWUOX.mjs → create-proposals-AV5CREPV.mjs} +3 -4
- package/dist/lib/browser/create-proposals-AV5CREPV.mjs.map +7 -0
- package/dist/lib/browser/{delete-QZZE655Y.mjs → delete-GLYEP7NE.mjs} +6 -6
- package/dist/lib/browser/delete-GLYEP7NE.mjs.map +7 -0
- package/dist/lib/browser/{delete-message-WQAZLYBO.mjs → delete-message-RQ72ZY5D.mjs} +5 -14
- package/dist/lib/browser/delete-message-RQ72ZY5D.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +79 -592
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{on-create-space-2UGS234J.mjs → on-create-space-SPE3QVFZ.mjs} +3 -4
- package/dist/lib/browser/on-create-space-SPE3QVFZ.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +3 -4
- package/dist/lib/browser/operations/index.mjs.map +3 -3
- package/dist/lib/browser/{restore-KKQHFLYO.mjs → restore-VX7FLZOZ.mjs} +3 -4
- package/dist/lib/browser/restore-VX7FLZOZ.mjs.map +7 -0
- package/dist/lib/browser/{restore-message-VOP2UE7N.mjs → restore-message-D65NSWUA.mjs} +5 -14
- package/dist/lib/browser/restore-message-D65NSWUA.mjs.map +7 -0
- package/dist/lib/browser/{select-VBJ3MBLN.mjs → select-AT4L7EBU.mjs} +6 -6
- package/dist/lib/browser/{select-VBJ3MBLN.mjs.map → select-AT4L7EBU.mjs.map} +1 -1
- package/dist/lib/browser/{toggle-resolved-GIYF3KWJ.mjs → toggle-resolved-JD3D4WBZ.mjs} +5 -14
- package/dist/lib/browser/toggle-resolved-JD3D4WBZ.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +90 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -3
- package/dist/lib/node-esm/{add-message-E6XC6E3Z.mjs → add-message-4EAQ2ZPI.mjs} +9 -17
- package/dist/lib/node-esm/add-message-4EAQ2ZPI.mjs.map +7 -0
- package/dist/lib/node-esm/append-channel-message-F7KGBSWP.mjs +41 -0
- package/dist/lib/node-esm/append-channel-message-F7KGBSWP.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +1 -1
- package/dist/lib/node-esm/blueprints/index.mjs.map +3 -3
- package/dist/lib/node-esm/chunk-BVEZBGIY.mjs +30 -0
- package/dist/lib/node-esm/chunk-BVEZBGIY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-I6LAZYVU.mjs → chunk-XKUMDYGR.mjs} +15 -16
- package/dist/lib/node-esm/chunk-XKUMDYGR.mjs.map +7 -0
- package/dist/lib/node-esm/{create-A6XQZR7M.mjs → create-DEZFPN2Y.mjs} +9 -9
- package/dist/lib/node-esm/create-DEZFPN2Y.mjs.map +7 -0
- package/dist/lib/node-esm/{create-channel-KA5T23ZS.mjs → create-channel-6VHTC2OR.mjs} +5 -7
- package/dist/lib/node-esm/create-channel-6VHTC2OR.mjs.map +7 -0
- package/dist/lib/node-esm/{create-proposals-HDBVDNUX.mjs → create-proposals-P5O2ICOL.mjs} +3 -4
- package/dist/lib/{browser/create-proposals-VTOSWUOX.mjs.map → node-esm/create-proposals-P5O2ICOL.mjs.map} +3 -3
- package/dist/lib/node-esm/{delete-3RAWD5GG.mjs → delete-QG45QLPY.mjs} +6 -6
- package/dist/lib/node-esm/delete-QG45QLPY.mjs.map +7 -0
- package/dist/lib/node-esm/{delete-message-W4XFE4KW.mjs → delete-message-PGNLB6TL.mjs} +5 -14
- package/dist/lib/node-esm/delete-message-PGNLB6TL.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +79 -592
- 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-ZURB6UKR.mjs → on-create-space-TFBSHWQ4.mjs} +3 -4
- package/dist/lib/{browser/on-create-space-2UGS234J.mjs.map → node-esm/on-create-space-TFBSHWQ4.mjs.map} +1 -1
- package/dist/lib/node-esm/operations/index.mjs +3 -4
- package/dist/lib/node-esm/operations/index.mjs.map +3 -3
- package/dist/lib/node-esm/{restore-PDYEKDE3.mjs → restore-E27OAIFJ.mjs} +3 -4
- package/dist/lib/node-esm/restore-E27OAIFJ.mjs.map +7 -0
- package/dist/lib/node-esm/{restore-message-O5XC34MW.mjs → restore-message-J3CH6NGI.mjs} +5 -14
- package/dist/lib/node-esm/restore-message-J3CH6NGI.mjs.map +7 -0
- package/dist/lib/node-esm/{select-6KETLVWY.mjs → select-UU6Q2XAB.mjs} +6 -6
- package/dist/lib/node-esm/{select-6KETLVWY.mjs.map → select-UU6Q2XAB.mjs.map} +1 -1
- package/dist/lib/node-esm/{toggle-resolved-QR3SOXR7.mjs → toggle-resolved-VS6NKXL3.mjs} +5 -14
- package/dist/lib/node-esm/toggle-resolved-VS6NKXL3.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +91 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -3
- package/dist/types/src/ThreadPlugin.d.ts +1 -0
- 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/blueprints/thread-blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -1
- package/dist/types/src/calls/call-manager.d.ts.map +1 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
- package/dist/types/src/calls/media-manager.d.ts.map +1 -1
- package/dist/types/src/calls/speaking-monitor.d.ts +0 -3
- package/dist/types/src/calls/speaking-monitor.d.ts.map +1 -1
- package/dist/types/src/calls/types.d.ts.map +1 -1
- package/dist/types/src/calls/util/audio.d.ts.map +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts +2 -2
- package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
- package/dist/types/src/calls/util/history-cache.d.ts.map +1 -1
- package/dist/types/src/calls/util/media.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.map +1 -1
- package/dist/types/src/calls-service.stories.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +2 -2
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/call-manager.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +4 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +2 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -1
- package/dist/types/src/components/Call/Call.d.ts +32 -4
- package/dist/types/src/components/Call/Call.d.ts.map +1 -1
- package/dist/types/src/components/Call/Toolbar.d.ts +5 -5
- package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +44 -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/CommentsPanel/CommentsPanel.d.ts.map +1 -1
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +70 -70
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -1
- package/dist/types/src/components/Lobby/Lobby.d.ts +24 -3
- package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.d.ts +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
- package/dist/types/src/components/MessagePanel/MessagePanel.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 +70 -70
- 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/ResponsivePanel.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +70 -70
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +70 -70
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts +16 -0
- package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelChat/index.d.ts +4 -0
- package/dist/types/src/containers/ChannelChat/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +1 -1
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +70 -70
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -1
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts +20 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts.map +1 -0
- package/dist/types/src/containers/{ChatContainer/ChatContainer.stories.d.ts → ThreadContainer/ThreadContainer.stories.d.ts} +71 -71
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadContainer/index.d.ts +4 -0
- package/dist/types/src/containers/ThreadContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +2 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts +2 -2
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/hooks/analytics.d.ts.map +1 -1
- package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/add-message.d.ts +1 -1
- package/dist/types/src/operations/add-message.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 +1 -1
- package/dist/types/src/operations/create-channel.d.ts.map +1 -1
- package/dist/types/src/operations/create-proposals.d.ts +1 -1
- package/dist/types/src/operations/create-proposals.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +1 -1
- package/dist/types/src/operations/create.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +855 -1649
- package/dist/types/src/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/operations/delete-message.d.ts +1 -1
- package/dist/types/src/operations/delete-message.d.ts.map +1 -1
- package/dist/types/src/operations/delete.d.ts +1 -1
- package/dist/types/src/operations/delete.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +1 -1
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/restore-message.d.ts +1 -1
- package/dist/types/src/operations/restore-message.d.ts.map +1 -1
- package/dist/types/src/operations/restore.d.ts +1 -1
- package/dist/types/src/operations/restore.d.ts.map +1 -1
- package/dist/types/src/operations/select.d.ts +1 -1
- package/dist/types/src/operations/select.d.ts.map +1 -1
- package/dist/types/src/operations/toggle-resolved.d.ts +1 -1
- package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -1
- package/dist/types/src/testing/data.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +70 -70
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +2 -1
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +4 -2
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +2 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +65 -67
- package/src/ThreadPlugin.node.ts +84 -0
- package/src/ThreadPlugin.test.ts +37 -0
- package/src/ThreadPlugin.tsx +8 -8
- package/src/blueprints/thread-blueprint.ts +2 -3
- package/src/calls/util/calls-service.ts +3 -1
- package/src/calls/util/stub-media-streams.ts +3 -1
- package/src/calls-service.stories.tsx +4 -4
- package/src/capabilities/app-graph-builder.ts +3 -2
- package/src/capabilities/blueprint-definition.ts +2 -0
- package/src/capabilities/index.ts +2 -1
- package/src/capabilities/markdown.ts +10 -6
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +24 -17
- package/src/components/Call/Call.tsx +5 -5
- package/src/components/Call/Toolbar.tsx +1 -1
- package/src/components/Chat/Chat.tsx +218 -0
- package/src/components/Chat/index.ts +5 -0
- package/src/components/CommentsPanel/CommentsPanel.stories.tsx +5 -3
- package/src/components/Lobby/Lobby.tsx +5 -4
- package/src/components/MessagePanel/MessagePanel.tsx +3 -3
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +2 -1
- package/src/components/ResponsiveGrid/ResponsivePanel.stories.tsx +2 -1
- package/src/components/ThreadSettings/ThreadSettings.stories.tsx +2 -1
- package/src/components/index.ts +1 -0
- package/src/containers/ChannelChat/ChannelChat.tsx +65 -0
- package/src/containers/ChannelChat/index.ts +8 -0
- package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +54 -10
- package/src/containers/ChannelContainer/ChannelContainer.tsx +4 -4
- package/src/containers/{ChatContainer/ChatContainer.stories.tsx → ThreadContainer/ThreadContainer.stories.tsx} +10 -11
- package/src/containers/ThreadContainer/ThreadContainer.tsx +75 -0
- package/src/containers/ThreadContainer/index.ts +8 -0
- package/src/containers/index.ts +2 -1
- package/src/extensions/threads.ts +7 -7
- package/src/index.ts +10 -3
- package/src/operations/add-message.ts +3 -3
- package/src/operations/append-channel-message.ts +36 -0
- package/src/operations/create-channel.ts +2 -2
- package/src/operations/create-proposals.ts +1 -1
- package/src/operations/create.ts +4 -4
- package/src/operations/definitions.ts +9 -9
- package/src/operations/delete-message.ts +2 -2
- package/src/operations/delete.ts +1 -1
- package/src/operations/index.ts +2 -2
- package/src/operations/on-create-space.ts +1 -1
- package/src/operations/restore-message.ts +2 -2
- package/src/operations/restore.ts +1 -1
- package/src/operations/select.ts +1 -1
- package/src/operations/toggle-resolved.ts +2 -2
- package/src/testing/index.ts +1 -1
- package/src/translations.ts +1 -1
- package/src/types/Settings.ts +1 -1
- package/src/types/capabilities.ts +2 -1
- package/src/types/index.ts +0 -1
- package/dist/lib/browser/add-message-A33GVGQX.mjs.map +0 -7
- package/dist/lib/browser/chunk-2QNKWX4H.mjs.map +0 -7
- package/dist/lib/browser/chunk-7T7J6ZR6.mjs +0 -61
- package/dist/lib/browser/chunk-7T7J6ZR6.mjs.map +0 -7
- package/dist/lib/browser/create-N2ZVTONJ.mjs.map +0 -7
- package/dist/lib/browser/create-channel-Y4H3535D.mjs.map +0 -7
- package/dist/lib/browser/create-channel-thread-6N7TKEAW.mjs +0 -28
- package/dist/lib/browser/create-channel-thread-6N7TKEAW.mjs.map +0 -7
- package/dist/lib/browser/delete-QZZE655Y.mjs.map +0 -7
- package/dist/lib/browser/delete-message-WQAZLYBO.mjs.map +0 -7
- package/dist/lib/browser/restore-KKQHFLYO.mjs.map +0 -7
- package/dist/lib/browser/restore-message-VOP2UE7N.mjs.map +0 -7
- package/dist/lib/browser/toggle-resolved-GIYF3KWJ.mjs.map +0 -7
- package/dist/lib/node-esm/add-message-E6XC6E3Z.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-I6LAZYVU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UGSMYQLZ.mjs +0 -62
- package/dist/lib/node-esm/chunk-UGSMYQLZ.mjs.map +0 -7
- package/dist/lib/node-esm/create-A6XQZR7M.mjs.map +0 -7
- package/dist/lib/node-esm/create-channel-KA5T23ZS.mjs.map +0 -7
- package/dist/lib/node-esm/create-channel-thread-44PXAPGM.mjs +0 -29
- package/dist/lib/node-esm/create-channel-thread-44PXAPGM.mjs.map +0 -7
- package/dist/lib/node-esm/create-proposals-HDBVDNUX.mjs.map +0 -7
- package/dist/lib/node-esm/delete-3RAWD5GG.mjs.map +0 -7
- package/dist/lib/node-esm/delete-message-W4XFE4KW.mjs.map +0 -7
- package/dist/lib/node-esm/on-create-space-ZURB6UKR.mjs.map +0 -7
- package/dist/lib/node-esm/restore-PDYEKDE3.mjs.map +0 -7
- package/dist/lib/node-esm/restore-message-O5XC34MW.mjs.map +0 -7
- package/dist/lib/node-esm/toggle-resolved-QR3SOXR7.mjs.map +0 -7
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +0 -16
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/index.d.ts +0 -4
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
- package/dist/types/src/operations/create-channel-thread.d.ts +0 -5
- package/dist/types/src/operations/create-channel-thread.d.ts.map +0 -1
- package/dist/types/src/testing/stories.d.ts +0 -3
- package/dist/types/src/testing/stories.d.ts.map +0 -1
- package/dist/types/src/types/Channel.d.ts +0 -711
- package/dist/types/src/types/Channel.d.ts.map +0 -1
- package/src/containers/ChatContainer/ChatContainer.tsx +0 -131
- package/src/containers/ChatContainer/index.ts +0 -8
- package/src/operations/create-channel-thread.ts +0 -26
- package/src/testing/stories.ts +0 -51
- package/src/types/Channel.ts +0 -37
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/translations.ts
|
|
4
|
+
import { Type } from "@dxos/echo";
|
|
5
|
+
import { Channel } from "@dxos/types";
|
|
6
|
+
import { meta } from "#meta";
|
|
7
|
+
var translations = [
|
|
8
|
+
{
|
|
9
|
+
"en-US": {
|
|
10
|
+
[Type.getTypename(Channel.Channel)]: {
|
|
11
|
+
"typename.label": "Channel",
|
|
12
|
+
"typename.label_zero": "Channels",
|
|
13
|
+
"typename.label_one": "Channel",
|
|
14
|
+
"typename.label_other": "Channels",
|
|
15
|
+
"object-name.placeholder": "New channel",
|
|
16
|
+
"add-object.label": "Add channel",
|
|
17
|
+
"rename-object.label": "Rename channel",
|
|
18
|
+
"delete-object.label": "Delete channel",
|
|
19
|
+
"object-deleted.label": "Channel deleted"
|
|
20
|
+
},
|
|
21
|
+
[meta.id]: {
|
|
22
|
+
"plugin.name": "Chat",
|
|
23
|
+
"channel-title.label": "Title",
|
|
24
|
+
"message.placeholder": "Reply\u2026",
|
|
25
|
+
"activity.message": "Processing\u2026",
|
|
26
|
+
"anonymous.label": "Anonymous",
|
|
27
|
+
"delete-message-block.label": "Delete message block",
|
|
28
|
+
"detached-thread.label": "Referenced content was removed",
|
|
29
|
+
"delete-thread.label": "Delete thread",
|
|
30
|
+
"resolve-thread.label": "Resolve thread",
|
|
31
|
+
"thread-deleted.label": "Thread deleted",
|
|
32
|
+
"message-deleted.label": "Message deleted",
|
|
33
|
+
"comments.heading": "Comments",
|
|
34
|
+
"chat.heading": "Chat",
|
|
35
|
+
"draft.button": "DRAFT",
|
|
36
|
+
"no-comments.title": "Comments",
|
|
37
|
+
"no-comments.message": "Click on the <commentIcon></commentIcon> button in the document toolbar to create a comment thread on the selected text.",
|
|
38
|
+
"toggle-show-resolved.label": "Show resolved",
|
|
39
|
+
"unnamed-object-threads.label": "Threads",
|
|
40
|
+
"mark-as-resolved.label": "Mark as resolved",
|
|
41
|
+
"mark-as-unresolved.label": "Mark as unresolved",
|
|
42
|
+
"save-message.label": "Save",
|
|
43
|
+
"edit-message.label": "Edit",
|
|
44
|
+
"delete-message.label": "Delete message",
|
|
45
|
+
"accept-proposal.label": "Accept proposal",
|
|
46
|
+
"open-comments-panel.label": "Show Comments",
|
|
47
|
+
"comments.label": "Comments",
|
|
48
|
+
"show-all.label": "All comments",
|
|
49
|
+
"show-unresolved.label": "Unresolved comments",
|
|
50
|
+
"add-comment.label": "Add comment",
|
|
51
|
+
"channel-companion.label": "Channel",
|
|
52
|
+
"call-panel.label": "Active Call",
|
|
53
|
+
"display-name.label": "Display name",
|
|
54
|
+
"display-name.description": "Set your display name before joining a meeting.",
|
|
55
|
+
"display-name-input.placeholder": "Enter your name",
|
|
56
|
+
"set-display-name.label": "Continue",
|
|
57
|
+
"call-tab.label": "Call",
|
|
58
|
+
"meeting-status.title": "Calls",
|
|
59
|
+
"share-meeting-link.label": "Share meeting",
|
|
60
|
+
"show-webrtc-stats.title": "WebRTC Stats",
|
|
61
|
+
"show-calls-history.title": "Service History",
|
|
62
|
+
"meeting-summary.label": "Summary",
|
|
63
|
+
"summarize.label": "Summarize",
|
|
64
|
+
"summarizing.label": "Creating summary...",
|
|
65
|
+
"create-summary.message": "A summary doesn\u2019t exist for this meeting yet. Create one now?",
|
|
66
|
+
"icon-pin.label": "Pin video",
|
|
67
|
+
"icon-unpin.label": "Unpin video",
|
|
68
|
+
"icon-wave.label": "Waving",
|
|
69
|
+
"icon-muted.label": "Muted",
|
|
70
|
+
"join-call.button": "Join",
|
|
71
|
+
"leave-call.button": "Leave",
|
|
72
|
+
"mic-on.button": "Unmute",
|
|
73
|
+
"mic-off.button": "Mute",
|
|
74
|
+
"camera-on.button": "Turn camera on",
|
|
75
|
+
"camera-off.button": "Turn camera off",
|
|
76
|
+
"camera-off.label": "Camera off",
|
|
77
|
+
"raise-hand.button": "Raise hand",
|
|
78
|
+
"lower-hand.button": "Lower hand",
|
|
79
|
+
"screenshare-on.button": "Share screen",
|
|
80
|
+
"screenshare-off.button": "Stop streaming",
|
|
81
|
+
"channel-toolbar.title": "Channel actions",
|
|
82
|
+
"start-video-call.menu": "Start video call"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
export {
|
|
88
|
+
translations
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=translations.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Type } from '@dxos/echo';\nimport { type Resource } from '@dxos/react-ui';\nimport { Channel } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n {\n 'en-US': {\n [Type.getTypename(Channel.Channel)]: {\n 'typename.label': 'Channel',\n 'typename.label_zero': 'Channels',\n 'typename.label_one': 'Channel',\n 'typename.label_other': 'Channels',\n 'object-name.placeholder': 'New channel',\n 'add-object.label': 'Add channel',\n 'rename-object.label': 'Rename channel',\n 'delete-object.label': 'Delete channel',\n 'object-deleted.label': 'Channel deleted',\n },\n [meta.id]: {\n 'plugin.name': 'Chat',\n 'channel-title.label': 'Title',\n 'message.placeholder': 'Reply…',\n 'activity.message': 'Processing…',\n 'anonymous.label': 'Anonymous',\n 'delete-message-block.label': 'Delete message block',\n 'detached-thread.label': 'Referenced content was removed',\n 'delete-thread.label': 'Delete thread',\n 'resolve-thread.label': 'Resolve thread',\n 'thread-deleted.label': 'Thread deleted',\n 'message-deleted.label': 'Message deleted',\n 'comments.heading': 'Comments',\n 'chat.heading': 'Chat',\n 'draft.button': 'DRAFT',\n 'no-comments.title': 'Comments',\n 'no-comments.message':\n 'Click on the <commentIcon></commentIcon> button in the document toolbar to create a comment thread on the selected text.',\n 'toggle-show-resolved.label': 'Show resolved',\n 'unnamed-object-threads.label': 'Threads',\n 'mark-as-resolved.label': 'Mark as resolved',\n 'mark-as-unresolved.label': 'Mark as unresolved',\n 'save-message.label': 'Save',\n 'edit-message.label': 'Edit',\n 'delete-message.label': 'Delete message',\n 'accept-proposal.label': 'Accept proposal',\n 'open-comments-panel.label': 'Show Comments',\n 'comments.label': 'Comments',\n 'show-all.label': 'All comments',\n 'show-unresolved.label': 'Unresolved comments',\n 'add-comment.label': 'Add comment',\n\n 'channel-companion.label': 'Channel',\n 'call-panel.label': 'Active Call',\n\n 'display-name.label': 'Display name',\n 'display-name.description': 'Set your display name before joining a meeting.',\n 'display-name-input.placeholder': 'Enter your name',\n 'set-display-name.label': 'Continue',\n\n 'call-tab.label': 'Call',\n 'meeting-status.title': 'Calls',\n 'share-meeting-link.label': 'Share meeting',\n 'show-webrtc-stats.title': 'WebRTC Stats',\n 'show-calls-history.title': 'Service History',\n\n 'meeting-summary.label': 'Summary',\n 'summarize.label': 'Summarize',\n 'summarizing.label': 'Creating summary...',\n 'create-summary.message': 'A summary doesn’t exist for this meeting yet. Create one now?',\n\n 'icon-pin.label': 'Pin video',\n 'icon-unpin.label': 'Unpin video',\n 'icon-wave.label': 'Waving',\n 'icon-muted.label': 'Muted',\n 'join-call.button': 'Join',\n 'leave-call.button': 'Leave',\n 'mic-on.button': 'Unmute',\n 'mic-off.button': 'Mute',\n 'camera-on.button': 'Turn camera on',\n 'camera-off.button': 'Turn camera off',\n 'camera-off.label': 'Camera off',\n 'raise-hand.button': 'Raise hand',\n 'lower-hand.button': 'Lower hand',\n 'screenshare-on.button': 'Share screen',\n 'screenshare-off.button': 'Stop streaming',\n\n 'channel-toolbar.title': 'Channel actions',\n 'start-video-call.menu': 'Start video call',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,YAAY;AAErB,SAASC,eAAe;AAExB,SAASC,YAAY;AAEd,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACH,KAAKI,YAAYH,QAAQA,OAAO,CAAA,GAAI;QACnC,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;QAC3B,oBAAoB;QACpB,uBAAuB;QACvB,uBAAuB;QACvB,wBAAwB;MAC1B;MACA,CAACC,KAAKG,EAAE,GAAG;QACT,eAAe;QACf,uBAAuB;QACvB,uBAAuB;QACvB,oBAAoB;QACpB,mBAAmB;QACnB,8BAA8B;QAC9B,yBAAyB;QACzB,uBAAuB;QACvB,wBAAwB;QACxB,wBAAwB;QACxB,yBAAyB;QACzB,oBAAoB;QACpB,gBAAgB;QAChB,gBAAgB;QAChB,qBAAqB;QACrB,uBACE;QACF,8BAA8B;QAC9B,gCAAgC;QAChC,0BAA0B;QAC1B,4BAA4B;QAC5B,sBAAsB;QACtB,sBAAsB;QACtB,wBAAwB;QACxB,yBAAyB;QACzB,6BAA6B;QAC7B,kBAAkB;QAClB,kBAAkB;QAClB,yBAAyB;QACzB,qBAAqB;QAErB,2BAA2B;QAC3B,oBAAoB;QAEpB,sBAAsB;QACtB,4BAA4B;QAC5B,kCAAkC;QAClC,0BAA0B;QAE1B,kBAAkB;QAClB,wBAAwB;QACxB,4BAA4B;QAC5B,2BAA2B;QAC3B,4BAA4B;QAE5B,yBAAyB;QACzB,mBAAmB;QACnB,qBAAqB;QACrB,0BAA0B;QAE1B,kBAAkB;QAClB,oBAAoB;QACpB,mBAAmB;QACnB,oBAAoB;QACpB,oBAAoB;QACpB,qBAAqB;QACrB,iBAAiB;QACjB,kBAAkB;QAClB,oBAAoB;QACpB,qBAAqB;QACrB,oBAAoB;QACpB,qBAAqB;QACrB,qBAAqB;QACrB,yBAAyB;QACzB,0BAA0B;QAE1B,yBAAyB;QACzB,yBAAyB;MAC3B;IACF;EACF;;",
|
|
6
|
+
"names": ["Type", "Channel", "meta", "translations", "getTypename", "id"]
|
|
7
|
+
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Channel_exports,
|
|
3
2
|
Settings_exports,
|
|
4
3
|
ThreadCapabilities
|
|
5
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-E4GG3NX2.mjs";
|
|
6
5
|
import "../chunk-J5LGTIGS.mjs";
|
|
7
6
|
export {
|
|
8
|
-
Channel_exports as Channel,
|
|
9
7
|
Settings_exports as Settings,
|
|
10
8
|
ThreadCapabilities
|
|
11
9
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AddMessage
|
|
4
|
-
} from "./chunk-I6LAZYVU.mjs";
|
|
5
2
|
import {
|
|
6
3
|
ThreadCapabilities
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BVEZBGIY.mjs";
|
|
5
|
+
import {
|
|
6
|
+
AddMessage
|
|
7
|
+
} from "./chunk-XKUMDYGR.mjs";
|
|
8
8
|
import "./chunk-HSLMI22Q.mjs";
|
|
9
9
|
|
|
10
10
|
// src/operations/add-message.ts
|
|
11
11
|
import * as Effect from "effect/Effect";
|
|
12
12
|
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
13
|
+
import { Operation } from "@dxos/compute";
|
|
13
14
|
import { Obj, Ref, Relation } from "@dxos/echo";
|
|
14
15
|
import { invariant } from "@dxos/invariant";
|
|
15
|
-
import { Operation } from "@dxos/operation";
|
|
16
16
|
import { ObservabilityOperation } from "@dxos/plugin-observability/operations";
|
|
17
17
|
import { SpaceOperation } from "@dxos/plugin-space/operations";
|
|
18
18
|
import { AnchoredTo, Message } from "@dxos/types";
|
|
@@ -23,15 +23,7 @@ var handler = AddMessage.pipe(Operation.withHandler(Effect.fnUntraced(function*
|
|
|
23
23
|
const thread = Relation.getSource(anchor);
|
|
24
24
|
const subjectId = Obj.getDXN(subject).toString();
|
|
25
25
|
const db = Obj.getDatabase(subject);
|
|
26
|
-
invariant(db, "Database not found", {
|
|
27
|
-
F: __dxlog_file,
|
|
28
|
-
L: 26,
|
|
29
|
-
S: this,
|
|
30
|
-
A: [
|
|
31
|
-
"db",
|
|
32
|
-
"'Database not found'"
|
|
33
|
-
]
|
|
34
|
-
});
|
|
26
|
+
invariant(db, "Database not found", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 20, S: this, A: ["db", "'Database not found'"] });
|
|
35
27
|
const message = Obj.make(Message.Message, {
|
|
36
28
|
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
37
29
|
sender,
|
|
@@ -42,13 +34,13 @@ var handler = AddMessage.pipe(Operation.withHandler(Effect.fnUntraced(function*
|
|
|
42
34
|
}
|
|
43
35
|
]
|
|
44
36
|
});
|
|
45
|
-
Obj.
|
|
37
|
+
Obj.update(thread, (thread2) => {
|
|
46
38
|
thread2.messages.push(Ref.make(message));
|
|
47
39
|
});
|
|
48
40
|
const state = registry.get(stateAtom);
|
|
49
41
|
const draft = state.drafts[subjectId]?.find((a) => a.id === anchor.id);
|
|
50
42
|
if (draft) {
|
|
51
|
-
Obj.
|
|
43
|
+
Obj.update(thread, (thread2) => {
|
|
52
44
|
thread2.status = "active";
|
|
53
45
|
});
|
|
54
46
|
registry.set(stateAtom, {
|
|
@@ -95,4 +87,4 @@ var add_message_default = handler;
|
|
|
95
87
|
export {
|
|
96
88
|
add_message_default as default
|
|
97
89
|
};
|
|
98
|
-
//# sourceMappingURL=add-message-
|
|
90
|
+
//# sourceMappingURL=add-message-4EAQ2ZPI.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/add-message.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Obj, Ref, Relation } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\nimport { SpaceOperation } from '@dxos/plugin-space/operations';\nimport { AnchoredTo, Message, Thread } from '@dxos/types';\n\nimport { ThreadCapabilities } from '../types';\nimport { AddMessage } from './definitions';\n\nconst handler: Operation.WithHandler<typeof AddMessage> = AddMessage.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ anchor, subject, sender, text }) {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(ThreadCapabilities.State);\n const thread = Relation.getSource(anchor) as Thread.Thread;\n const subjectId = Obj.getDXN(subject).toString();\n const db = Obj.getDatabase(subject);\n invariant(db, 'Database not found');\n\n const message = Obj.make(Message.Message, {\n created: new Date().toISOString(),\n sender,\n blocks: [{ _tag: 'text', text }],\n });\n Obj.update(thread, (thread) => {\n thread.messages.push(Ref.make(message));\n });\n\n const state = registry.get(stateAtom);\n const draft = state.drafts[subjectId]?.find((a: { id: string }) => a.id === anchor.id);\n if (draft) {\n Obj.update(thread, (thread) => {\n thread.status = 'active';\n });\n registry.set(stateAtom, {\n ...state,\n drafts: {\n ...state.drafts,\n [subjectId]: state.drafts[subjectId]?.filter((a: { id: string }) => a.id !== anchor.id),\n },\n });\n yield* Operation.invoke(SpaceOperation.AddObject, { object: thread, target: db, hidden: true });\n yield* Operation.invoke(SpaceOperation.AddRelation, {\n db,\n schema: AnchoredTo.AnchoredTo,\n source: thread,\n target: subject,\n fields: { anchor: draft.anchor },\n });\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.create',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n },\n });\n }\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.message.add',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n threadLength: thread.messages.length,\n messageId: message.id,\n messageLength: text.length,\n },\n });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiB;AAC1B,SAASC,KAAKC,KAAKC,gBAAgB;AACnC,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AACvC,SAASC,sBAAsB;AAC/B,SAASC,YAAYC,eAAuB;AAK5C,IAAA,eAA0DC;IAIpD,UAAMC,WAAY,KAAOC,UAAWC,YAAIC,kBAAwB,WAAA,EAAA,QAAA,SAAA,QAAA,KAAA,GAAA;AAChE,QAAMC,WAASC,OAASC,WAAUC,IAAAA,aAAAA,YAAAA;AAClC,QAAMC,YAAYC,OAAIC,WAAOC,IAASC,mBAAQ,KAAA;AAC9C,QAAMC,SAASC,SAAAA,UAAYH,MAAAA;AAC3BI,QAAAA,YAAc,IAAA,OAAA,OAAA,EAAA,SAAA;AAEd,QAAMC,KAAAA,IAAAA,YAAmBC,OAAQA;YAC/BC,IAAS,sBAAsB,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,sBAAA,EAAA,CAAA;QAC/BC,UAAAA,IAAAA,KAAAA,QAAAA,SAAAA;IACAC,UAAQ,oBAAA,KAAA,GAAA,YAAA;;YAAGC;;QAAmB,MAAA;QAAE;MAClC;IACIC;;AAEJ,MAAA,OAAA,QAAA,CAAAlB,YAAA;AAEA,IAAAA,QAAMmB,SAAQC,KAAStB,IAAIF,KAAAA,OAAAA,CAAAA;EAC3B,CAAA;AACA,QAAIyB,QAAO,SAAA,IAAA,SAAA;QACThB,QAAU,MAACL,OAASA,SAAAA,GAAAA,KAAAA,CAAAA,MAAAA,EAAAA,OAAAA,OAAAA,EAAAA;aAClBA;AACF,QAAA,OAAA,QAAA,CAAAA,YAAA;AACAoB,MAAAA,QAASE,SAAI1B;;aAEX2B,IAAQ,WAAA;;cAELnB;QACH,GAAA,MAAA;QACF,CAAA,SAAA,GAAA,MAAA,OAAA,SAAA,GAAA,OAAA,CAAA,MAAA,EAAA,OAAA,OAAA,EAAA;MACA;;WAAoEoB,UAAQf,OAAAA,eAAAA,WAAAA;MAAIgB,QAAQ;MAAK,QAAA;MAC7F,QAAOC;;WAELC,UAAQC,OAAWA,eAAU,aAAA;MAC7BC;MACAL,QAAQjB,WAAAA;MACRuB,QAAQ;cAAE3B;MAAqB,QAAA;QACjC,QAAA,MAAA;MACA;;WAEE4B,UAAY,SAAA,uBAAA,WAAA;YACVC;kBACAC;QACF,SAAA,GAAA;QACF,UAAA,OAAA;MACF;IAEA,CAAA;;SAEEF,UAAY,SAAA,uBAAA,WAAA;UACVC;gBACAC;MACAC,SAAAA,GAAAA;MACAC,UAAAA,OAAWvB;MACXwB,cAAAA,OAAoBC,SAAM;MAC5B,WAAA,QAAA;MACF,eAAA,KAAA;IACF;EAIJ,CAAA;;;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "Operation", "Obj", "Ref", "Relation", "invariant", "ObservabilityOperation", "SpaceOperation", "AnchoredTo", "Message", "AddMessage", "stateAtom", "Capability", "get", "ThreadCapabilities", "thread", "Relation", "getSource", "anchor", "subjectId", "Obj", "getDXN", "subject", "toString", "db", "getDatabase", "invariant", "message", "Message", "created", "sender", "blocks", "_tag", "update", "state", "registry", "draft", "set", "drafts", "target", "hidden", "Operation", "schema", "AnchoredTo", "source", "fields", "properties", "spaceId", "threadId", "threadLength", "messageId", "messageLength", "length"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
AppendChannelMessage
|
|
4
|
+
} from "./chunk-XKUMDYGR.mjs";
|
|
5
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
6
|
+
|
|
7
|
+
// src/operations/append-channel-message.ts
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import { Capability } from "@dxos/app-framework";
|
|
10
|
+
import { Operation } from "@dxos/compute";
|
|
11
|
+
import { Database, Feed, Obj } from "@dxos/echo";
|
|
12
|
+
import { createFeedServiceLayer } from "@dxos/echo-db";
|
|
13
|
+
import { invariant } from "@dxos/invariant";
|
|
14
|
+
import { ClientCapabilities } from "@dxos/plugin-client/types";
|
|
15
|
+
import { Message } from "@dxos/types";
|
|
16
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-thread/src/operations/append-channel-message.ts";
|
|
17
|
+
var handler = AppendChannelMessage.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ channel, sender, text }) {
|
|
18
|
+
const db = Obj.getDatabase(channel);
|
|
19
|
+
invariant(db, "Database not found", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 15, S: this, A: ["db", "'Database not found'"] });
|
|
20
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
21
|
+
const space = client.spaces.get(db.spaceId);
|
|
22
|
+
invariant(space, "Space not found", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 18, S: this, A: ["space", "'Space not found'"] });
|
|
23
|
+
const feed = yield* Database.load(channel.feed);
|
|
24
|
+
const message = Message.make({
|
|
25
|
+
sender,
|
|
26
|
+
blocks: [
|
|
27
|
+
{
|
|
28
|
+
_tag: "text",
|
|
29
|
+
text
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
yield* Feed.append(feed, [
|
|
34
|
+
message
|
|
35
|
+
]).pipe(Effect.provide(createFeedServiceLayer(space.queues)));
|
|
36
|
+
})));
|
|
37
|
+
var append_channel_message_default = handler;
|
|
38
|
+
export {
|
|
39
|
+
append_channel_message_default as default
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=append-channel-message-F7KGBSWP.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/append-channel-message.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Database, Feed, Obj } from '@dxos/echo';\nimport { createFeedServiceLayer } from '@dxos/echo-db';\nimport { invariant } from '@dxos/invariant';\nimport { ClientCapabilities } from '@dxos/plugin-client/types';\nimport { Message } from '@dxos/types';\n\nimport { AppendChannelMessage } from './definitions';\n\nconst handler: Operation.WithHandler<typeof AppendChannelMessage> = AppendChannelMessage.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ channel, sender, text }) {\n const db = Obj.getDatabase(channel);\n invariant(db, 'Database not found');\n const client = yield* Capability.get(ClientCapabilities.Client);\n const space = client.spaces.get(db.spaceId);\n invariant(space, 'Space not found');\n\n const feed = yield* Database.load(channel.feed);\n const message = Message.make({\n sender,\n blocks: [{ _tag: 'text', text }],\n });\n yield* Feed.append(feed, [message]).pipe(Effect.provide(createFeedServiceLayer(space.queues)));\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,MAAMC,WAAW;AACpC,SAASC,8BAA8B;AACvC,SAASC,iBAAiB;AAC1B,SAASC,0BAA0B;AACnC,SAASC,eAAe;AAIxB,IAAA,eAAoEC;IAI9DC,UAAUC,qBAAI,KAAA,UAAA,YAAA,kBAAA,WAAA,EAAA,SAAA,QAAA,KAAA,GAAA;AACd,QAAMC,KAAAA,IAAS,YAAOC,OAAWC;AACjC,YAAMC,IAAQH,sBAAqBI,EAAAA,YAAO,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,sBAAA,EAAA,CAAA;AAC1CN,QAAAA,SAAUK,OAAO,WAAA,IAAA,mBAAA,MAAA;AAEjB,QAAME,QAAO,OAAOC,OAAAA,IAASC,GAAKC,OAAQH;AAC1C,YAAMI,OAAUC,mBAAa,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,SAAA,mBAAA,EAAA,CAAA;QAC3BC,OAAAA,OAAAA,SAAAA,KAAAA,QAAAA,IAAAA;QACAC,UAAQ,QAAA,KAAA;;YAAGC;;QAAmB,MAAA;QAAE;MAClC;IACA;;SAAwC,KAACC,OAAOC,MAAQC;IAC1D;EAIJ,CAAA,EAAA,KAAeC,eAAQ,uBAAA,MAAA,MAAA,CAAA,CAAA;;;",
|
|
6
|
+
"names": ["Effect", "Capability", "Operation", "Database", "Feed", "Obj", "createFeedServiceLayer", "invariant", "ClientCapabilities", "Message", "AppendChannelMessage", "invariant", "db", "client", "Capability", "get", "space", "spaceId", "feed", "Database", "load", "channel", "message", "Message", "sender", "blocks", "_tag", "Effect", "provide", "createFeedServiceLayer", "handler"]
|
|
7
|
+
}
|
|
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import "../chunk-HSLMI22Q.mjs";
|
|
3
3
|
|
|
4
4
|
// src/blueprints/thread-blueprint.ts
|
|
5
|
-
import { Blueprint, Template } from "@dxos/
|
|
5
|
+
import { Blueprint, Template } from "@dxos/compute";
|
|
6
6
|
import { trim } from "@dxos/util";
|
|
7
7
|
import { ThreadOperation } from "#operations";
|
|
8
8
|
var BLUEPRINT_KEY = "org.dxos.blueprint.thread";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/blueprints/thread-blueprint.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {
|
|
5
|
-
"mappings": ";;;;
|
|
6
|
-
"names": ["Blueprint", "Template", "trim", "ThreadOperation", "BLUEPRINT_KEY", "make", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Blueprint, Template } from '@dxos/compute';\nimport { trim } from '@dxos/util';\n\nimport { ThreadOperation } from '#operations';\n\nconst BLUEPRINT_KEY = 'org.dxos.blueprint.thread';\n\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'Thread',\n tools: Blueprint.toolDefinitions({ operations: [ThreadOperation.CreateProposals] }),\n instructions: Template.make({\n // TODO(wittjosiah): Move example to function input schema annotation.\n source: trim`\n You can update markdown documents via proposals.\n For each diff, respond with the smallest possible matching span.\n For example:\n - \"There is a tyop in this sentence.\"\n + \"There is a typo in this sentence.\"\n - \"This id goof.\"\n + \"This is good.\"\n `,\n }),\n });\n\nconst blueprint: Blueprint.Definition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
|
|
5
|
+
"mappings": ";;;;AAIA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAErB,SAASC,uBAAuB;AAEhC,IAAMC,gBAAgB;AAEtB,IAAMC,OAAO,MACXL,UAAUK,KAAK;EACbC,KAAKF;EACLG,MAAM;EACNC,OAAOR,UAAUS,gBAAgB;IAAEC,YAAY;MAACP,gBAAgBQ;;EAAiB,CAAA;EACjFC,cAAcX,SAASI,KAAK;;IAE1BQ,QAAQX;;;;;;;;;EASV,CAAA;AACF,CAAA;AAEF,IAAMY,YAAkC;EACtCR,KAAKF;EACLC;AACF;AAEA,IAAA,2BAAeS;",
|
|
6
|
+
"names": ["Blueprint", "Template", "trim", "ThreadOperation", "BLUEPRINT_KEY", "make", "key", "name", "tools", "toolDefinitions", "operations", "CreateProposals", "instructions", "source", "blueprint"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
__export
|
|
4
|
+
} from "./chunk-HSLMI22Q.mjs";
|
|
5
|
+
|
|
6
|
+
// src/types/capabilities.ts
|
|
7
|
+
import { Capability } from "@dxos/app-framework";
|
|
8
|
+
import { meta } from "#meta";
|
|
9
|
+
(function(ThreadCapabilities2) {
|
|
10
|
+
ThreadCapabilities2.Settings = Capability.make(`${meta.id}.capability.settings`);
|
|
11
|
+
ThreadCapabilities2.CallManager = Capability.make(`${meta.id}.capability.call-manager`);
|
|
12
|
+
ThreadCapabilities2.CallExtension = Capability.make(`${meta.id}.capability.call-extension`);
|
|
13
|
+
ThreadCapabilities2.State = Capability.make(`${meta.id}.capability.state`);
|
|
14
|
+
ThreadCapabilities2.ViewState = Capability.make(`${meta.id}.capability.view-state`);
|
|
15
|
+
})(ThreadCapabilities || (ThreadCapabilities = {}));
|
|
16
|
+
var ThreadCapabilities;
|
|
17
|
+
|
|
18
|
+
// src/types/Settings.ts
|
|
19
|
+
var Settings_exports = {};
|
|
20
|
+
__export(Settings_exports, {
|
|
21
|
+
Settings: () => Settings
|
|
22
|
+
});
|
|
23
|
+
import * as Schema from "effect/Schema";
|
|
24
|
+
var Settings = Schema.mutable(Schema.Struct({}));
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
ThreadCapabilities,
|
|
28
|
+
Settings_exports
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=chunk-BVEZBGIY.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/capabilities.ts", "../../../src/types/Settings.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\n\nimport { Capability } from '@dxos/app-framework';\nimport { type Channel } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nimport { type CallManager, type CallState, type MediaState } from '../calls';\nimport { type ThreadState, type ViewStore } from '../types';\nimport * as Settings from './Settings';\n\nexport namespace ThreadCapabilities {\n export const Settings = Capability.make<Atom.Writable<Settings.Settings>>(`${meta.id}.capability.settings`);\n export const CallManager = Capability.make<CallManager>(`${meta.id}.capability.call-manager`);\n\n // TODO(burdon): Better way to define specific extensions for meeting companions.\n // TODO(burdon): This brings in deps from ../calls; how should we manage/minimize explicit type exposure to other plugins?\n // TODO(wittjosiah): These callbacks could be intents once we support broadcast.\n export type CallProperties = {\n onJoin: (state: { channel?: Channel.Channel; roomId?: string }) => Promise<void>;\n onLeave: (roomId?: string) => Promise<void>;\n onCallStateUpdated: (callState: CallState) => Promise<void>;\n onMediaStateUpdated: ([mediaState, isSpeaking]: [MediaState, boolean]) => Promise<void>;\n };\n\n export const CallExtension = Capability.make<CallProperties>(`${meta.id}.capability.call-extension`);\n\n /** Thread state (drafts, toolbar state, current selection). */\n export const State = Capability.make<Atom.Writable<ThreadState>>(`${meta.id}.capability.state`);\n\n /** Per-subject view state (e.g., showResolvedThreads). */\n export const ViewState = Capability.make<Atom.Writable<ViewStore>>(`${meta.id}.capability.view-state`);\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nexport const Settings = Schema.mutable(Schema.Struct({}));\nexport interface Settings extends Schema.Schema.Type<typeof Settings> {}\n"],
|
|
5
|
+
"mappings": ";;;;;;AAMA,SAASA,kBAAkB;AAG3B,SAASC,YAAY;UAMJC,qBAAAA;sBACFC,WAAWH,WAAWI,KAAuC,GAAGH,KAAKI,EAAE,sBAAsB;sBAC7FC,cAAcN,WAAWI,KAAkB,GAAGH,KAAKI,EAAE,0BAA0B;sBAY/EE,gBAAgBP,WAAWI,KAAqB,GAAGH,KAAKI,EAAE,4BAA4B;sBAGtFG,QAAQR,WAAWI,KAAiC,GAAGH,KAAKI,EAAE,mBAAmB;sBAGjFI,YAAYT,WAAWI,KAA+B,GAAGH,KAAKI,EAAE,wBAAwB;AACvG,GArBiBH,uBAAAA,qBAAAA,CAAAA,EAAAA;;;;ACfjB;;;;AAMA,YAAYQ,YAAY;AAEjB,IAAMC,WAAkBC,eAAeC,cAAO,CAAC,CAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "meta", "ThreadCapabilities", "Settings", "make", "id", "CallManager", "CallExtension", "State", "ViewState", "Schema", "Settings", "mutable", "Struct"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
Channel_exports
|
|
4
|
-
} from "./chunk-UGSMYQLZ.mjs";
|
|
5
2
|
import {
|
|
6
3
|
__export
|
|
7
4
|
} from "./chunk-HSLMI22Q.mjs";
|
|
@@ -10,9 +7,9 @@ import {
|
|
|
10
7
|
var definitions_exports = {};
|
|
11
8
|
__export(definitions_exports, {
|
|
12
9
|
AddMessage: () => AddMessage,
|
|
10
|
+
AppendChannelMessage: () => AppendChannelMessage,
|
|
13
11
|
Create: () => Create,
|
|
14
12
|
CreateChannel: () => CreateChannel,
|
|
15
|
-
CreateChannelThread: () => CreateChannelThread,
|
|
16
13
|
CreateProposals: () => CreateProposals,
|
|
17
14
|
Delete: () => Delete,
|
|
18
15
|
DeleteMessage: () => DeleteMessage,
|
|
@@ -26,12 +23,12 @@ __export(definitions_exports, {
|
|
|
26
23
|
});
|
|
27
24
|
import * as Schema from "effect/Schema";
|
|
28
25
|
import { Capability } from "@dxos/app-framework";
|
|
26
|
+
import { Operation } from "@dxos/compute";
|
|
29
27
|
import { Database, Key, Obj, Ref } from "@dxos/echo";
|
|
30
28
|
import { Collection } from "@dxos/echo";
|
|
31
|
-
import { Operation } from "@dxos/operation";
|
|
32
29
|
import { Markdown } from "@dxos/plugin-markdown/types";
|
|
33
30
|
import { SpaceSchema } from "@dxos/react-client/echo";
|
|
34
|
-
import { Actor, AnchoredTo, Message, Thread } from "@dxos/types";
|
|
31
|
+
import { Actor, AnchoredTo, Channel, Message, Thread } from "@dxos/types";
|
|
35
32
|
import { meta } from "#meta";
|
|
36
33
|
var THREAD_OPERATION = `${meta.id}.operation`;
|
|
37
34
|
var OnCreateSpace = Operation.make({
|
|
@@ -62,23 +59,25 @@ var CreateChannel = Operation.make({
|
|
|
62
59
|
name: Schema.optional(Schema.String)
|
|
63
60
|
}),
|
|
64
61
|
output: Schema.Struct({
|
|
65
|
-
object:
|
|
62
|
+
object: Channel.Channel
|
|
66
63
|
})
|
|
67
64
|
});
|
|
68
|
-
var
|
|
65
|
+
var AppendChannelMessage = Operation.make({
|
|
69
66
|
meta: {
|
|
70
|
-
key: `${THREAD_OPERATION}.
|
|
71
|
-
name: "
|
|
67
|
+
key: `${THREAD_OPERATION}.append-channel-message`,
|
|
68
|
+
name: "Append Channel Message"
|
|
72
69
|
},
|
|
70
|
+
// Note: Feed.FeedService is provided inside the handler from space.queues, not at the
|
|
71
|
+
// operation level — the runtime can't fulfill it without a space context.
|
|
73
72
|
services: [
|
|
74
73
|
Capability.Service
|
|
75
74
|
],
|
|
76
75
|
input: Schema.Struct({
|
|
77
|
-
channel:
|
|
76
|
+
channel: Channel.Channel,
|
|
77
|
+
sender: Actor.Actor,
|
|
78
|
+
text: Schema.String
|
|
78
79
|
}),
|
|
79
|
-
output: Schema.
|
|
80
|
-
object: Thread.Thread
|
|
81
|
-
})
|
|
80
|
+
output: Schema.Void
|
|
82
81
|
});
|
|
83
82
|
var Create = Operation.make({
|
|
84
83
|
meta: {
|
|
@@ -245,7 +244,7 @@ var CreateProposals = Operation.make({
|
|
|
245
244
|
export {
|
|
246
245
|
OnCreateSpace,
|
|
247
246
|
CreateChannel,
|
|
248
|
-
|
|
247
|
+
AppendChannelMessage,
|
|
249
248
|
Create,
|
|
250
249
|
Delete,
|
|
251
250
|
Select,
|
|
@@ -257,4 +256,4 @@ export {
|
|
|
257
256
|
CreateProposals,
|
|
258
257
|
definitions_exports
|
|
259
258
|
};
|
|
260
|
-
//# sourceMappingURL=chunk-
|
|
259
|
+
//# sourceMappingURL=chunk-XKUMDYGR.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Database, Key, Obj, Ref } from '@dxos/echo';\nimport { Collection } from '@dxos/echo';\nimport { Markdown } from '@dxos/plugin-markdown/types';\nimport { SpaceSchema } from '@dxos/react-client/echo';\nimport { Actor, AnchoredTo, Channel, Message, Thread } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nconst THREAD_OPERATION = `${meta.id}.operation`;\n\nexport const OnCreateSpace = Operation.make({\n meta: { key: `${THREAD_OPERATION}.on-create-space`, name: 'On Create Space' },\n services: [Capability.Service],\n input: Schema.Struct({\n space: SpaceSchema,\n rootCollection: Collection.Collection,\n isDefault: Schema.Boolean.pipe(Schema.optional),\n }),\n output: Schema.Void,\n});\n\nexport const CreateChannel = Operation.make({\n meta: { key: `${THREAD_OPERATION}.create-channel`, name: 'Create Channel' },\n services: [Capability.Service],\n input: Schema.Struct({\n spaceId: Key.SpaceId,\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: Channel.Channel,\n }),\n});\n\nexport const AppendChannelMessage = Operation.make({\n meta: { key: `${THREAD_OPERATION}.append-channel-message`, name: 'Append Channel Message' },\n // Note: Feed.FeedService is provided inside the handler from space.queues, not at the\n // operation level — the runtime can't fulfill it without a space context.\n services: [Capability.Service],\n input: Schema.Struct({\n channel: Channel.Channel,\n sender: Actor.Actor,\n text: Schema.String,\n }),\n output: Schema.Void,\n});\n\nexport const Create = Operation.make({\n meta: { key: `${THREAD_OPERATION}.create`, name: 'Create Thread' },\n services: [Capability.Service],\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n anchor: Schema.optional(Schema.String),\n subject: Obj.Unknown,\n }),\n output: Schema.Void,\n});\n\nexport const DeleteOutput = Schema.Struct({\n thread: Thread.Thread.annotations({ description: 'The deleted thread.' }),\n anchor: AnchoredTo.AnchoredTo.annotations({ description: 'The deleted anchor.' }),\n}).pipe(Schema.partial);\n\nexport type DeleteOutput = Schema.Schema.Type<typeof DeleteOutput>;\n\nexport const Delete = Operation.make({\n meta: { key: `${THREAD_OPERATION}.delete`, name: 'Delete Thread' },\n services: [Capability.Service],\n input: Schema.Struct({\n anchor: AnchoredTo.AnchoredTo,\n subject: Obj.Unknown,\n thread: Schema.optional(Thread.Thread),\n }),\n output: DeleteOutput,\n});\n\nexport const Select = Operation.make({\n meta: { key: `${THREAD_OPERATION}.select`, name: 'Select Thread' },\n services: [Capability.Service],\n input: Schema.Struct({\n current: Schema.String,\n }),\n output: Schema.Void,\n});\n\nexport const ToggleResolved = Operation.make({\n meta: { key: `${THREAD_OPERATION}.toggle-resolved`, name: 'Toggle Resolved' },\n services: [Capability.Service],\n input: Schema.Struct({\n thread: Thread.Thread,\n }),\n output: Schema.Void,\n});\n\nexport const AddMessage = Operation.make({\n meta: { key: `${THREAD_OPERATION}.add-message`, name: 'Add Message' },\n services: [Capability.Service],\n input: Schema.Struct({\n subject: Obj.Unknown,\n anchor: AnchoredTo.AnchoredTo,\n sender: Actor.Actor,\n text: Schema.String,\n }),\n output: Schema.Void,\n});\n\nexport const DeleteMessageOutput = Schema.partial(\n Schema.Struct({\n message: Message.Message.annotations({ description: 'The deleted message.' }),\n messageIndex: Schema.Number.annotations({ description: 'The index the message was at.' }),\n }),\n);\n\nexport type DeleteMessageOutput = Schema.Schema.Type<typeof DeleteMessageOutput>;\n\nexport const DeleteMessage = Operation.make({\n meta: { key: `${THREAD_OPERATION}.delete-message`, name: 'Delete Message' },\n services: [Capability.Service],\n input: Schema.Struct({\n anchor: AnchoredTo.AnchoredTo,\n subject: Obj.Unknown,\n messageId: Schema.String,\n }),\n output: DeleteMessageOutput,\n});\n\n/**\n * Restore a deleted thread (inverse of Delete).\n */\nexport const Restore = Operation.make({\n meta: { key: `${THREAD_OPERATION}.restore`, name: 'Restore Thread' },\n services: [Capability.Service],\n input: Schema.Struct({\n thread: Thread.Thread.annotations({ description: 'The thread to restore.' }),\n anchor: AnchoredTo.AnchoredTo.annotations({ description: 'The anchor relation to restore.' }),\n }),\n output: Schema.Void,\n});\n\n/**\n * Restore a deleted message (inverse of DeleteMessage).\n */\nexport const RestoreMessage = Operation.make({\n meta: { key: `${THREAD_OPERATION}.restore-message`, name: 'Restore Message' },\n services: [Capability.Service],\n input: Schema.Struct({\n anchor: AnchoredTo.AnchoredTo.annotations({ description: 'The anchor of the thread.' }),\n message: Message.Message.annotations({ description: 'The message to restore.' }),\n messageIndex: Schema.Number.annotations({ description: 'The index to restore the message at.' }),\n }),\n output: Schema.Void,\n});\n\nexport const CreateProposals = Operation.make({\n meta: {\n key: 'org.dxos.function.thread.create-proposals',\n name: 'Create Proposals',\n description: 'Proposes a set of changes to a document.',\n },\n input: Schema.Struct({\n doc: Ref.Ref(Markdown.Document).annotations({\n description: 'The ID of the document.',\n }),\n diffs: Schema.Array(Schema.String).annotations({\n description: 'The diffs to propose for the document.',\n }),\n }),\n output: Schema.Void,\n services: [Database.Service],\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;AAAA;;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,KAAKC,KAAKC,WAAW;AACxC,SAASC,kBAAkB;AAC3B,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,OAAOC,YAAYC,SAASC,SAASC,cAAc;AAE5D,SAASC,YAAY;AAErB,IAAMC,mBAAmB,GAAGD,KAAKE,EAAE;AAE5B,IAAMC,gBAAgBhB,UAAUiB,KAAK;EAC1CJ,MAAM;IAAEK,KAAK,GAAGJ,gBAAAA;IAAoCK,MAAM;EAAkB;EAC5EC,UAAU;IAACrB,WAAWsB;;EACtBC,OAAcC,cAAO;IACnBC,OAAOjB;IACPkB,gBAAgBpB,WAAWA;IAC3BqB,WAAkBC,eAAQC,KAAYC,eAAQ;EAChD,CAAA;EACAC,QAAeC;AACjB,CAAA;AAEO,IAAMC,gBAAgBhC,UAAUiB,KAAK;EAC1CJ,MAAM;IAAEK,KAAK,GAAGJ,gBAAAA;IAAmCK,MAAM;EAAiB;EAC1EC,UAAU;IAACrB,WAAWsB;;EACtBC,OAAcC,cAAO;IACnBU,SAAS/B,IAAIgC;IACbf,MAAaU,gBAAgBM,aAAM;EACrC,CAAA;EACAL,QAAeP,cAAO;IACpBa,QAAQ1B,QAAQA;EAClB,CAAA;AACF,CAAA;AAEO,IAAM2B,uBAAuBrC,UAAUiB,KAAK;EACjDJ,MAAM;IAAEK,KAAK,GAAGJ,gBAAAA;IAA2CK,MAAM;EAAyB;;;EAG1FC,UAAU;IAACrB,WAAWsB;;EACtBC,OAAcC,cAAO;IACnBe,SAAS5B,QAAQA;IACjB6B,QAAQ/B,MAAMA;IACdgC,MAAaL;EACf,CAAA;EACAL,QAAeC;AACjB,CAAA;AAEO,IAAMU,SAASzC,UAAUiB,KAAK;EACnCJ,MAAM;IAAEK,KAAK,GAAGJ,gBAAAA;IAA2BK,MAAM;EAAgB;EACjEC,UAAU;IAACrB,WAAWsB;;EACtBC,OAAcC,cAAO;IACnBJ,MAAaU,gBAAgBM,aAAM;IACnCO,QAAeb,gBAAgBM,aAAM;IACrCQ,SAASxC,IAAIyC;EACf,CAAA;EACAd,QAAeC;AACjB,CAAA;AAEO,IAAMc,eAAsBtB,cAAO;EACxCuB,QAAQlC,OAAOA,OAAOmC,YAAY;IAAEC,aAAa;EAAsB,CAAA;EACvEN,QAAQjC,WAAWA,WAAWsC,YAAY;IAAEC,aAAa;EAAsB,CAAA;AACjF,CAAA,EAAGpB,KAAYqB,cAAO;AAIf,IAAMC,SAASlD,UAAUiB,KAAK;EACnCJ,MAAM;IAAEK,KAAK,GAAGJ,gBAAAA;IAA2BK,MAAM;EAAgB;EACjEC,UAAU;IAACrB,WAAWsB;;EACtBC,OAAcC,cAAO;IACnBmB,QAAQjC,WAAWA;IACnBkC,SAASxC,IAAIyC;IACbE,QAAejB,gBAASjB,OAAOA,MAAM;EACvC,CAAA;EACAkB,QAAQe;AACV,CAAA;AAEO,IAAMM,SAASnD,UAAUiB,KAAK;EACnCJ,MAAM;IAAEK,KAAK,GAAGJ,gBAAAA;IAA2BK,MAAM;EAAgB;EACjEC,UAAU;IAACrB,WAAWsB;;EACtBC,OAAcC,cAAO;IACnB6B,SAAgBjB;EAClB,CAAA;EACAL,QAAeC;AACjB,CAAA;AAEO,IAAMsB,iBAAiBrD,UAAUiB,KAAK;EAC3CJ,MAAM;IAAEK,KAAK,GAAGJ,gBAAAA;IAAoCK,MAAM;EAAkB;EAC5EC,UAAU;IAACrB,WAAWsB;;EACtBC,OAAcC,cAAO;IACnBuB,QAAQlC,OAAOA;EACjB,CAAA;EACAkB,QAAeC;AACjB,CAAA;AAEO,IAAMuB,aAAatD,UAAUiB,KAAK;EACvCJ,MAAM;IAAEK,KAAK,GAAGJ,gBAAAA;IAAgCK,MAAM;EAAc;EACpEC,UAAU;IAACrB,WAAWsB;;EACtBC,OAAcC,cAAO;IACnBoB,SAASxC,IAAIyC;IACbF,QAAQjC,WAAWA;IACnB8B,QAAQ/B,MAAMA;IACdgC,MAAaL;EACf,CAAA;EACAL,QAAeC;AACjB,CAAA;AAEO,IAAMwB,sBAA6BN,eACjC1B,cAAO;EACZiC,SAAS7C,QAAQA,QAAQoC,YAAY;IAAEC,aAAa;EAAuB,CAAA;EAC3ES,cAAqBC,cAAOX,YAAY;IAAEC,aAAa;EAAgC,CAAA;AACzF,CAAA,CAAA;AAKK,IAAMW,gBAAgB3D,UAAUiB,KAAK;EAC1CJ,MAAM;IAAEK,KAAK,GAAGJ,gBAAAA;IAAmCK,MAAM;EAAiB;EAC1EC,UAAU;IAACrB,WAAWsB;;EACtBC,OAAcC,cAAO;IACnBmB,QAAQjC,WAAWA;IACnBkC,SAASxC,IAAIyC;IACbgB,WAAkBzB;EACpB,CAAA;EACAL,QAAQyB;AACV,CAAA;AAKO,IAAMM,UAAU7D,UAAUiB,KAAK;EACpCJ,MAAM;IAAEK,KAAK,GAAGJ,gBAAAA;IAA4BK,MAAM;EAAiB;EACnEC,UAAU;IAACrB,WAAWsB;;EACtBC,OAAcC,cAAO;IACnBuB,QAAQlC,OAAOA,OAAOmC,YAAY;MAAEC,aAAa;IAAyB,CAAA;IAC1EN,QAAQjC,WAAWA,WAAWsC,YAAY;MAAEC,aAAa;IAAkC,CAAA;EAC7F,CAAA;EACAlB,QAAeC;AACjB,CAAA;AAKO,IAAM+B,iBAAiB9D,UAAUiB,KAAK;EAC3CJ,MAAM;IAAEK,KAAK,GAAGJ,gBAAAA;IAAoCK,MAAM;EAAkB;EAC5EC,UAAU;IAACrB,WAAWsB;;EACtBC,OAAcC,cAAO;IACnBmB,QAAQjC,WAAWA,WAAWsC,YAAY;MAAEC,aAAa;IAA4B,CAAA;IACrFQ,SAAS7C,QAAQA,QAAQoC,YAAY;MAAEC,aAAa;IAA0B,CAAA;IAC9ES,cAAqBC,cAAOX,YAAY;MAAEC,aAAa;IAAuC,CAAA;EAChG,CAAA;EACAlB,QAAeC;AACjB,CAAA;AAEO,IAAMgC,kBAAkB/D,UAAUiB,KAAK;EAC5CJ,MAAM;IACJK,KAAK;IACLC,MAAM;IACN6B,aAAa;EACf;EACA1B,OAAcC,cAAO;IACnByC,KAAK5D,IAAIA,IAAIE,SAAS2D,QAAQ,EAAElB,YAAY;MAC1CC,aAAa;IACf,CAAA;IACAkB,OAAcC,aAAahC,aAAM,EAAEY,YAAY;MAC7CC,aAAa;IACf,CAAA;EACF,CAAA;EACAlB,QAAeC;EACfX,UAAU;IAACnB,SAASoB;;AACtB,CAAA;",
|
|
6
|
+
"names": ["Schema", "Capability", "Operation", "Database", "Key", "Obj", "Ref", "Collection", "Markdown", "SpaceSchema", "Actor", "AnchoredTo", "Channel", "Message", "Thread", "meta", "THREAD_OPERATION", "id", "OnCreateSpace", "make", "key", "name", "services", "Service", "input", "Struct", "space", "rootCollection", "isDefault", "Boolean", "pipe", "optional", "output", "Void", "CreateChannel", "spaceId", "SpaceId", "String", "object", "AppendChannelMessage", "channel", "sender", "text", "Create", "anchor", "subject", "Unknown", "DeleteOutput", "thread", "annotations", "description", "partial", "Delete", "Select", "current", "ToggleResolved", "AddMessage", "DeleteMessageOutput", "message", "messageIndex", "Number", "DeleteMessage", "messageId", "Restore", "RestoreMessage", "CreateProposals", "doc", "Document", "diffs", "Array"]
|
|
7
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
ThreadCapabilities
|
|
4
|
+
} from "./chunk-BVEZBGIY.mjs";
|
|
2
5
|
import {
|
|
3
6
|
Create,
|
|
4
7
|
Select
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
ThreadCapabilities
|
|
8
|
-
} from "./chunk-UGSMYQLZ.mjs";
|
|
8
|
+
} from "./chunk-XKUMDYGR.mjs";
|
|
9
9
|
import "./chunk-HSLMI22Q.mjs";
|
|
10
10
|
|
|
11
11
|
// src/operations/create.ts
|
|
12
12
|
import * as Effect from "effect/Effect";
|
|
13
13
|
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
14
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
15
|
+
import { Operation } from "@dxos/compute";
|
|
14
16
|
import { Obj, Relation } from "@dxos/echo";
|
|
15
|
-
import { Operation } from "@dxos/operation";
|
|
16
|
-
import { DeckOperation } from "@dxos/plugin-deck/operations";
|
|
17
17
|
import { linkedSegment } from "@dxos/react-ui-attention";
|
|
18
18
|
import { AnchoredTo, Thread } from "@dxos/types";
|
|
19
19
|
var handler = Create.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ name, anchor: _anchor, subject }) {
|
|
@@ -45,12 +45,12 @@ var handler = Create.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ n
|
|
|
45
45
|
yield* Operation.invoke(Select, {
|
|
46
46
|
current: Obj.getDXN(thread).toString()
|
|
47
47
|
});
|
|
48
|
-
yield* Operation.invoke(
|
|
49
|
-
|
|
48
|
+
yield* Operation.invoke(LayoutOperation.UpdateCompanion, {
|
|
49
|
+
subject: linkedSegment("comments")
|
|
50
50
|
});
|
|
51
51
|
})));
|
|
52
52
|
var create_default = handler;
|
|
53
53
|
export {
|
|
54
54
|
create_default as default
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=create-
|
|
56
|
+
//# sourceMappingURL=create-DEZFPN2Y.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/create.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { Obj, Relation } from '@dxos/echo';\nimport { linkedSegment } from '@dxos/react-ui-attention';\nimport { AnchoredTo, Thread } from '@dxos/types';\n\nimport { ThreadCapabilities } from '../types';\nimport { Create, Select } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Create> = Create.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ name, anchor: _anchor, subject }) {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(ThreadCapabilities.State);\n const subjectId = Obj.getDXN(subject).toString();\n const thread = Thread.make({ name });\n const anchor = Relation.make(AnchoredTo.AnchoredTo, {\n [Relation.Source]: thread,\n [Relation.Target]: subject,\n anchor: _anchor,\n });\n\n const state = registry.get(stateAtom);\n const existingDrafts = state.drafts[subjectId];\n registry.set(stateAtom, {\n ...state,\n drafts: {\n ...state.drafts,\n [subjectId]: existingDrafts ? [...existingDrafts, anchor] : [anchor],\n },\n });\n\n yield* Operation.invoke(Select, { current: Obj.getDXN(thread).toString() });\n yield* Operation.invoke(LayoutOperation.UpdateCompanion, {\n subject: linkedSegment('comments'),\n });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,KAAKC,gBAAgB;AAC9B,SAASC,qBAAqB;AAC9B,SAASC,YAAYC,cAAc;AAKnC,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,MAAMC,QAAQC,SAASC,QAAO,GAAE;AAC7D,QAAMC,WAAW,OAAOC,WAAWC,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YAAY,OAAOJ,WAAWC,IAAII,mBAAmBC,KAAK;AAChE,QAAMC,YAAYC,IAAIC,OAAOX,OAAAA,EAASY,SAAQ;AAC9C,QAAMC,SAASC,OAAOC,KAAK;IAAElB;EAAK,CAAA;AAClC,QAAMC,SAASkB,SAASD,KAAKE,WAAWA,YAAY;IAClD,CAACD,SAASE,MAAM,GAAGL;IACnB,CAACG,SAASG,MAAM,GAAGnB;IACnBF,QAAQC;EACV,CAAA;AAEA,QAAMqB,QAAQnB,SAASE,IAAIG,SAAAA;AAC3B,QAAMe,iBAAiBD,MAAME,OAAOb,SAAAA;AACpCR,WAASsB,IAAIjB,WAAW;IACtB,GAAGc;IACHE,QAAQ;MACN,GAAGF,MAAME;MACT,CAACb,SAAAA,GAAYY,iBAAiB;WAAIA;QAAgBvB;UAAU;QAACA;;IAC/D;EACF,CAAA;AAEA,SAAOJ,UAAU8B,OAAOC,QAAQ;IAAEC,SAAShB,IAAIC,OAAOE,MAAAA,EAAQD,SAAQ;EAAG,CAAA;AACzE,SAAOlB,UAAU8B,OAAOG,gBAAgBC,iBAAiB;IACvD5B,SAAS6B,cAAc,UAAA;EACzB,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAetC;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "Operation", "Obj", "Relation", "linkedSegment", "AnchoredTo", "Thread", "handler", "Create", "pipe", "Operation", "withHandler", "fnUntraced", "name", "anchor", "_anchor", "subject", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "stateAtom", "ThreadCapabilities", "State", "subjectId", "Obj", "getDXN", "toString", "thread", "Thread", "make", "Relation", "AnchoredTo", "Source", "Target", "state", "existingDrafts", "drafts", "set", "invoke", "Select", "current", "LayoutOperation", "UpdateCompanion", "linkedSegment"]
|
|
7
|
+
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
CreateChannel
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
Channel_exports
|
|
7
|
-
} from "./chunk-UGSMYQLZ.mjs";
|
|
4
|
+
} from "./chunk-XKUMDYGR.mjs";
|
|
8
5
|
import "./chunk-HSLMI22Q.mjs";
|
|
9
6
|
|
|
10
7
|
// src/operations/create-channel.ts
|
|
11
8
|
import * as Effect from "effect/Effect";
|
|
12
|
-
import { Operation } from "@dxos/
|
|
9
|
+
import { Operation } from "@dxos/compute";
|
|
10
|
+
import { Channel } from "@dxos/types";
|
|
13
11
|
var handler = CreateChannel.pipe(Operation.withHandler((input) => Effect.sync(() => ({
|
|
14
|
-
object:
|
|
12
|
+
object: Channel.make({
|
|
15
13
|
name: input.name
|
|
16
14
|
})
|
|
17
15
|
}))));
|
|
@@ -19,4 +17,4 @@ var create_channel_default = handler;
|
|
|
19
17
|
export {
|
|
20
18
|
create_channel_default as default
|
|
21
19
|
};
|
|
22
|
-
//# sourceMappingURL=create-channel-
|
|
20
|
+
//# sourceMappingURL=create-channel-6VHTC2OR.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/create-channel.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\nimport { Channel } from '@dxos/types';\n\nimport { CreateChannel } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateChannel> = CreateChannel.pipe(\n Operation.withHandler((input) =>\n Effect.sync(() => ({\n object: Channel.make({ name: input.name }),\n })),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,eAAe;AAIxB,IAAMC,UAAuDC,cAAcC,KACzEC,UAAUC,YAAY,CAACC,UACdC,YAAK,OAAO;EACjBC,QAAQC,QAAQC,KAAK;IAAEC,MAAML,MAAMK;EAAK,CAAA;AAC1C,EAAA,CAAA,CAAA;AAIJ,IAAA,yBAAeV;",
|
|
6
|
+
"names": ["Effect", "Operation", "Channel", "handler", "CreateChannel", "pipe", "Operation", "withHandler", "input", "sync", "object", "Channel", "make", "name"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
CreateProposals
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-UGSMYQLZ.mjs";
|
|
4
|
+
} from "./chunk-XKUMDYGR.mjs";
|
|
6
5
|
import "./chunk-HSLMI22Q.mjs";
|
|
7
6
|
|
|
8
7
|
// src/operations/create-proposals.ts
|
|
@@ -10,9 +9,9 @@ import * as Array from "effect/Array";
|
|
|
10
9
|
import * as Effect from "effect/Effect";
|
|
11
10
|
import * as Function from "effect/Function";
|
|
12
11
|
import { computeDiffsWithCursors } from "@dxos/assistant";
|
|
12
|
+
import { Operation } from "@dxos/compute";
|
|
13
13
|
import { Database, Obj, Ref, Relation } from "@dxos/echo";
|
|
14
14
|
import { createDocAccessor } from "@dxos/echo-db";
|
|
15
|
-
import { Operation } from "@dxos/operation";
|
|
16
15
|
import { AnchoredTo, Message, Thread } from "@dxos/types";
|
|
17
16
|
var handler = CreateProposals.pipe(Operation.withHandler(Effect.fn(function* ({ doc, diffs }) {
|
|
18
17
|
const object = yield* Database.load(doc);
|
|
@@ -55,4 +54,4 @@ var create_proposals_default = handler;
|
|
|
55
54
|
export {
|
|
56
55
|
create_proposals_default as default
|
|
57
56
|
};
|
|
58
|
-
//# sourceMappingURL=create-proposals-
|
|
57
|
+
//# sourceMappingURL=create-proposals-P5O2ICOL.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/operations/create-proposals.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\n\nimport { computeDiffsWithCursors } from '@dxos/assistant';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,cAAc;AAE1B,SAASC,+BAA+B;AACxC,SAASC,UAAUC,KAAKC,KAAKC,gBAAgB;AAC7C,SAASC,yBAAyB;AAClC,SAASC,
|
|
6
|
-
"names": ["Array", "Effect", "Function", "computeDiffsWithCursors", "Database", "Obj", "Ref", "Relation", "createDocAccessor", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\n\nimport { computeDiffsWithCursors } from '@dxos/assistant';\nimport { Operation } from '@dxos/compute';\nimport { Database, Obj, Ref, Relation } from '@dxos/echo';\nimport { createDocAccessor } from '@dxos/echo-db';\nimport { AnchoredTo, Message, Thread } from '@dxos/types';\n\nimport { CreateProposals } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateProposals> = CreateProposals.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ doc, diffs }) {\n const object = yield* Database.load(doc);\n const content = yield* Effect.promise(() => object.content.load());\n const accessor = createDocAccessor(content, ['content']);\n\n yield* Function.pipe(\n computeDiffsWithCursors(accessor, diffs),\n Array.map(\n Effect.fnUntraced(function* ({ cursor, text }) {\n const proposal = Obj.make(Message.Message, {\n created: new Date().toISOString(),\n sender: { role: 'assistant' },\n blocks: [{ _tag: 'proposal', text }],\n });\n const thread = Thread.make({ name: 'Proposal', messages: [Ref.make(proposal)], status: 'active' });\n const relation = Relation.make(AnchoredTo.AnchoredTo, {\n [Relation.Source]: thread,\n [Relation.Target]: object,\n anchor: cursor,\n });\n yield* Database.add(thread);\n yield* Database.add(relation);\n }),\n ),\n Effect.allWith({ concurrency: 'unbounded' }),\n );\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,YAAYA,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,cAAc;AAE1B,SAASC,+BAA+B;AACxC,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,KAAKC,KAAKC,gBAAgB;AAC7C,SAASC,yBAAyB;AAClC,SAASC,YAAYC,SAASC,cAAc;AAI5C,IAAMC,UAAyDC,gBAAgBC,KAC7EC,UAAUC,YACDC,UAAG,WAAW,EAAEC,KAAKC,MAAK,GAAE;AACjC,QAAMC,SAAS,OAAOC,SAASC,KAAKJ,GAAAA;AACpC,QAAMK,UAAU,OAAcC,eAAQ,MAAMJ,OAAOG,QAAQD,KAAI,CAAA;AAC/D,QAAMG,WAAWC,kBAAkBH,SAAS;IAAC;GAAU;AAEvD,SAAgBT,cACda,wBAAwBF,UAAUN,KAAAA,GAC5BS,UACGC,kBAAW,WAAW,EAAEC,QAAQC,KAAI,GAAE;AAC3C,UAAMC,WAAWC,IAAIC,KAAKC,QAAQA,SAAS;MACzCC,UAAS,oBAAIC,KAAAA,GAAOC,YAAW;MAC/BC,QAAQ;QAAEC,MAAM;MAAY;MAC5BC,QAAQ;QAAC;UAAEC,MAAM;UAAYX;QAAK;;IACpC,CAAA;AACA,UAAMY,SAASC,OAAOV,KAAK;MAAEW,MAAM;MAAYC,UAAU;QAACC,IAAIb,KAAKF,QAAAA;;MAAYgB,QAAQ;IAAS,CAAA;AAChG,UAAMC,WAAWC,SAAShB,KAAKiB,WAAWA,YAAY;MACpD,CAACD,SAASE,MAAM,GAAGT;MACnB,CAACO,SAASG,MAAM,GAAGjC;MACnBkC,QAAQxB;IACV,CAAA;AACA,WAAOT,SAASkC,IAAIZ,MAAAA;AACpB,WAAOtB,SAASkC,IAAIN,QAAAA;EACtB,CAAA,CAAA,GAEKO,eAAQ;IAAEC,aAAa;EAAY,CAAA,CAAA;AAE9C,CAAA,CAAA,CAAA;AAIJ,IAAA,2BAAe7C;",
|
|
6
|
+
"names": ["Array", "Effect", "Function", "computeDiffsWithCursors", "Operation", "Database", "Obj", "Ref", "Relation", "createDocAccessor", "AnchoredTo", "Message", "Thread", "handler", "CreateProposals", "pipe", "Operation", "withHandler", "fn", "doc", "diffs", "object", "Database", "load", "content", "promise", "accessor", "createDocAccessor", "computeDiffsWithCursors", "map", "fnUntraced", "cursor", "text", "proposal", "Obj", "make", "Message", "created", "Date", "toISOString", "sender", "role", "blocks", "_tag", "thread", "Thread", "name", "messages", "Ref", "status", "relation", "Relation", "AnchoredTo", "Source", "Target", "anchor", "add", "allWith", "concurrency"]
|
|
7
7
|
}
|