@dxos/plugin-thread 0.8.4-main.422d1c7879 → 0.8.4-main.51f1e5ca51
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 → add-message-OC4QB4I2.mjs} +7 -15
- package/dist/lib/browser/add-message-OC4QB4I2.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-MESW3R4Q.mjs → chunk-J67QAUIW.mjs} +1 -1
- package/dist/lib/browser/{chunk-MESW3R4Q.mjs.map → chunk-J67QAUIW.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-VPM44Z35.mjs → chunk-KCMJ7H7F.mjs} +3 -3
- package/dist/lib/browser/chunk-KCMJ7H7F.mjs.map +7 -0
- package/dist/lib/browser/{create-UGT7V733.mjs → create-IUWQEW74.mjs} +4 -4
- package/dist/lib/browser/create-IUWQEW74.mjs.map +7 -0
- package/dist/lib/browser/{create-channel-EF67LCS6.mjs → create-channel-CBC5WEFG.mjs} +4 -4
- package/dist/lib/browser/{create-channel-EF67LCS6.mjs.map → create-channel-CBC5WEFG.mjs.map} +1 -1
- package/dist/lib/browser/{create-channel-thread-CCZTSWQ6.mjs → create-channel-thread-JJ5LQ3OZ.mjs} +5 -5
- package/dist/lib/browser/create-channel-thread-JJ5LQ3OZ.mjs.map +7 -0
- package/dist/lib/browser/{create-proposals-CMK7S7VS.mjs → create-proposals-RHLVRJZ4.mjs} +4 -4
- package/dist/lib/browser/{create-proposals-CMK7S7VS.mjs.map → create-proposals-RHLVRJZ4.mjs.map} +3 -3
- package/dist/lib/browser/{delete-FSFVU6ZA.mjs → delete-PVIEGTTY.mjs} +4 -4
- package/dist/lib/browser/delete-PVIEGTTY.mjs.map +7 -0
- package/dist/lib/browser/{delete-message-XL5M5J33.mjs → delete-message-TLVRPLJF.mjs} +6 -14
- package/dist/lib/browser/delete-message-TLVRPLJF.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +72 -458
- 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 → on-create-space-KRTKYRFU.mjs} +4 -4
- package/dist/lib/browser/{on-create-space-VYS2JGVT.mjs.map → on-create-space-KRTKYRFU.mjs.map} +1 -1
- package/dist/lib/browser/operations/index.mjs +4 -4
- package/dist/lib/browser/operations/index.mjs.map +3 -3
- package/dist/lib/browser/{restore-2ZGMKUSD.mjs → restore-AVE55SJF.mjs} +4 -4
- package/dist/lib/browser/restore-AVE55SJF.mjs.map +7 -0
- package/dist/lib/browser/{restore-message-OYEGWPII.mjs → restore-message-F57RMGDJ.mjs} +6 -14
- package/dist/lib/browser/restore-message-F57RMGDJ.mjs.map +7 -0
- package/dist/lib/browser/{select-VG2XLULE.mjs → select-BJDZJI64.mjs} +4 -4
- package/dist/lib/browser/{select-VG2XLULE.mjs.map → select-BJDZJI64.mjs.map} +1 -1
- package/dist/lib/browser/{toggle-resolved-MM6YC5BU.mjs → toggle-resolved-HQE5P7BV.mjs} +6 -14
- package/dist/lib/browser/toggle-resolved-HQE5P7BV.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 -1
- package/dist/lib/node-esm/{add-message-XWKHLNS6.mjs → add-message-HJXNAILW.mjs} +7 -15
- package/dist/lib/node-esm/add-message-HJXNAILW.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-SDRAQNSQ.mjs → chunk-2Q6V7NGK.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-SDRAQNSQ.mjs.map → chunk-2Q6V7NGK.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-JTHXNWKJ.mjs → chunk-4KRVIOPC.mjs} +3 -3
- package/dist/lib/node-esm/chunk-4KRVIOPC.mjs.map +7 -0
- package/dist/lib/node-esm/{create-XAYNDVU2.mjs → create-NALJT67D.mjs} +4 -4
- package/dist/lib/node-esm/create-NALJT67D.mjs.map +7 -0
- package/dist/lib/node-esm/{create-channel-UYWUNB3L.mjs → create-channel-CS2EAYJF.mjs} +4 -4
- package/dist/lib/node-esm/{create-channel-UYWUNB3L.mjs.map → create-channel-CS2EAYJF.mjs.map} +1 -1
- package/dist/lib/node-esm/{create-channel-thread-UQF2SBHS.mjs → create-channel-thread-KZZFZDTU.mjs} +5 -5
- package/dist/lib/node-esm/create-channel-thread-KZZFZDTU.mjs.map +7 -0
- package/dist/lib/node-esm/{create-proposals-5FJNURKH.mjs → create-proposals-AFAYZQBI.mjs} +4 -4
- package/dist/lib/node-esm/{create-proposals-5FJNURKH.mjs.map → create-proposals-AFAYZQBI.mjs.map} +3 -3
- package/dist/lib/node-esm/{delete-WRODXR3E.mjs → delete-HQJVZY7Q.mjs} +4 -4
- package/dist/lib/node-esm/delete-HQJVZY7Q.mjs.map +7 -0
- package/dist/lib/node-esm/{delete-message-TAHCYTW2.mjs → delete-message-VVPEYLV4.mjs} +6 -14
- package/dist/lib/node-esm/delete-message-VVPEYLV4.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +72 -458
- 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 → on-create-space-2UX7Z5EQ.mjs} +4 -4
- package/dist/lib/node-esm/{on-create-space-XDY2YXPV.mjs.map → on-create-space-2UX7Z5EQ.mjs.map} +1 -1
- package/dist/lib/node-esm/operations/index.mjs +4 -4
- package/dist/lib/node-esm/operations/index.mjs.map +3 -3
- package/dist/lib/node-esm/{restore-T3QA7TSL.mjs → restore-FMIWJR5T.mjs} +4 -4
- package/dist/lib/node-esm/restore-FMIWJR5T.mjs.map +7 -0
- package/dist/lib/node-esm/{restore-message-WFTEVBEV.mjs → restore-message-3L7AMQMG.mjs} +6 -14
- package/dist/lib/node-esm/restore-message-3L7AMQMG.mjs.map +7 -0
- package/dist/lib/node-esm/{select-Q4UDWJJF.mjs → select-VCAFISBK.mjs} +4 -4
- package/dist/lib/node-esm/{select-Q4UDWJJF.mjs.map → select-VCAFISBK.mjs.map} +1 -1
- package/dist/lib/node-esm/{toggle-resolved-33XTAK2H.mjs → toggle-resolved-JDZZ257P.mjs} +6 -14
- package/dist/lib/node-esm/toggle-resolved-JDZZ257P.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 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- 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 +1 -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 +3 -3
- 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.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 +4 -4
- package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
- 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/containers/CallDebugPanel/CallDebugPanel.d.ts.map +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/ChatContainer/ChatContainer.d.ts +1 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts +70 -70
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.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/operations/add-message.d.ts +1 -1
- package/dist/types/src/operations/add-message.d.ts.map +1 -1
- package/dist/types/src/operations/create-channel-thread.d.ts +1 -1
- package/dist/types/src/operations/create-channel-thread.d.ts.map +1 -1
- 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 +825 -825
- 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/Channel.d.ts +177 -177
- package/dist/types/src/types/Channel.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.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 +59 -54
- package/src/ThreadPlugin.tsx +4 -5
- 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/capabilities/app-graph-builder.ts +1 -1
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/markdown.ts +7 -3
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/components/Call/Call.tsx +5 -5
- package/src/components/CommentsPanel/CommentsPanel.stories.tsx +5 -3
- package/src/components/Lobby/Lobby.tsx +5 -4
- 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/containers/ChannelContainer/ChannelContainer.stories.tsx +39 -7
- package/src/containers/ChatContainer/ChatContainer.stories.tsx +1 -1
- package/src/containers/ChatContainer/ChatContainer.tsx +1 -6
- package/src/extensions/threads.ts +7 -7
- package/src/operations/add-message.ts +3 -3
- package/src/operations/create-channel-thread.ts +2 -2
- package/src/operations/create-channel.ts +1 -1
- package/src/operations/create-proposals.ts +1 -1
- package/src/operations/create.ts +1 -1
- package/src/operations/definitions.ts +1 -1
- package/src/operations/delete-message.ts +2 -2
- package/src/operations/delete.ts +1 -1
- package/src/operations/index.ts +1 -1
- 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/dist/lib/browser/add-message-VPPFFLFL.mjs.map +0 -7
- package/dist/lib/browser/chunk-VPM44Z35.mjs.map +0 -7
- package/dist/lib/browser/create-UGT7V733.mjs.map +0 -7
- package/dist/lib/browser/create-channel-thread-CCZTSWQ6.mjs.map +0 -7
- package/dist/lib/browser/delete-FSFVU6ZA.mjs.map +0 -7
- package/dist/lib/browser/delete-message-XL5M5J33.mjs.map +0 -7
- package/dist/lib/browser/restore-2ZGMKUSD.mjs.map +0 -7
- package/dist/lib/browser/restore-message-OYEGWPII.mjs.map +0 -7
- package/dist/lib/browser/toggle-resolved-MM6YC5BU.mjs.map +0 -7
- package/dist/lib/node-esm/add-message-XWKHLNS6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JTHXNWKJ.mjs.map +0 -7
- package/dist/lib/node-esm/create-XAYNDVU2.mjs.map +0 -7
- package/dist/lib/node-esm/create-channel-thread-UQF2SBHS.mjs.map +0 -7
- package/dist/lib/node-esm/delete-WRODXR3E.mjs.map +0 -7
- package/dist/lib/node-esm/delete-message-TAHCYTW2.mjs.map +0 -7
- package/dist/lib/node-esm/restore-T3QA7TSL.mjs.map +0 -7
- package/dist/lib/node-esm/restore-message-WFTEVBEV.mjs.map +0 -7
- package/dist/lib/node-esm/toggle-resolved-33XTAK2H.mjs.map +0 -7
- package/dist/types/src/testing/stories.d.ts +0 -3
- package/dist/types/src/testing/stories.d.ts.map +0 -1
- package/src/testing/stories.ts +0 -51
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
7
8
|
import { Obj, Ref } from '@dxos/echo';
|
|
8
|
-
import { Operation } from '@dxos/operation';
|
|
9
9
|
import { Thread } from '@dxos/types';
|
|
10
10
|
|
|
11
11
|
import { CreateChannelThread } from './definitions';
|
|
@@ -15,7 +15,7 @@ const handler: Operation.WithHandler<typeof CreateChannelThread> = CreateChannel
|
|
|
15
15
|
Effect.sync(() => {
|
|
16
16
|
const thread = Thread.make({ status: 'active' });
|
|
17
17
|
const threadRef = Ref.make(thread);
|
|
18
|
-
Obj.
|
|
18
|
+
Obj.update(input.channel, (obj) => {
|
|
19
19
|
obj.threads.push(threadRef);
|
|
20
20
|
});
|
|
21
21
|
return { object: thread };
|
|
@@ -7,9 +7,9 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import * as Function from 'effect/Function';
|
|
8
8
|
|
|
9
9
|
import { computeDiffsWithCursors } from '@dxos/assistant';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
10
11
|
import { Database, Obj, Ref, Relation } from '@dxos/echo';
|
|
11
12
|
import { createDocAccessor } from '@dxos/echo-db';
|
|
12
|
-
import { Operation } from '@dxos/operation';
|
|
13
13
|
import { AnchoredTo, Message, Thread } from '@dxos/types';
|
|
14
14
|
|
|
15
15
|
import { CreateProposals } from './definitions';
|
package/src/operations/create.ts
CHANGED
|
@@ -6,8 +6,8 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
8
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
9
10
|
import { Obj, Relation } from '@dxos/echo';
|
|
10
|
-
import { Operation } from '@dxos/operation';
|
|
11
11
|
import { linkedSegment } from '@dxos/react-ui-attention';
|
|
12
12
|
import { AnchoredTo, Thread } from '@dxos/types';
|
|
13
13
|
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
8
9
|
import { Database, Key, Obj, Ref } from '@dxos/echo';
|
|
9
10
|
import { Collection } from '@dxos/echo';
|
|
10
|
-
import { Operation } from '@dxos/operation';
|
|
11
11
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
12
12
|
import { SpaceSchema } from '@dxos/react-client/echo';
|
|
13
13
|
import { Actor, AnchoredTo, Message, Thread } from '@dxos/types';
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
7
8
|
import { Obj, Relation } from '@dxos/echo';
|
|
8
9
|
import { invariant } from '@dxos/invariant';
|
|
9
|
-
import { Operation } from '@dxos/operation';
|
|
10
10
|
import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
|
|
11
11
|
import { Thread } from '@dxos/types';
|
|
12
12
|
|
|
@@ -31,7 +31,7 @@ const handler: Operation.WithHandler<typeof DeleteMessage> = DeleteMessage.pipe(
|
|
|
31
31
|
return { messageIndex: -1 };
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
Obj.
|
|
34
|
+
Obj.update(thread, (thread) => {
|
|
35
35
|
thread.messages.splice(msgIndex, 1);
|
|
36
36
|
});
|
|
37
37
|
|
package/src/operations/delete.ts
CHANGED
|
@@ -6,8 +6,8 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
8
|
import { sleep } from '@dxos/async';
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
9
10
|
import { Obj, Relation } from '@dxos/echo';
|
|
10
|
-
import { Operation } from '@dxos/operation';
|
|
11
11
|
import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
|
|
12
12
|
import { Thread } from '@dxos/types';
|
|
13
13
|
|
package/src/operations/index.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
7
8
|
import { Obj, Ref, Relation } from '@dxos/echo';
|
|
8
9
|
import { invariant } from '@dxos/invariant';
|
|
9
|
-
import { Operation } from '@dxos/operation';
|
|
10
10
|
import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
|
|
11
11
|
import { Thread } from '@dxos/types';
|
|
12
12
|
|
|
@@ -19,7 +19,7 @@ const handler: Operation.WithHandler<typeof RestoreMessage> = RestoreMessage.pip
|
|
|
19
19
|
const db = Obj.getDatabase(thread);
|
|
20
20
|
invariant(db, 'Database not found');
|
|
21
21
|
|
|
22
|
-
Obj.
|
|
22
|
+
Obj.update(thread, (thread) => {
|
|
23
23
|
thread.messages.splice(messageIndex, 0, Ref.make(message));
|
|
24
24
|
});
|
|
25
25
|
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { sleep } from '@dxos/async';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
8
9
|
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { Operation } from '@dxos/operation';
|
|
10
10
|
import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
|
|
11
11
|
|
|
12
12
|
import { Restore } from './definitions';
|
package/src/operations/select.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
-
import { Operation } from '@dxos/
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
9
|
|
|
10
10
|
import { ThreadCapabilities } from '../types';
|
|
11
11
|
import { Select } from './definitions';
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
7
8
|
import { Obj } from '@dxos/echo';
|
|
8
9
|
import { invariant } from '@dxos/invariant';
|
|
9
|
-
import { Operation } from '@dxos/operation';
|
|
10
10
|
import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
|
|
11
11
|
|
|
12
12
|
import { ToggleResolved } from './definitions';
|
|
@@ -16,7 +16,7 @@ const handler: Operation.WithHandler<typeof ToggleResolved> = ToggleResolved.pip
|
|
|
16
16
|
Effect.fnUntraced(function* (input) {
|
|
17
17
|
const thread = input.thread;
|
|
18
18
|
|
|
19
|
-
Obj.
|
|
19
|
+
Obj.update(thread, (thread) => {
|
|
20
20
|
if (thread.status === 'active' || thread.status === undefined) {
|
|
21
21
|
thread.status = 'resolved';
|
|
22
22
|
} else if (thread.status === 'resolved') {
|
package/src/testing/index.ts
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
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 { Obj, Ref, Relation } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { Operation } from '@dxos/operation';\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.change(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.change(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,KAAKC,KAAKC,gBAAgB;AACnC,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AACvC,SAASC,sBAAsB;AAC/B,SAASC,YAAYC,eAAuB;;AAK5C,IAAMC,UAAoDC,WAAWC,KACnEC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,QAAQC,SAASC,QAAQC,KAAI,GAAE;AAC5D,QAAMC,WAAW,OAAOC,WAAWC,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YAAY,OAAOJ,WAAWC,IAAII,mBAAmBC,KAAK;AAChE,QAAMC,SAASC,SAASC,UAAUd,MAAAA;AAClC,QAAMe,YAAYC,IAAIC,OAAOhB,OAAAA,EAASiB,SAAQ;AAC9C,QAAMC,KAAKH,IAAII,YAAYnB,OAAAA;AAC3BoB,YAAUF,IAAI,sBAAA;;;;;;;;;AAEd,QAAMG,UAAUN,IAAIO,KAAKC,QAAQA,SAAS;IACxCC,UAAS,oBAAIC,KAAAA,GAAOC,YAAW;IAC/BzB;IACA0B,QAAQ;MAAC;QAAEC,MAAM;QAAQ1B;MAAK;;EAChC,CAAA;AACAa,MAAIc,OAAOlB,QAAQ,CAACA,YAAAA;AAClBA,IAAAA,QAAOmB,SAASC,KAAKC,IAAIV,KAAKD,OAAAA,CAAAA;EAChC,CAAA;AAEA,QAAMY,QAAQ9B,SAASE,IAAIG,SAAAA;AAC3B,QAAM0B,QAAQD,MAAME,OAAOrB,SAAAA,GAAYsB,KAAK,CAACC,MAAsBA,EAAEC,OAAOvC,OAAOuC,EAAE;AACrF,MAAIJ,OAAO;AACTnB,QAAIc,OAAOlB,QAAQ,CAACA,YAAAA;AAClBA,MAAAA,QAAO4B,SAAS;IAClB,CAAA;AACApC,aAASqC,IAAIhC,WAAW;MACtB,GAAGyB;MACHE,QAAQ;QACN,GAAGF,MAAME;QACT,CAACrB,SAAAA,GAAYmB,MAAME,OAAOrB,SAAAA,GAAY2B,OAAO,CAACJ,MAAsBA,EAAEC,OAAOvC,OAAOuC,EAAE;MACxF;IACF,CAAA;AACA,WAAO1C,UAAU8C,OAAOC,eAAeC,WAAW;MAAEC,QAAQlC;MAAQmC,QAAQ5B;MAAI6B,QAAQ;IAAK,CAAA;AAC7F,WAAOnD,UAAU8C,OAAOC,eAAeK,aAAa;MAClD9B;MACA+B,QAAQC,WAAWA;MACnBC,QAAQxC;MACRmC,QAAQ9C;MACRoD,QAAQ;QAAErD,QAAQmC,MAAMnC;MAAO;IACjC,CAAA;AACA,WAAOH,UAAUyD,SAASC,uBAAuBC,WAAW;MAC1DC,MAAM;MACNC,YAAY;QACVC,SAASxC,GAAGwC;QACZC,UAAUhD,OAAO2B;MACnB;IACF,CAAA;EACF;AAEA,SAAO1C,UAAUyD,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAASxC,GAAGwC;MACZC,UAAUhD,OAAO2B;MACjBsB,cAAcjD,OAAOmB,SAAS+B;MAC9BC,WAAWzC,QAAQiB;MACnByB,eAAe7D,KAAK2D;IACtB;EACF,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,sBAAepE;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "Obj", "Ref", "Relation", "invariant", "Operation", "ObservabilityOperation", "SpaceOperation", "AnchoredTo", "Message", "handler", "AddMessage", "pipe", "Operation", "withHandler", "fnUntraced", "anchor", "subject", "sender", "text", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "stateAtom", "ThreadCapabilities", "State", "thread", "Relation", "getSource", "subjectId", "Obj", "getDXN", "toString", "db", "getDatabase", "invariant", "message", "make", "Message", "created", "Date", "toISOString", "blocks", "_tag", "change", "messages", "push", "Ref", "state", "draft", "drafts", "find", "a", "id", "status", "set", "filter", "invoke", "SpaceOperation", "AddObject", "object", "target", "hidden", "AddRelation", "schema", "AnchoredTo", "source", "fields", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId", "threadLength", "length", "messageId", "messageLength"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { Database, Key, Obj, Ref } from '@dxos/echo';\nimport { Collection } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { Markdown } from '@dxos/plugin-markdown/types';\nimport { SpaceSchema } from '@dxos/react-client/echo';\nimport { Actor, AnchoredTo, Message, Thread } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nimport { Channel } from '../types';\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 CreateChannelThread = Operation.make({\n meta: { key: `${THREAD_OPERATION}.create-channel-thread`, name: 'Create Channel Thread' },\n services: [Capability.Service],\n input: Schema.Struct({\n channel: Channel.Channel,\n }),\n output: Schema.Struct({\n object: Thread.Thread,\n }),\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,UAAUC,KAAKC,KAAKC,WAAW;AACxC,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,OAAOC,YAAYC,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C4D,SAAS1D;;AACtB,CAAA;",
|
|
6
|
-
"names": ["Schema", "Capability", "Database", "Key", "Obj", "Ref", "Collection", "Operation", "Markdown", "SpaceSchema", "Actor", "AnchoredTo", "Message", "Thread", "meta", "THREAD_OPERATION", "meta", "id", "OnCreateSpace", "Operation", "make", "key", "name", "services", "Capability", "Service", "input", "Struct", "space", "SpaceSchema", "rootCollection", "Collection", "isDefault", "Boolean", "pipe", "optional", "output", "Void", "CreateChannel", "spaceId", "Key", "SpaceId", "String", "object", "Channel", "CreateChannelThread", "channel", "Thread", "Create", "anchor", "subject", "Obj", "Unknown", "DeleteOutput", "thread", "annotations", "description", "AnchoredTo", "partial", "Delete", "Select", "current", "ToggleResolved", "AddMessage", "sender", "Actor", "text", "DeleteMessageOutput", "message", "Message", "messageIndex", "Number", "DeleteMessage", "messageId", "Restore", "RestoreMessage", "CreateProposals", "doc", "Ref", "Markdown", "Document", "diffs", "Array", "Database"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { Obj, Relation } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\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,KAAKC,gBAAgB;AAC9B,SAASC,iBAAiB;AAC1B,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", "Obj", "Relation", "Operation", "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,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/create-channel-thread.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Obj, Ref } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { Thread } from '@dxos/types';\n\nimport { CreateChannelThread } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateChannelThread> = CreateChannelThread.pipe(\n Operation.withHandler((input) =>\n Effect.sync(() => {\n const thread = Thread.make({ status: 'active' });\n const threadRef = Ref.make(thread);\n Obj.change(input.channel, (obj) => {\n obj.threads.push(threadRef);\n });\n return { object: thread };\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,WAAW;AACzB,SAASC,iBAAiB;AAC1B,SAASC,cAAc;AAIvB,IAAMC,UAA6DC,oBAAoBC,KACrFC,UAAUC,YAAY,CAACC,UACdC,YAAK,MAAA;AACV,QAAMC,SAASC,OAAOC,KAAK;IAAEC,QAAQ;EAAS,CAAA;AAC9C,QAAMC,YAAYC,IAAIH,KAAKF,MAAAA;AAC3BM,MAAIC,OAAOT,MAAMU,SAAS,CAACC,QAAAA;AACzBA,QAAIC,QAAQC,KAAKP,SAAAA;EACnB,CAAA;AACA,SAAO;IAAEQ,QAAQZ;EAAO;AAC1B,CAAA,CAAA,CAAA;AAIJ,IAAA,gCAAeP;",
|
|
6
|
-
"names": ["Effect", "Obj", "Ref", "Operation", "Thread", "handler", "CreateChannelThread", "pipe", "Operation", "withHandler", "input", "sync", "thread", "Thread", "make", "status", "threadRef", "Ref", "Obj", "change", "channel", "obj", "threads", "push", "object"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/delete.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 { sleep } from '@dxos/async';\nimport { Obj, Relation } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\nimport { Thread } from '@dxos/types';\n\nimport { ThreadCapabilities } from '../types';\nimport { Delete } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Delete> = Delete.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ subject, anchor, thread: _thread }) {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(ThreadCapabilities.State);\n const thread = _thread ?? (Relation.getSource(anchor) as Thread.Thread);\n const subjectId = Obj.getDXN(subject).toString();\n const state = registry.get(stateAtom);\n const draft = state.drafts[subjectId];\n if (draft) {\n const index = draft.findIndex((a: { id: string }) => a.id === anchor.id);\n if (index !== -1) {\n registry.set(stateAtom, {\n ...state,\n drafts: {\n ...state.drafts,\n [subjectId]: state.drafts[subjectId]?.filter((_, i) => i !== index),\n },\n });\n return {};\n }\n }\n\n const db = Obj.getDatabase(thread);\n if (!db) {\n return {};\n }\n\n // TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.\n db.remove(anchor);\n yield* Effect.promise(() => sleep(100));\n db.remove(thread);\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.delete',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n },\n });\n\n return { thread, anchor };\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,aAAa;AACtB,SAASC,KAAKC,gBAAgB;AAC9B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AAMvC,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,SAASC,QAAQC,QAAQC,QAAO,GAAE;AAC/D,QAAMC,WAAW,OAAOC,WAAWC,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YAAY,OAAOJ,WAAWC,IAAII,mBAAmBC,KAAK;AAChE,QAAMT,SAASC,WAAYS,SAASC,UAAUZ,MAAAA;AAC9C,QAAMa,YAAYC,IAAIC,OAAOhB,OAAAA,EAASiB,SAAQ;AAC9C,QAAMC,QAAQd,SAASE,IAAIG,SAAAA;AAC3B,QAAMU,QAAQD,MAAME,OAAON,SAAAA;AAC3B,MAAIK,OAAO;AACT,UAAME,QAAQF,MAAMG,UAAU,CAACC,MAAsBA,EAAEC,OAAOvB,OAAOuB,EAAE;AACvE,QAAIH,UAAU,IAAI;AAChBjB,eAASqB,IAAIhB,WAAW;QACtB,GAAGS;QACHE,QAAQ;UACN,GAAGF,MAAME;UACT,CAACN,SAAAA,GAAYI,MAAME,OAAON,SAAAA,GAAYY,OAAO,CAACC,GAAGC,MAAMA,MAAMP,KAAAA;QAC/D;MACF,CAAA;AACA,aAAO,CAAC;IACV;EACF;AAEA,QAAMQ,KAAKd,IAAIe,YAAY5B,MAAAA;AAC3B,MAAI,CAAC2B,IAAI;AACP,WAAO,CAAC;EACV;AAGAA,KAAGE,OAAO9B,MAAAA;AACV,SAAc+B,eAAQ,MAAMC,MAAM,GAAA,CAAA;AAClCJ,KAAGE,OAAO7B,MAAAA;AAEV,SAAOL,UAAUqC,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAASV,GAAGU;MACZC,UAAUtC,OAAOsB;IACnB;EACF,CAAA;AAEA,SAAO;IAAEtB;IAAQD;EAAO;AAC1B,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAeP;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "sleep", "Obj", "Relation", "Operation", "ObservabilityOperation", "handler", "Delete", "pipe", "Operation", "withHandler", "fnUntraced", "subject", "anchor", "thread", "_thread", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "stateAtom", "ThreadCapabilities", "State", "Relation", "getSource", "subjectId", "Obj", "getDXN", "toString", "state", "draft", "drafts", "index", "findIndex", "a", "id", "set", "filter", "_", "i", "db", "getDatabase", "remove", "promise", "sleep", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/delete-message.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Obj, Relation } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\nimport { Thread } from '@dxos/types';\n\nimport { Delete, DeleteMessage } from './definitions';\n\nconst handler: Operation.WithHandler<typeof DeleteMessage> = DeleteMessage.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ subject, anchor, messageId }) {\n const thread = Relation.getSource(anchor) as Thread.Thread;\n const db = Obj.getDatabase(subject);\n invariant(db, 'Database not found');\n\n const msgIndex = thread.messages.findIndex((ref) => ref.target?.id === messageId);\n const msg = thread.messages[msgIndex]?.target;\n if (!msg) {\n return { messageIndex: -1 };\n }\n\n if (msgIndex === 0 && thread.messages.length === 1) {\n // TODO(wittjosiah): This doesn't support restoring the thread.\n yield* Operation.invoke(Delete, { subject, anchor });\n return { messageIndex: -1 };\n }\n\n Obj.change(thread, (thread) => {\n thread.messages.splice(msgIndex, 1);\n });\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.message.delete',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n threadLength: thread.messages.length,\n messageId,\n },\n });\n\n return { message: msg, messageIndex: msgIndex };\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,gBAAgB;AAC9B,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;;AAKvC,IAAMC,UAAuDC,cAAcC,KACzEC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,SAASC,QAAQC,UAAS,GAAE;AACzD,QAAMC,SAASC,SAASC,UAAUJ,MAAAA;AAClC,QAAMK,KAAKC,IAAIC,YAAYR,OAAAA;AAC3BS,YAAUH,IAAI,sBAAA;;;;;;;;;AAEd,QAAMI,WAAWP,OAAOQ,SAASC,UAAU,CAACC,QAAQA,IAAIC,QAAQC,OAAOb,SAAAA;AACvE,QAAMc,MAAMb,OAAOQ,SAASD,QAAAA,GAAWI;AACvC,MAAI,CAACE,KAAK;AACR,WAAO;MAAEC,cAAc;IAAG;EAC5B;AAEA,MAAIP,aAAa,KAAKP,OAAOQ,SAASO,WAAW,GAAG;AAElD,WAAOrB,UAAUsB,OAAOC,QAAQ;MAAEpB;MAASC;IAAO,CAAA;AAClD,WAAO;MAAEgB,cAAc;IAAG;EAC5B;AAEAV,MAAIc,OAAOlB,QAAQ,CAACA,YAAAA;AAClBA,IAAAA,QAAOQ,SAASW,OAAOZ,UAAU,CAAA;EACnC,CAAA;AAEA,SAAOb,UAAU0B,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAAStB,GAAGsB;MACZC,UAAU1B,OAAOY;MACjBe,cAAc3B,OAAOQ,SAASO;MAC9BhB;IACF;EACF,CAAA;AAEA,SAAO;IAAE6B,SAASf;IAAKC,cAAcP;EAAS;AAChD,CAAA,CAAA,CAAA;AAIJ,IAAA,yBAAehB;",
|
|
6
|
-
"names": ["Effect", "Obj", "Relation", "invariant", "Operation", "ObservabilityOperation", "handler", "DeleteMessage", "pipe", "Operation", "withHandler", "fnUntraced", "subject", "anchor", "messageId", "thread", "Relation", "getSource", "db", "Obj", "getDatabase", "invariant", "msgIndex", "messages", "findIndex", "ref", "target", "id", "msg", "messageIndex", "length", "invoke", "Delete", "change", "splice", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId", "threadLength", "message"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/restore.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { sleep } from '@dxos/async';\nimport { Obj } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\n\nimport { Restore } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Restore> = Restore.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ thread, anchor }) {\n const db = Obj.getDatabase(thread);\n if (!db) {\n return;\n }\n\n // TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.\n db.add(thread);\n yield* Effect.promise(() => sleep(100));\n db.add(anchor);\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.undo-delete',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n },\n });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,aAAa;AACtB,SAASC,WAAW;AACpB,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AAIvC,IAAMC,UAAiDC,QAAQC,KAC7DC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,QAAQC,OAAM,GAAE;AAC7C,QAAMC,KAAKC,IAAIC,YAAYJ,MAAAA;AAC3B,MAAI,CAACE,IAAI;AACP;EACF;AAGAA,KAAGG,IAAIL,MAAAA;AACP,SAAcM,eAAQ,MAAMC,MAAM,GAAA,CAAA;AAClCL,KAAGG,IAAIJ,MAAAA;AAEP,SAAOJ,UAAUW,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAASX,GAAGW;MACZC,UAAUd,OAAOe;IACnB;EACF,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,kBAAerB;",
|
|
6
|
-
"names": ["Effect", "sleep", "Obj", "Operation", "ObservabilityOperation", "handler", "Restore", "pipe", "Operation", "withHandler", "fnUntraced", "thread", "anchor", "db", "Obj", "getDatabase", "add", "promise", "sleep", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId", "id"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/restore-message.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Obj, Ref, Relation } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\nimport { Thread } from '@dxos/types';\n\nimport { RestoreMessage } from './definitions';\n\nconst handler: Operation.WithHandler<typeof RestoreMessage> = RestoreMessage.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ anchor, message, messageIndex }) {\n const thread = Relation.getSource(anchor) as Thread.Thread;\n const db = Obj.getDatabase(thread);\n invariant(db, 'Database not found');\n\n Obj.change(thread, (thread) => {\n thread.messages.splice(messageIndex, 0, Ref.make(message));\n });\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.message.undo-delete',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n messageId: message.id,\n },\n });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,KAAKC,gBAAgB;AACnC,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;;AAKvC,IAAMC,UAAwDC,eAAeC,KAC3EC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,QAAQC,SAASC,aAAY,GAAE;AAC5D,QAAMC,SAASC,SAASC,UAAUL,MAAAA;AAClC,QAAMM,KAAKC,IAAIC,YAAYL,MAAAA;AAC3BM,YAAUH,IAAI,sBAAA;;;;;;;;;AAEdC,MAAIG,OAAOP,QAAQ,CAACA,YAAAA;AAClBA,IAAAA,QAAOQ,SAASC,OAAOV,cAAc,GAAGW,IAAIC,KAAKb,OAAAA,CAAAA;EACnD,CAAA;AAEA,SAAOJ,UAAUkB,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAASd,GAAGc;MACZC,UAAUlB,OAAOmB;MACjBC,WAAWtB,QAAQqB;IACrB;EACF,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,0BAAe5B;",
|
|
6
|
-
"names": ["Effect", "Obj", "Ref", "Relation", "invariant", "Operation", "ObservabilityOperation", "handler", "RestoreMessage", "pipe", "Operation", "withHandler", "fnUntraced", "anchor", "message", "messageIndex", "thread", "Relation", "getSource", "db", "Obj", "getDatabase", "invariant", "change", "messages", "splice", "Ref", "make", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId", "id", "messageId"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/toggle-resolved.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Obj } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\n\nimport { ToggleResolved } from './definitions';\n\nconst handler: Operation.WithHandler<typeof ToggleResolved> = ToggleResolved.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const thread = input.thread;\n\n Obj.change(thread, (thread) => {\n if (thread.status === 'active' || thread.status === undefined) {\n thread.status = 'resolved';\n } else if (thread.status === 'resolved') {\n thread.status = 'active';\n }\n });\n\n const db = Obj.getDatabase(thread);\n invariant(db, 'Database not found');\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.toggle-resolved',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n },\n });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,WAAW;AACpB,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;;AAIvC,IAAMC,UAAwDC,eAAeC,KAC3EC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAMC,SAASD,MAAMC;AAErBC,MAAIC,OAAOF,QAAQ,CAACA,YAAAA;AAClB,QAAIA,QAAOG,WAAW,YAAYH,QAAOG,WAAWC,QAAW;AAC7DJ,MAAAA,QAAOG,SAAS;IAClB,WAAWH,QAAOG,WAAW,YAAY;AACvCH,MAAAA,QAAOG,SAAS;IAClB;EACF,CAAA;AAEA,QAAME,KAAKJ,IAAIK,YAAYN,MAAAA;AAC3BO,YAAUF,IAAI,sBAAA;;;;;;;;;AAEd,SAAOT,UAAUY,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAASR,GAAGQ;MACZC,UAAUd,OAAOe;IACnB;EACF,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,0BAAetB;",
|
|
6
|
-
"names": ["Effect", "Obj", "invariant", "Operation", "ObservabilityOperation", "handler", "ToggleResolved", "pipe", "Operation", "withHandler", "fnUntraced", "input", "thread", "Obj", "change", "status", "undefined", "db", "getDatabase", "invariant", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId", "id"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { Obj, Ref, Relation } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { Operation } from '@dxos/operation';\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.change(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.change(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,KAAKC,KAAKC,gBAAgB;AACnC,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AACvC,SAASC,sBAAsB;AAC/B,SAASC,YAAYC,eAAuB;;AAK5C,IAAMC,UAAoDC,WAAWC,KACnEC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,QAAQC,SAASC,QAAQC,KAAI,GAAE;AAC5D,QAAMC,WAAW,OAAOC,WAAWC,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YA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,UAAUyD,SAASC,uBAAuBC,WAAW;MAC1DC,MAAM;MACNC,YAAY;QACVC,SAASxC,GAAGwC;QACZC,UAAUhD,OAAO2B;MACnB;IACF,CAAA;EACF;AAEA,SAAO1C,UAAUyD,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAASxC,GAAGwC;MACZC,UAAUhD,OAAO2B;MACjBsB,cAAcjD,OAAOmB,SAAS+B;MAC9BC,WAAWzC,QAAQiB;MACnByB,eAAe7D,KAAK2D;IACtB;EACF,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,sBAAepE;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "Obj", "Ref", "Relation", "invariant", "Operation", "ObservabilityOperation", "SpaceOperation", "AnchoredTo", "Message", "handler", "AddMessage", "pipe", "Operation", "withHandler", "fnUntraced", "anchor", "subject", "sender", "text", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "stateAtom", "ThreadCapabilities", "State", "thread", "Relation", "getSource", "subjectId", "Obj", "getDXN", "toString", "db", "getDatabase", "invariant", "message", "make", "Message", "created", "Date", "toISOString", "blocks", "_tag", "change", "messages", "push", "Ref", "state", "draft", "drafts", "find", "a", "id", "status", "set", "filter", "invoke", "SpaceOperation", "AddObject", "object", "target", "hidden", "AddRelation", "schema", "AnchoredTo", "source", "fields", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId", "threadLength", "length", "messageId", "messageLength"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { Database, Key, Obj, Ref } from '@dxos/echo';\nimport { Collection } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { Markdown } from '@dxos/plugin-markdown/types';\nimport { SpaceSchema } from '@dxos/react-client/echo';\nimport { Actor, AnchoredTo, Message, Thread } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nimport { Channel } from '../types';\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 CreateChannelThread = Operation.make({\n meta: { key: `${THREAD_OPERATION}.create-channel-thread`, name: 'Create Channel Thread' },\n services: [Capability.Service],\n input: Schema.Struct({\n channel: Channel.Channel,\n }),\n output: Schema.Struct({\n object: Thread.Thread,\n }),\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,UAAUC,KAAKC,KAAKC,WAAW;AACxC,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,OAAOC,YAAYC,SAASC,cAAc;AAEnD,SAASC,YAAY;AAIrB,IAAMC,mBAAmB,GAAGC,KAAKC,EAAE;AAE5B,IAAMC,gBAAgBC,UAAUC,KAAK;EAC1CJ,MAAM;IAAEK,KAAK,GAAGN,gBAAAA;IAAoCO,MAAM;EAAkB;EAC5EC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBC,OAAOC;IACPC,gBAAgBC,WAAWA;IAC3BC,WAAkBC,eAAQC,KAAYC,eAAQ;EAChD,CAAA;EACAC,QAAeC;AACjB,CAAA;AAEO,IAAMC,gBAAgBnB,UAAUC,KAAK;EAC1CJ,MAAM;IAAEK,KAAK,GAAGN,gBAAAA;IAAmCO,MAAM;EAAiB;EAC1EC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBY,SAASC,IAAIC;IACbnB,MAAaa,gBAAgBO,aAAM;EACrC,CAAA;EACAN,QAAeT,cAAO;IACpBgB,QAAQC,gB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3CJ,MAAM;IAAEK,KAAK,GAAGN,gBAAAA;IAAoCO,MAAM;EAAkB;EAC5EC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBsB,QAAQQ,WAAWA,WAAWF,YAAY;MAAEC,aAAa;IAA4B,CAAA;IACrFY,SAASC,QAAQA,QAAQd,YAAY;MAAEC,aAAa;IAA0B,CAAA;IAC9Ec,cAAqBC,cAAOhB,YAAY;MAAEC,aAAa;IAAuC,CAAA;EAChG,CAAA;EACApB,QAAeC;AACjB,CAAA;AAEO,IAAMuC,kBAAkBzD,UAAUC,KAAK;EAC5CJ,MAAM;IACJK,KAAK;IACLC,MAAM;IACNkC,aAAa;EACf;EACA9B,OAAcC,cAAO;IACnBkD,KAAKC,IAAIA,IAAIC,SAASC,QAAQ,EAAEzB,YAAY;MAC1CC,aAAa;IACf,CAAA;IACAyB,OAAcC,aAAaxC,aAAM,EAAEa,YAAY;MAC7CC,aAAa;IACf,CAAA;EACF,CAAA;EACApB,QAAeC;EACfd,UAAU;IAAC4D,SAAS1D;;AACtB,CAAA;",
|
|
6
|
-
"names": ["Schema", "Capability", "Database", "Key", "Obj", "Ref", "Collection", "Operation", "Markdown", "SpaceSchema", "Actor", "AnchoredTo", "Message", "Thread", "meta", "THREAD_OPERATION", "meta", "id", "OnCreateSpace", "Operation", "make", "key", "name", "services", "Capability", "Service", "input", "Struct", "space", "SpaceSchema", "rootCollection", "Collection", "isDefault", "Boolean", "pipe", "optional", "output", "Void", "CreateChannel", "spaceId", "Key", "SpaceId", "String", "object", "Channel", "CreateChannelThread", "channel", "Thread", "Create", "anchor", "subject", "Obj", "Unknown", "DeleteOutput", "thread", "annotations", "description", "AnchoredTo", "partial", "Delete", "Select", "current", "ToggleResolved", "AddMessage", "sender", "Actor", "text", "DeleteMessageOutput", "message", "Message", "messageIndex", "Number", "DeleteMessage", "messageId", "Restore", "RestoreMessage", "CreateProposals", "doc", "Ref", "Markdown", "Document", "diffs", "Array", "Database"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { Obj, Relation } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\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,KAAKC,gBAAgB;AAC9B,SAASC,iBAAiB;AAC1B,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", "Obj", "Relation", "Operation", "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,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/create-channel-thread.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Obj, Ref } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { Thread } from '@dxos/types';\n\nimport { CreateChannelThread } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateChannelThread> = CreateChannelThread.pipe(\n Operation.withHandler((input) =>\n Effect.sync(() => {\n const thread = Thread.make({ status: 'active' });\n const threadRef = Ref.make(thread);\n Obj.change(input.channel, (obj) => {\n obj.threads.push(threadRef);\n });\n return { object: thread };\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,WAAW;AACzB,SAASC,iBAAiB;AAC1B,SAASC,cAAc;AAIvB,IAAMC,UAA6DC,oBAAoBC,KACrFC,UAAUC,YAAY,CAACC,UACdC,YAAK,MAAA;AACV,QAAMC,SAASC,OAAOC,KAAK;IAAEC,QAAQ;EAAS,CAAA;AAC9C,QAAMC,YAAYC,IAAIH,KAAKF,MAAAA;AAC3BM,MAAIC,OAAOT,MAAMU,SAAS,CAACC,QAAAA;AACzBA,QAAIC,QAAQC,KAAKP,SAAAA;EACnB,CAAA;AACA,SAAO;IAAEQ,QAAQZ;EAAO;AAC1B,CAAA,CAAA,CAAA;AAIJ,IAAA,gCAAeP;",
|
|
6
|
-
"names": ["Effect", "Obj", "Ref", "Operation", "Thread", "handler", "CreateChannelThread", "pipe", "Operation", "withHandler", "input", "sync", "thread", "Thread", "make", "status", "threadRef", "Ref", "Obj", "change", "channel", "obj", "threads", "push", "object"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/delete.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 { sleep } from '@dxos/async';\nimport { Obj, Relation } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\nimport { Thread } from '@dxos/types';\n\nimport { ThreadCapabilities } from '../types';\nimport { Delete } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Delete> = Delete.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ subject, anchor, thread: _thread }) {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(ThreadCapabilities.State);\n const thread = _thread ?? (Relation.getSource(anchor) as Thread.Thread);\n const subjectId = Obj.getDXN(subject).toString();\n const state = registry.get(stateAtom);\n const draft = state.drafts[subjectId];\n if (draft) {\n const index = draft.findIndex((a: { id: string }) => a.id === anchor.id);\n if (index !== -1) {\n registry.set(stateAtom, {\n ...state,\n drafts: {\n ...state.drafts,\n [subjectId]: state.drafts[subjectId]?.filter((_, i) => i !== index),\n },\n });\n return {};\n }\n }\n\n const db = Obj.getDatabase(thread);\n if (!db) {\n return {};\n }\n\n // TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.\n db.remove(anchor);\n yield* Effect.promise(() => sleep(100));\n db.remove(thread);\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.delete',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n },\n });\n\n return { thread, anchor };\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,aAAa;AACtB,SAASC,KAAKC,gBAAgB;AAC9B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AAMvC,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,SAASC,QAAQC,QAAQC,QAAO,GAAE;AAC/D,QAAMC,WAAW,OAAOC,WAAWC,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YAAY,OAAOJ,WAAWC,IAAII,mBAAmBC,KAAK;AAChE,QAAMT,SAASC,WAAYS,SAASC,UAAUZ,MAAAA;AAC9C,QAAMa,YAAYC,IAAIC,OAAOhB,OAAAA,EAASiB,SAAQ;AAC9C,QAAMC,QAAQd,SAASE,IAAIG,SAAAA;AAC3B,QAAMU,QAAQD,MAAME,OAAON,SAAAA;AAC3B,MAAIK,OAAO;AACT,UAAME,QAAQF,MAAMG,UAAU,CAACC,MAAsBA,EAAEC,OAAOvB,OAAOuB,EAAE;AACvE,QAAIH,UAAU,IAAI;AAChBjB,eAASqB,IAAIhB,WAAW;QACtB,GAAGS;QACHE,QAAQ;UACN,GAAGF,MAAME;UACT,CAACN,SAAAA,GAAYI,MAAME,OAAON,SAAAA,GAAYY,OAAO,CAACC,GAAGC,MAAMA,MAAMP,KAAAA;QAC/D;MACF,CAAA;AACA,aAAO,CAAC;IACV;EACF;AAEA,QAAMQ,KAAKd,IAAIe,YAAY5B,MAAAA;AAC3B,MAAI,CAAC2B,IAAI;AACP,WAAO,CAAC;EACV;AAGAA,KAAGE,OAAO9B,MAAAA;AACV,SAAc+B,eAAQ,MAAMC,MAAM,GAAA,CAAA;AAClCJ,KAAGE,OAAO7B,MAAAA;AAEV,SAAOL,UAAUqC,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAASV,GAAGU;MACZC,UAAUtC,OAAOsB;IACnB;EACF,CAAA;AAEA,SAAO;IAAEtB;IAAQD;EAAO;AAC1B,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAeP;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "sleep", "Obj", "Relation", "Operation", "ObservabilityOperation", "handler", "Delete", "pipe", "Operation", "withHandler", "fnUntraced", "subject", "anchor", "thread", "_thread", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "stateAtom", "ThreadCapabilities", "State", "Relation", "getSource", "subjectId", "Obj", "getDXN", "toString", "state", "draft", "drafts", "index", "findIndex", "a", "id", "set", "filter", "_", "i", "db", "getDatabase", "remove", "promise", "sleep", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/delete-message.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Obj, Relation } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\nimport { Thread } from '@dxos/types';\n\nimport { Delete, DeleteMessage } from './definitions';\n\nconst handler: Operation.WithHandler<typeof DeleteMessage> = DeleteMessage.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ subject, anchor, messageId }) {\n const thread = Relation.getSource(anchor) as Thread.Thread;\n const db = Obj.getDatabase(subject);\n invariant(db, 'Database not found');\n\n const msgIndex = thread.messages.findIndex((ref) => ref.target?.id === messageId);\n const msg = thread.messages[msgIndex]?.target;\n if (!msg) {\n return { messageIndex: -1 };\n }\n\n if (msgIndex === 0 && thread.messages.length === 1) {\n // TODO(wittjosiah): This doesn't support restoring the thread.\n yield* Operation.invoke(Delete, { subject, anchor });\n return { messageIndex: -1 };\n }\n\n Obj.change(thread, (thread) => {\n thread.messages.splice(msgIndex, 1);\n });\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.message.delete',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n threadLength: thread.messages.length,\n messageId,\n },\n });\n\n return { message: msg, messageIndex: msgIndex };\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,gBAAgB;AAC9B,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;;AAKvC,IAAMC,UAAuDC,cAAcC,KACzEC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,SAASC,QAAQC,UAAS,GAAE;AACzD,QAAMC,SAASC,SAASC,UAAUJ,MAAAA;AAClC,QAAMK,KAAKC,IAAIC,YAAYR,OAAAA;AAC3BS,YAAUH,IAAI,sBAAA;;;;;;;;;AAEd,QAAMI,WAAWP,OAAOQ,SAASC,UAAU,CAACC,QAAQA,IAAIC,QAAQC,OAAOb,SAAAA;AACvE,QAAMc,MAAMb,OAAOQ,SAASD,QAAAA,GAAWI;AACvC,MAAI,CAACE,KAAK;AACR,WAAO;MAAEC,cAAc;IAAG;EAC5B;AAEA,MAAIP,aAAa,KAAKP,OAAOQ,SAASO,WAAW,GAAG;AAElD,WAAOrB,UAAUsB,OAAOC,QAAQ;MAAEpB;MAASC;IAAO,CAAA;AAClD,WAAO;MAAEgB,cAAc;IAAG;EAC5B;AAEAV,MAAIc,OAAOlB,QAAQ,CAACA,YAAAA;AAClBA,IAAAA,QAAOQ,SAASW,OAAOZ,UAAU,CAAA;EACnC,CAAA;AAEA,SAAOb,UAAU0B,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAAStB,GAAGsB;MACZC,UAAU1B,OAAOY;MACjBe,cAAc3B,OAAOQ,SAASO;MAC9BhB;IACF;EACF,CAAA;AAEA,SAAO;IAAE6B,SAASf;IAAKC,cAAcP;EAAS;AAChD,CAAA,CAAA,CAAA;AAIJ,IAAA,yBAAehB;",
|
|
6
|
-
"names": ["Effect", "Obj", "Relation", "invariant", "Operation", "ObservabilityOperation", "handler", "DeleteMessage", "pipe", "Operation", "withHandler", "fnUntraced", "subject", "anchor", "messageId", "thread", "Relation", "getSource", "db", "Obj", "getDatabase", "invariant", "msgIndex", "messages", "findIndex", "ref", "target", "id", "msg", "messageIndex", "length", "invoke", "Delete", "change", "splice", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId", "threadLength", "message"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/restore.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { sleep } from '@dxos/async';\nimport { Obj } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\n\nimport { Restore } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Restore> = Restore.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ thread, anchor }) {\n const db = Obj.getDatabase(thread);\n if (!db) {\n return;\n }\n\n // TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.\n db.add(thread);\n yield* Effect.promise(() => sleep(100));\n db.add(anchor);\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.undo-delete',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n },\n });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,aAAa;AACtB,SAASC,WAAW;AACpB,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AAIvC,IAAMC,UAAiDC,QAAQC,KAC7DC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,QAAQC,OAAM,GAAE;AAC7C,QAAMC,KAAKC,IAAIC,YAAYJ,MAAAA;AAC3B,MAAI,CAACE,IAAI;AACP;EACF;AAGAA,KAAGG,IAAIL,MAAAA;AACP,SAAcM,eAAQ,MAAMC,MAAM,GAAA,CAAA;AAClCL,KAAGG,IAAIJ,MAAAA;AAEP,SAAOJ,UAAUW,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAASX,GAAGW;MACZC,UAAUd,OAAOe;IACnB;EACF,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,kBAAerB;",
|
|
6
|
-
"names": ["Effect", "sleep", "Obj", "Operation", "ObservabilityOperation", "handler", "Restore", "pipe", "Operation", "withHandler", "fnUntraced", "thread", "anchor", "db", "Obj", "getDatabase", "add", "promise", "sleep", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId", "id"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/restore-message.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Obj, Ref, Relation } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\nimport { Thread } from '@dxos/types';\n\nimport { RestoreMessage } from './definitions';\n\nconst handler: Operation.WithHandler<typeof RestoreMessage> = RestoreMessage.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ anchor, message, messageIndex }) {\n const thread = Relation.getSource(anchor) as Thread.Thread;\n const db = Obj.getDatabase(thread);\n invariant(db, 'Database not found');\n\n Obj.change(thread, (thread) => {\n thread.messages.splice(messageIndex, 0, Ref.make(message));\n });\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.message.undo-delete',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n messageId: message.id,\n },\n });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,KAAKC,gBAAgB;AACnC,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;;AAKvC,IAAMC,UAAwDC,eAAeC,KAC3EC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,QAAQC,SAASC,aAAY,GAAE;AAC5D,QAAMC,SAASC,SAASC,UAAUL,MAAAA;AAClC,QAAMM,KAAKC,IAAIC,YAAYL,MAAAA;AAC3BM,YAAUH,IAAI,sBAAA;;;;;;;;;AAEdC,MAAIG,OAAOP,QAAQ,CAACA,YAAAA;AAClBA,IAAAA,QAAOQ,SAASC,OAAOV,cAAc,GAAGW,IAAIC,KAAKb,OAAAA,CAAAA;EACnD,CAAA;AAEA,SAAOJ,UAAUkB,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAASd,GAAGc;MACZC,UAAUlB,OAAOmB;MACjBC,WAAWtB,QAAQqB;IACrB;EACF,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,0BAAe5B;",
|
|
6
|
-
"names": ["Effect", "Obj", "Ref", "Relation", "invariant", "Operation", "ObservabilityOperation", "handler", "RestoreMessage", "pipe", "Operation", "withHandler", "fnUntraced", "anchor", "message", "messageIndex", "thread", "Relation", "getSource", "db", "Obj", "getDatabase", "invariant", "change", "messages", "splice", "Ref", "make", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId", "id", "messageId"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/toggle-resolved.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Obj } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\n\nimport { ToggleResolved } from './definitions';\n\nconst handler: Operation.WithHandler<typeof ToggleResolved> = ToggleResolved.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const thread = input.thread;\n\n Obj.change(thread, (thread) => {\n if (thread.status === 'active' || thread.status === undefined) {\n thread.status = 'resolved';\n } else if (thread.status === 'resolved') {\n thread.status = 'active';\n }\n });\n\n const db = Obj.getDatabase(thread);\n invariant(db, 'Database not found');\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.toggle-resolved',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n },\n });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,WAAW;AACpB,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;;AAIvC,IAAMC,UAAwDC,eAAeC,KAC3EC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAMC,SAASD,MAAMC;AAErBC,MAAIC,OAAOF,QAAQ,CAACA,YAAAA;AAClB,QAAIA,QAAOG,WAAW,YAAYH,QAAOG,WAAWC,QAAW;AAC7DJ,MAAAA,QAAOG,SAAS;IAClB,WAAWH,QAAOG,WAAW,YAAY;AACvCH,MAAAA,QAAOG,SAAS;IAClB;EACF,CAAA;AAEA,QAAME,KAAKJ,IAAIK,YAAYN,MAAAA;AAC3BO,YAAUF,IAAI,sBAAA;;;;;;;;;AAEd,SAAOT,UAAUY,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAASR,GAAGQ;MACZC,UAAUd,OAAOe;IACnB;EACF,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,0BAAetB;",
|
|
6
|
-
"names": ["Effect", "Obj", "invariant", "Operation", "ObservabilityOperation", "handler", "ToggleResolved", "pipe", "Operation", "withHandler", "fnUntraced", "input", "thread", "Obj", "change", "status", "undefined", "db", "getDatabase", "invariant", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId", "id"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stories.d.ts","sourceRoot":"","sources":["../../../../src/testing/stories.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAUlD,eAAO,MAAM,mBAAmB,QAAa,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAkCxE,CAAC"}
|
package/src/testing/stories.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { type Plugin } from '@dxos/app-framework';
|
|
8
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
9
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
10
|
-
import { corePlugins } from '@dxos/plugin-testing';
|
|
11
|
-
import { Config } from '@dxos/react-client';
|
|
12
|
-
|
|
13
|
-
import { Channel } from '#types';
|
|
14
|
-
|
|
15
|
-
import { ThreadPlugin } from '../ThreadPlugin';
|
|
16
|
-
|
|
17
|
-
export const createThreadPlugins = async (): Promise<Array<Plugin.Plugin>> => [
|
|
18
|
-
...corePlugins(),
|
|
19
|
-
ClientPlugin({
|
|
20
|
-
onClientInitialized: ({ client }) =>
|
|
21
|
-
Effect.gen(function* () {
|
|
22
|
-
yield* Effect.promise(() => client.halo.createIdentity({ displayName: 'Test User' }));
|
|
23
|
-
}),
|
|
24
|
-
onSpacesReady: ({ client }) =>
|
|
25
|
-
Effect.gen(function* () {
|
|
26
|
-
const space = client.spaces.get()[0];
|
|
27
|
-
space.db.add(Channel.make());
|
|
28
|
-
}),
|
|
29
|
-
config: new Config({
|
|
30
|
-
runtime: {
|
|
31
|
-
client: {
|
|
32
|
-
edgeFeatures: {
|
|
33
|
-
signaling: true,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
services: {
|
|
37
|
-
edge: {
|
|
38
|
-
url: 'https://edge.dxos.workers.dev/',
|
|
39
|
-
},
|
|
40
|
-
iceProviders: [
|
|
41
|
-
{
|
|
42
|
-
urls: 'https://edge.dxos.workers.dev/ice',
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
}),
|
|
48
|
-
}),
|
|
49
|
-
SpacePlugin({}),
|
|
50
|
-
ThreadPlugin(),
|
|
51
|
-
];
|