@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.
Files changed (242) hide show
  1. package/dist/lib/browser/{add-message-VPPFFLFL.mjs → add-message-OC4QB4I2.mjs} +7 -15
  2. package/dist/lib/browser/add-message-OC4QB4I2.mjs.map +7 -0
  3. package/dist/lib/browser/blueprints/index.mjs +1 -1
  4. package/dist/lib/browser/blueprints/index.mjs.map +3 -3
  5. package/dist/lib/browser/{chunk-MESW3R4Q.mjs → chunk-J67QAUIW.mjs} +1 -1
  6. package/dist/lib/browser/{chunk-MESW3R4Q.mjs.map → chunk-J67QAUIW.mjs.map} +2 -2
  7. package/dist/lib/browser/{chunk-VPM44Z35.mjs → chunk-KCMJ7H7F.mjs} +3 -3
  8. package/dist/lib/browser/chunk-KCMJ7H7F.mjs.map +7 -0
  9. package/dist/lib/browser/{create-UGT7V733.mjs → create-IUWQEW74.mjs} +4 -4
  10. package/dist/lib/browser/create-IUWQEW74.mjs.map +7 -0
  11. package/dist/lib/browser/{create-channel-EF67LCS6.mjs → create-channel-CBC5WEFG.mjs} +4 -4
  12. package/dist/lib/browser/{create-channel-EF67LCS6.mjs.map → create-channel-CBC5WEFG.mjs.map} +1 -1
  13. package/dist/lib/browser/{create-channel-thread-CCZTSWQ6.mjs → create-channel-thread-JJ5LQ3OZ.mjs} +5 -5
  14. package/dist/lib/browser/create-channel-thread-JJ5LQ3OZ.mjs.map +7 -0
  15. package/dist/lib/browser/{create-proposals-CMK7S7VS.mjs → create-proposals-RHLVRJZ4.mjs} +4 -4
  16. package/dist/lib/browser/{create-proposals-CMK7S7VS.mjs.map → create-proposals-RHLVRJZ4.mjs.map} +3 -3
  17. package/dist/lib/browser/{delete-FSFVU6ZA.mjs → delete-PVIEGTTY.mjs} +4 -4
  18. package/dist/lib/browser/delete-PVIEGTTY.mjs.map +7 -0
  19. package/dist/lib/browser/{delete-message-XL5M5J33.mjs → delete-message-TLVRPLJF.mjs} +6 -14
  20. package/dist/lib/browser/delete-message-TLVRPLJF.mjs.map +7 -0
  21. package/dist/lib/browser/index.mjs +72 -458
  22. package/dist/lib/browser/index.mjs.map +4 -4
  23. package/dist/lib/browser/meta.json +1 -1
  24. package/dist/lib/browser/{on-create-space-VYS2JGVT.mjs → on-create-space-KRTKYRFU.mjs} +4 -4
  25. package/dist/lib/browser/{on-create-space-VYS2JGVT.mjs.map → on-create-space-KRTKYRFU.mjs.map} +1 -1
  26. package/dist/lib/browser/operations/index.mjs +4 -4
  27. package/dist/lib/browser/operations/index.mjs.map +3 -3
  28. package/dist/lib/browser/{restore-2ZGMKUSD.mjs → restore-AVE55SJF.mjs} +4 -4
  29. package/dist/lib/browser/restore-AVE55SJF.mjs.map +7 -0
  30. package/dist/lib/browser/{restore-message-OYEGWPII.mjs → restore-message-F57RMGDJ.mjs} +6 -14
  31. package/dist/lib/browser/restore-message-F57RMGDJ.mjs.map +7 -0
  32. package/dist/lib/browser/{select-VG2XLULE.mjs → select-BJDZJI64.mjs} +4 -4
  33. package/dist/lib/browser/{select-VG2XLULE.mjs.map → select-BJDZJI64.mjs.map} +1 -1
  34. package/dist/lib/browser/{toggle-resolved-MM6YC5BU.mjs → toggle-resolved-HQE5P7BV.mjs} +6 -14
  35. package/dist/lib/browser/toggle-resolved-HQE5P7BV.mjs.map +7 -0
  36. package/dist/lib/browser/translations.mjs +90 -0
  37. package/dist/lib/browser/translations.mjs.map +7 -0
  38. package/dist/lib/browser/types/index.mjs +1 -1
  39. package/dist/lib/node-esm/{add-message-XWKHLNS6.mjs → add-message-HJXNAILW.mjs} +7 -15
  40. package/dist/lib/node-esm/add-message-HJXNAILW.mjs.map +7 -0
  41. package/dist/lib/node-esm/blueprints/index.mjs +1 -1
  42. package/dist/lib/node-esm/blueprints/index.mjs.map +3 -3
  43. package/dist/lib/node-esm/{chunk-SDRAQNSQ.mjs → chunk-2Q6V7NGK.mjs} +1 -1
  44. package/dist/lib/node-esm/{chunk-SDRAQNSQ.mjs.map → chunk-2Q6V7NGK.mjs.map} +2 -2
  45. package/dist/lib/node-esm/{chunk-JTHXNWKJ.mjs → chunk-4KRVIOPC.mjs} +3 -3
  46. package/dist/lib/node-esm/chunk-4KRVIOPC.mjs.map +7 -0
  47. package/dist/lib/node-esm/{create-XAYNDVU2.mjs → create-NALJT67D.mjs} +4 -4
  48. package/dist/lib/node-esm/create-NALJT67D.mjs.map +7 -0
  49. package/dist/lib/node-esm/{create-channel-UYWUNB3L.mjs → create-channel-CS2EAYJF.mjs} +4 -4
  50. package/dist/lib/node-esm/{create-channel-UYWUNB3L.mjs.map → create-channel-CS2EAYJF.mjs.map} +1 -1
  51. package/dist/lib/node-esm/{create-channel-thread-UQF2SBHS.mjs → create-channel-thread-KZZFZDTU.mjs} +5 -5
  52. package/dist/lib/node-esm/create-channel-thread-KZZFZDTU.mjs.map +7 -0
  53. package/dist/lib/node-esm/{create-proposals-5FJNURKH.mjs → create-proposals-AFAYZQBI.mjs} +4 -4
  54. package/dist/lib/node-esm/{create-proposals-5FJNURKH.mjs.map → create-proposals-AFAYZQBI.mjs.map} +3 -3
  55. package/dist/lib/node-esm/{delete-WRODXR3E.mjs → delete-HQJVZY7Q.mjs} +4 -4
  56. package/dist/lib/node-esm/delete-HQJVZY7Q.mjs.map +7 -0
  57. package/dist/lib/node-esm/{delete-message-TAHCYTW2.mjs → delete-message-VVPEYLV4.mjs} +6 -14
  58. package/dist/lib/node-esm/delete-message-VVPEYLV4.mjs.map +7 -0
  59. package/dist/lib/node-esm/index.mjs +72 -458
  60. package/dist/lib/node-esm/index.mjs.map +4 -4
  61. package/dist/lib/node-esm/meta.json +1 -1
  62. package/dist/lib/node-esm/{on-create-space-XDY2YXPV.mjs → on-create-space-2UX7Z5EQ.mjs} +4 -4
  63. package/dist/lib/node-esm/{on-create-space-XDY2YXPV.mjs.map → on-create-space-2UX7Z5EQ.mjs.map} +1 -1
  64. package/dist/lib/node-esm/operations/index.mjs +4 -4
  65. package/dist/lib/node-esm/operations/index.mjs.map +3 -3
  66. package/dist/lib/node-esm/{restore-T3QA7TSL.mjs → restore-FMIWJR5T.mjs} +4 -4
  67. package/dist/lib/node-esm/restore-FMIWJR5T.mjs.map +7 -0
  68. package/dist/lib/node-esm/{restore-message-WFTEVBEV.mjs → restore-message-3L7AMQMG.mjs} +6 -14
  69. package/dist/lib/node-esm/restore-message-3L7AMQMG.mjs.map +7 -0
  70. package/dist/lib/node-esm/{select-Q4UDWJJF.mjs → select-VCAFISBK.mjs} +4 -4
  71. package/dist/lib/node-esm/{select-Q4UDWJJF.mjs.map → select-VCAFISBK.mjs.map} +1 -1
  72. package/dist/lib/node-esm/{toggle-resolved-33XTAK2H.mjs → toggle-resolved-JDZZ257P.mjs} +6 -14
  73. package/dist/lib/node-esm/toggle-resolved-JDZZ257P.mjs.map +7 -0
  74. package/dist/lib/node-esm/translations.mjs +91 -0
  75. package/dist/lib/node-esm/translations.mjs.map +7 -0
  76. package/dist/lib/node-esm/types/index.mjs +1 -1
  77. package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
  78. package/dist/types/src/blueprints/thread-blueprint.d.ts +2 -2
  79. package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -1
  80. package/dist/types/src/calls/call-manager.d.ts.map +1 -1
  81. package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
  82. package/dist/types/src/calls/media-manager.d.ts.map +1 -1
  83. package/dist/types/src/calls/speaking-monitor.d.ts +0 -3
  84. package/dist/types/src/calls/speaking-monitor.d.ts.map +1 -1
  85. package/dist/types/src/calls/types.d.ts.map +1 -1
  86. package/dist/types/src/calls/util/audio.d.ts.map +1 -1
  87. package/dist/types/src/calls/util/calls-service.d.ts +2 -2
  88. package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
  89. package/dist/types/src/calls/util/history-cache.d.ts.map +1 -1
  90. package/dist/types/src/calls/util/media.d.ts.map +1 -1
  91. package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
  92. package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
  93. package/dist/types/src/calls-service.stories.d.ts.map +1 -1
  94. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  95. package/dist/types/src/capabilities/blueprint-definition.d.ts +1 -2
  96. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  97. package/dist/types/src/capabilities/call-manager.d.ts.map +1 -1
  98. package/dist/types/src/capabilities/index.d.ts +3 -3
  99. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  100. package/dist/types/src/capabilities/markdown.d.ts +1 -1
  101. package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
  102. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  103. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
  104. package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
  105. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  106. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  107. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  108. package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -1
  109. package/dist/types/src/components/Call/Call.d.ts +32 -4
  110. package/dist/types/src/components/Call/Call.d.ts.map +1 -1
  111. package/dist/types/src/components/Call/Toolbar.d.ts +4 -4
  112. package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
  113. package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts.map +1 -1
  114. package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +70 -70
  115. package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -1
  116. package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -1
  117. package/dist/types/src/components/Lobby/Lobby.d.ts +24 -3
  118. package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
  119. package/dist/types/src/components/Media/VideoObject.d.ts +1 -1
  120. package/dist/types/src/components/Media/VideoObject.stories.d.ts +1 -1
  121. package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
  122. package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -1
  123. package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
  124. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +1 -1
  125. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +70 -70
  126. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
  127. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
  128. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +1 -1
  129. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +70 -70
  130. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +1 -1
  131. package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -1
  132. package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +70 -70
  133. package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -1
  134. package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +1 -1
  135. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +1 -1
  136. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +70 -70
  137. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +1 -1
  138. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +1 -1
  139. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -1
  140. package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts +70 -70
  141. package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +1 -1
  142. package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -1
  143. package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -1
  144. package/dist/types/src/extensions/threads.d.ts +2 -2
  145. package/dist/types/src/extensions/threads.d.ts.map +1 -1
  146. package/dist/types/src/hooks/analytics.d.ts.map +1 -1
  147. package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
  148. package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -1
  149. package/dist/types/src/operations/add-message.d.ts +1 -1
  150. package/dist/types/src/operations/add-message.d.ts.map +1 -1
  151. package/dist/types/src/operations/create-channel-thread.d.ts +1 -1
  152. package/dist/types/src/operations/create-channel-thread.d.ts.map +1 -1
  153. package/dist/types/src/operations/create-channel.d.ts +1 -1
  154. package/dist/types/src/operations/create-channel.d.ts.map +1 -1
  155. package/dist/types/src/operations/create-proposals.d.ts +1 -1
  156. package/dist/types/src/operations/create-proposals.d.ts.map +1 -1
  157. package/dist/types/src/operations/create.d.ts +1 -1
  158. package/dist/types/src/operations/create.d.ts.map +1 -1
  159. package/dist/types/src/operations/definitions.d.ts +825 -825
  160. package/dist/types/src/operations/definitions.d.ts.map +1 -1
  161. package/dist/types/src/operations/delete-message.d.ts +1 -1
  162. package/dist/types/src/operations/delete-message.d.ts.map +1 -1
  163. package/dist/types/src/operations/delete.d.ts +1 -1
  164. package/dist/types/src/operations/delete.d.ts.map +1 -1
  165. package/dist/types/src/operations/index.d.ts +1 -1
  166. package/dist/types/src/operations/index.d.ts.map +1 -1
  167. package/dist/types/src/operations/on-create-space.d.ts +1 -1
  168. package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
  169. package/dist/types/src/operations/restore-message.d.ts +1 -1
  170. package/dist/types/src/operations/restore-message.d.ts.map +1 -1
  171. package/dist/types/src/operations/restore.d.ts +1 -1
  172. package/dist/types/src/operations/restore.d.ts.map +1 -1
  173. package/dist/types/src/operations/select.d.ts +1 -1
  174. package/dist/types/src/operations/select.d.ts.map +1 -1
  175. package/dist/types/src/operations/toggle-resolved.d.ts +1 -1
  176. package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -1
  177. package/dist/types/src/testing/data.d.ts.map +1 -1
  178. package/dist/types/src/testing/index.d.ts +1 -1
  179. package/dist/types/src/testing/index.d.ts.map +1 -1
  180. package/dist/types/src/translations.d.ts +70 -70
  181. package/dist/types/src/translations.d.ts.map +1 -1
  182. package/dist/types/src/types/Channel.d.ts +177 -177
  183. package/dist/types/src/types/Channel.d.ts.map +1 -1
  184. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  185. package/dist/types/src/util.d.ts +2 -2
  186. package/dist/types/src/util.d.ts.map +1 -1
  187. package/dist/types/tsconfig.tsbuildinfo +1 -1
  188. package/package.json +59 -54
  189. package/src/ThreadPlugin.tsx +4 -5
  190. package/src/blueprints/thread-blueprint.ts +2 -3
  191. package/src/calls/util/calls-service.ts +3 -1
  192. package/src/calls/util/stub-media-streams.ts +3 -1
  193. package/src/capabilities/app-graph-builder.ts +1 -1
  194. package/src/capabilities/index.ts +1 -1
  195. package/src/capabilities/markdown.ts +7 -3
  196. package/src/capabilities/operation-handler.ts +1 -1
  197. package/src/components/Call/Call.tsx +5 -5
  198. package/src/components/CommentsPanel/CommentsPanel.stories.tsx +5 -3
  199. package/src/components/Lobby/Lobby.tsx +5 -4
  200. package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +2 -1
  201. package/src/components/ResponsiveGrid/ResponsivePanel.stories.tsx +2 -1
  202. package/src/components/ThreadSettings/ThreadSettings.stories.tsx +2 -1
  203. package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +39 -7
  204. package/src/containers/ChatContainer/ChatContainer.stories.tsx +1 -1
  205. package/src/containers/ChatContainer/ChatContainer.tsx +1 -6
  206. package/src/extensions/threads.ts +7 -7
  207. package/src/operations/add-message.ts +3 -3
  208. package/src/operations/create-channel-thread.ts +2 -2
  209. package/src/operations/create-channel.ts +1 -1
  210. package/src/operations/create-proposals.ts +1 -1
  211. package/src/operations/create.ts +1 -1
  212. package/src/operations/definitions.ts +1 -1
  213. package/src/operations/delete-message.ts +2 -2
  214. package/src/operations/delete.ts +1 -1
  215. package/src/operations/index.ts +1 -1
  216. package/src/operations/on-create-space.ts +1 -1
  217. package/src/operations/restore-message.ts +2 -2
  218. package/src/operations/restore.ts +1 -1
  219. package/src/operations/select.ts +1 -1
  220. package/src/operations/toggle-resolved.ts +2 -2
  221. package/src/testing/index.ts +1 -1
  222. package/dist/lib/browser/add-message-VPPFFLFL.mjs.map +0 -7
  223. package/dist/lib/browser/chunk-VPM44Z35.mjs.map +0 -7
  224. package/dist/lib/browser/create-UGT7V733.mjs.map +0 -7
  225. package/dist/lib/browser/create-channel-thread-CCZTSWQ6.mjs.map +0 -7
  226. package/dist/lib/browser/delete-FSFVU6ZA.mjs.map +0 -7
  227. package/dist/lib/browser/delete-message-XL5M5J33.mjs.map +0 -7
  228. package/dist/lib/browser/restore-2ZGMKUSD.mjs.map +0 -7
  229. package/dist/lib/browser/restore-message-OYEGWPII.mjs.map +0 -7
  230. package/dist/lib/browser/toggle-resolved-MM6YC5BU.mjs.map +0 -7
  231. package/dist/lib/node-esm/add-message-XWKHLNS6.mjs.map +0 -7
  232. package/dist/lib/node-esm/chunk-JTHXNWKJ.mjs.map +0 -7
  233. package/dist/lib/node-esm/create-XAYNDVU2.mjs.map +0 -7
  234. package/dist/lib/node-esm/create-channel-thread-UQF2SBHS.mjs.map +0 -7
  235. package/dist/lib/node-esm/delete-WRODXR3E.mjs.map +0 -7
  236. package/dist/lib/node-esm/delete-message-TAHCYTW2.mjs.map +0 -7
  237. package/dist/lib/node-esm/restore-T3QA7TSL.mjs.map +0 -7
  238. package/dist/lib/node-esm/restore-message-WFTEVBEV.mjs.map +0 -7
  239. package/dist/lib/node-esm/toggle-resolved-33XTAK2H.mjs.map +0 -7
  240. package/dist/types/src/testing/stories.d.ts +0 -3
  241. package/dist/types/src/testing/stories.d.ts.map +0 -1
  242. package/src/testing/stories.ts +0 -51
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  AddMessage
3
- } from "./chunk-VPM44Z35.mjs";
3
+ } from "./chunk-KCMJ7H7F.mjs";
4
4
  import {
5
5
  ThreadCapabilities
6
- } from "./chunk-MESW3R4Q.mjs";
6
+ } from "./chunk-J67QAUIW.mjs";
7
7
  import "./chunk-J5LGTIGS.mjs";
8
8
 
9
9
  // src/operations/add-message.ts
10
10
  import * as Effect from "effect/Effect";
11
11
  import { Capabilities, Capability } from "@dxos/app-framework";
12
+ import { Operation } from "@dxos/compute";
12
13
  import { Obj, Ref, Relation } from "@dxos/echo";
13
14
  import { invariant } from "@dxos/invariant";
14
- import { Operation } from "@dxos/operation";
15
15
  import { ObservabilityOperation } from "@dxos/plugin-observability/operations";
16
16
  import { SpaceOperation } from "@dxos/plugin-space/operations";
17
17
  import { AnchoredTo, Message } from "@dxos/types";
@@ -22,15 +22,7 @@ var handler = AddMessage.pipe(Operation.withHandler(Effect.fnUntraced(function*
22
22
  const thread = Relation.getSource(anchor);
23
23
  const subjectId = Obj.getDXN(subject).toString();
24
24
  const db = Obj.getDatabase(subject);
25
- invariant(db, "Database not found", {
26
- F: __dxlog_file,
27
- L: 26,
28
- S: this,
29
- A: [
30
- "db",
31
- "'Database not found'"
32
- ]
33
- });
25
+ invariant(db, "Database not found", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 20, S: this, A: ["db", "'Database not found'"] });
34
26
  const message = Obj.make(Message.Message, {
35
27
  created: (/* @__PURE__ */ new Date()).toISOString(),
36
28
  sender,
@@ -41,13 +33,13 @@ var handler = AddMessage.pipe(Operation.withHandler(Effect.fnUntraced(function*
41
33
  }
42
34
  ]
43
35
  });
44
- Obj.change(thread, (thread2) => {
36
+ Obj.update(thread, (thread2) => {
45
37
  thread2.messages.push(Ref.make(message));
46
38
  });
47
39
  const state = registry.get(stateAtom);
48
40
  const draft = state.drafts[subjectId]?.find((a) => a.id === anchor.id);
49
41
  if (draft) {
50
- Obj.change(thread, (thread2) => {
42
+ Obj.update(thread, (thread2) => {
51
43
  thread2.status = "active";
52
44
  });
53
45
  registry.set(stateAtom, {
@@ -94,4 +86,4 @@ var add_message_default = handler;
94
86
  export {
95
87
  add_message_default as default
96
88
  };
97
- //# sourceMappingURL=add-message-VPPFFLFL.mjs.map
89
+ //# sourceMappingURL=add-message-OC4QB4I2.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
+ }
@@ -1,7 +1,7 @@
1
1
  import "../chunk-J5LGTIGS.mjs";
2
2
 
3
3
  // src/blueprints/thread-blueprint.ts
4
- import { Blueprint, Template } from "@dxos/blueprints";
4
+ import { Blueprint, Template } from "@dxos/compute";
5
5
  import { trim } from "@dxos/util";
6
6
  import { ThreadOperation } from "#operations";
7
7
  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 { type AppCapabilities } from '@dxos/app-toolkit';\nimport { Blueprint, Template } from '@dxos/blueprints';\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: AppCapabilities.BlueprintDefinition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
5
- "mappings": ";;;AAKA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAErB,SAASC,uBAAuB;AAEhC,IAAMC,gBAAgB;AAEtB,IAAMC,OAAO,MACXC,UAAUD,KAAK;EACbE,KAAKH;EACLI,MAAM;EACNC,OAAOH,UAAUI,gBAAgB;IAAEC,YAAY;MAACC,gBAAgBC;;EAAiB,CAAA;EACjFC,cAAcC,SAASV,KAAK;;IAE1BW,QAAQC;;;;;;;;;EASV,CAAA;AACF,CAAA;AAEF,IAAMC,YAAiD;EACrDX,KAAKH;EACLC;AACF;AAEA,IAAA,2BAAea;",
6
- "names": ["Blueprint", "Template", "trim", "ThreadOperation", "BLUEPRINT_KEY", "make", "Blueprint", "key", "name", "tools", "toolDefinitions", "operations", "ThreadOperation", "CreateProposals", "instructions", "Template", "source", "trim", "blueprint"]
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
  }
@@ -58,4 +58,4 @@ export {
58
58
  Channel_exports,
59
59
  Settings_exports
60
60
  };
61
- //# sourceMappingURL=chunk-MESW3R4Q.mjs.map
61
+ //# sourceMappingURL=chunk-J67QAUIW.mjs.map
@@ -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,WAAWC,WAAWC,KAAuC,GAAGC,KAAKC,EAAE,sBAAsB;sBAC7FC,cAAcJ,WAAWC,KAAkB,GAAGC,KAAKC,EAAE,0BAA0B;sBAY/EE,gBAAgBL,WAAWC,KAAqB,GAAGC,KAAKC,EAAE,4BAA4B;sBAGtFG,QAAQN,WAAWC,KAAiC,GAAGC,KAAKC,EAAE,mBAAmB;sBAGjFI,YAAYP,WAAWC,KAA+B,GAAGC,KAAKC,EAAE,wBAAwB;AACvG,GArBiBL,uBAAAA,qBAAAA,CAAAA,EAAAA;;;;ACdjB;;;;;AAMA,YAAYU,YAAY;AAExB,SAASC,YAAYC,KAAKC,KAAKC,YAAY;AAC3C,SAASC,2BAA2B;AACpC,SAASC,cAAc;AAGhB,IAAMC,UAAiBC,cAAO;EACnCC,MAAaC,gBAAgBC,aAAM;EACnCC,eAAeC,IAAIA,IAAIC,OAAOA,MAAM,EAAEC,KAAKC,oBAAoBC,IAAI,KAAA,CAAA;;EAEnEC,SAASL,IAAIA,IAAIC,OAAOA,MAAM,EAAEC,KAAYI,cAAOH,oBAAoBC,IAAI,KAAA,CAAA;AAC7E,CAAA,EAAGF,KACDK,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,WAAWC,eAAeR,IAAI;EAC5BS,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAKK,IAAMC,OAAO,CAACC,QAAqD,CAAC,MACzEC,IAAIF,KAAKrB,SAAS;EAChB,GAAGsB;EACHjB,eAAeC,IAAIe,KAAKE,IAAIF,KAAKd,OAAOA,QAAQ;IAAEiB,UAAU,CAAA;IAAIC,QAAQ;EAAS,CAAA,CAAA;EACjFd,SAAS,CAAA;AACX,CAAA;;;ACpCF;;;;AAMA,YAAYe,aAAY;AAEjB,IAAMC,WAAkBC,gBAAeC,eAAO,CAAC,CAAA,CAAA;",
6
- "names": ["Capability", "meta", "ThreadCapabilities", "Settings", "Capability", "make", "meta", "id", "CallManager", "CallExtension", "State", "ViewState", "Schema", "Annotation", "Obj", "Ref", "Type", "FormInputAnnotation", "Thread", "Channel", "Struct", "name", "optional", "String", "defaultThread", "Ref", "Thread", "pipe", "FormInputAnnotation", "set", "threads", "Array", "Type", "object", "typename", "version", "Annotation", "IconAnnotation", "icon", "hue", "make", "props", "Obj", "messages", "status", "Schema", "Settings", "mutable", "Struct"]
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,6 +1,6 @@
1
1
  import {
2
2
  Channel_exports
3
- } from "./chunk-MESW3R4Q.mjs";
3
+ } from "./chunk-J67QAUIW.mjs";
4
4
  import {
5
5
  __export
6
6
  } from "./chunk-J5LGTIGS.mjs";
@@ -25,9 +25,9 @@ __export(definitions_exports, {
25
25
  });
26
26
  import * as Schema from "effect/Schema";
27
27
  import { Capability } from "@dxos/app-framework";
28
+ import { Operation } from "@dxos/compute";
28
29
  import { Database, Key, Obj, Ref } from "@dxos/echo";
29
30
  import { Collection } from "@dxos/echo";
30
- import { Operation } from "@dxos/operation";
31
31
  import { Markdown } from "@dxos/plugin-markdown/types";
32
32
  import { SpaceSchema } from "@dxos/react-client/echo";
33
33
  import { Actor, AnchoredTo, Message, Thread } from "@dxos/types";
@@ -256,4 +256,4 @@ export {
256
256
  CreateProposals,
257
257
  definitions_exports
258
258
  };
259
- //# sourceMappingURL=chunk-VPM44Z35.mjs.map
259
+ //# sourceMappingURL=chunk-KCMJ7H7F.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": "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",
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
+ }
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  Create,
3
3
  Select
4
- } from "./chunk-VPM44Z35.mjs";
4
+ } from "./chunk-KCMJ7H7F.mjs";
5
5
  import {
6
6
  ThreadCapabilities
7
- } from "./chunk-MESW3R4Q.mjs";
7
+ } from "./chunk-J67QAUIW.mjs";
8
8
  import "./chunk-J5LGTIGS.mjs";
9
9
 
10
10
  // src/operations/create.ts
11
11
  import * as Effect from "effect/Effect";
12
12
  import { Capabilities, Capability } from "@dxos/app-framework";
13
13
  import { LayoutOperation } from "@dxos/app-toolkit";
14
+ import { Operation } from "@dxos/compute";
14
15
  import { Obj, Relation } from "@dxos/echo";
15
- import { Operation } from "@dxos/operation";
16
16
  import { linkedSegment } from "@dxos/react-ui-attention";
17
17
  import { AnchoredTo, Thread } from "@dxos/types";
18
18
  var handler = Create.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ name, anchor: _anchor, subject }) {
@@ -52,4 +52,4 @@ var create_default = handler;
52
52
  export {
53
53
  create_default as default
54
54
  };
55
- //# sourceMappingURL=create-UGT7V733.mjs.map
55
+ //# sourceMappingURL=create-IUWQEW74.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,14 +1,14 @@
1
1
  import {
2
2
  CreateChannel
3
- } from "./chunk-VPM44Z35.mjs";
3
+ } from "./chunk-KCMJ7H7F.mjs";
4
4
  import {
5
5
  Channel_exports
6
- } from "./chunk-MESW3R4Q.mjs";
6
+ } from "./chunk-J67QAUIW.mjs";
7
7
  import "./chunk-J5LGTIGS.mjs";
8
8
 
9
9
  // src/operations/create-channel.ts
10
10
  import * as Effect from "effect/Effect";
11
- import { Operation } from "@dxos/operation";
11
+ import { Operation } from "@dxos/compute";
12
12
  var handler = CreateChannel.pipe(Operation.withHandler((input) => Effect.sync(() => ({
13
13
  object: Channel_exports.make({
14
14
  name: input.name
@@ -18,4 +18,4 @@ var create_channel_default = handler;
18
18
  export {
19
19
  create_channel_default as default
20
20
  };
21
- //# sourceMappingURL=create-channel-EF67LCS6.mjs.map
21
+ //# sourceMappingURL=create-channel-CBC5WEFG.mjs.map
@@ -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/operation';\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"],
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
  }
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  CreateChannelThread
3
- } from "./chunk-VPM44Z35.mjs";
4
- import "./chunk-MESW3R4Q.mjs";
3
+ } from "./chunk-KCMJ7H7F.mjs";
4
+ import "./chunk-J67QAUIW.mjs";
5
5
  import "./chunk-J5LGTIGS.mjs";
6
6
 
7
7
  // src/operations/create-channel-thread.ts
8
8
  import * as Effect from "effect/Effect";
9
+ import { Operation } from "@dxos/compute";
9
10
  import { Obj, Ref } from "@dxos/echo";
10
- import { Operation } from "@dxos/operation";
11
11
  import { Thread } from "@dxos/types";
12
12
  var handler = CreateChannelThread.pipe(Operation.withHandler((input) => Effect.sync(() => {
13
13
  const thread = Thread.make({
14
14
  status: "active"
15
15
  });
16
16
  const threadRef = Ref.make(thread);
17
- Obj.change(input.channel, (obj) => {
17
+ Obj.update(input.channel, (obj) => {
18
18
  obj.threads.push(threadRef);
19
19
  });
20
20
  return {
@@ -25,4 +25,4 @@ var create_channel_thread_default = handler;
25
25
  export {
26
26
  create_channel_thread_default as default
27
27
  };
28
- //# sourceMappingURL=create-channel-thread-CCZTSWQ6.mjs.map
28
+ //# sourceMappingURL=create-channel-thread-JJ5LQ3OZ.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,7 +1,7 @@
1
1
  import {
2
2
  CreateProposals
3
- } from "./chunk-VPM44Z35.mjs";
4
- import "./chunk-MESW3R4Q.mjs";
3
+ } from "./chunk-KCMJ7H7F.mjs";
4
+ import "./chunk-J67QAUIW.mjs";
5
5
  import "./chunk-J5LGTIGS.mjs";
6
6
 
7
7
  // src/operations/create-proposals.ts
@@ -9,9 +9,9 @@ import * as Array from "effect/Array";
9
9
  import * as Effect from "effect/Effect";
10
10
  import * as Function from "effect/Function";
11
11
  import { computeDiffsWithCursors } from "@dxos/assistant";
12
+ import { Operation } from "@dxos/compute";
12
13
  import { Database, Obj, Ref, Relation } from "@dxos/echo";
13
14
  import { createDocAccessor } from "@dxos/echo-db";
14
- import { Operation } from "@dxos/operation";
15
15
  import { AnchoredTo, Message, Thread } from "@dxos/types";
16
16
  var handler = CreateProposals.pipe(Operation.withHandler(Effect.fn(function* ({ doc, diffs }) {
17
17
  const object = yield* Database.load(doc);
@@ -54,4 +54,4 @@ var create_proposals_default = handler;
54
54
  export {
55
55
  create_proposals_default as default
56
56
  };
57
- //# sourceMappingURL=create-proposals-CMK7S7VS.mjs.map
57
+ //# sourceMappingURL=create-proposals-RHLVRJZ4.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/operations/create-proposals.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\n\nimport { computeDiffsWithCursors } from '@dxos/assistant';\nimport { Database, Obj, Ref, Relation } from '@dxos/echo';\nimport { createDocAccessor } from '@dxos/echo-db';\nimport { Operation } from '@dxos/operation';\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,UAAUC,KAAKC,KAAKC,gBAAgB;AAC7C,SAASC,yBAAyB;AAClC,SAASC,iBAAiB;AAC1B,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", "Database", "Obj", "Ref", "Relation", "createDocAccessor", "Operation", "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"]
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,17 +1,17 @@
1
1
  import {
2
2
  Delete
3
- } from "./chunk-VPM44Z35.mjs";
3
+ } from "./chunk-KCMJ7H7F.mjs";
4
4
  import {
5
5
  ThreadCapabilities
6
- } from "./chunk-MESW3R4Q.mjs";
6
+ } from "./chunk-J67QAUIW.mjs";
7
7
  import "./chunk-J5LGTIGS.mjs";
8
8
 
9
9
  // src/operations/delete.ts
10
10
  import * as Effect from "effect/Effect";
11
11
  import { Capabilities, Capability } from "@dxos/app-framework";
12
12
  import { sleep } from "@dxos/async";
13
+ import { Operation } from "@dxos/compute";
13
14
  import { Obj, Relation } from "@dxos/echo";
14
- import { Operation } from "@dxos/operation";
15
15
  import { ObservabilityOperation } from "@dxos/plugin-observability/operations";
16
16
  var handler = Delete.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ subject, anchor, thread: _thread }) {
17
17
  const registry = yield* Capability.get(Capabilities.AtomRegistry);
@@ -56,4 +56,4 @@ var delete_default = handler;
56
56
  export {
57
57
  delete_default as default
58
58
  };
59
- //# sourceMappingURL=delete-FSFVU6ZA.mjs.map
59
+ //# sourceMappingURL=delete-PVIEGTTY.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
+ }
@@ -1,29 +1,21 @@
1
1
  import {
2
2
  Delete,
3
3
  DeleteMessage
4
- } from "./chunk-VPM44Z35.mjs";
5
- import "./chunk-MESW3R4Q.mjs";
4
+ } from "./chunk-KCMJ7H7F.mjs";
5
+ import "./chunk-J67QAUIW.mjs";
6
6
  import "./chunk-J5LGTIGS.mjs";
7
7
 
8
8
  // src/operations/delete-message.ts
9
9
  import * as Effect from "effect/Effect";
10
+ import { Operation } from "@dxos/compute";
10
11
  import { Obj, Relation } from "@dxos/echo";
11
12
  import { invariant } from "@dxos/invariant";
12
- import { Operation } from "@dxos/operation";
13
13
  import { ObservabilityOperation } from "@dxos/plugin-observability/operations";
14
14
  var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-thread/src/operations/delete-message.ts";
15
15
  var handler = DeleteMessage.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ subject, anchor, messageId }) {
16
16
  const thread = Relation.getSource(anchor);
17
17
  const db = Obj.getDatabase(subject);
18
- invariant(db, "Database not found", {
19
- F: __dxlog_file,
20
- L: 20,
21
- S: this,
22
- A: [
23
- "db",
24
- "'Database not found'"
25
- ]
26
- });
18
+ invariant(db, "Database not found", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 13, S: this, A: ["db", "'Database not found'"] });
27
19
  const msgIndex = thread.messages.findIndex((ref) => ref.target?.id === messageId);
28
20
  const msg = thread.messages[msgIndex]?.target;
29
21
  if (!msg) {
@@ -40,7 +32,7 @@ var handler = DeleteMessage.pipe(Operation.withHandler(Effect.fnUntraced(functio
40
32
  messageIndex: -1
41
33
  };
42
34
  }
43
- Obj.change(thread, (thread2) => {
35
+ Obj.update(thread, (thread2) => {
44
36
  thread2.messages.splice(msgIndex, 1);
45
37
  });
46
38
  yield* Operation.schedule(ObservabilityOperation.SendEvent, {
@@ -61,4 +53,4 @@ var delete_message_default = handler;
61
53
  export {
62
54
  delete_message_default as default
63
55
  };
64
- //# sourceMappingURL=delete-message-XL5M5J33.mjs.map
56
+ //# sourceMappingURL=delete-message-TLVRPLJF.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/delete-message.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\nimport { Obj, Relation } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\nimport { Thread } from '@dxos/types';\n\nimport { Delete, DeleteMessage } from './definitions';\n\nconst handler: Operation.WithHandler<typeof DeleteMessage> = DeleteMessage.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ subject, anchor, messageId }) {\n const thread = Relation.getSource(anchor) as Thread.Thread;\n const db = Obj.getDatabase(subject);\n invariant(db, 'Database not found');\n\n const msgIndex = thread.messages.findIndex((ref) => ref.target?.id === messageId);\n const msg = thread.messages[msgIndex]?.target;\n if (!msg) {\n return { messageIndex: -1 };\n }\n\n if (msgIndex === 0 && thread.messages.length === 1) {\n // TODO(wittjosiah): This doesn't support restoring the thread.\n yield* Operation.invoke(Delete, { subject, anchor });\n return { messageIndex: -1 };\n }\n\n Obj.update(thread, (thread) => {\n thread.messages.splice(msgIndex, 1);\n });\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.message.delete',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n threadLength: thread.messages.length,\n messageId,\n },\n });\n\n return { message: msg, messageIndex: msgIndex };\n }),\n ),\n);\n\nexport default handler;\n"],
5
+ "mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,KAAKC,gBAAgB;AAC9B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AAKvC,IAAA,eAA6DC;IAIvD,UAAWC,cAAe,KAACC,UAAAA,YAAAA,kBAAAA,WAAAA,EAAAA,SAAAA,QAAAA,UAAAA,GAAAA;AAC3BC,QAAAA,SAAc,SAAA,UAAA,MAAA;AAEd,QAAMC,KAAAA,IAAAA,YAAkBC,OAASC;AACjC,YAAMC,IAAMC,sBAAgBJ,EAAAA,YAAWK,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,MAAAA,GAAAA,CAAAA,MAAAA,sBAAAA,EAAAA,CAAAA;AACvC,QAAKF,WAAK,OAAA,SAAA,UAAA,CAAA,QAAA,IAAA,QAAA,OAAA,SAAA;QACR,MAAO,OAAA,SAAA,QAAA,GAAA;YAAEG;AAAiB,WAAA;MAC5B,cAAA;IAEIN;;MAEF,aAAOO,KAAUC,OAAOC,SAAQ,WAAA,GAAA;WAAWC,UAAAA,OAAAA,QAAAA;MAAO;MAClD;;AAA0B,WAAA;MAC5B,cAAA;IAEIC;;AAEJ,MAAA,OAAA,QAAA,CAAAP,YAAA;AAEA,IAAAA,QAAOG,SAAUK,OAASC,UAAAA,CAAAA;;SAExBC,UAAY,SAAA,uBAAA,WAAA;UACVC;gBACAC;MACAC,SAAAA,GAAAA;MACAC,UAAAA,OAAAA;MACF,cAAA,OAAA,SAAA;MACF;IAEA;;SAAuBZ;IAAuB,SAAA;IAChD,cAAA;EAIJ;;;",
6
+ "names": ["Effect", "Operation", "Obj", "Relation", "invariant", "ObservabilityOperation", "DeleteMessage", "Obj", "subject", "invariant", "msgIndex", "messages", "findIndex", "msg", "thread", "target", "messageIndex", "Operation", "invoke", "Delete", "anchor", "update", "schedule", "ObservabilityOperation", "properties", "spaceId", "threadId", "threadLength", "messageId"]
7
+ }