@dxos/plugin-thread 0.9.0 → 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/ChannelArticle-CTYSCRTR.mjs +122 -0
- package/dist/lib/neutral/ChannelArticle-CTYSCRTR.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.mjs +4 -2
- package/dist/lib/neutral/ThreadPlugin.mjs.map +4 -4
- package/dist/lib/neutral/app-graph-builder-NZOWDFE5.mjs +65 -0
- package/dist/lib/neutral/app-graph-builder-NZOWDFE5.mjs.map +7 -0
- package/dist/lib/neutral/{append-channel-message-J6DXDPBH.mjs → append-channel-message-YIIJY6GX.mjs} +2 -2
- package/dist/lib/neutral/capabilities/index.mjs +5 -5
- package/dist/lib/neutral/{channel-backend-feed-FCXGAIEC.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-HJHK5O6F.mjs → chunk-5VTDNDBV.mjs} +5 -5
- package/dist/lib/neutral/{chunk-HJHK5O6F.mjs.map → chunk-5VTDNDBV.mjs.map} +3 -3
- package/dist/lib/neutral/chunk-A5JYVGL2.mjs +45 -0
- package/dist/lib/neutral/chunk-A5JYVGL2.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-P4RSGFS4.mjs → chunk-GM3SGQMJ.mjs} +2 -2
- package/dist/lib/neutral/chunk-J7OTCRYF.mjs +12 -0
- package/dist/lib/neutral/chunk-J7OTCRYF.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-SZXFLBZL.mjs → chunk-XPUQE4Y7.mjs} +2 -2
- package/dist/lib/neutral/components/index.mjs +8 -5
- package/dist/lib/neutral/components/index.mjs.map +3 -3
- package/dist/lib/neutral/containers/index.mjs +1 -1
- package/dist/lib/neutral/{create-channel-UW2LSL4G.mjs → create-channel-4CA7P2M5.mjs} +2 -2
- package/dist/lib/neutral/{create-object-RLCOUVAW.mjs → create-object-O3TZ2MCJ.mjs} +3 -4
- package/dist/lib/neutral/{create-object-RLCOUVAW.mjs.map → create-object-O3TZ2MCJ.mjs.map} +3 -3
- package/dist/lib/neutral/hooks/index.mjs +2 -2
- package/dist/lib/neutral/index.mjs +7 -7
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/{navigation-resolver-4X4HCQYX.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 +2 -2
- package/dist/lib/neutral/{react-surface-G6KT7TSU.mjs → react-surface-H2EKIMSK.mjs} +3 -2
- package/dist/lib/neutral/{react-surface-G6KT7TSU.mjs.map → react-surface-H2EKIMSK.mjs.map} +3 -3
- package/dist/lib/neutral/translations.mjs +1 -1
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/lib/neutral/types/index.mjs +1 -1
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- 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/index.d.ts +5 -10
- package/dist/types/src/capabilities/index.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 +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts +6 -6
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts +1 -1
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ThreadArticle/ThreadArticle.stories.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +32 -2
- 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/ThreadCapabilities.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/dx.config.ts +33 -0
- package/package.json +39 -33
- package/src/ThreadPlugin.test.ts +1 -1
- package/src/ThreadPlugin.tsx +3 -2
- package/src/capabilities/app-graph-builder.ts +43 -27
- 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/capabilities/react-surface.tsx +1 -1
- package/src/components/Chat/Chat.tsx +5 -5
- package/src/containers/ChannelArticle/ChannelArticle.stories.tsx +7 -5
- package/src/containers/ChannelArticle/ChannelArticle.tsx +72 -20
- package/src/containers/ThreadArticle/ThreadArticle.stories.tsx +3 -2
- package/src/meta.ts +3 -27
- package/src/paths.ts +6 -3
- package/src/translations.ts +1 -1
- package/src/types/ThreadCapabilities.ts +1 -1
- package/src/types/ThreadOperation.ts +7 -4
- package/dist/lib/neutral/ChannelArticle-H633OM3U.mjs +0 -57
- package/dist/lib/neutral/ChannelArticle-H633OM3U.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-OLKN3VTB.mjs +0 -50
- package/dist/lib/neutral/app-graph-builder-OLKN3VTB.mjs.map +0 -7
- package/dist/lib/neutral/channel-backend-feed-FCXGAIEC.mjs.map +0 -7
- package/dist/lib/neutral/chunk-AWAQTEU6.mjs +0 -10
- package/dist/lib/neutral/chunk-AWAQTEU6.mjs.map +0 -7
- package/dist/lib/neutral/chunk-OOC6EQ7X.mjs +0 -36
- package/dist/lib/neutral/chunk-OOC6EQ7X.mjs.map +0 -7
- package/dist/lib/neutral/navigation-resolver-4X4HCQYX.mjs.map +0 -7
- /package/dist/lib/neutral/{append-channel-message-J6DXDPBH.mjs.map → append-channel-message-YIIJY6GX.mjs.map} +0 -0
- /package/dist/lib/neutral/{chunk-P4RSGFS4.mjs.map → chunk-GM3SGQMJ.mjs.map} +0 -0
- /package/dist/lib/neutral/{chunk-SZXFLBZL.mjs.map → chunk-XPUQE4Y7.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-channel-UW2LSL4G.mjs.map → create-channel-4CA7P2M5.mjs.map} +0 -0
|
@@ -8,12 +8,15 @@ 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
|
|
|
16
|
-
const makeKey = (name: string) => DXN.make(`${meta.
|
|
19
|
+
const makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);
|
|
17
20
|
|
|
18
21
|
export const CreateChannel = Operation.make({
|
|
19
22
|
meta: { key: makeKey('createChannel'), name: 'Create Channel', icon: 'ph--hash--regular' },
|
|
@@ -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,57 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/containers/ChannelArticle/ChannelArticle.tsx
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { useCapabilities, useOperationInvoker } from "@dxos/app-framework/ui";
|
|
6
|
-
import { Obj } from "@dxos/echo";
|
|
7
|
-
import { getSpace, useMembers } from "@dxos/react-client/echo";
|
|
8
|
-
import { useIdentity } from "@dxos/react-client/halo";
|
|
9
|
-
import { Panel } from "@dxos/react-ui";
|
|
10
|
-
import { Chat } from "#components";
|
|
11
|
-
import { useMessages, useStatus } from "#hooks";
|
|
12
|
-
import { ThreadCapabilities, ThreadOperation, resolveProvider } from "#types";
|
|
13
|
-
var ChannelArticle = ({ subject: channel }) => {
|
|
14
|
-
const identity = useIdentity();
|
|
15
|
-
const space = channel ? getSpace(channel) : void 0;
|
|
16
|
-
const members = useMembers(space?.id);
|
|
17
|
-
const id = channel ? Obj.getURI(channel) : void 0;
|
|
18
|
-
const activity = useStatus(space, id);
|
|
19
|
-
const { invokePromise } = useOperationInvoker();
|
|
20
|
-
const providers = useCapabilities(ThreadCapabilities.ChannelBackend);
|
|
21
|
-
const provider = channel ? resolveProvider(providers, channel.backend.kind) : void 0;
|
|
22
|
-
const messages = useMessages(channel);
|
|
23
|
-
const readOnly = channel ? provider?.readOnly?.(channel) ?? Obj.getMeta(channel).keys.length > 0 : false;
|
|
24
|
-
const handleSend = (text) => {
|
|
25
|
-
if (!channel || !identity || readOnly) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
void invokePromise(ThreadOperation.AppendChannelMessage, {
|
|
29
|
-
channel,
|
|
30
|
-
sender: {
|
|
31
|
-
identityDid: identity.did
|
|
32
|
-
},
|
|
33
|
-
text
|
|
34
|
-
});
|
|
35
|
-
return true;
|
|
36
|
-
};
|
|
37
|
-
if (!space || !channel || !id) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
return /* @__PURE__ */ React.createElement(Panel.Root, {
|
|
41
|
-
classNames: "dx-document"
|
|
42
|
-
}, /* @__PURE__ */ React.createElement(Panel.Content, {
|
|
43
|
-
asChild: true
|
|
44
|
-
}, /* @__PURE__ */ React.createElement(Chat, {
|
|
45
|
-
id,
|
|
46
|
-
identity: identity ?? void 0,
|
|
47
|
-
members,
|
|
48
|
-
messages,
|
|
49
|
-
activity,
|
|
50
|
-
onSend: handleSend,
|
|
51
|
-
readOnly
|
|
52
|
-
})));
|
|
53
|
-
};
|
|
54
|
-
export {
|
|
55
|
-
ChannelArticle as default
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=ChannelArticle-H633OM3U.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/ChannelArticle/ChannelArticle.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport { getSpace, useMembers } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { Panel } from '@dxos/react-ui';\nimport { type Channel } from '@dxos/types';\n\nimport { Chat } from '#components';\nimport { useMessages, useStatus } from '#hooks';\nimport { ThreadCapabilities, ThreadOperation, resolveProvider } from '#types';\n\nexport type ChannelArticleProps = AppSurface.ObjectArticleProps<\n Channel.Channel | undefined,\n {\n roomId?: string;\n fullscreen?: boolean;\n }\n>;\n\n/**\n * Channel article: renders the channel chat inside a document panel. Messages\n * are read and written through the channel's backend provider (resolved by\n * `channel.backend.kind`), so the container is agnostic to where messages are\n * stored. Read-only state defaults to the provider's policy, or to \"channel\n * carries foreign-key `Obj.Meta`\" when the provider has none.\n *\n * The \"Start video call\" action and the in-call surface are contributed by\n * plugin-calls — this container is call-agnostic.\n */\nexport const ChannelArticle = ({ subject: channel }: ChannelArticleProps) => {\n const identity = useIdentity();\n const space = channel ? getSpace(channel) : undefined;\n const members = useMembers(space?.id);\n const id = channel ? Obj.getURI(channel) : undefined;\n const activity = useStatus(space, id);\n const { invokePromise } = useOperationInvoker();\n\n const providers = useCapabilities(ThreadCapabilities.ChannelBackend);\n const provider = channel ? resolveProvider(providers, channel.backend.kind) : undefined;\n const messages = useMessages(channel);\n const readOnly = channel ? (provider?.readOnly?.(channel) ?? Obj.getMeta(channel).keys.length > 0) : false;\n\n const handleSend = (text: string) => {\n if (!channel || !identity || readOnly) {\n return false;\n }\n\n void invokePromise(ThreadOperation.AppendChannelMessage, {\n channel,\n sender: { identityDid: identity.did },\n text,\n });\n\n return true;\n };\n\n if (!space || !channel || !id) {\n return null;\n }\n\n return (\n <Panel.Root classNames='dx-document'>\n <Panel.Content asChild>\n <Chat\n id={id}\n identity={identity ?? undefined}\n members={members}\n messages={messages}\n activity={activity}\n onSend={handleSend}\n readOnly={readOnly}\n />\n </Panel.Content>\n </Panel.Root>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,OAAOA,WAAW;AAElB,SAASC,iBAAiBC,2BAA2B;AAErD,SAASC,WAAW;AACpB,SAASC,UAAUC,kBAAkB;AACrC,SAASC,mBAAmB;AAC5B,SAASC,aAAa;AAGtB,SAASC,YAAY;AACrB,SAASC,aAAaC,iBAAiB;AACvC,SAASC,oBAAoBC,iBAAiBC,uBAAuB;AAoB9D,IAAMC,iBAAiB,CAAC,EAAEC,SAASC,QAAO,MAAuB;AACtE,QAAMC,WAAWX,YAAAA;AACjB,QAAMY,QAAQF,UAAUZ,SAASY,OAAAA,IAAWG;AAC5C,QAAMC,UAAUf,WAAWa,OAAOG,EAAAA;AAClC,QAAMA,KAAKL,UAAUb,IAAImB,OAAON,OAAAA,IAAWG;AAC3C,QAAMI,WAAWb,UAAUQ,OAAOG,EAAAA;AAClC,QAAM,EAAEG,cAAa,IAAKtB,oBAAAA;AAE1B,QAAMuB,YAAYxB,gBAAgBU,mBAAmBe,cAAc;AACnE,QAAMC,WAAWX,UAAUH,gBAAgBY,WAAWT,QAAQY,QAAQC,IAAI,IAAIV;AAC9E,QAAMW,WAAWrB,YAAYO,OAAAA;AAC7B,QAAMe,WAAWf,UAAWW,UAAUI,WAAWf,OAAAA,KAAYb,IAAI6B,QAAQhB,OAAAA,EAASiB,KAAKC,SAAS,IAAK;AAErG,QAAMC,aAAa,CAACC,SAAAA;AAClB,QAAI,CAACpB,WAAW,CAACC,YAAYc,UAAU;AACrC,aAAO;IACT;AAEA,SAAKP,cAAcZ,gBAAgByB,sBAAsB;MACvDrB;MACAsB,QAAQ;QAAEC,aAAatB,SAASuB;MAAI;MACpCJ;IACF,CAAA;AAEA,WAAO;EACT;AAEA,MAAI,CAAClB,SAAS,CAACF,WAAW,CAACK,IAAI;AAC7B,WAAO;EACT;AAEA,SACE,sBAAA,cAACd,MAAMkC,MAAI;IAACC,YAAW;KACrB,sBAAA,cAACnC,MAAMoC,SAAO;IAACC,SAAAA;KACb,sBAAA,cAACpC,MAAAA;IACCa;IACAJ,UAAUA,YAAYE;IACtBC;IACAU;IACAP;IACAsB,QAAQV;IACRJ;;AAKV;",
|
|
6
|
-
"names": ["React", "useCapabilities", "useOperationInvoker", "Obj", "getSpace", "useMembers", "useIdentity", "Panel", "Chat", "useMessages", "useStatus", "ThreadCapabilities", "ThreadOperation", "resolveProvider", "ChannelArticle", "subject", "channel", "identity", "space", "undefined", "members", "id", "getURI", "activity", "invokePromise", "providers", "ChannelBackend", "provider", "backend", "kind", "messages", "readOnly", "getMeta", "keys", "length", "handleSend", "text", "AppendChannelMessage", "sender", "identityDid", "did", "Root", "classNames", "Content", "asChild", "onSend"]
|
|
7
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/capabilities/app-graph-builder.ts
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import * as Option from "effect/Option";
|
|
6
|
-
import { Capability } from "@dxos/app-framework";
|
|
7
|
-
import { AppCapabilities, createTypeSectionExtension } from "@dxos/app-toolkit";
|
|
8
|
-
import { isSpace } from "@dxos/client/echo";
|
|
9
|
-
import { Operation } from "@dxos/compute";
|
|
10
|
-
import { Type } from "@dxos/echo";
|
|
11
|
-
import { GraphBuilder, Node } from "@dxos/plugin-graph";
|
|
12
|
-
import { SpaceOperation } from "@dxos/plugin-space";
|
|
13
|
-
import { Channel } from "@dxos/types";
|
|
14
|
-
var channelTypename = Type.getTypename(Channel.Channel);
|
|
15
|
-
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
16
|
-
const extensions = yield* Effect.all([
|
|
17
|
-
createTypeSectionExtension(Channel.Channel),
|
|
18
|
-
GraphBuilder.createExtension({
|
|
19
|
-
id: "channelsSectionActions",
|
|
20
|
-
match: (node) => {
|
|
21
|
-
const space = isSpace(node.properties.space) ? node.properties.space : void 0;
|
|
22
|
-
return node.type === channelTypename && space ? Option.some(space) : Option.none();
|
|
23
|
-
},
|
|
24
|
-
actions: (space) => Effect.succeed([
|
|
25
|
-
Node.makeAction({
|
|
26
|
-
id: "create-channel",
|
|
27
|
-
data: () => Operation.invoke(SpaceOperation.OpenCreateObject, {
|
|
28
|
-
target: space.db,
|
|
29
|
-
typename: channelTypename
|
|
30
|
-
}),
|
|
31
|
-
properties: {
|
|
32
|
-
label: [
|
|
33
|
-
"add-object.label",
|
|
34
|
-
{
|
|
35
|
-
ns: channelTypename
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
icon: "ph--plus--regular",
|
|
39
|
-
disposition: "list-item-primary"
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
])
|
|
43
|
-
})
|
|
44
|
-
]);
|
|
45
|
-
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
46
|
-
}));
|
|
47
|
-
export {
|
|
48
|
-
app_graph_builder_default as default
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=app-graph-builder-OLKN3VTB.mjs.map
|
|
@@ -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, createTypeSectionExtension } from '@dxos/app-toolkit';\nimport { isSpace } from '@dxos/client/echo';\nimport { Operation } from '@dxos/compute';\nimport { Type } from '@dxos/echo';\nimport { GraphBuilder, Node } from '@dxos/plugin-graph';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { Channel } from '@dxos/types';\n\nconst channelTypename = Type.getTypename(Channel.Channel);\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* Effect.all([\n createTypeSectionExtension(Channel.Channel),\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 }),\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,kCAAkC;AAC5D,SAASC,eAAe;AACxB,SAASC,iBAAiB;AAC1B,SAASC,YAAY;AACrB,SAASC,cAAcC,YAAY;AACnC,SAASC,sBAAsB;AAC/B,SAASC,eAAe;AAExB,IAAMC,kBAAkBL,KAAKM,YAAYF,QAAQA,OAAO;AAExD,IAAA,4BAAeT,WAAWY,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAcC,WAAI;IACnCb,2BAA2BO,QAAQA,OAAO;IAE1CH,aAAaU,gBAAgB;MAC3BC,IAAI;MACJC,OAAO,CAACC,SAAAA;AACN,cAAMC,QAAQjB,QAAQgB,KAAKE,WAAWD,KAAK,IAAID,KAAKE,WAAWD,QAAQE;AACvE,eAAOH,KAAKI,SAASb,mBAAmBU,QAAeI,YAAKJ,KAAAA,IAAgBK,YAAI;MAClF;MACAC,SAAS,CAACN,UACDO,eAAQ;QACbpB,KAAKqB,WAAW;UACdX,IAAI;UACJY,MAAM,MACJzB,UAAU0B,OAAOtB,eAAeuB,kBAAkB;YAChDC,QAAQZ,MAAMa;YACdC,UAAUxB;UACZ,CAAA;UACFW,YAAY;YACVc,OAAO;cAAC;cAAoB;gBAAEC,IAAI1B;cAAgB;;YAClD2B,MAAM;YACNC,aAAa;UACf;QACF,CAAA;OACD;IACL,CAAA;GACD;AAED,SAAOtC,WAAWuC,YAAYtC,gBAAgBuC,iBAAiB1B,UAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Option", "Capability", "AppCapabilities", "createTypeSectionExtension", "isSpace", "Operation", "Type", "GraphBuilder", "Node", "SpaceOperation", "Channel", "channelTypename", "getTypename", "makeModule", "fnUntraced", "extensions", "all", "createExtension", "id", "match", "node", "space", "properties", "undefined", "type", "some", "none", "actions", "succeed", "makeAction", "data", "invoke", "OpenCreateObject", "target", "db", "typename", "label", "ns", "icon", "disposition", "contributes", "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.queues)));\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,MAAA,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,10 +0,0 @@
|
|
|
1
|
-
// src/paths.ts
|
|
2
|
-
import { createTypeSectionPaths } from "@dxos/app-toolkit";
|
|
3
|
-
import { Channel } from "@dxos/types";
|
|
4
|
-
var { getSectionPath: getChannelsPath, getObjectPath: getChannelPath } = createTypeSectionPaths(Channel.Channel);
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
getChannelsPath,
|
|
8
|
-
getChannelPath
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=chunk-AWAQTEU6.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/paths.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { createTypeSectionPaths } from '@dxos/app-toolkit';\nimport { Channel } from '@dxos/types';\n\nconst { getSectionPath: getChannelsPath, getObjectPath: getChannelPath } = createTypeSectionPaths(Channel.Channel);\n\nexport { getChannelsPath, getChannelPath };\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,8BAA8B;AACvC,SAASC,eAAe;AAExB,IAAM,EAAEC,gBAAgBC,iBAAiBC,eAAeC,eAAc,IAAKL,uBAAuBC,QAAQA,OAAO;",
|
|
6
|
-
"names": ["createTypeSectionPaths", "Channel", "getSectionPath", "getChannelsPath", "getObjectPath", "getChannelPath"]
|
|
7
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// src/meta.ts
|
|
2
|
-
import { Plugin } from "@dxos/app-framework";
|
|
3
|
-
import { DXN } from "@dxos/keys";
|
|
4
|
-
import { trim } from "@dxos/util";
|
|
5
|
-
var meta = Plugin.makeMeta({
|
|
6
|
-
key: DXN.make("org.dxos.plugin.thread"),
|
|
7
|
-
name: "Threads",
|
|
8
|
-
author: "DXOS",
|
|
9
|
-
description: trim`
|
|
10
|
-
ThreadPlugin provides chat: channels backed by an ECHO feed and free-standing
|
|
11
|
-
message threads. It renders the channel article and companion surfaces plus a
|
|
12
|
-
thread surface, and contributes the operations that create a default channel on
|
|
13
|
-
space creation, create new channels, and append messages.
|
|
14
|
-
|
|
15
|
-
Channel messages are stored in the channel's feed queue and rendered newest-last
|
|
16
|
-
with a pinned composer; externally-synced channels (carrying foreign-key
|
|
17
|
-
metadata, e.g. Slack/Discord-sourced rooms) render read-only because there is no
|
|
18
|
-
local-write path back to the source. Free-standing threads render their messages
|
|
19
|
-
and append by pushing onto the thread's message list.
|
|
20
|
-
|
|
21
|
-
The shared message and thread UI comes from @dxos/react-ui-thread; the Channel,
|
|
22
|
-
Message, and Thread schema come from @dxos/types. Document comments and the
|
|
23
|
-
comment-thread AI agent live in the @dxos/plugin-comments plugin.
|
|
24
|
-
`,
|
|
25
|
-
icon: "ph--video-conference--regular",
|
|
26
|
-
iconHue: "rose",
|
|
27
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-thread",
|
|
28
|
-
spec: "PLUGIN.mdl"
|
|
29
|
-
});
|
|
30
|
-
var THREAD_ITEM = `${meta.id}.item`;
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
meta,
|
|
34
|
-
THREAD_ITEM
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=chunk-OOC6EQ7X.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const meta = Plugin.makeMeta({\n key: DXN.make('org.dxos.plugin.thread'),\n name: 'Threads',\n author: 'DXOS',\n description: trim`\n ThreadPlugin provides chat: channels backed by an ECHO feed and free-standing\n message threads. It renders the channel article and companion surfaces plus a\n thread surface, and contributes the operations that create a default channel on\n space creation, create new channels, and append messages.\n\n Channel messages are stored in the channel's feed queue and rendered newest-last\n with a pinned composer; externally-synced channels (carrying foreign-key\n metadata, e.g. Slack/Discord-sourced rooms) render read-only because there is no\n local-write path back to the source. Free-standing threads render their messages\n and append by pushing onto the thread's message list.\n\n The shared message and thread UI comes from @dxos/react-ui-thread; the Channel,\n Message, and Thread schema come from @dxos/types. Document comments and the\n comment-thread AI agent live in the @dxos/plugin-comments plugin.\n `,\n icon: 'ph--video-conference--regular',\n iconHue: 'rose',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-thread',\n spec: 'PLUGIN.mdl',\n});\n\nexport const THREAD_ITEM = `${meta.id}.item`;\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,WAAW;AACpB,SAASC,YAAY;AAEd,IAAMC,OAAOH,OAAOI,SAAS;EAClCC,KAAKJ,IAAIK,KAAK,wBAAA;EACdC,MAAM;EACNC,QAAQ;EACRC,aAAaP;;;;;;;;;;;;;;;;EAgBbQ,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,MAAM;AACR,CAAA;AAEO,IAAMC,cAAc,GAAGX,KAAKY,EAAE;",
|
|
6
|
-
"names": ["Plugin", "DXN", "trim", "meta", "makeMeta", "key", "make", "name", "author", "description", "icon", "iconHue", "source", "spec", "THREAD_ITEM", "id"]
|
|
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, createTypeSectionPathResolver } 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 createTypeSectionPathResolver(Channel.Channel),\n );\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiBC,qCAAqC;AAC/D,SAASC,eAAe;AAExB,IAAA,8BAAeH,WAAWI,WACjBC,kBAAW,aAAA;AAChB,SAAOL,WAAWM,YAChBL,gBAAgBM,wBAChBL,8BAA8BC,QAAQA,OAAO,CAAA;AAEjD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "AppCapabilities", "createTypeSectionPathResolver", "Channel", "makeModule", "fnUntraced", "contributes", "NavigationPathResolver"]
|
|
7
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/neutral/{create-channel-UW2LSL4G.mjs.map → create-channel-4CA7P2M5.mjs.map}
RENAMED
|
File without changes
|