@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
|
@@ -0,0 +1,7 @@
|
|
|
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 { Operation } from '@dxos/compute';\nimport { Obj } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\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.update(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,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AAIvC,IAAA,eAA8DC;IAKxDC,UAAWC,eAASA,KAAAA,UAAAA,YAAAA,kBAAAA,WAAAA,OAAAA;QAClB,SAAWC,MAAM;aACfD,QAAOC,CAAAA,YAAS;AAClB,QAAAD,QAAWA,WAAOC,YAAWD,QAAY,WAAA,QAAA;AACvCA,MAAAA,QAAOC,SAAS;IAClB,WAAAD,QAAA,WAAA,YAAA;AACF,MAAAA,QAAA,SAAA;IAEA;EACAE,CAAAA;AAEA,QAAA,KAAOC,IAAAA,YAAmBC,MAAAA;YAClB,IAAA,sBAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,sBAAA,EAAA,CAAA;SACNC,UAAY,SAAA,uBAAA,WAAA;UACVC;gBACAC;MACF,SAAA,GAAA;MACF,UAAA,OAAA;IACF;EAIJ,CAAA;;;",
|
|
6
|
+
"names": ["Effect", "Operation", "Obj", "invariant", "ObservabilityOperation", "ToggleResolved", "Obj", "thread", "status", "invariant", "Operation", "ObservabilityOperation", "properties", "spaceId", "threadId"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/translations.ts
|
|
4
|
+
import { Type } from "@dxos/echo";
|
|
5
|
+
import { meta } from "#meta";
|
|
6
|
+
import { Channel } from "#types";
|
|
7
|
+
var translations = [
|
|
8
|
+
{
|
|
9
|
+
"en-US": {
|
|
10
|
+
[Type.getTypename(Channel.Channel)]: {
|
|
11
|
+
"typename.label": "Channel",
|
|
12
|
+
"typename.label_zero": "Channels",
|
|
13
|
+
"typename.label_one": "Channel",
|
|
14
|
+
"typename.label_other": "Channels",
|
|
15
|
+
"object-name.placeholder": "New channel",
|
|
16
|
+
"add-object.label": "Add channel",
|
|
17
|
+
"rename-object.label": "Rename channel",
|
|
18
|
+
"delete-object.label": "Delete channel",
|
|
19
|
+
"object-deleted.label": "Channel deleted"
|
|
20
|
+
},
|
|
21
|
+
[meta.id]: {
|
|
22
|
+
"plugin.name": "Chat",
|
|
23
|
+
"channel-title.label": "Title",
|
|
24
|
+
"message.placeholder": "Reply\u2026",
|
|
25
|
+
"activity.message": "Processing\u2026",
|
|
26
|
+
"anonymous.label": "Anonymous",
|
|
27
|
+
"delete-message-block.label": "Delete message block",
|
|
28
|
+
"detached-thread.label": "Referenced content was removed",
|
|
29
|
+
"delete-thread.label": "Delete thread",
|
|
30
|
+
"resolve-thread.label": "Resolve thread",
|
|
31
|
+
"thread-deleted.label": "Thread deleted",
|
|
32
|
+
"message-deleted.label": "Message deleted",
|
|
33
|
+
"comments.heading": "Comments",
|
|
34
|
+
"chat.heading": "Chat",
|
|
35
|
+
"draft.button": "DRAFT",
|
|
36
|
+
"no-comments.title": "Comments",
|
|
37
|
+
"no-comments.message": "Click on the <commentIcon></commentIcon> button in the document toolbar to create a comment thread on the selected text.",
|
|
38
|
+
"toggle-show-resolved.label": "Show resolved",
|
|
39
|
+
"unnamed-object-threads.label": "Threads",
|
|
40
|
+
"mark-as-resolved.label": "Mark as resolved",
|
|
41
|
+
"mark-as-unresolved.label": "Mark as unresolved",
|
|
42
|
+
"save-message.label": "Save",
|
|
43
|
+
"edit-message.label": "Edit",
|
|
44
|
+
"delete-message.label": "Delete message",
|
|
45
|
+
"accept-proposal.label": "Accept proposal",
|
|
46
|
+
"open-comments-panel.label": "Show Comments",
|
|
47
|
+
"comments.label": "Comments",
|
|
48
|
+
"show-all.label": "All comments",
|
|
49
|
+
"show-unresolved.label": "Unresolved comments",
|
|
50
|
+
"add-comment.label": "Add comment",
|
|
51
|
+
"channel-companion.label": "Channel",
|
|
52
|
+
"call-panel.label": "Active Call",
|
|
53
|
+
"display-name.label": "Display name",
|
|
54
|
+
"display-name.description": "Set your display name before joining a meeting.",
|
|
55
|
+
"display-name-input.placeholder": "Enter your name",
|
|
56
|
+
"set-display-name.label": "Continue",
|
|
57
|
+
"call-tab.label": "Call",
|
|
58
|
+
"meeting-status.title": "Calls",
|
|
59
|
+
"share-meeting-link.label": "Share meeting",
|
|
60
|
+
"show-webrtc-stats.title": "WebRTC Stats",
|
|
61
|
+
"show-calls-history.title": "Service History",
|
|
62
|
+
"meeting-summary.label": "Summary",
|
|
63
|
+
"summarize.label": "Summarize",
|
|
64
|
+
"summarizing.label": "Creating summary...",
|
|
65
|
+
"create-summary.message": "A summary doesn\u2019t exist for this meeting yet. Create one now?",
|
|
66
|
+
"icon-pin.label": "Pin video",
|
|
67
|
+
"icon-unpin.label": "Unpin video",
|
|
68
|
+
"icon-wave.label": "Waving",
|
|
69
|
+
"icon-muted.label": "Muted",
|
|
70
|
+
"join-call.button": "Join",
|
|
71
|
+
"leave-call.button": "Leave",
|
|
72
|
+
"mic-on.button": "Unmute",
|
|
73
|
+
"mic-off.button": "Mute",
|
|
74
|
+
"camera-on.button": "Turn camera on",
|
|
75
|
+
"camera-off.button": "Turn camera off",
|
|
76
|
+
"camera-off.label": "Camera off",
|
|
77
|
+
"raise-hand.button": "Raise hand",
|
|
78
|
+
"lower-hand.button": "Lower hand",
|
|
79
|
+
"screenshare-on.button": "Share screen",
|
|
80
|
+
"screenshare-off.button": "Stop streaming",
|
|
81
|
+
"channel-toolbar.title": "Channel actions",
|
|
82
|
+
"start-video-call.menu": "Start video call"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
export {
|
|
88
|
+
translations
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=translations.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Type } from '@dxos/echo';\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\nimport { Channel } from '#types';\n\nexport const translations = [\n {\n 'en-US': {\n [Type.getTypename(Channel.Channel)]: {\n 'typename.label': 'Channel',\n 'typename.label_zero': 'Channels',\n 'typename.label_one': 'Channel',\n 'typename.label_other': 'Channels',\n 'object-name.placeholder': 'New channel',\n 'add-object.label': 'Add channel',\n 'rename-object.label': 'Rename channel',\n 'delete-object.label': 'Delete channel',\n 'object-deleted.label': 'Channel deleted',\n },\n [meta.id]: {\n 'plugin.name': 'Chat',\n 'channel-title.label': 'Title',\n 'message.placeholder': 'Reply…',\n 'activity.message': 'Processing…',\n 'anonymous.label': 'Anonymous',\n 'delete-message-block.label': 'Delete message block',\n 'detached-thread.label': 'Referenced content was removed',\n 'delete-thread.label': 'Delete thread',\n 'resolve-thread.label': 'Resolve thread',\n 'thread-deleted.label': 'Thread deleted',\n 'message-deleted.label': 'Message deleted',\n 'comments.heading': 'Comments',\n 'chat.heading': 'Chat',\n 'draft.button': 'DRAFT',\n 'no-comments.title': 'Comments',\n 'no-comments.message':\n 'Click on the <commentIcon></commentIcon> button in the document toolbar to create a comment thread on the selected text.',\n 'toggle-show-resolved.label': 'Show resolved',\n 'unnamed-object-threads.label': 'Threads',\n 'mark-as-resolved.label': 'Mark as resolved',\n 'mark-as-unresolved.label': 'Mark as unresolved',\n 'save-message.label': 'Save',\n 'edit-message.label': 'Edit',\n 'delete-message.label': 'Delete message',\n 'accept-proposal.label': 'Accept proposal',\n 'open-comments-panel.label': 'Show Comments',\n 'comments.label': 'Comments',\n 'show-all.label': 'All comments',\n 'show-unresolved.label': 'Unresolved comments',\n 'add-comment.label': 'Add comment',\n\n 'channel-companion.label': 'Channel',\n 'call-panel.label': 'Active Call',\n\n 'display-name.label': 'Display name',\n 'display-name.description': 'Set your display name before joining a meeting.',\n 'display-name-input.placeholder': 'Enter your name',\n 'set-display-name.label': 'Continue',\n\n 'call-tab.label': 'Call',\n 'meeting-status.title': 'Calls',\n 'share-meeting-link.label': 'Share meeting',\n 'show-webrtc-stats.title': 'WebRTC Stats',\n 'show-calls-history.title': 'Service History',\n\n 'meeting-summary.label': 'Summary',\n 'summarize.label': 'Summarize',\n 'summarizing.label': 'Creating summary...',\n 'create-summary.message': 'A summary doesn’t exist for this meeting yet. Create one now?',\n\n 'icon-pin.label': 'Pin video',\n 'icon-unpin.label': 'Unpin video',\n 'icon-wave.label': 'Waving',\n 'icon-muted.label': 'Muted',\n 'join-call.button': 'Join',\n 'leave-call.button': 'Leave',\n 'mic-on.button': 'Unmute',\n 'mic-off.button': 'Mute',\n 'camera-on.button': 'Turn camera on',\n 'camera-off.button': 'Turn camera off',\n 'camera-off.label': 'Camera off',\n 'raise-hand.button': 'Raise hand',\n 'lower-hand.button': 'Lower hand',\n 'screenshare-on.button': 'Share screen',\n 'screenshare-off.button': 'Stop streaming',\n\n 'channel-toolbar.title': 'Channel actions',\n 'start-video-call.menu': 'Start video call',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,YAAY;AAGrB,SAASC,YAAY;AACrB,SAASC,eAAe;AAEjB,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACH,KAAKI,YAAYF,QAAQA,OAAO,CAAA,GAAI;QACnC,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;QAC3B,oBAAoB;QACpB,uBAAuB;QACvB,uBAAuB;QACvB,wBAAwB;MAC1B;MACA,CAACD,KAAKI,EAAE,GAAG;QACT,eAAe;QACf,uBAAuB;QACvB,uBAAuB;QACvB,oBAAoB;QACpB,mBAAmB;QACnB,8BAA8B;QAC9B,yBAAyB;QACzB,uBAAuB;QACvB,wBAAwB;QACxB,wBAAwB;QACxB,yBAAyB;QACzB,oBAAoB;QACpB,gBAAgB;QAChB,gBAAgB;QAChB,qBAAqB;QACrB,uBACE;QACF,8BAA8B;QAC9B,gCAAgC;QAChC,0BAA0B;QAC1B,4BAA4B;QAC5B,sBAAsB;QACtB,sBAAsB;QACtB,wBAAwB;QACxB,yBAAyB;QACzB,6BAA6B;QAC7B,kBAAkB;QAClB,kBAAkB;QAClB,yBAAyB;QACzB,qBAAqB;QAErB,2BAA2B;QAC3B,oBAAoB;QAEpB,sBAAsB;QACtB,4BAA4B;QAC5B,kCAAkC;QAClC,0BAA0B;QAE1B,kBAAkB;QAClB,wBAAwB;QACxB,4BAA4B;QAC5B,2BAA2B;QAC3B,4BAA4B;QAE5B,yBAAyB;QACzB,mBAAmB;QACnB,qBAAqB;QACrB,0BAA0B;QAE1B,kBAAkB;QAClB,oBAAoB;QACpB,mBAAmB;QACnB,oBAAoB;QACpB,oBAAoB;QACpB,qBAAqB;QACrB,iBAAiB;QACjB,kBAAkB;QAClB,oBAAoB;QACpB,qBAAqB;QACrB,oBAAoB;QACpB,qBAAqB;QACrB,qBAAqB;QACrB,yBAAyB;QACzB,0BAA0B;QAE1B,yBAAyB;QACzB,yBAAyB;MAC3B;IACF;EACF;;",
|
|
6
|
+
"names": ["Type", "meta", "Channel", "translations", "getTypename", "id"]
|
|
7
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
AddMessage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4KRVIOPC.mjs";
|
|
5
5
|
import {
|
|
6
6
|
ThreadCapabilities
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2Q6V7NGK.mjs";
|
|
8
8
|
import "./chunk-HSLMI22Q.mjs";
|
|
9
9
|
|
|
10
10
|
// src/operations/add-message.ts
|
|
11
11
|
import * as Effect from "effect/Effect";
|
|
12
12
|
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
13
|
+
import { Operation } from "@dxos/compute";
|
|
13
14
|
import { Obj, Ref, Relation } from "@dxos/echo";
|
|
14
15
|
import { invariant } from "@dxos/invariant";
|
|
15
|
-
import { Operation } from "@dxos/operation";
|
|
16
16
|
import { ObservabilityOperation } from "@dxos/plugin-observability/operations";
|
|
17
17
|
import { SpaceOperation } from "@dxos/plugin-space/operations";
|
|
18
18
|
import { AnchoredTo, Message } from "@dxos/types";
|
|
@@ -23,15 +23,7 @@ var handler = AddMessage.pipe(Operation.withHandler(Effect.fnUntraced(function*
|
|
|
23
23
|
const thread = Relation.getSource(anchor);
|
|
24
24
|
const subjectId = Obj.getDXN(subject).toString();
|
|
25
25
|
const db = Obj.getDatabase(subject);
|
|
26
|
-
invariant(db, "Database not found", {
|
|
27
|
-
F: __dxlog_file,
|
|
28
|
-
L: 26,
|
|
29
|
-
S: this,
|
|
30
|
-
A: [
|
|
31
|
-
"db",
|
|
32
|
-
"'Database not found'"
|
|
33
|
-
]
|
|
34
|
-
});
|
|
26
|
+
invariant(db, "Database not found", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 20, S: this, A: ["db", "'Database not found'"] });
|
|
35
27
|
const message = Obj.make(Message.Message, {
|
|
36
28
|
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
37
29
|
sender,
|
|
@@ -42,13 +34,13 @@ var handler = AddMessage.pipe(Operation.withHandler(Effect.fnUntraced(function*
|
|
|
42
34
|
}
|
|
43
35
|
]
|
|
44
36
|
});
|
|
45
|
-
Obj.
|
|
37
|
+
Obj.update(thread, (thread2) => {
|
|
46
38
|
thread2.messages.push(Ref.make(message));
|
|
47
39
|
});
|
|
48
40
|
const state = registry.get(stateAtom);
|
|
49
41
|
const draft = state.drafts[subjectId]?.find((a) => a.id === anchor.id);
|
|
50
42
|
if (draft) {
|
|
51
|
-
Obj.
|
|
43
|
+
Obj.update(thread, (thread2) => {
|
|
52
44
|
thread2.status = "active";
|
|
53
45
|
});
|
|
54
46
|
registry.set(stateAtom, {
|
|
@@ -95,4 +87,4 @@ var add_message_default = handler;
|
|
|
95
87
|
export {
|
|
96
88
|
add_message_default as default
|
|
97
89
|
};
|
|
98
|
-
//# sourceMappingURL=add-message-
|
|
90
|
+
//# sourceMappingURL=add-message-HJXNAILW.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/add-message.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Obj, Ref, Relation } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\nimport { SpaceOperation } from '@dxos/plugin-space/operations';\nimport { AnchoredTo, Message, Thread } from '@dxos/types';\n\nimport { ThreadCapabilities } from '../types';\nimport { AddMessage } from './definitions';\n\nconst handler: Operation.WithHandler<typeof AddMessage> = AddMessage.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ anchor, subject, sender, text }) {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(ThreadCapabilities.State);\n const thread = Relation.getSource(anchor) as Thread.Thread;\n const subjectId = Obj.getDXN(subject).toString();\n const db = Obj.getDatabase(subject);\n invariant(db, 'Database not found');\n\n const message = Obj.make(Message.Message, {\n created: new Date().toISOString(),\n sender,\n blocks: [{ _tag: 'text', text }],\n });\n Obj.update(thread, (thread) => {\n thread.messages.push(Ref.make(message));\n });\n\n const state = registry.get(stateAtom);\n const draft = state.drafts[subjectId]?.find((a: { id: string }) => a.id === anchor.id);\n if (draft) {\n Obj.update(thread, (thread) => {\n thread.status = 'active';\n });\n registry.set(stateAtom, {\n ...state,\n drafts: {\n ...state.drafts,\n [subjectId]: state.drafts[subjectId]?.filter((a: { id: string }) => a.id !== anchor.id),\n },\n });\n yield* Operation.invoke(SpaceOperation.AddObject, { object: thread, target: db, hidden: true });\n yield* Operation.invoke(SpaceOperation.AddRelation, {\n db,\n schema: AnchoredTo.AnchoredTo,\n source: thread,\n target: subject,\n fields: { anchor: draft.anchor },\n });\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.create',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n },\n });\n }\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.message.add',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n threadLength: thread.messages.length,\n messageId: message.id,\n messageLength: text.length,\n },\n });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiB;AAC1B,SAASC,KAAKC,KAAKC,gBAAgB;AACnC,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AACvC,SAASC,sBAAsB;AAC/B,SAASC,YAAYC,eAAuB;AAK5C,IAAA,eAA0DC;IAIpD,UAAMC,WAAY,KAAOC,UAAWC,YAAIC,kBAAwB,WAAA,EAAA,QAAA,SAAA,QAAA,KAAA,GAAA;AAChE,QAAMC,WAASC,OAASC,WAAUC,IAAAA,aAAAA,YAAAA;AAClC,QAAMC,YAAYC,OAAIC,WAAOC,IAASC,mBAAQ,KAAA;AAC9C,QAAMC,SAASC,SAAAA,UAAYH,MAAAA;AAC3BI,QAAAA,YAAc,IAAA,OAAA,OAAA,EAAA,SAAA;AAEd,QAAMC,KAAAA,IAAAA,YAAmBC,OAAQA;YAC/BC,IAAS,sBAAsB,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,sBAAA,EAAA,CAAA;QAC/BC,UAAAA,IAAAA,KAAAA,QAAAA,SAAAA;IACAC,UAAQ,oBAAA,KAAA,GAAA,YAAA;;YAAGC;;QAAmB,MAAA;QAAE;MAClC;IACIC;;AAEJ,MAAA,OAAA,QAAA,CAAAlB,YAAA;AAEA,IAAAA,QAAMmB,SAAQC,KAAStB,IAAIF,KAAAA,OAAAA,CAAAA;EAC3B,CAAA;AACA,QAAIyB,QAAO,SAAA,IAAA,SAAA;QACThB,QAAU,MAACL,OAASA,SAAAA,GAAAA,KAAAA,CAAAA,MAAAA,EAAAA,OAAAA,OAAAA,EAAAA;aAClBA;AACF,QAAA,OAAA,QAAA,CAAAA,YAAA;AACAoB,MAAAA,QAASE,SAAI1B;;aAEX2B,IAAQ,WAAA;;cAELnB;QACH,GAAA,MAAA;QACF,CAAA,SAAA,GAAA,MAAA,OAAA,SAAA,GAAA,OAAA,CAAA,MAAA,EAAA,OAAA,OAAA,EAAA;MACA;;WAAoEoB,UAAQf,OAAAA,eAAAA,WAAAA;MAAIgB,QAAQ;MAAK,QAAA;MAC7F,QAAOC;;WAELC,UAAQC,OAAWA,eAAU,aAAA;MAC7BC;MACAL,QAAQjB,WAAAA;MACRuB,QAAQ;cAAE3B;MAAqB,QAAA;QACjC,QAAA,MAAA;MACA;;WAEE4B,UAAY,SAAA,uBAAA,WAAA;YACVC;kBACAC;QACF,SAAA,GAAA;QACF,UAAA,OAAA;MACF;IAEA,CAAA;;SAEEF,UAAY,SAAA,uBAAA,WAAA;UACVC;gBACAC;MACAC,SAAAA,GAAAA;MACAC,UAAAA,OAAWvB;MACXwB,cAAAA,OAAoBC,SAAM;MAC5B,WAAA,QAAA;MACF,eAAA,KAAA;IACF;EAIJ,CAAA;;;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "Operation", "Obj", "Ref", "Relation", "invariant", "ObservabilityOperation", "SpaceOperation", "AnchoredTo", "Message", "AddMessage", "stateAtom", "Capability", "get", "ThreadCapabilities", "thread", "Relation", "getSource", "anchor", "subjectId", "Obj", "getDXN", "subject", "toString", "db", "getDatabase", "invariant", "message", "Message", "created", "sender", "blocks", "_tag", "update", "state", "registry", "draft", "set", "drafts", "target", "hidden", "Operation", "schema", "AnchoredTo", "source", "fields", "properties", "spaceId", "threadId", "threadLength", "messageId", "messageLength", "length"]
|
|
7
|
+
}
|
|
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import "../chunk-HSLMI22Q.mjs";
|
|
3
3
|
|
|
4
4
|
// src/blueprints/thread-blueprint.ts
|
|
5
|
-
import { Blueprint, Template } from "@dxos/
|
|
5
|
+
import { Blueprint, Template } from "@dxos/compute";
|
|
6
6
|
import { trim } from "@dxos/util";
|
|
7
7
|
import { ThreadOperation } from "#operations";
|
|
8
8
|
var BLUEPRINT_KEY = "org.dxos.blueprint.thread";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/blueprints/thread-blueprint.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {
|
|
5
|
-
"mappings": ";;;;
|
|
6
|
-
"names": ["Blueprint", "Template", "trim", "ThreadOperation", "BLUEPRINT_KEY", "make", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Blueprint, Template } from '@dxos/compute';\nimport { trim } from '@dxos/util';\n\nimport { ThreadOperation } from '#operations';\n\nconst BLUEPRINT_KEY = 'org.dxos.blueprint.thread';\n\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'Thread',\n tools: Blueprint.toolDefinitions({ operations: [ThreadOperation.CreateProposals] }),\n instructions: Template.make({\n // TODO(wittjosiah): Move example to function input schema annotation.\n source: trim`\n You can update markdown documents via proposals.\n For each diff, respond with the smallest possible matching span.\n For example:\n - \"There is a tyop in this sentence.\"\n + \"There is a typo in this sentence.\"\n - \"This id goof.\"\n + \"This is good.\"\n `,\n }),\n });\n\nconst blueprint: Blueprint.Definition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
|
|
5
|
+
"mappings": ";;;;AAIA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAErB,SAASC,uBAAuB;AAEhC,IAAMC,gBAAgB;AAEtB,IAAMC,OAAO,MACXL,UAAUK,KAAK;EACbC,KAAKF;EACLG,MAAM;EACNC,OAAOR,UAAUS,gBAAgB;IAAEC,YAAY;MAACP,gBAAgBQ;;EAAiB,CAAA;EACjFC,cAAcX,SAASI,KAAK;;IAE1BQ,QAAQX;;;;;;;;;EASV,CAAA;AACF,CAAA;AAEF,IAAMY,YAAkC;EACtCR,KAAKF;EACLC;AACF;AAEA,IAAA,2BAAeS;",
|
|
6
|
+
"names": ["Blueprint", "Template", "trim", "ThreadOperation", "BLUEPRINT_KEY", "make", "key", "name", "tools", "toolDefinitions", "operations", "CreateProposals", "instructions", "source", "blueprint"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/capabilities.ts", "../../../src/types/Channel.ts", "../../../src/types/Settings.ts"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nimport { type CallManager, type CallState, type MediaState } from '../calls';\nimport { type Channel, type ThreadState, type ViewStore } from '../types';\nimport * as Settings from './Settings';\n\nexport namespace ThreadCapabilities {\n export const Settings = Capability.make<Atom.Writable<Settings.Settings>>(`${meta.id}.capability.settings`);\n export const CallManager = Capability.make<CallManager>(`${meta.id}.capability.call-manager`);\n\n // TODO(burdon): Better way to define specific extensions for meeting companions.\n // TODO(burdon): This brings in deps from ../calls; how should we manage/minimize explicit type exposure to other plugins?\n // TODO(wittjosiah): These callbacks could be intents once we support broadcast.\n export type CallProperties = {\n onJoin: (state: { channel?: Channel.Channel; roomId?: string }) => Promise<void>;\n onLeave: (roomId?: string) => Promise<void>;\n onCallStateUpdated: (callState: CallState) => Promise<void>;\n onMediaStateUpdated: ([mediaState, isSpeaking]: [MediaState, boolean]) => Promise<void>;\n };\n\n export const CallExtension = Capability.make<CallProperties>(`${meta.id}.capability.call-extension`);\n\n /** Thread state (drafts, toolbar state, current selection). */\n export const State = Capability.make<Atom.Writable<ThreadState>>(`${meta.id}.capability.state`);\n\n /** Per-subject view state (e.g., showResolvedThreads). */\n export const ViewState = Capability.make<Atom.Writable<ViewStore>>(`${meta.id}.capability.view-state`);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation } from '@dxos/echo/internal';\nimport { Thread } from '@dxos/types';\n\n// TODO(burdon): What is the difference between Thread and Channel.\nexport const Channel = Schema.Struct({\n name: Schema.optional(Schema.String),\n defaultThread: Ref.Ref(Thread.Thread).pipe(FormInputAnnotation.set(false)),\n // TODO(wittjosiah): Should be an \"ordered collection\".\n threads: Ref.Ref(Thread.Thread).pipe(Schema.Array, FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.channel',\n version: '0.1.0',\n }),\n Annotation.IconAnnotation.set({\n icon: 'ph--hash--regular',\n hue: 'rose',\n }),\n);\n\nexport interface Channel extends Schema.Schema.Type<typeof Channel> {}\n\nexport const make = (props: Pick<Obj.MakeProps<typeof Channel>, 'name'> = {}) =>\n Obj.make(Channel, {\n ...props,\n defaultThread: Ref.make(Obj.make(Thread.Thread, { messages: [], status: 'active' })),\n threads: [],\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nexport const Settings = Schema.mutable(Schema.Struct({}));\nexport interface Settings extends Schema.Schema.Type<typeof Settings> {}\n"],
|
|
5
|
-
"mappings": ";;;;;;AAMA,SAASA,kBAAkB;AAE3B,SAASC,YAAY;UAMJC,qBAAAA;sBACFC,
|
|
6
|
-
"names": ["Capability", "meta", "ThreadCapabilities", "Settings", "
|
|
5
|
+
"mappings": ";;;;;;AAMA,SAASA,kBAAkB;AAE3B,SAASC,YAAY;UAMJC,qBAAAA;sBACFC,WAAWH,WAAWI,KAAuC,GAAGH,KAAKI,EAAE,sBAAsB;sBAC7FC,cAAcN,WAAWI,KAAkB,GAAGH,KAAKI,EAAE,0BAA0B;sBAY/EE,gBAAgBP,WAAWI,KAAqB,GAAGH,KAAKI,EAAE,4BAA4B;sBAGtFG,QAAQR,WAAWI,KAAiC,GAAGH,KAAKI,EAAE,mBAAmB;sBAGjFI,YAAYT,WAAWI,KAA+B,GAAGH,KAAKI,EAAE,wBAAwB;AACvG,GArBiBH,uBAAAA,qBAAAA,CAAAA,EAAAA;;;;ACdjB;;;;;AAMA,YAAYQ,YAAY;AAExB,SAASC,YAAYC,KAAKC,KAAKC,YAAY;AAC3C,SAASC,2BAA2B;AACpC,SAASC,cAAc;AAGhB,IAAMC,UAAiBC,cAAO;EACnCC,MAAaC,gBAAgBC,aAAM;EACnCC,eAAeT,IAAIA,IAAIG,OAAOA,MAAM,EAAEO,KAAKR,oBAAoBS,IAAI,KAAA,CAAA;;EAEnEC,SAASZ,IAAIA,IAAIG,OAAOA,MAAM,EAAEO,KAAYG,cAAOX,oBAAoBS,IAAI,KAAA,CAAA;AAC7E,CAAA,EAAGD,KACDT,KAAKa,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAlB,WAAWmB,eAAeN,IAAI;EAC5BO,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAKK,IAAMC,OAAO,CAACC,QAAqD,CAAC,MACzEtB,IAAIqB,KAAKhB,SAAS;EAChB,GAAGiB;EACHZ,eAAeT,IAAIoB,KAAKrB,IAAIqB,KAAKjB,OAAOA,QAAQ;IAAEmB,UAAU,CAAA;IAAIC,QAAQ;EAAS,CAAA,CAAA;EACjFX,SAAS,CAAA;AACX,CAAA;;;ACpCF;;;;AAMA,YAAYY,aAAY;AAEjB,IAAMC,WAAkBC,gBAAeC,eAAO,CAAC,CAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "meta", "ThreadCapabilities", "Settings", "make", "id", "CallManager", "CallExtension", "State", "ViewState", "Schema", "Annotation", "Obj", "Ref", "Type", "FormInputAnnotation", "Thread", "Channel", "Struct", "name", "optional", "String", "defaultThread", "pipe", "set", "threads", "Array", "object", "typename", "version", "IconAnnotation", "icon", "hue", "make", "props", "messages", "status", "Schema", "Settings", "mutable", "Struct"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
Channel_exports
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2Q6V7NGK.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__export
|
|
7
7
|
} from "./chunk-HSLMI22Q.mjs";
|
|
@@ -26,9 +26,9 @@ __export(definitions_exports, {
|
|
|
26
26
|
});
|
|
27
27
|
import * as Schema from "effect/Schema";
|
|
28
28
|
import { Capability } from "@dxos/app-framework";
|
|
29
|
+
import { Operation } from "@dxos/compute";
|
|
29
30
|
import { Database, Key, Obj, Ref } from "@dxos/echo";
|
|
30
31
|
import { Collection } from "@dxos/echo";
|
|
31
|
-
import { Operation } from "@dxos/operation";
|
|
32
32
|
import { Markdown } from "@dxos/plugin-markdown/types";
|
|
33
33
|
import { SpaceSchema } from "@dxos/react-client/echo";
|
|
34
34
|
import { Actor, AnchoredTo, Message, Thread } from "@dxos/types";
|
|
@@ -257,4 +257,4 @@ export {
|
|
|
257
257
|
CreateProposals,
|
|
258
258
|
definitions_exports
|
|
259
259
|
};
|
|
260
|
-
//# sourceMappingURL=chunk-
|
|
260
|
+
//# sourceMappingURL=chunk-4KRVIOPC.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Database, Key, Obj, Ref } from '@dxos/echo';\nimport { Collection } from '@dxos/echo';\nimport { Markdown } from '@dxos/plugin-markdown/types';\nimport { SpaceSchema } from '@dxos/react-client/echo';\nimport { Actor, AnchoredTo, 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,iBAAiB;AAC1B,SAASC,UAAUC,KAAKC,KAAKC,WAAW;AACxC,SAASC,kBAAkB;AAC3B,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,gBAAQA;EAClB,CAAA;AACF,CAAA;AAEO,IAAMC,sBAAsB1B,UAAUC,KAAK;EAChDJ,MAAM;IAAEK,KAAK,GAAGN,gBAAAA;IAA0CO,MAAM;EAAwB;EACxFC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBmB,SAASF,gBAAQA;EACnB,CAAA;EACAR,QAAeT,cAAO;IACpBgB,QAAQI,OAAOA;EACjB,CAAA;AACF,CAAA;AAEO,IAAMC,SAAS7B,UAAUC,KAAK;EACnCJ,MAAM;IAAEK,KAAK,GAAGN,gBAAAA;IAA2BO,MAAM;EAAgB;EACjEC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBL,MAAaa,gBAAgBO,aAAM;IACnCO,QAAed,gBAAgBO,aAAM;IACrCQ,SAASC,IAAIC;EACf,CAAA;EACAhB,QAAeC;AACjB,CAAA;AAEO,IAAMgB,eAAsB1B,cAAO;EACxC2B,QAAQP,OAAOA,OAAOQ,YAAY;IAAEC,aAAa;EAAsB,CAAA;EACvEP,QAAQQ,WAAWA,WAAWF,YAAY;IAAEC,aAAa;EAAsB,CAAA;AACjF,CAAA,EAAGtB,KAAYwB,cAAO;AAIf,IAAMC,SAASxC,UAAUC,KAAK;EACnCJ,MAAM;IAAEK,KAAK,GAAGN,gBAAAA;IAA2BO,MAAM;EAAgB;EACjEC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBsB,QAAQQ,WAAWA;IACnBP,SAASC,IAAIC;IACbE,QAAenB,gBAASY,OAAOA,MAAM;EACvC,CAAA;EACAX,QAAQiB;AACV,CAAA;AAEO,IAAMO,SAASzC,UAAUC,KAAK;EACnCJ,MAAM;IAAEK,KAAK,GAAGN,gBAAAA;IAA2BO,MAAM;EAAgB;EACjEC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBkC,SAAgBnB;EAClB,CAAA;EACAN,QAAeC;AACjB,CAAA;AAEO,IAAMyB,iBAAiB3C,UAAUC,KAAK;EAC3CJ,MAAM;IAAEK,KAAK,GAAGN,gBAAAA;IAAoCO,MAAM;EAAkB;EAC5EC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnB2B,QAAQP,OAAOA;EACjB,CAAA;EACAX,QAAeC;AACjB,CAAA;AAEO,IAAM0B,aAAa5C,UAAUC,KAAK;EACvCJ,MAAM;IAAEK,KAAK,GAAGN,gBAAAA;IAAgCO,MAAM;EAAc;EACpEC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBuB,SAASC,IAAIC;IACbH,QAAQQ,WAAWA;IACnBO,QAAQC,MAAMA;IACdC,MAAaxB;EACf,CAAA;EACAN,QAAeC;AACjB,CAAA;AAEO,IAAM8B,sBAA6BT,eACjC/B,cAAO;EACZyC,SAASC,QAAQA,QAAQd,YAAY;IAAEC,aAAa;EAAuB,CAAA;EAC3Ec,cAAqBC,cAAOhB,YAAY;IAAEC,aAAa;EAAgC,CAAA;AACzF,CAAA,CAAA;AAKK,IAAMgB,gBAAgBrD,UAAUC,KAAK;EAC1CJ,MAAM;IAAEK,KAAK,GAAGN,gBAAAA;IAAmCO,MAAM;EAAiB;EAC1EC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnBsB,QAAQQ,WAAWA;IACnBP,SAASC,IAAIC;IACbqB,WAAkB/B;EACpB,CAAA;EACAN,QAAQ+B;AACV,CAAA;AAKO,IAAMO,UAAUvD,UAAUC,KAAK;EACpCJ,MAAM;IAAEK,KAAK,GAAGN,gBAAAA;IAA4BO,MAAM;EAAiB;EACnEC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC,cAAO;IACnB2B,QAAQP,OAAOA,OAAOQ,YAAY;MAAEC,aAAa;IAAyB,CAAA;IAC1EP,QAAQQ,WAAWA,WAAWF,YAAY;MAAEC,aAAa;IAAkC,CAAA;EAC7F,CAAA;EACApB,QAAeC;AACjB,CAAA;AAKO,IAAMsC,iBAAiBxD,UAAUC,KAAK;EAC3CJ,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", "Operation", "Database", "Key", "Obj", "Ref", "Collection", "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
|
+
}
|
|
@@ -2,18 +2,18 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
Create,
|
|
4
4
|
Select
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4KRVIOPC.mjs";
|
|
6
6
|
import {
|
|
7
7
|
ThreadCapabilities
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2Q6V7NGK.mjs";
|
|
9
9
|
import "./chunk-HSLMI22Q.mjs";
|
|
10
10
|
|
|
11
11
|
// src/operations/create.ts
|
|
12
12
|
import * as Effect from "effect/Effect";
|
|
13
13
|
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
14
14
|
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
15
|
+
import { Operation } from "@dxos/compute";
|
|
15
16
|
import { Obj, Relation } from "@dxos/echo";
|
|
16
|
-
import { Operation } from "@dxos/operation";
|
|
17
17
|
import { linkedSegment } from "@dxos/react-ui-attention";
|
|
18
18
|
import { AnchoredTo, Thread } from "@dxos/types";
|
|
19
19
|
var handler = Create.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ name, anchor: _anchor, subject }) {
|
|
@@ -53,4 +53,4 @@ var create_default = handler;
|
|
|
53
53
|
export {
|
|
54
54
|
create_default as default
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=create-
|
|
56
|
+
//# sourceMappingURL=create-NALJT67D.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/create.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { Obj, Relation } from '@dxos/echo';\nimport { linkedSegment } from '@dxos/react-ui-attention';\nimport { AnchoredTo, Thread } from '@dxos/types';\n\nimport { ThreadCapabilities } from '../types';\nimport { Create, Select } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Create> = Create.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ name, anchor: _anchor, subject }) {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(ThreadCapabilities.State);\n const subjectId = Obj.getDXN(subject).toString();\n const thread = Thread.make({ name });\n const anchor = Relation.make(AnchoredTo.AnchoredTo, {\n [Relation.Source]: thread,\n [Relation.Target]: subject,\n anchor: _anchor,\n });\n\n const state = registry.get(stateAtom);\n const existingDrafts = state.drafts[subjectId];\n registry.set(stateAtom, {\n ...state,\n drafts: {\n ...state.drafts,\n [subjectId]: existingDrafts ? [...existingDrafts, anchor] : [anchor],\n },\n });\n\n yield* Operation.invoke(Select, { current: Obj.getDXN(thread).toString() });\n yield* Operation.invoke(LayoutOperation.UpdateCompanion, {\n subject: linkedSegment('comments'),\n });\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,KAAKC,gBAAgB;AAC9B,SAASC,qBAAqB;AAC9B,SAASC,YAAYC,cAAc;AAKnC,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,MAAMC,QAAQC,SAASC,QAAO,GAAE;AAC7D,QAAMC,WAAW,OAAOC,WAAWC,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YAAY,OAAOJ,WAAWC,IAAII,mBAAmBC,KAAK;AAChE,QAAMC,YAAYC,IAAIC,OAAOX,OAAAA,EAASY,SAAQ;AAC9C,QAAMC,SAASC,OAAOC,KAAK;IAAElB;EAAK,CAAA;AAClC,QAAMC,SAASkB,SAASD,KAAKE,WAAWA,YAAY;IAClD,CAACD,SAASE,MAAM,GAAGL;IACnB,CAACG,SAASG,MAAM,GAAGnB;IACnBF,QAAQC;EACV,CAAA;AAEA,QAAMqB,QAAQnB,SAASE,IAAIG,SAAAA;AAC3B,QAAMe,iBAAiBD,MAAME,OAAOb,SAAAA;AACpCR,WAASsB,IAAIjB,WAAW;IACtB,GAAGc;IACHE,QAAQ;MACN,GAAGF,MAAME;MACT,CAACb,SAAAA,GAAYY,iBAAiB;WAAIA;QAAgBvB;UAAU;QAACA;;IAC/D;EACF,CAAA;AAEA,SAAOJ,UAAU8B,OAAOC,QAAQ;IAAEC,SAAShB,IAAIC,OAAOE,MAAAA,EAAQD,SAAQ;EAAG,CAAA;AACzE,SAAOlB,UAAU8B,OAAOG,gBAAgBC,iBAAiB;IACvD5B,SAAS6B,cAAc,UAAA;EACzB,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAetC;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "Operation", "Obj", "Relation", "linkedSegment", "AnchoredTo", "Thread", "handler", "Create", "pipe", "Operation", "withHandler", "fnUntraced", "name", "anchor", "_anchor", "subject", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "stateAtom", "ThreadCapabilities", "State", "subjectId", "Obj", "getDXN", "toString", "thread", "Thread", "make", "Relation", "AnchoredTo", "Source", "Target", "state", "existingDrafts", "drafts", "set", "invoke", "Select", "current", "LayoutOperation", "UpdateCompanion", "linkedSegment"]
|
|
7
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
CreateChannel
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4KRVIOPC.mjs";
|
|
5
5
|
import {
|
|
6
6
|
Channel_exports
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2Q6V7NGK.mjs";
|
|
8
8
|
import "./chunk-HSLMI22Q.mjs";
|
|
9
9
|
|
|
10
10
|
// src/operations/create-channel.ts
|
|
11
11
|
import * as Effect from "effect/Effect";
|
|
12
|
-
import { Operation } from "@dxos/
|
|
12
|
+
import { Operation } from "@dxos/compute";
|
|
13
13
|
var handler = CreateChannel.pipe(Operation.withHandler((input) => Effect.sync(() => ({
|
|
14
14
|
object: Channel_exports.make({
|
|
15
15
|
name: input.name
|
|
@@ -19,4 +19,4 @@ var create_channel_default = handler;
|
|
|
19
19
|
export {
|
|
20
20
|
create_channel_default as default
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=create-channel-
|
|
22
|
+
//# sourceMappingURL=create-channel-CS2EAYJF.mjs.map
|
package/dist/lib/node-esm/{create-channel-UYWUNB3L.mjs.map → create-channel-CS2EAYJF.mjs.map}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/operations/create-channel.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\n\nimport { Channel } from '../types';\nimport { CreateChannel } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateChannel> = CreateChannel.pipe(\n Operation.withHandler((input) =>\n Effect.sync(() => ({\n object: Channel.make({ name: input.name }),\n })),\n ),\n);\n\nexport default handler;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAK1B,IAAMC,UAAuDC,cAAcC,KACzEC,UAAUC,YAAY,CAACC,UACdC,YAAK,OAAO;EACjBC,QAAQC,gBAAQC,KAAK;IAAEC,MAAML,MAAMK;EAAK,CAAA;AAC1C,EAAA,CAAA,CAAA;AAIJ,IAAA,yBAAeV;",
|
|
6
6
|
"names": ["Effect", "Operation", "handler", "CreateChannel", "pipe", "Operation", "withHandler", "input", "sync", "object", "Channel", "make", "name"]
|
|
7
7
|
}
|
package/dist/lib/node-esm/{create-channel-thread-UQF2SBHS.mjs → create-channel-thread-KZZFZDTU.mjs}
RENAMED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
CreateChannelThread
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-4KRVIOPC.mjs";
|
|
5
|
+
import "./chunk-2Q6V7NGK.mjs";
|
|
6
6
|
import "./chunk-HSLMI22Q.mjs";
|
|
7
7
|
|
|
8
8
|
// src/operations/create-channel-thread.ts
|
|
9
9
|
import * as Effect from "effect/Effect";
|
|
10
|
+
import { Operation } from "@dxos/compute";
|
|
10
11
|
import { Obj, Ref } from "@dxos/echo";
|
|
11
|
-
import { Operation } from "@dxos/operation";
|
|
12
12
|
import { Thread } from "@dxos/types";
|
|
13
13
|
var handler = CreateChannelThread.pipe(Operation.withHandler((input) => Effect.sync(() => {
|
|
14
14
|
const thread = Thread.make({
|
|
15
15
|
status: "active"
|
|
16
16
|
});
|
|
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 {
|
|
@@ -26,4 +26,4 @@ var create_channel_thread_default = handler;
|
|
|
26
26
|
export {
|
|
27
27
|
create_channel_thread_default as default
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=create-channel-thread-
|
|
29
|
+
//# sourceMappingURL=create-channel-thread-KZZFZDTU.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 { Operation } from '@dxos/compute';\nimport { Obj, Ref } from '@dxos/echo';\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.update(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,iBAAiB;AAC1B,SAASC,KAAKC,WAAW;AACzB,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", "Operation", "Obj", "Ref", "Thread", "handler", "CreateChannelThread", "pipe", "Operation", "withHandler", "input", "sync", "thread", "Thread", "make", "status", "threadRef", "Ref", "Obj", "update", "channel", "obj", "threads", "push", "object"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
CreateProposals
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-4KRVIOPC.mjs";
|
|
5
|
+
import "./chunk-2Q6V7NGK.mjs";
|
|
6
6
|
import "./chunk-HSLMI22Q.mjs";
|
|
7
7
|
|
|
8
8
|
// src/operations/create-proposals.ts
|
|
@@ -10,9 +10,9 @@ import * as Array from "effect/Array";
|
|
|
10
10
|
import * as Effect from "effect/Effect";
|
|
11
11
|
import * as Function from "effect/Function";
|
|
12
12
|
import { computeDiffsWithCursors } from "@dxos/assistant";
|
|
13
|
+
import { Operation } from "@dxos/compute";
|
|
13
14
|
import { Database, Obj, Ref, Relation } from "@dxos/echo";
|
|
14
15
|
import { createDocAccessor } from "@dxos/echo-db";
|
|
15
|
-
import { Operation } from "@dxos/operation";
|
|
16
16
|
import { AnchoredTo, Message, Thread } from "@dxos/types";
|
|
17
17
|
var handler = CreateProposals.pipe(Operation.withHandler(Effect.fn(function* ({ doc, diffs }) {
|
|
18
18
|
const object = yield* Database.load(doc);
|
|
@@ -55,4 +55,4 @@ var create_proposals_default = handler;
|
|
|
55
55
|
export {
|
|
56
56
|
create_proposals_default as default
|
|
57
57
|
};
|
|
58
|
-
//# sourceMappingURL=create-proposals-
|
|
58
|
+
//# sourceMappingURL=create-proposals-AFAYZQBI.mjs.map
|
package/dist/lib/node-esm/{create-proposals-5FJNURKH.mjs.map → create-proposals-AFAYZQBI.mjs.map}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/operations/create-proposals.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\n\nimport { computeDiffsWithCursors } from '@dxos/assistant';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,cAAc;AAE1B,SAASC,+BAA+B;AACxC,SAASC,UAAUC,KAAKC,KAAKC,gBAAgB;AAC7C,SAASC,yBAAyB;AAClC,SAASC,
|
|
6
|
-
"names": ["Array", "Effect", "Function", "computeDiffsWithCursors", "Database", "Obj", "Ref", "Relation", "createDocAccessor", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\n\nimport { computeDiffsWithCursors } from '@dxos/assistant';\nimport { Operation } from '@dxos/compute';\nimport { Database, Obj, Ref, Relation } from '@dxos/echo';\nimport { createDocAccessor } from '@dxos/echo-db';\nimport { AnchoredTo, Message, Thread } from '@dxos/types';\n\nimport { CreateProposals } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateProposals> = CreateProposals.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ doc, diffs }) {\n const object = yield* Database.load(doc);\n const content = yield* Effect.promise(() => object.content.load());\n const accessor = createDocAccessor(content, ['content']);\n\n yield* Function.pipe(\n computeDiffsWithCursors(accessor, diffs),\n Array.map(\n Effect.fnUntraced(function* ({ cursor, text }) {\n const proposal = Obj.make(Message.Message, {\n created: new Date().toISOString(),\n sender: { role: 'assistant' },\n blocks: [{ _tag: 'proposal', text }],\n });\n const thread = Thread.make({ name: 'Proposal', messages: [Ref.make(proposal)], status: 'active' });\n const relation = Relation.make(AnchoredTo.AnchoredTo, {\n [Relation.Source]: thread,\n [Relation.Target]: object,\n anchor: cursor,\n });\n yield* Database.add(thread);\n yield* Database.add(relation);\n }),\n ),\n Effect.allWith({ concurrency: 'unbounded' }),\n );\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,YAAYA,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,cAAc;AAE1B,SAASC,+BAA+B;AACxC,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,KAAKC,KAAKC,gBAAgB;AAC7C,SAASC,yBAAyB;AAClC,SAASC,YAAYC,SAASC,cAAc;AAI5C,IAAMC,UAAyDC,gBAAgBC,KAC7EC,UAAUC,YACDC,UAAG,WAAW,EAAEC,KAAKC,MAAK,GAAE;AACjC,QAAMC,SAAS,OAAOC,SAASC,KAAKJ,GAAAA;AACpC,QAAMK,UAAU,OAAcC,eAAQ,MAAMJ,OAAOG,QAAQD,KAAI,CAAA;AAC/D,QAAMG,WAAWC,kBAAkBH,SAAS;IAAC;GAAU;AAEvD,SAAgBT,cACda,wBAAwBF,UAAUN,KAAAA,GAC5BS,UACGC,kBAAW,WAAW,EAAEC,QAAQC,KAAI,GAAE;AAC3C,UAAMC,WAAWC,IAAIC,KAAKC,QAAQA,SAAS;MACzCC,UAAS,oBAAIC,KAAAA,GAAOC,YAAW;MAC/BC,QAAQ;QAAEC,MAAM;MAAY;MAC5BC,QAAQ;QAAC;UAAEC,MAAM;UAAYX;QAAK;;IACpC,CAAA;AACA,UAAMY,SAASC,OAAOV,KAAK;MAAEW,MAAM;MAAYC,UAAU;QAACC,IAAIb,KAAKF,QAAAA;;MAAYgB,QAAQ;IAAS,CAAA;AAChG,UAAMC,WAAWC,SAAShB,KAAKiB,WAAWA,YAAY;MACpD,CAACD,SAASE,MAAM,GAAGT;MACnB,CAACO,SAASG,MAAM,GAAGjC;MACnBkC,QAAQxB;IACV,CAAA;AACA,WAAOT,SAASkC,IAAIZ,MAAAA;AACpB,WAAOtB,SAASkC,IAAIN,QAAAA;EACtB,CAAA,CAAA,GAEKO,eAAQ;IAAEC,aAAa;EAAY,CAAA,CAAA;AAE9C,CAAA,CAAA,CAAA;AAIJ,IAAA,2BAAe7C;",
|
|
6
|
+
"names": ["Array", "Effect", "Function", "computeDiffsWithCursors", "Operation", "Database", "Obj", "Ref", "Relation", "createDocAccessor", "AnchoredTo", "Message", "Thread", "handler", "CreateProposals", "pipe", "Operation", "withHandler", "fn", "doc", "diffs", "object", "Database", "load", "content", "promise", "accessor", "createDocAccessor", "computeDiffsWithCursors", "map", "fnUntraced", "cursor", "text", "proposal", "Obj", "make", "Message", "created", "Date", "toISOString", "sender", "role", "blocks", "_tag", "thread", "Thread", "name", "messages", "Ref", "status", "relation", "Relation", "AnchoredTo", "Source", "Target", "anchor", "add", "allWith", "concurrency"]
|
|
7
7
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
Delete
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4KRVIOPC.mjs";
|
|
5
5
|
import {
|
|
6
6
|
ThreadCapabilities
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2Q6V7NGK.mjs";
|
|
8
8
|
import "./chunk-HSLMI22Q.mjs";
|
|
9
9
|
|
|
10
10
|
// src/operations/delete.ts
|
|
11
11
|
import * as Effect from "effect/Effect";
|
|
12
12
|
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
13
13
|
import { sleep } from "@dxos/async";
|
|
14
|
+
import { Operation } from "@dxos/compute";
|
|
14
15
|
import { Obj, Relation } from "@dxos/echo";
|
|
15
|
-
import { Operation } from "@dxos/operation";
|
|
16
16
|
import { ObservabilityOperation } from "@dxos/plugin-observability/operations";
|
|
17
17
|
var handler = Delete.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ subject, anchor, thread: _thread }) {
|
|
18
18
|
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
@@ -57,4 +57,4 @@ var delete_default = handler;
|
|
|
57
57
|
export {
|
|
58
58
|
delete_default as default
|
|
59
59
|
};
|
|
60
|
-
//# sourceMappingURL=delete-
|
|
60
|
+
//# sourceMappingURL=delete-HQJVZY7Q.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 { Operation } from '@dxos/compute';\nimport { Obj, Relation } from '@dxos/echo';\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,iBAAiB;AAC1B,SAASC,KAAKC,gBAAgB;AAC9B,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", "Operation", "Obj", "Relation", "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
|
+
}
|
|
@@ -2,29 +2,21 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
Delete,
|
|
4
4
|
DeleteMessage
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-4KRVIOPC.mjs";
|
|
6
|
+
import "./chunk-2Q6V7NGK.mjs";
|
|
7
7
|
import "./chunk-HSLMI22Q.mjs";
|
|
8
8
|
|
|
9
9
|
// src/operations/delete-message.ts
|
|
10
10
|
import * as Effect from "effect/Effect";
|
|
11
|
+
import { Operation } from "@dxos/compute";
|
|
11
12
|
import { Obj, Relation } from "@dxos/echo";
|
|
12
13
|
import { invariant } from "@dxos/invariant";
|
|
13
|
-
import { Operation } from "@dxos/operation";
|
|
14
14
|
import { ObservabilityOperation } from "@dxos/plugin-observability/operations";
|
|
15
15
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-thread/src/operations/delete-message.ts";
|
|
16
16
|
var handler = DeleteMessage.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ subject, anchor, messageId }) {
|
|
17
17
|
const thread = Relation.getSource(anchor);
|
|
18
18
|
const db = Obj.getDatabase(subject);
|
|
19
|
-
invariant(db, "Database not found", {
|
|
20
|
-
F: __dxlog_file,
|
|
21
|
-
L: 20,
|
|
22
|
-
S: this,
|
|
23
|
-
A: [
|
|
24
|
-
"db",
|
|
25
|
-
"'Database not found'"
|
|
26
|
-
]
|
|
27
|
-
});
|
|
19
|
+
invariant(db, "Database not found", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 13, S: this, A: ["db", "'Database not found'"] });
|
|
28
20
|
const msgIndex = thread.messages.findIndex((ref) => ref.target?.id === messageId);
|
|
29
21
|
const msg = thread.messages[msgIndex]?.target;
|
|
30
22
|
if (!msg) {
|
|
@@ -41,7 +33,7 @@ var handler = DeleteMessage.pipe(Operation.withHandler(Effect.fnUntraced(functio
|
|
|
41
33
|
messageIndex: -1
|
|
42
34
|
};
|
|
43
35
|
}
|
|
44
|
-
Obj.
|
|
36
|
+
Obj.update(thread, (thread2) => {
|
|
45
37
|
thread2.messages.splice(msgIndex, 1);
|
|
46
38
|
});
|
|
47
39
|
yield* Operation.schedule(ObservabilityOperation.SendEvent, {
|
|
@@ -62,4 +54,4 @@ var delete_message_default = handler;
|
|
|
62
54
|
export {
|
|
63
55
|
delete_message_default as default
|
|
64
56
|
};
|
|
65
|
-
//# sourceMappingURL=delete-message-
|
|
57
|
+
//# sourceMappingURL=delete-message-VVPEYLV4.mjs.map
|