@dxos/plugin-thread 0.9.1-main.c7dcc2e112 → 0.9.1-staging.ee54ba693a
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/neutral/ThreadPlugin.mjs +2 -0
- package/dist/lib/neutral/ThreadPlugin.mjs.map +3 -3
- package/dist/lib/neutral/{app-graph-builder-U4ZDM6GK.mjs → app-graph-builder-NZOWDFE5.mjs} +14 -35
- package/dist/lib/neutral/app-graph-builder-NZOWDFE5.mjs.map +7 -0
- package/dist/lib/neutral/{append-channel-message-2OZYIIFL.mjs → append-channel-message-YIIJY6GX.mjs} +2 -2
- package/dist/lib/neutral/capabilities/index.mjs +4 -4
- package/dist/lib/neutral/{channel-backend-feed-ALIPAEPT.mjs → channel-backend-feed-TOS55NID.mjs} +7 -8
- package/dist/lib/neutral/channel-backend-feed-TOS55NID.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-UYINIL64.mjs → chunk-5VTDNDBV.mjs} +3 -3
- package/dist/lib/neutral/{chunk-UYINIL64.mjs.map → chunk-5VTDNDBV.mjs.map} +3 -3
- package/dist/lib/neutral/{chunk-GQCMB5ZC.mjs → chunk-GM3SGQMJ.mjs} +2 -2
- package/dist/lib/neutral/{chunk-DM2T6BH5.mjs → chunk-J7OTCRYF.mjs} +4 -2
- package/dist/lib/neutral/{chunk-DM2T6BH5.mjs.map → chunk-J7OTCRYF.mjs.map} +3 -3
- package/dist/lib/neutral/{chunk-KUO5HUCH.mjs → chunk-XPUQE4Y7.mjs} +2 -2
- package/dist/lib/neutral/components/index.mjs +1 -1
- package/dist/lib/neutral/components/index.mjs.map +3 -3
- package/dist/lib/neutral/{create-channel-Y6D7YGVX.mjs → create-channel-4CA7P2M5.mjs} +2 -2
- package/dist/lib/neutral/{create-object-LOZBRZAF.mjs → create-object-O3TZ2MCJ.mjs} +3 -4
- package/dist/lib/neutral/{create-object-LOZBRZAF.mjs.map → create-object-O3TZ2MCJ.mjs.map} +3 -3
- package/dist/lib/neutral/hooks/index.mjs +2 -2
- package/dist/lib/neutral/index.mjs +3 -3
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/{navigation-resolver-VNFRIC7W.mjs → navigation-resolver-LSTZL32O.mjs} +7 -3
- package/dist/lib/neutral/navigation-resolver-LSTZL32O.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +1 -1
- package/dist/lib/neutral/types/index.mjs +1 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/channel-backend-feed.d.ts +1 -1
- package/dist/types/src/capabilities/channel-backend-feed.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +1 -7
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -1
- package/dist/types/src/capabilities/navigation-resolver.d.ts +1 -2
- package/dist/types/src/capabilities/navigation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/paths.d.ts +1 -1
- package/dist/types/src/paths.d.ts.map +1 -1
- package/dist/types/src/types/ThreadOperation.d.ts +4 -68
- package/dist/types/src/types/ThreadOperation.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +36 -36
- package/src/ThreadPlugin.tsx +2 -1
- package/src/capabilities/app-graph-builder.ts +13 -31
- package/src/capabilities/channel-backend-feed.ts +2 -3
- package/src/capabilities/create-object.ts +0 -1
- package/src/capabilities/navigation-resolver.ts +7 -5
- package/src/components/Chat/Chat.tsx +1 -1
- package/src/containers/ChannelArticle/ChannelArticle.stories.tsx +3 -4
- package/src/containers/ThreadArticle/ThreadArticle.stories.tsx +1 -1
- package/src/paths.ts +2 -1
- package/src/types/ThreadOperation.ts +6 -3
- package/dist/lib/neutral/app-graph-builder-U4ZDM6GK.mjs.map +0 -7
- package/dist/lib/neutral/channel-backend-feed-ALIPAEPT.mjs.map +0 -7
- package/dist/lib/neutral/navigation-resolver-VNFRIC7W.mjs.map +0 -7
- /package/dist/lib/neutral/{append-channel-message-2OZYIIFL.mjs.map → append-channel-message-YIIJY6GX.mjs.map} +0 -0
- /package/dist/lib/neutral/{chunk-GQCMB5ZC.mjs.map → chunk-GM3SGQMJ.mjs.map} +0 -0
- /package/dist/lib/neutral/{chunk-KUO5HUCH.mjs.map → chunk-XPUQE4Y7.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-channel-Y6D7YGVX.mjs.map → create-channel-4CA7P2M5.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-thread",
|
|
3
|
-
"version": "0.9.1-
|
|
3
|
+
"version": "0.9.1-staging.ee54ba693a",
|
|
4
4
|
"description": "DXOS Threads Surface plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -97,48 +97,48 @@
|
|
|
97
97
|
],
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@effect-atom/atom-react": "^0.5.0",
|
|
100
|
-
"@dxos/app-
|
|
101
|
-
"@dxos/
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/client
|
|
104
|
-
"@dxos/display-name": "0.9.1-
|
|
105
|
-
"@dxos/echo": "0.9.1-
|
|
106
|
-
"@dxos/
|
|
107
|
-
"@dxos/
|
|
108
|
-
"@dxos/
|
|
109
|
-
"@dxos/
|
|
110
|
-
"@dxos/plugin-client": "0.9.1-
|
|
111
|
-
"@dxos/plugin-
|
|
112
|
-
"@dxos/random": "0.9.1-
|
|
113
|
-
"@dxos/
|
|
114
|
-
"@dxos/
|
|
115
|
-
"@dxos/react-ui-thread": "0.9.1-
|
|
116
|
-
"@dxos/
|
|
117
|
-
"@dxos/
|
|
118
|
-
"@dxos/
|
|
100
|
+
"@dxos/app-toolkit": "0.9.1-staging.ee54ba693a",
|
|
101
|
+
"@dxos/app-framework": "0.9.1-staging.ee54ba693a",
|
|
102
|
+
"@dxos/client-protocol": "0.9.1-staging.ee54ba693a",
|
|
103
|
+
"@dxos/client": "0.9.1-staging.ee54ba693a",
|
|
104
|
+
"@dxos/display-name": "0.9.1-staging.ee54ba693a",
|
|
105
|
+
"@dxos/echo": "0.9.1-staging.ee54ba693a",
|
|
106
|
+
"@dxos/compute": "0.9.1-staging.ee54ba693a",
|
|
107
|
+
"@dxos/invariant": "0.9.1-staging.ee54ba693a",
|
|
108
|
+
"@dxos/echo-client": "0.9.1-staging.ee54ba693a",
|
|
109
|
+
"@dxos/keys": "0.9.1-staging.ee54ba693a",
|
|
110
|
+
"@dxos/plugin-client": "0.9.1-staging.ee54ba693a",
|
|
111
|
+
"@dxos/plugin-graph": "0.9.1-staging.ee54ba693a",
|
|
112
|
+
"@dxos/random": "0.9.1-staging.ee54ba693a",
|
|
113
|
+
"@dxos/plugin-space": "0.9.1-staging.ee54ba693a",
|
|
114
|
+
"@dxos/react-client": "0.9.1-staging.ee54ba693a",
|
|
115
|
+
"@dxos/react-ui-thread": "0.9.1-staging.ee54ba693a",
|
|
116
|
+
"@dxos/types": "0.9.1-staging.ee54ba693a",
|
|
117
|
+
"@dxos/plugin-calls": "0.9.1-staging.ee54ba693a",
|
|
118
|
+
"@dxos/util": "0.9.1-staging.ee54ba693a"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
|
-
"@types/react": "~19.2.
|
|
121
|
+
"@types/react": "~19.2.17",
|
|
122
122
|
"@types/react-dom": "~19.2.3",
|
|
123
|
-
"effect": "3.21.
|
|
124
|
-
"react": "~19.2.
|
|
125
|
-
"react-dom": "~19.2.
|
|
123
|
+
"effect": "3.21.4",
|
|
124
|
+
"react": "~19.2.7",
|
|
125
|
+
"react-dom": "~19.2.7",
|
|
126
126
|
"vite": "^8.0.16",
|
|
127
|
-
"@dxos/plugin-testing": "0.9.1-
|
|
128
|
-
"@dxos/react-ui": "0.9.1-
|
|
129
|
-
"@dxos/
|
|
130
|
-
"@dxos/react-ui-
|
|
131
|
-
"@dxos/ui
|
|
127
|
+
"@dxos/plugin-testing": "0.9.1-staging.ee54ba693a",
|
|
128
|
+
"@dxos/react-ui-menu": "0.9.1-staging.ee54ba693a",
|
|
129
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a",
|
|
130
|
+
"@dxos/react-ui-form": "0.9.1-staging.ee54ba693a",
|
|
131
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a"
|
|
132
132
|
},
|
|
133
133
|
"peerDependencies": {
|
|
134
134
|
"@effect-atom/atom-react": "^0.5.0",
|
|
135
|
-
"effect": "3.21.
|
|
136
|
-
"react": "~19.2.
|
|
137
|
-
"react-dom": "~19.2.
|
|
138
|
-
"@dxos/react-ui
|
|
139
|
-
"@dxos/
|
|
140
|
-
"@dxos/react-ui": "0.9.1-
|
|
141
|
-
"@dxos/ui-
|
|
135
|
+
"effect": "3.21.4",
|
|
136
|
+
"react": "~19.2.7",
|
|
137
|
+
"react-dom": "~19.2.7",
|
|
138
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a",
|
|
139
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a",
|
|
140
|
+
"@dxos/react-ui-menu": "0.9.1-staging.ee54ba693a",
|
|
141
|
+
"@dxos/react-ui-form": "0.9.1-staging.ee54ba693a"
|
|
142
142
|
},
|
|
143
143
|
"publishConfig": {
|
|
144
144
|
"access": "public"
|
package/src/ThreadPlugin.tsx
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { ActivationEvents, Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
import { ClientEvents } from '@dxos/plugin-client';
|
|
7
8
|
import { translations as threadTranslations } from '@dxos/react-ui-thread/translations';
|
|
8
9
|
import { Channel, Message, Thread } from '@dxos/types';
|
|
9
10
|
|
|
@@ -25,7 +26,7 @@ import pluginSpec from '../PLUGIN.mdl?raw';
|
|
|
25
26
|
|
|
26
27
|
export const ThreadPlugin = Plugin.define(meta).pipe(
|
|
27
28
|
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
28
|
-
AppPlugin.addNavigationResolverModule({ activate: NavigationResolver }),
|
|
29
|
+
AppPlugin.addNavigationResolverModule({ activatesOn: ClientEvents.ClientReady, activate: NavigationResolver }),
|
|
29
30
|
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
30
31
|
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
31
32
|
AppPlugin.addSchemaModule({
|
|
@@ -3,17 +3,16 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Option from 'effect/Option';
|
|
7
6
|
|
|
8
7
|
import { Capability } from '@dxos/app-framework';
|
|
9
|
-
import { AppCapabilities, AppNode, TypeSection } from '@dxos/app-toolkit';
|
|
10
|
-
import { isSpace } from '@dxos/client/echo';
|
|
8
|
+
import { AppCapabilities, AppNode, AppNodeMatcher, Paths, TypeSection } from '@dxos/app-toolkit';
|
|
11
9
|
import { Operation } from '@dxos/compute';
|
|
12
10
|
import { Obj, Type } from '@dxos/echo';
|
|
13
11
|
import { CallsCapabilities } from '@dxos/plugin-calls/types';
|
|
14
|
-
import { GraphBuilder
|
|
12
|
+
import { GraphBuilder } from '@dxos/plugin-graph';
|
|
15
13
|
import { SpaceOperation } from '@dxos/plugin-space';
|
|
16
14
|
import { Channel } from '@dxos/types';
|
|
15
|
+
import { Position } from '@dxos/util';
|
|
17
16
|
|
|
18
17
|
import { meta } from '#meta';
|
|
19
18
|
|
|
@@ -26,7 +25,15 @@ export default Capability.makeModule(
|
|
|
26
25
|
const capabilities = yield* Capability.Service;
|
|
27
26
|
|
|
28
27
|
const extensions = yield* Effect.all([
|
|
29
|
-
TypeSection.createTypeSectionExtension(Channel.Channel
|
|
28
|
+
TypeSection.createTypeSectionExtension(Channel.Channel, {
|
|
29
|
+
match: AppNodeMatcher.whenNavTreeGroup(Paths.GroupTypes.communications),
|
|
30
|
+
createObject: (space) =>
|
|
31
|
+
Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
32
|
+
target: space.db,
|
|
33
|
+
typename: channelTypename,
|
|
34
|
+
targetNodeId: getChannelsPath(space.db.spaceId),
|
|
35
|
+
}),
|
|
36
|
+
}),
|
|
30
37
|
|
|
31
38
|
GraphBuilder.createTypeExtension({
|
|
32
39
|
id: 'channelChatCompanion',
|
|
@@ -48,36 +55,11 @@ export default Capability.makeModule(
|
|
|
48
55
|
label: ['channel-companion.label', { ns: meta.profile.key }],
|
|
49
56
|
icon: 'ph--hash--regular',
|
|
50
57
|
data: 'chat',
|
|
51
|
-
position:
|
|
58
|
+
position: Position.first,
|
|
52
59
|
}),
|
|
53
60
|
]);
|
|
54
61
|
},
|
|
55
62
|
}),
|
|
56
|
-
|
|
57
|
-
GraphBuilder.createExtension({
|
|
58
|
-
id: 'channelsSectionActions',
|
|
59
|
-
match: (node) => {
|
|
60
|
-
const space = isSpace(node.properties.space) ? node.properties.space : undefined;
|
|
61
|
-
return node.type === channelTypename && space ? Option.some(space) : Option.none();
|
|
62
|
-
},
|
|
63
|
-
actions: (space) =>
|
|
64
|
-
Effect.succeed([
|
|
65
|
-
Node.makeAction({
|
|
66
|
-
id: 'create-channel',
|
|
67
|
-
data: () =>
|
|
68
|
-
Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
69
|
-
target: space.db,
|
|
70
|
-
typename: channelTypename,
|
|
71
|
-
targetNodeId: getChannelsPath(space.db.spaceId),
|
|
72
|
-
}),
|
|
73
|
-
properties: {
|
|
74
|
-
label: ['add-object.label', { ns: channelTypename }],
|
|
75
|
-
icon: 'ph--plus--regular',
|
|
76
|
-
disposition: 'list-item-primary',
|
|
77
|
-
},
|
|
78
|
-
}),
|
|
79
|
-
]),
|
|
80
|
-
}),
|
|
81
63
|
]);
|
|
82
64
|
|
|
83
65
|
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
@@ -6,8 +6,7 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
import * as Schema from 'effect/Schema';
|
|
7
7
|
|
|
8
8
|
import { Capability } from '@dxos/app-framework';
|
|
9
|
-
import { Feed, Filter, Obj, Query } from '@dxos/echo';
|
|
10
|
-
import { createFeedServiceLayer } from '@dxos/echo-client';
|
|
9
|
+
import { Database, Feed, Filter, Obj, Query } from '@dxos/echo';
|
|
11
10
|
import { invariant } from '@dxos/invariant';
|
|
12
11
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
13
12
|
import { Channel, Message } from '@dxos/types';
|
|
@@ -45,7 +44,7 @@ export const feedChannelBackend: ThreadCapabilities.ChannelBackendProvider = {
|
|
|
45
44
|
invariant(space, 'Space not found');
|
|
46
45
|
const feed = Channel.getFeed(channel);
|
|
47
46
|
invariant(feed, 'Channel is not feed-backed');
|
|
48
|
-
yield* Feed.append(feed, [message]).pipe(Effect.provide(
|
|
47
|
+
yield* Feed.append(feed, [message]).pipe(Effect.provide(Database.layer(space.db)));
|
|
49
48
|
}),
|
|
50
49
|
readOnly: (channel) => Obj.getMeta(channel).keys.length > 0,
|
|
51
50
|
};
|
|
@@ -5,14 +5,16 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
|
-
import { AppCapabilities, TypeSection } from '@dxos/app-toolkit';
|
|
8
|
+
import { AppCapabilities, Paths, TypeSection } from '@dxos/app-toolkit';
|
|
9
9
|
import { Channel } from '@dxos/types';
|
|
10
10
|
|
|
11
11
|
export default Capability.makeModule(
|
|
12
12
|
Effect.fnUntraced(function* () {
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
return [
|
|
14
|
+
Capability.contributes(
|
|
15
|
+
AppCapabilities.NavigationPathResolver,
|
|
16
|
+
TypeSection.createTypeSectionPathResolver(Channel.Channel, { groupId: Paths.GroupSegments.communications }),
|
|
17
|
+
),
|
|
18
|
+
];
|
|
17
19
|
}),
|
|
18
20
|
);
|
|
@@ -9,7 +9,7 @@ import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
|
9
9
|
import { PublicKey } from '@dxos/react-client';
|
|
10
10
|
import { type SpaceMember } from '@dxos/react-client/echo';
|
|
11
11
|
import { type Identity } from '@dxos/react-client/halo';
|
|
12
|
-
import {
|
|
12
|
+
import { Card, type ThemedClassName, composable, useTranslation } from '@dxos/react-ui';
|
|
13
13
|
import { type ObjectTileComponent, Thread } from '@dxos/react-ui-thread';
|
|
14
14
|
import { type Message } from '@dxos/types';
|
|
15
15
|
import { hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/ui-theme';
|
|
@@ -10,8 +10,7 @@ import { Capability } from '@dxos/app-framework';
|
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
11
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
12
12
|
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
13
|
-
import { Feed, Query } from '@dxos/echo';
|
|
14
|
-
import { createFeedServiceLayer } from '@dxos/echo-client';
|
|
13
|
+
import { Database, Feed, Query } from '@dxos/echo';
|
|
15
14
|
import { invariant } from '@dxos/invariant';
|
|
16
15
|
import { CallsPlugin } from '@dxos/plugin-calls/plugin';
|
|
17
16
|
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
@@ -20,7 +19,7 @@ import { SpacePlugin } from '@dxos/plugin-space/testing';
|
|
|
20
19
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
21
20
|
import { Config } from '@dxos/react-client';
|
|
22
21
|
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
23
|
-
import { withLayout, withTheme
|
|
22
|
+
import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
24
23
|
import { Channel, Message, Thread } from '@dxos/types';
|
|
25
24
|
|
|
26
25
|
import { translations } from '#translations';
|
|
@@ -82,7 +81,7 @@ const meta = {
|
|
|
82
81
|
blocks: [{ _tag: 'text', text: 'Messages are stored in the feed.' }],
|
|
83
82
|
}),
|
|
84
83
|
];
|
|
85
|
-
yield* Feed.append(feed, seed).pipe(Effect.provide(
|
|
84
|
+
yield* Feed.append(feed, seed).pipe(Effect.provide(Database.layer(personalSpace.db)));
|
|
86
85
|
}),
|
|
87
86
|
}),
|
|
88
87
|
SpacePlugin({}),
|
|
@@ -17,7 +17,7 @@ import { useIdentity } from '@dxos/react-client/halo';
|
|
|
17
17
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
18
18
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
19
19
|
import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
|
|
20
|
-
import {
|
|
20
|
+
import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
21
21
|
import { Message, Thread } from '@dxos/types';
|
|
22
22
|
|
|
23
23
|
import { translations } from '#translations';
|
package/src/paths.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { Channel } from '@dxos/types';
|
|
|
7
7
|
|
|
8
8
|
const { getSectionPath: getChannelsPath, getObjectPath: getChannelPath } = Paths.createTypeSectionPaths(
|
|
9
9
|
Channel.Channel,
|
|
10
|
+
{ groupId: Paths.GroupSegments.communications },
|
|
10
11
|
);
|
|
11
12
|
|
|
12
|
-
export {
|
|
13
|
+
export { getChannelPath, getChannelsPath };
|
|
@@ -8,8 +8,11 @@ import * as Schema from 'effect/Schema';
|
|
|
8
8
|
|
|
9
9
|
import { Capability } from '@dxos/app-framework';
|
|
10
10
|
import { Operation } from '@dxos/compute';
|
|
11
|
-
import { Key, Type
|
|
12
|
-
|
|
11
|
+
import { DXN, Key, Type } from '@dxos/echo';
|
|
12
|
+
// Person is referenced in Actor.Actor's inferred type; importing it allows TypeScript to name
|
|
13
|
+
// it in the emitted .d.ts for AppendChannelMessage.
|
|
14
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
15
|
+
import { Actor, Channel, type Person } from '@dxos/types';
|
|
13
16
|
|
|
14
17
|
import { meta } from '#meta';
|
|
15
18
|
|
|
@@ -37,7 +40,7 @@ export const AppendChannelMessage = Operation.make({
|
|
|
37
40
|
name: 'Append Channel Message',
|
|
38
41
|
icon: 'ph--chat-text--regular',
|
|
39
42
|
},
|
|
40
|
-
// Note:
|
|
43
|
+
// Note: Database.Service is provided inside the handler from space.db, not at the
|
|
41
44
|
// operation level — the runtime can't fulfill it without a space context.
|
|
42
45
|
services: [Capability.Service],
|
|
43
46
|
input: Schema.Struct({
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, AppNode, TypeSection } from '@dxos/app-toolkit';\nimport { isSpace } from '@dxos/client/echo';\nimport { Operation } from '@dxos/compute';\nimport { Obj, Type } from '@dxos/echo';\nimport { CallsCapabilities } from '@dxos/plugin-calls/types';\nimport { GraphBuilder, Node } from '@dxos/plugin-graph';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { Channel } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nimport { getChannelsPath } from '../paths';\n\nconst channelTypename = Type.getTypename(Channel.Channel);\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const capabilities = yield* Capability.Service;\n\n const extensions = yield* Effect.all([\n TypeSection.createTypeSectionExtension(Channel.Channel),\n\n GraphBuilder.createTypeExtension({\n id: 'channelChatCompanion',\n type: Channel.Channel,\n connector: (channel, get) => {\n const [callManager] = get(capabilities.atom(CallsCapabilities.Manager));\n if (!callManager) {\n return Effect.succeed([]);\n }\n const joined = get(callManager.joinedAtom);\n const roomId = get(callManager.roomIdAtom);\n if (!joined || roomId !== Obj.getURI(channel)) {\n return Effect.succeed([]);\n }\n\n return Effect.succeed([\n AppNode.makeCompanion({\n id: 'chat',\n label: ['channel-companion.label', { ns: meta.profile.key }],\n icon: 'ph--hash--regular',\n data: 'chat',\n position: 'first',\n }),\n ]);\n },\n }),\n\n GraphBuilder.createExtension({\n id: 'channelsSectionActions',\n match: (node) => {\n const space = isSpace(node.properties.space) ? node.properties.space : undefined;\n return node.type === channelTypename && space ? Option.some(space) : Option.none();\n },\n actions: (space) =>\n Effect.succeed([\n Node.makeAction({\n id: 'create-channel',\n data: () =>\n Operation.invoke(SpaceOperation.OpenCreateObject, {\n target: space.db,\n typename: channelTypename,\n targetNodeId: getChannelsPath(space.db.spaceId),\n }),\n properties: {\n label: ['add-object.label', { ns: channelTypename }],\n icon: 'ph--plus--regular',\n disposition: 'list-item-primary',\n },\n }),\n ]),\n }),\n ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiBC,SAASC,mBAAmB;AACtD,SAASC,eAAe;AACxB,SAASC,iBAAiB;AAC1B,SAASC,KAAKC,YAAY;AAC1B,SAASC,yBAAyB;AAClC,SAASC,cAAcC,YAAY;AACnC,SAASC,sBAAsB;AAC/B,SAASC,eAAe;AAExB,SAASC,YAAY;AAIrB,IAAMC,kBAAkBC,KAAKC,YAAYC,QAAQA,OAAO;AAExD,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,eAAe,OAAOH,WAAWI;AAEvC,QAAMC,aAAa,OAAcC,WAAI;IACnCC,YAAYC,2BAA2BT,QAAQA,OAAO;IAEtDU,aAAaC,oBAAoB;MAC/BC,IAAI;MACJC,MAAMb,QAAQA;MACdc,WAAW,CAACC,SAASC,QAAAA;AACnB,cAAM,CAACC,WAAAA,IAAeD,IAAIZ,aAAac,KAAKC,kBAAkBC,OAAO,CAAA;AACrE,YAAI,CAACH,aAAa;AAChB,iBAAcI,eAAQ,CAAA,CAAE;QAC1B;AACA,cAAMC,SAASN,IAAIC,YAAYM,UAAU;AACzC,cAAMC,SAASR,IAAIC,YAAYQ,UAAU;AACzC,YAAI,CAACH,UAAUE,WAAWE,IAAIC,OAAOZ,OAAAA,GAAU;AAC7C,iBAAcM,eAAQ,CAAA,CAAE;QAC1B;AAEA,eAAcA,eAAQ;UACpBO,QAAQC,cAAc;YACpBjB,IAAI;YACJkB,OAAO;cAAC;cAA2B;gBAAEC,IAAIC,KAAKC,QAAQC;cAAI;;YAC1DC,MAAM;YACNC,MAAM;YACNC,UAAU;UACZ,CAAA;SACD;MACH;IACF,CAAA;IAEA3B,aAAa4B,gBAAgB;MAC3B1B,IAAI;MACJ2B,OAAO,CAACC,SAAAA;AACN,cAAMC,QAAQC,QAAQF,KAAKG,WAAWF,KAAK,IAAID,KAAKG,WAAWF,QAAQG;AACvE,eAAOJ,KAAK3B,SAAShB,mBAAmB4C,QAAeI,YAAKJ,KAAAA,IAAgBK,YAAI;MAClF;MACAC,SAAS,CAACN,UACDpB,eAAQ;QACb2B,KAAKC,WAAW;UACdrC,IAAI;UACJwB,MAAM,MACJc,UAAUC,OAAOC,eAAeC,kBAAkB;YAChDC,QAAQb,MAAMc;YACdC,UAAU3D;YACV4D,cAAcC,gBAAgBjB,MAAMc,GAAGI,OAAO;UAChD,CAAA;UACFhB,YAAY;YACVb,OAAO;cAAC;cAAoB;gBAAEC,IAAIlC;cAAgB;;YAClDsC,MAAM;YACNyB,aAAa;UACf;QACF,CAAA;OACD;IACL,CAAA;GACD;AAED,SAAO3D,WAAW4D,YAAYC,gBAAgBC,iBAAiBzD,UAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Option", "Capability", "AppCapabilities", "AppNode", "TypeSection", "isSpace", "Operation", "Obj", "Type", "CallsCapabilities", "GraphBuilder", "Node", "SpaceOperation", "Channel", "meta", "channelTypename", "Type", "getTypename", "Channel", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "extensions", "all", "TypeSection", "createTypeSectionExtension", "GraphBuilder", "createTypeExtension", "id", "type", "connector", "channel", "get", "callManager", "atom", "CallsCapabilities", "Manager", "succeed", "joined", "joinedAtom", "roomId", "roomIdAtom", "Obj", "getURI", "AppNode", "makeCompanion", "label", "ns", "meta", "profile", "key", "icon", "data", "position", "createExtension", "match", "node", "space", "isSpace", "properties", "undefined", "some", "none", "actions", "Node", "makeAction", "Operation", "invoke", "SpaceOperation", "OpenCreateObject", "target", "db", "typename", "targetNodeId", "getChannelsPath", "spaceId", "disposition", "contributes", "AppCapabilities", "AppGraphBuilder"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/channel-backend-feed.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Feed, Filter, Obj, Query } from '@dxos/echo';\nimport { createFeedServiceLayer } from '@dxos/echo-client';\nimport { invariant } from '@dxos/invariant';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { Channel, Message } from '@dxos/types';\n\nimport { ThreadCapabilities } from '../types';\n\n/**\n * Default local ECHO-feed-backed channel provider. Stores messages in a `Feed`\n * (`makeConfig` → `Feed.make()`), reads them via a reactive database query, and\n * writes via `Feed.append`. This is the backend `Channel.make()` defaults to.\n */\nexport const feedChannelBackend: ThreadCapabilities.ChannelBackendProvider = {\n kind: Channel.FeedBackendKind,\n label: 'Feed',\n icon: 'ph--rows--regular',\n createFields: Schema.Struct({}),\n makeConfig: () => Feed.make(),\n subscribe: (channel, onMessages) => {\n const feed = Channel.getFeed(channel);\n const db = Obj.getDatabase(channel);\n if (!feed || !db) {\n onMessages([]);\n return () => {};\n }\n\n const result = db.query(Query.select(Filter.type(Message.Message)).from(feed));\n return result.subscribe(() => onMessages(result.results), { fire: true });\n },\n send: (channel, message) =>\n Effect.gen(function* () {\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 const feed = Channel.getFeed(channel);\n invariant(feed, 'Channel is not feed-backed');\n yield* Feed.append(feed, [message]).pipe(Effect.provide(createFeedServiceLayer(space.db)));\n }),\n readOnly: (channel) => Obj.getMeta(channel).keys.length > 0,\n};\n\n/** Contributes the default feed-backed channel provider. */\nexport const ChannelBackendFeed = Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(ThreadCapabilities.ChannelBackend, feedChannelBackend);\n }),\n);\n\nexport default ChannelBackendFeed;\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,MAAMC,QAAQC,KAAKC,aAAa;AACzC,SAASC,8BAA8B;AACvC,SAASC,iBAAiB;AAC1B,SAASC,0BAA0B;AACnC,SAASC,SAASC,eAAe;AAIjC,IAAA,eAAA;AAOS,IAAA,qBAAA;EACPC,MAAM,QAAA;EACNC,OAAAA;EACAC,MAAAA;EACAC,cAAqBC,cAAAA,CAAAA,CAAAA;cACbC,MAAAA,KAAOC,KAAQC;aACfC,CAAAA,SAASC,eAAYC;AAC3B,UAAKL,OAAQ,QAAK,QAAA,OAAA;UAChBD,KAAAA,IAAW,YAAE,OAAA;QACb,CAAA,QAAO,CAAA,IAAO;AAChB,iBAAA,CAAA,CAAA;AAEA,aAAMO,MAASH;MAAAA;IACf;UAA4DI,SAAM,GAAA,MAAA,MAAA,OAAA,OAAA,KAAA,QAAA,OAAA,CAAA,EAAA,KAAA,IAAA,CAAA;AAAK,WAAA,OAAA,UAAA,MAAA,WAAA,OAAA,OAAA,GAAA;MACzE,MAAA;IACAC,CAAAA;;kBAGIC,YAAc,WAAA,aAAA;AACd,UAAMC,KAAAA,IAAS,YAAOC,OAAWC;AACjC,cAAMC,IAAQH,sBAAqBI,EAAAA,YAAO,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,sBAAA,EAAA,CAAA;AAC1CL,UAAAA,SAAUI,OAAO,WAAA,IAAA,mBAAA,MAAA;AACjB,UAAMb,QAAOC,OAAQC,OAAO,IAACG,GAAAA,OAAAA;AAC7BI,cAAUT,OAAM,mBAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,SAAA,mBAAA,EAAA,CAAA;AAChB,UAAA,OAAYe,QAAOf,QAAM,OAAA;cAACgB,MAAAA,8BAAAA,EAAAA,YAAAA,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,MAAAA,GAAAA,CAAAA,QAAAA,8BAAAA,EAAAA,CAAAA;WAAc,KAACC,OAAOC,MAAQC;MAC1D;IACFC,CAAAA,EAAWf,KAAYgB,eAAIC,uBAA4B,MAAG,EAAA,CAAA,CAAA;EAC1D,CAAA;EAEF,UAAA,CAAA,YAAA,IAAA,QAAA,OAAA,EAAA,KAAA,SAA0D;;AAKxD,IAAA,qBAAA,WAAA,WAAA,kBAAA,aAAA;AAEF,SAAA,WAAeC,YAAmB,2BAAA,gBAAA,kBAAA;;;",
|
|
6
|
-
"names": ["Effect", "Schema", "Capability", "Feed", "Filter", "Obj", "Query", "createFeedServiceLayer", "invariant", "ClientCapabilities", "Channel", "Message", "icon", "createFields", "makeConfig", "subscribe", "onMessages", "feed", "Channel", "getFeed", "db", "getDatabase", "channel", "result", "fire", "send", "invariant", "client", "Capability", "get", "space", "spaceId", "append", "message", "Effect", "provide", "createFeedServiceLayer", "readOnly", "Obj", "getMeta", "ChannelBackendFeed"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/navigation-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, TypeSection } from '@dxos/app-toolkit';\nimport { Channel } from '@dxos/types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(\n AppCapabilities.NavigationPathResolver,\n TypeSection.createTypeSectionPathResolver(Channel.Channel),\n );\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiBC,mBAAmB;AAC7C,SAASC,eAAe;AAExB,IAAA,8BAAeH,WAAWI,WACjBC,kBAAW,aAAA;AAChB,SAAOL,WAAWM,YAChBL,gBAAgBM,wBAChBL,YAAYM,8BAA8BL,QAAQA,OAAO,CAAA;AAE7D,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "AppCapabilities", "TypeSection", "Channel", "makeModule", "fnUntraced", "contributes", "NavigationPathResolver", "createTypeSectionPathResolver"]
|
|
7
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/neutral/{create-channel-Y6D7YGVX.mjs.map → create-channel-4CA7P2M5.mjs.map}
RENAMED
|
File without changes
|