@dxos/plugin-space 0.8.4-main.84f28bd → 0.8.4-main.9735255

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 (622) hide show
  1. package/dist/lib/browser/CollectionArticle-OQMUVFVV.mjs +125 -0
  2. package/dist/lib/browser/CollectionArticle-OQMUVFVV.mjs.map +7 -0
  3. package/dist/lib/browser/ObjectCardStack-TWHN6C2Y.mjs +148 -0
  4. package/dist/lib/browser/ObjectCardStack-TWHN6C2Y.mjs.map +7 -0
  5. package/dist/lib/browser/ObjectDetails-GEDIISKK.mjs +142 -0
  6. package/dist/lib/browser/ObjectDetails-GEDIISKK.mjs.map +7 -0
  7. package/dist/lib/browser/RecordArticle-W57QE7QV.mjs +107 -0
  8. package/dist/lib/browser/RecordArticle-W57QE7QV.mjs.map +7 -0
  9. package/dist/lib/browser/app-graph-builder-SJHTZXZF.mjs +523 -0
  10. package/dist/lib/browser/app-graph-builder-SJHTZXZF.mjs.map +7 -0
  11. package/dist/lib/browser/app-graph-serializer-7AT7QMSK.mjs +84 -0
  12. package/dist/lib/browser/app-graph-serializer-7AT7QMSK.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-4WZUGLQQ.mjs +117 -0
  14. package/dist/lib/browser/chunk-4WZUGLQQ.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-ASV6DYFH.mjs +19 -0
  16. package/dist/lib/browser/chunk-ASV6DYFH.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-AWVAX26X.mjs +13 -0
  18. package/dist/lib/browser/chunk-AWVAX26X.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-CCRSHECL.mjs +714 -0
  20. package/dist/lib/browser/chunk-CCRSHECL.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-HSMQFM57.mjs +16 -0
  22. package/dist/lib/browser/chunk-HSMQFM57.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-SUI34XSA.mjs +772 -0
  24. package/dist/lib/browser/chunk-SUI34XSA.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-TWUMNPG4.mjs +1898 -0
  26. package/dist/lib/browser/chunk-TWUMNPG4.mjs.map +7 -0
  27. package/dist/lib/browser/{chunk-6VLSHG4A.mjs → chunk-ZT2VPYRM.mjs} +105 -36
  28. package/dist/lib/browser/chunk-ZT2VPYRM.mjs.map +7 -0
  29. package/dist/lib/browser/cli/index.mjs +849 -0
  30. package/dist/lib/browser/cli/index.mjs.map +7 -0
  31. package/dist/lib/browser/identity-created-VCFYLSBB.mjs +23 -0
  32. package/dist/lib/browser/identity-created-VCFYLSBB.mjs.map +7 -0
  33. package/dist/lib/browser/index.mjs +243 -180
  34. package/dist/lib/browser/index.mjs.map +4 -4
  35. package/dist/lib/browser/meta.json +1 -1
  36. package/dist/lib/browser/operation-resolver-SIRQT36Z.mjs +827 -0
  37. package/dist/lib/browser/operation-resolver-SIRQT36Z.mjs.map +7 -0
  38. package/dist/lib/browser/react-root-3SPMM45V.mjs +30 -0
  39. package/dist/lib/browser/react-root-3SPMM45V.mjs.map +7 -0
  40. package/dist/lib/browser/react-surface-UUS7NDHS.mjs +382 -0
  41. package/dist/lib/browser/react-surface-UUS7NDHS.mjs.map +7 -0
  42. package/dist/lib/browser/repair-CJG26D52.mjs +50 -0
  43. package/dist/lib/browser/repair-CJG26D52.mjs.map +7 -0
  44. package/dist/lib/browser/settings-ZS2AQ73E.mjs +33 -0
  45. package/dist/lib/browser/settings-ZS2AQ73E.mjs.map +7 -0
  46. package/dist/lib/browser/spaces-ready-OQDGWUOS.mjs +242 -0
  47. package/dist/lib/browser/spaces-ready-OQDGWUOS.mjs.map +7 -0
  48. package/dist/lib/browser/state-7YZQB2KY.mjs +58 -0
  49. package/dist/lib/browser/state-7YZQB2KY.mjs.map +7 -0
  50. package/dist/lib/browser/types/index.mjs +18 -10
  51. package/dist/lib/node-esm/CollectionArticle-V5OOJVJJ.mjs +126 -0
  52. package/dist/lib/node-esm/CollectionArticle-V5OOJVJJ.mjs.map +7 -0
  53. package/dist/lib/node-esm/ObjectCardStack-C5ZXRKP7.mjs +149 -0
  54. package/dist/lib/node-esm/ObjectCardStack-C5ZXRKP7.mjs.map +7 -0
  55. package/dist/lib/node-esm/ObjectDetails-6ZLDRKCO.mjs +143 -0
  56. package/dist/lib/node-esm/ObjectDetails-6ZLDRKCO.mjs.map +7 -0
  57. package/dist/lib/node-esm/RecordArticle-SSV74Z46.mjs +108 -0
  58. package/dist/lib/node-esm/RecordArticle-SSV74Z46.mjs.map +7 -0
  59. package/dist/lib/node-esm/app-graph-builder-HZ3XXDFZ.mjs +524 -0
  60. package/dist/lib/node-esm/app-graph-builder-HZ3XXDFZ.mjs.map +7 -0
  61. package/dist/lib/node-esm/app-graph-serializer-WJ2TIQG6.mjs +85 -0
  62. package/dist/lib/node-esm/app-graph-serializer-WJ2TIQG6.mjs.map +7 -0
  63. package/dist/lib/node-esm/{chunk-SXD6T2N4.mjs → chunk-2SW6S2BB.mjs} +105 -36
  64. package/dist/lib/node-esm/chunk-2SW6S2BB.mjs.map +7 -0
  65. package/dist/lib/node-esm/chunk-7KMYUWSR.mjs +773 -0
  66. package/dist/lib/node-esm/chunk-7KMYUWSR.mjs.map +7 -0
  67. package/dist/lib/node-esm/chunk-CVXULIYC.mjs +20 -0
  68. package/dist/lib/node-esm/chunk-CVXULIYC.mjs.map +7 -0
  69. package/dist/lib/node-esm/chunk-FYSBFBSD.mjs +1899 -0
  70. package/dist/lib/node-esm/chunk-FYSBFBSD.mjs.map +7 -0
  71. package/dist/lib/node-esm/chunk-HREWB23G.mjs +15 -0
  72. package/dist/lib/node-esm/chunk-HREWB23G.mjs.map +7 -0
  73. package/dist/lib/node-esm/chunk-JOBIWCBC.mjs +118 -0
  74. package/dist/lib/node-esm/chunk-JOBIWCBC.mjs.map +7 -0
  75. package/dist/lib/node-esm/chunk-MPL6NHQX.mjs +715 -0
  76. package/dist/lib/node-esm/chunk-MPL6NHQX.mjs.map +7 -0
  77. package/dist/lib/node-esm/chunk-SL4BJSUG.mjs +18 -0
  78. package/dist/lib/node-esm/chunk-SL4BJSUG.mjs.map +7 -0
  79. package/dist/lib/node-esm/cli/index.mjs +850 -0
  80. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  81. package/dist/lib/node-esm/identity-created-2SJABVJD.mjs +25 -0
  82. package/dist/lib/node-esm/identity-created-2SJABVJD.mjs.map +7 -0
  83. package/dist/lib/node-esm/index.mjs +243 -180
  84. package/dist/lib/node-esm/index.mjs.map +4 -4
  85. package/dist/lib/node-esm/meta.json +1 -1
  86. package/dist/lib/node-esm/operation-resolver-ZE3XJL5J.mjs +828 -0
  87. package/dist/lib/node-esm/operation-resolver-ZE3XJL5J.mjs.map +7 -0
  88. package/dist/lib/node-esm/react-root-Y6JTGDTW.mjs +31 -0
  89. package/dist/lib/node-esm/react-root-Y6JTGDTW.mjs.map +7 -0
  90. package/dist/lib/node-esm/react-surface-SQ4SK3OK.mjs +383 -0
  91. package/dist/lib/node-esm/react-surface-SQ4SK3OK.mjs.map +7 -0
  92. package/dist/lib/node-esm/repair-G3ZW3VG3.mjs +51 -0
  93. package/dist/lib/node-esm/repair-G3ZW3VG3.mjs.map +7 -0
  94. package/dist/lib/node-esm/settings-PVI2VG56.mjs +34 -0
  95. package/dist/lib/node-esm/settings-PVI2VG56.mjs.map +7 -0
  96. package/dist/lib/node-esm/spaces-ready-R744OHQG.mjs +243 -0
  97. package/dist/lib/node-esm/spaces-ready-R744OHQG.mjs.map +7 -0
  98. package/dist/lib/node-esm/state-XE5YGPHM.mjs +59 -0
  99. package/dist/lib/node-esm/state-XE5YGPHM.mjs.map +7 -0
  100. package/dist/lib/node-esm/types/index.mjs +18 -10
  101. package/dist/types/src/SpacePlugin.d.ts +3 -15
  102. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  103. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  104. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  106. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  107. package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts +5 -0
  108. package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts.map +1 -0
  109. package/dist/types/src/capabilities/app-graph-serializer/index.d.ts +3 -0
  110. package/dist/types/src/capabilities/app-graph-serializer/index.d.ts.map +1 -0
  111. package/dist/types/src/capabilities/identity-created/identity-created.d.ts +5 -0
  112. package/dist/types/src/capabilities/identity-created/identity-created.d.ts.map +1 -0
  113. package/dist/types/src/capabilities/identity-created/index.d.ts +3 -0
  114. package/dist/types/src/capabilities/identity-created/index.d.ts.map +1 -0
  115. package/dist/types/src/capabilities/index.d.ts +10 -21
  116. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  117. package/dist/types/src/capabilities/operation-resolver/index.d.ts +6 -0
  118. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +9 -0
  120. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  121. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  122. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  123. package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
  124. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  125. package/dist/types/src/capabilities/react-surface/index.d.ts +5 -0
  126. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  127. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +8 -0
  128. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/repair/index.d.ts +3 -0
  130. package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
  131. package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
  132. package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
  133. package/dist/types/src/capabilities/settings/index.d.ts +7 -0
  134. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  135. package/dist/types/src/capabilities/settings/settings.d.ts +9 -0
  136. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  137. package/dist/types/src/capabilities/spaces-ready/index.d.ts +3 -0
  138. package/dist/types/src/capabilities/spaces-ready/index.d.ts.map +1 -0
  139. package/dist/types/src/capabilities/spaces-ready/spaces-ready.d.ts +5 -0
  140. package/dist/types/src/capabilities/spaces-ready/spaces-ready.d.ts.map +1 -0
  141. package/dist/types/src/capabilities/state/index.d.ts +13 -0
  142. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  143. package/dist/types/src/capabilities/state/state.d.ts +17 -0
  144. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  145. package/dist/types/src/cli/commands/database/add.d.ts +17 -0
  146. package/dist/types/src/cli/commands/database/add.d.ts.map +1 -0
  147. package/dist/types/src/cli/commands/database/index.d.ts +3 -0
  148. package/dist/types/src/cli/commands/database/index.d.ts.map +1 -0
  149. package/dist/types/src/cli/commands/database/query/index.d.ts +2 -0
  150. package/dist/types/src/cli/commands/database/query/index.d.ts.map +1 -0
  151. package/dist/types/src/cli/commands/database/query/query.d.ts +13 -0
  152. package/dist/types/src/cli/commands/database/query/query.d.ts.map +1 -0
  153. package/dist/types/src/cli/commands/database/query/query.test.d.ts +2 -0
  154. package/dist/types/src/cli/commands/database/query/query.test.d.ts.map +1 -0
  155. package/dist/types/src/cli/commands/database/remove.d.ts +9 -0
  156. package/dist/types/src/cli/commands/database/remove.d.ts.map +1 -0
  157. package/dist/types/src/cli/commands/database/stats.d.ts +6 -0
  158. package/dist/types/src/cli/commands/database/stats.d.ts.map +1 -0
  159. package/dist/types/src/cli/commands/database/util.d.ts +14 -0
  160. package/dist/types/src/cli/commands/database/util.d.ts.map +1 -0
  161. package/dist/types/src/cli/commands/index.d.ts +4 -0
  162. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  163. package/dist/types/src/cli/commands/queue/index.d.ts +7 -0
  164. package/dist/types/src/cli/commands/queue/index.d.ts.map +1 -0
  165. package/dist/types/src/cli/commands/queue/query.d.ts +8 -0
  166. package/dist/types/src/cli/commands/queue/query.d.ts.map +1 -0
  167. package/dist/types/src/cli/commands/queue/util.d.ts +6 -0
  168. package/dist/types/src/cli/commands/queue/util.d.ts.map +1 -0
  169. package/dist/types/src/cli/commands/space/close/close.d.ts +12 -0
  170. package/dist/types/src/cli/commands/space/close/close.d.ts.map +1 -0
  171. package/dist/types/src/cli/commands/space/close/index.d.ts +2 -0
  172. package/dist/types/src/cli/commands/space/close/index.d.ts.map +1 -0
  173. package/dist/types/src/cli/commands/space/create/create.d.ts +12 -0
  174. package/dist/types/src/cli/commands/space/create/create.d.ts.map +1 -0
  175. package/dist/types/src/cli/commands/space/create/create.test.d.ts +2 -0
  176. package/dist/types/src/cli/commands/space/create/create.test.d.ts.map +1 -0
  177. package/dist/types/src/cli/commands/space/create/index.d.ts +2 -0
  178. package/dist/types/src/cli/commands/space/create/index.d.ts.map +1 -0
  179. package/dist/types/src/cli/commands/space/index.d.ts +31 -0
  180. package/dist/types/src/cli/commands/space/index.d.ts.map +1 -0
  181. package/dist/types/src/cli/commands/space/info/index.d.ts +2 -0
  182. package/dist/types/src/cli/commands/space/info/index.d.ts.map +1 -0
  183. package/dist/types/src/cli/commands/space/info/info.d.ts +13 -0
  184. package/dist/types/src/cli/commands/space/info/info.d.ts.map +1 -0
  185. package/dist/types/src/cli/commands/space/info/info.test.d.ts +2 -0
  186. package/dist/types/src/cli/commands/space/info/info.test.d.ts.map +1 -0
  187. package/dist/types/src/cli/commands/space/join/index.d.ts +2 -0
  188. package/dist/types/src/cli/commands/space/join/index.d.ts.map +1 -0
  189. package/dist/types/src/cli/commands/space/join/join.d.ts +14 -0
  190. package/dist/types/src/cli/commands/space/join/join.d.ts.map +1 -0
  191. package/dist/types/src/cli/commands/space/join/util.d.ts +17 -0
  192. package/dist/types/src/cli/commands/space/join/util.d.ts.map +1 -0
  193. package/dist/types/src/cli/commands/space/list/index.d.ts +2 -0
  194. package/dist/types/src/cli/commands/space/list/index.d.ts.map +1 -0
  195. package/dist/types/src/cli/commands/space/list/list.d.ts +7 -0
  196. package/dist/types/src/cli/commands/space/list/list.d.ts.map +1 -0
  197. package/dist/types/src/cli/commands/space/list/list.test.d.ts +2 -0
  198. package/dist/types/src/cli/commands/space/list/list.test.d.ts.map +1 -0
  199. package/dist/types/src/cli/commands/space/members/index.d.ts +2 -0
  200. package/dist/types/src/cli/commands/space/members/index.d.ts.map +1 -0
  201. package/dist/types/src/cli/commands/space/members/members.d.ts +13 -0
  202. package/dist/types/src/cli/commands/space/members/members.d.ts.map +1 -0
  203. package/dist/types/src/cli/commands/space/members/members.test.d.ts +2 -0
  204. package/dist/types/src/cli/commands/space/members/members.test.d.ts.map +1 -0
  205. package/dist/types/src/cli/commands/space/members/util.d.ts +9 -0
  206. package/dist/types/src/cli/commands/space/members/util.d.ts.map +1 -0
  207. package/dist/types/src/cli/commands/space/open/index.d.ts +2 -0
  208. package/dist/types/src/cli/commands/space/open/index.d.ts.map +1 -0
  209. package/dist/types/src/cli/commands/space/open/open.d.ts +12 -0
  210. package/dist/types/src/cli/commands/space/open/open.d.ts.map +1 -0
  211. package/dist/types/src/cli/commands/space/schema/index.d.ts +8 -0
  212. package/dist/types/src/cli/commands/space/schema/index.d.ts.map +1 -0
  213. package/dist/types/src/cli/commands/space/schema/list/index.d.ts +2 -0
  214. package/dist/types/src/cli/commands/space/schema/list/index.d.ts.map +1 -0
  215. package/dist/types/src/cli/commands/space/schema/list/list.d.ts +15 -0
  216. package/dist/types/src/cli/commands/space/schema/list/list.d.ts.map +1 -0
  217. package/dist/types/src/cli/commands/space/schema/list/list.test.d.ts +2 -0
  218. package/dist/types/src/cli/commands/space/schema/list/list.test.d.ts.map +1 -0
  219. package/dist/types/src/cli/commands/space/schema/list/util.d.ts +15 -0
  220. package/dist/types/src/cli/commands/space/schema/list/util.d.ts.map +1 -0
  221. package/dist/types/src/cli/commands/space/share/index.d.ts +2 -0
  222. package/dist/types/src/cli/commands/space/share/index.d.ts.map +1 -0
  223. package/dist/types/src/cli/commands/space/share/share.d.ts +19 -0
  224. package/dist/types/src/cli/commands/space/share/share.d.ts.map +1 -0
  225. package/dist/types/src/cli/commands/space/sync/index.d.ts +2 -0
  226. package/dist/types/src/cli/commands/space/sync/index.d.ts.map +1 -0
  227. package/dist/types/src/cli/commands/space/sync/sync.d.ts +6 -0
  228. package/dist/types/src/cli/commands/space/sync/sync.d.ts.map +1 -0
  229. package/dist/types/src/cli/commands/space/sync/sync.test.d.ts +2 -0
  230. package/dist/types/src/cli/commands/space/sync/sync.test.d.ts.map +1 -0
  231. package/dist/types/src/cli/index.d.ts +2 -0
  232. package/dist/types/src/cli/index.d.ts.map +1 -0
  233. package/dist/types/src/cli/plugin.d.ts +4 -0
  234. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  235. package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
  236. package/dist/types/src/components/CollectionArticle.d.ts +9 -0
  237. package/dist/types/src/components/CollectionArticle.d.ts.map +1 -0
  238. package/dist/types/src/components/CollectionSection.d.ts +3 -4
  239. package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
  240. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +6 -5
  241. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
  242. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +1602 -8
  243. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
  244. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +20 -10
  245. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
  246. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -1
  247. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
  248. package/dist/types/src/components/{JoinDialog.d.ts → JoinDialog/JoinDialog.d.ts} +1 -1
  249. package/dist/types/src/components/JoinDialog/JoinDialog.d.ts.map +1 -0
  250. package/dist/types/src/components/JoinDialog/index.d.ts +2 -0
  251. package/dist/types/src/components/JoinDialog/index.d.ts.map +1 -0
  252. package/dist/types/src/components/{MembersContainer.d.ts → MembersContainer/MembersContainer.d.ts} +3 -2
  253. package/dist/types/src/components/MembersContainer/MembersContainer.d.ts.map +1 -0
  254. package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts +1600 -0
  255. package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts.map +1 -0
  256. package/dist/types/src/components/MembersContainer/index.d.ts +2 -0
  257. package/dist/types/src/components/MembersContainer/index.d.ts.map +1 -0
  258. package/dist/types/src/components/MenuFooter.d.ts +1 -1
  259. package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
  260. package/dist/types/src/components/ObjectCardStack/ObjectCardStack.d.ts +8 -0
  261. package/dist/types/src/components/ObjectCardStack/ObjectCardStack.d.ts.map +1 -0
  262. package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts +9 -0
  263. package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts.map +1 -0
  264. package/dist/types/src/components/ObjectCardStack/index.d.ts +3 -0
  265. package/dist/types/src/components/ObjectCardStack/index.d.ts.map +1 -0
  266. package/dist/types/src/components/{ObjectSettings → ObjectDetails}/BaseObjectSettings.d.ts +3 -3
  267. package/dist/types/src/components/ObjectDetails/BaseObjectSettings.d.ts.map +1 -0
  268. package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts +1433 -0
  269. package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts.map +1 -0
  270. package/dist/types/src/components/ObjectDetails/ForeignKeys.d.ts +8 -0
  271. package/dist/types/src/components/ObjectDetails/ForeignKeys.d.ts.map +1 -0
  272. package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts +9 -0
  273. package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts.map +1 -0
  274. package/dist/types/src/components/ObjectDetails/index.d.ts +3 -0
  275. package/dist/types/src/components/ObjectDetails/index.d.ts.map +1 -0
  276. package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts +7 -0
  277. package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts.map +1 -0
  278. package/dist/types/src/components/ObjectRenamePopover/index.d.ts +2 -0
  279. package/dist/types/src/components/ObjectRenamePopover/index.d.ts.map +1 -0
  280. package/dist/types/src/components/RecordArticle.d.ts +5 -0
  281. package/dist/types/src/components/RecordArticle.d.ts.map +1 -0
  282. package/dist/types/src/components/RecordArticle.stories.d.ts +1600 -0
  283. package/dist/types/src/components/RecordArticle.stories.d.ts.map +1 -0
  284. package/dist/types/src/components/SchemaContainer.d.ts +2 -2
  285. package/dist/types/src/components/SchemaContainer.d.ts.map +1 -1
  286. package/dist/types/src/components/SpacePluginSettings.d.ts +4 -2
  287. package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
  288. package/dist/types/src/components/{SpacePresence.d.ts → SpacePresence/SpacePresence.d.ts} +7 -6
  289. package/dist/types/src/components/SpacePresence/SpacePresence.d.ts.map +1 -0
  290. package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts +1430 -0
  291. package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts.map +1 -0
  292. package/dist/types/src/components/SpacePresence/index.d.ts +2 -0
  293. package/dist/types/src/components/SpacePresence/index.d.ts.map +1 -0
  294. package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts +7 -0
  295. package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts.map +1 -0
  296. package/dist/types/src/components/SpaceRenamePopover/index.d.ts +2 -0
  297. package/dist/types/src/components/SpaceRenamePopover/index.d.ts.map +1 -0
  298. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts +1 -1
  299. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
  300. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +1430 -4
  301. package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
  302. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +1 -1
  303. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
  304. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1431 -5
  305. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
  306. package/dist/types/src/components/SyncStatus/status.d.ts +5 -5
  307. package/dist/types/src/components/ViewEditor.d.ts +7 -0
  308. package/dist/types/src/components/ViewEditor.d.ts.map +1 -0
  309. package/dist/types/src/components/index.d.ts +16 -6
  310. package/dist/types/src/components/index.d.ts.map +1 -1
  311. package/dist/types/src/constants.d.ts +6 -0
  312. package/dist/types/src/constants.d.ts.map +1 -0
  313. package/dist/types/src/helpers/index.d.ts +2 -0
  314. package/dist/types/src/helpers/index.d.ts.map +1 -0
  315. package/dist/types/src/helpers/query.d.ts +7 -0
  316. package/dist/types/src/helpers/query.d.ts.map +1 -0
  317. package/dist/types/src/helpers/query.test.d.ts +2 -0
  318. package/dist/types/src/helpers/query.test.d.ts.map +1 -0
  319. package/dist/types/src/hooks/index.d.ts +1 -0
  320. package/dist/types/src/hooks/index.d.ts.map +1 -1
  321. package/dist/types/src/hooks/useActiveSpace.d.ts +2 -2
  322. package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
  323. package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +2 -8
  324. package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
  325. package/dist/types/src/hooks/usePath.d.ts +3 -3
  326. package/dist/types/src/hooks/usePath.d.ts.map +1 -1
  327. package/dist/types/src/hooks/useTypeOptions.d.ts +10 -0
  328. package/dist/types/src/hooks/useTypeOptions.d.ts.map +1 -0
  329. package/dist/types/src/index.d.ts +2 -2
  330. package/dist/types/src/index.d.ts.map +1 -1
  331. package/dist/types/src/meta.d.ts +2 -3
  332. package/dist/types/src/meta.d.ts.map +1 -1
  333. package/dist/types/src/translations.d.ts +1300 -36
  334. package/dist/types/src/translations.d.ts.map +1 -1
  335. package/dist/types/src/types/capabilities.d.ts +71 -0
  336. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  337. package/dist/types/src/types/events.d.ts +9 -0
  338. package/dist/types/src/types/events.d.ts.map +1 -0
  339. package/dist/types/src/types/form.d.ts +22 -0
  340. package/dist/types/src/types/form.d.ts.map +1 -0
  341. package/dist/types/src/types/index.d.ts +3 -0
  342. package/dist/types/src/types/index.d.ts.map +1 -1
  343. package/dist/types/src/types/types.d.ts +640 -338
  344. package/dist/types/src/types/types.d.ts.map +1 -1
  345. package/dist/types/src/util.d.ts +49 -31
  346. package/dist/types/src/util.d.ts.map +1 -1
  347. package/dist/types/tsconfig.tsbuildinfo +1 -1
  348. package/package.json +86 -64
  349. package/src/SpacePlugin.ts +174 -170
  350. package/src/capabilities/app-graph-builder/app-graph-builder.ts +617 -0
  351. package/src/capabilities/app-graph-builder/index.ts +7 -0
  352. package/src/capabilities/app-graph-serializer/app-graph-serializer.ts +82 -0
  353. package/src/capabilities/app-graph-serializer/index.ts +7 -0
  354. package/src/capabilities/identity-created/identity-created.ts +29 -0
  355. package/src/capabilities/identity-created/index.ts +7 -0
  356. package/src/capabilities/index.ts +10 -15
  357. package/src/capabilities/operation-resolver/index.ts +7 -0
  358. package/src/capabilities/operation-resolver/operation-resolver.ts +760 -0
  359. package/src/capabilities/react-root/index.ts +7 -0
  360. package/src/capabilities/react-root/react-root.tsx +25 -0
  361. package/src/capabilities/react-surface/index.ts +7 -0
  362. package/src/capabilities/react-surface/react-surface.tsx +375 -0
  363. package/src/capabilities/repair/index.ts +7 -0
  364. package/src/capabilities/repair/repair.ts +67 -0
  365. package/src/capabilities/settings/index.ts +7 -0
  366. package/src/capabilities/settings/settings.ts +32 -0
  367. package/src/capabilities/spaces-ready/index.ts +7 -0
  368. package/src/capabilities/spaces-ready/spaces-ready.ts +289 -0
  369. package/src/capabilities/state/index.ts +7 -0
  370. package/src/capabilities/state/state.ts +64 -0
  371. package/src/cli/commands/database/add.ts +116 -0
  372. package/src/cli/commands/database/index.ts +16 -0
  373. package/src/cli/commands/database/query/index.ts +5 -0
  374. package/src/cli/commands/database/query/query.test.ts +55 -0
  375. package/src/cli/commands/database/query/query.ts +44 -0
  376. package/src/cli/commands/database/remove.ts +51 -0
  377. package/src/cli/commands/database/stats.ts +44 -0
  378. package/src/cli/commands/database/util.ts +32 -0
  379. package/src/cli/commands/index.ts +7 -0
  380. package/src/cli/commands/queue/index.ts +12 -0
  381. package/src/cli/commands/queue/query.ts +45 -0
  382. package/src/cli/commands/queue/util.ts +19 -0
  383. package/src/cli/commands/space/close/close.ts +40 -0
  384. package/src/cli/commands/space/close/index.ts +5 -0
  385. package/src/cli/commands/space/create/create.test.ts +67 -0
  386. package/src/cli/commands/space/create/create.ts +61 -0
  387. package/src/cli/commands/space/create/index.ts +5 -0
  388. package/src/cli/commands/space/index.ts +21 -0
  389. package/src/cli/commands/space/info/index.ts +5 -0
  390. package/src/cli/commands/space/info/info.test.ts +47 -0
  391. package/src/cli/commands/space/info/info.ts +37 -0
  392. package/src/cli/commands/space/join/index.ts +5 -0
  393. package/src/cli/commands/space/join/join.ts +122 -0
  394. package/src/cli/commands/space/join/util.ts +82 -0
  395. package/src/cli/commands/space/list/index.ts +5 -0
  396. package/src/cli/commands/space/list/list.test.ts +36 -0
  397. package/src/cli/commands/space/list/list.ts +30 -0
  398. package/src/cli/commands/space/members/index.ts +5 -0
  399. package/src/cli/commands/space/members/members.test.ts +46 -0
  400. package/src/cli/commands/space/members/members.ts +40 -0
  401. package/src/cli/commands/space/members/util.ts +29 -0
  402. package/src/cli/commands/space/open/index.ts +5 -0
  403. package/src/cli/commands/space/open/open.ts +39 -0
  404. package/src/cli/commands/space/schema/index.ts +12 -0
  405. package/src/cli/commands/space/schema/list/index.ts +5 -0
  406. package/src/cli/commands/space/schema/list/list.test.ts +42 -0
  407. package/src/cli/commands/space/schema/list/list.ts +64 -0
  408. package/src/cli/commands/space/schema/list/util.ts +39 -0
  409. package/src/cli/commands/space/share/index.ts +5 -0
  410. package/src/cli/commands/space/share/share.ts +112 -0
  411. package/src/cli/commands/space/sync/index.ts +5 -0
  412. package/src/cli/commands/space/sync/sync.test.ts +12 -0
  413. package/src/cli/commands/space/sync/sync.ts +33 -0
  414. package/src/cli/index.ts +5 -0
  415. package/src/cli/plugin.ts +81 -0
  416. package/src/components/AwaitingObject.tsx +26 -27
  417. package/src/components/CollectionArticle.tsx +153 -0
  418. package/src/components/CollectionSection.tsx +8 -6
  419. package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +37 -30
  420. package/src/components/CreateDialog/CreateObjectDialog.tsx +95 -71
  421. package/src/components/CreateDialog/CreateObjectPanel.tsx +170 -97
  422. package/src/components/CreateDialog/CreateSpaceDialog.tsx +39 -33
  423. package/src/components/{JoinDialog.tsx → JoinDialog/JoinDialog.tsx} +28 -39
  424. package/src/components/JoinDialog/index.ts +5 -0
  425. package/src/components/MembersContainer/MembersContainer.stories.tsx +56 -0
  426. package/src/components/{MembersContainer.tsx → MembersContainer/MembersContainer.tsx} +56 -55
  427. package/src/components/MembersContainer/index.ts +5 -0
  428. package/src/components/MenuFooter.tsx +5 -6
  429. package/src/components/ObjectCardStack/ObjectCardStack.tsx +67 -0
  430. package/src/components/ObjectCardStack/ObjectForm.tsx +97 -0
  431. package/src/components/ObjectCardStack/index.ts +7 -0
  432. package/src/components/ObjectDetails/BaseObjectSettings.stories.tsx +63 -0
  433. package/src/components/ObjectDetails/BaseObjectSettings.tsx +122 -0
  434. package/src/components/{ObjectSettings → ObjectDetails}/ForeignKeys.tsx +8 -8
  435. package/src/components/ObjectDetails/ObjectDetails.tsx +32 -0
  436. package/src/components/ObjectDetails/index.ts +7 -0
  437. package/src/components/ObjectRenamePopover/ObjectRenamePopover.tsx +52 -0
  438. package/src/components/ObjectRenamePopover/index.ts +5 -0
  439. package/src/components/RecordArticle.stories.tsx +115 -0
  440. package/src/components/RecordArticle.tsx +122 -0
  441. package/src/components/SchemaContainer.tsx +28 -31
  442. package/src/components/SpacePluginSettings.tsx +25 -16
  443. package/src/components/{SpacePresence.stories.tsx → SpacePresence/SpacePresence.stories.tsx} +24 -23
  444. package/src/components/{SpacePresence.tsx → SpacePresence/SpacePresence.tsx} +27 -24
  445. package/src/components/SpacePresence/index.ts +5 -0
  446. package/src/components/{PopoverRenameSpace.tsx → SpaceRenamePopover/SpaceRenamePopover.tsx} +16 -16
  447. package/src/components/SpaceRenamePopover/index.ts +5 -0
  448. package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +19 -11
  449. package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +193 -157
  450. package/src/components/SyncStatus/InlineSyncStatus.tsx +8 -8
  451. package/src/components/SyncStatus/SyncStatus.stories.tsx +9 -9
  452. package/src/components/SyncStatus/SyncStatus.tsx +110 -13
  453. package/src/components/SyncStatus/save-tracker.ts +2 -2
  454. package/src/components/SyncStatus/status.ts +4 -4
  455. package/src/components/ViewEditor.tsx +101 -0
  456. package/src/components/index.ts +11 -6
  457. package/src/constants.ts +11 -0
  458. package/src/helpers/index.ts +5 -0
  459. package/src/helpers/query.test.ts +24 -0
  460. package/src/helpers/query.ts +153 -0
  461. package/src/hooks/index.ts +1 -0
  462. package/src/hooks/useActiveSpace.ts +7 -4
  463. package/src/hooks/useInputSurfaceLookup.tsx +9 -13
  464. package/src/hooks/usePath.ts +5 -5
  465. package/src/hooks/useTypeOptions.ts +25 -0
  466. package/src/index.ts +2 -2
  467. package/src/meta.ts +8 -5
  468. package/src/translations.ts +106 -32
  469. package/src/types/capabilities.ts +73 -0
  470. package/src/types/events.ts +15 -0
  471. package/src/types/form.ts +69 -0
  472. package/src/types/index.ts +3 -0
  473. package/src/types/types.ts +539 -206
  474. package/src/util.tsx +447 -241
  475. package/dist/lib/browser/app-graph-builder-PMDF6PJV.mjs +0 -363
  476. package/dist/lib/browser/app-graph-builder-PMDF6PJV.mjs.map +0 -7
  477. package/dist/lib/browser/app-graph-serializer-UKYMBX4O.mjs +0 -80
  478. package/dist/lib/browser/app-graph-serializer-UKYMBX4O.mjs.map +0 -7
  479. package/dist/lib/browser/chunk-6VLSHG4A.mjs.map +0 -7
  480. package/dist/lib/browser/chunk-C7KGJTAL.mjs +0 -18
  481. package/dist/lib/browser/chunk-C7KGJTAL.mjs.map +0 -7
  482. package/dist/lib/browser/chunk-FBCGT5YY.mjs +0 -13
  483. package/dist/lib/browser/chunk-FBCGT5YY.mjs.map +0 -7
  484. package/dist/lib/browser/chunk-GVTXQCIW.mjs +0 -1915
  485. package/dist/lib/browser/chunk-GVTXQCIW.mjs.map +0 -7
  486. package/dist/lib/browser/chunk-S6NY637J.mjs +0 -284
  487. package/dist/lib/browser/chunk-S6NY637J.mjs.map +0 -7
  488. package/dist/lib/browser/chunk-VLBRSGJ2.mjs +0 -94
  489. package/dist/lib/browser/chunk-VLBRSGJ2.mjs.map +0 -7
  490. package/dist/lib/browser/chunk-WBSEOLEM.mjs +0 -546
  491. package/dist/lib/browser/chunk-WBSEOLEM.mjs.map +0 -7
  492. package/dist/lib/browser/chunk-XXIPJLJF.mjs +0 -19
  493. package/dist/lib/browser/chunk-XXIPJLJF.mjs.map +0 -7
  494. package/dist/lib/browser/identity-created-23XJJV2N.mjs +0 -23
  495. package/dist/lib/browser/identity-created-23XJJV2N.mjs.map +0 -7
  496. package/dist/lib/browser/intent-resolver-WK5WYFH3.mjs +0 -610
  497. package/dist/lib/browser/intent-resolver-WK5WYFH3.mjs.map +0 -7
  498. package/dist/lib/browser/react-root-7S6FIC5G.mjs +0 -29
  499. package/dist/lib/browser/react-root-7S6FIC5G.mjs.map +0 -7
  500. package/dist/lib/browser/react-surface-6C3YJNDK.mjs +0 -353
  501. package/dist/lib/browser/react-surface-6C3YJNDK.mjs.map +0 -7
  502. package/dist/lib/browser/schema-defs-K3B3OAH4.mjs +0 -26
  503. package/dist/lib/browser/schema-defs-K3B3OAH4.mjs.map +0 -7
  504. package/dist/lib/browser/schema-tools-BNP4JTD7.mjs +0 -124
  505. package/dist/lib/browser/schema-tools-BNP4JTD7.mjs.map +0 -7
  506. package/dist/lib/browser/settings-XNWYRWNM.mjs +0 -24
  507. package/dist/lib/browser/settings-XNWYRWNM.mjs.map +0 -7
  508. package/dist/lib/browser/spaces-ready-K7NSNBHM.mjs +0 -199
  509. package/dist/lib/browser/spaces-ready-K7NSNBHM.mjs.map +0 -7
  510. package/dist/lib/browser/state-522XTUR4.mjs +0 -47
  511. package/dist/lib/browser/state-522XTUR4.mjs.map +0 -7
  512. package/dist/lib/node-esm/app-graph-builder-TO72W6MI.mjs +0 -364
  513. package/dist/lib/node-esm/app-graph-builder-TO72W6MI.mjs.map +0 -7
  514. package/dist/lib/node-esm/app-graph-serializer-LA3IZDXJ.mjs +0 -81
  515. package/dist/lib/node-esm/app-graph-serializer-LA3IZDXJ.mjs.map +0 -7
  516. package/dist/lib/node-esm/chunk-2THX6G4C.mjs +0 -285
  517. package/dist/lib/node-esm/chunk-2THX6G4C.mjs.map +0 -7
  518. package/dist/lib/node-esm/chunk-72QMMRKC.mjs +0 -19
  519. package/dist/lib/node-esm/chunk-72QMMRKC.mjs.map +0 -7
  520. package/dist/lib/node-esm/chunk-AT7LGFER.mjs +0 -20
  521. package/dist/lib/node-esm/chunk-AT7LGFER.mjs.map +0 -7
  522. package/dist/lib/node-esm/chunk-HJJHLWKY.mjs +0 -547
  523. package/dist/lib/node-esm/chunk-HJJHLWKY.mjs.map +0 -7
  524. package/dist/lib/node-esm/chunk-HWNG4MEU.mjs +0 -15
  525. package/dist/lib/node-esm/chunk-HWNG4MEU.mjs.map +0 -7
  526. package/dist/lib/node-esm/chunk-OUBADVJE.mjs +0 -1916
  527. package/dist/lib/node-esm/chunk-OUBADVJE.mjs.map +0 -7
  528. package/dist/lib/node-esm/chunk-SSLBYZEY.mjs +0 -96
  529. package/dist/lib/node-esm/chunk-SSLBYZEY.mjs.map +0 -7
  530. package/dist/lib/node-esm/chunk-SXD6T2N4.mjs.map +0 -7
  531. package/dist/lib/node-esm/identity-created-IJQO6GCR.mjs +0 -25
  532. package/dist/lib/node-esm/identity-created-IJQO6GCR.mjs.map +0 -7
  533. package/dist/lib/node-esm/intent-resolver-HSR27ME4.mjs +0 -611
  534. package/dist/lib/node-esm/intent-resolver-HSR27ME4.mjs.map +0 -7
  535. package/dist/lib/node-esm/react-root-HUK3ANLV.mjs +0 -30
  536. package/dist/lib/node-esm/react-root-HUK3ANLV.mjs.map +0 -7
  537. package/dist/lib/node-esm/react-surface-AGAWX7DD.mjs +0 -354
  538. package/dist/lib/node-esm/react-surface-AGAWX7DD.mjs.map +0 -7
  539. package/dist/lib/node-esm/schema-defs-4MCDG4DV.mjs +0 -27
  540. package/dist/lib/node-esm/schema-defs-4MCDG4DV.mjs.map +0 -7
  541. package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs +0 -126
  542. package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs.map +0 -7
  543. package/dist/lib/node-esm/settings-YGKHGFPH.mjs +0 -25
  544. package/dist/lib/node-esm/settings-YGKHGFPH.mjs.map +0 -7
  545. package/dist/lib/node-esm/spaces-ready-UM2P3DCR.mjs +0 -200
  546. package/dist/lib/node-esm/spaces-ready-UM2P3DCR.mjs.map +0 -7
  547. package/dist/lib/node-esm/state-C4IOXPZP.mjs +0 -48
  548. package/dist/lib/node-esm/state-C4IOXPZP.mjs.map +0 -7
  549. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  550. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  551. package/dist/types/src/capabilities/app-graph-serializer.d.ts +0 -4
  552. package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +0 -1
  553. package/dist/types/src/capabilities/capabilities.d.ts +0 -22
  554. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  555. package/dist/types/src/capabilities/identity-created.d.ts +0 -4
  556. package/dist/types/src/capabilities/identity-created.d.ts.map +0 -1
  557. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -9
  558. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  559. package/dist/types/src/capabilities/react-root.d.ts +0 -7
  560. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  561. package/dist/types/src/capabilities/react-surface.d.ts +0 -7
  562. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  563. package/dist/types/src/capabilities/schema-defs.d.ts +0 -4
  564. package/dist/types/src/capabilities/schema-defs.d.ts.map +0 -1
  565. package/dist/types/src/capabilities/schema-tool.test.d.ts +0 -2
  566. package/dist/types/src/capabilities/schema-tool.test.d.ts.map +0 -1
  567. package/dist/types/src/capabilities/schema-tools.d.ts +0 -13
  568. package/dist/types/src/capabilities/schema-tools.d.ts.map +0 -1
  569. package/dist/types/src/capabilities/settings.d.ts +0 -4
  570. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  571. package/dist/types/src/capabilities/spaces-ready.d.ts +0 -4
  572. package/dist/types/src/capabilities/spaces-ready.d.ts.map +0 -1
  573. package/dist/types/src/capabilities/state.d.ts +0 -5
  574. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  575. package/dist/types/src/components/CollectionMain.d.ts +0 -6
  576. package/dist/types/src/components/CollectionMain.d.ts.map +0 -1
  577. package/dist/types/src/components/JoinDialog.d.ts.map +0 -1
  578. package/dist/types/src/components/MembersContainer.d.ts.map +0 -1
  579. package/dist/types/src/components/MembersContainer.stories.d.ts +0 -8
  580. package/dist/types/src/components/MembersContainer.stories.d.ts.map +0 -1
  581. package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts +0 -7
  582. package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +0 -1
  583. package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +0 -1
  584. package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts +0 -8
  585. package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +0 -1
  586. package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts +0 -8
  587. package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +0 -1
  588. package/dist/types/src/components/ObjectSettings/index.d.ts +0 -2
  589. package/dist/types/src/components/ObjectSettings/index.d.ts.map +0 -1
  590. package/dist/types/src/components/PersistenceStatus.d.ts +0 -6
  591. package/dist/types/src/components/PersistenceStatus.d.ts.map +0 -1
  592. package/dist/types/src/components/PopoverRenameObject.d.ts +0 -7
  593. package/dist/types/src/components/PopoverRenameObject.d.ts.map +0 -1
  594. package/dist/types/src/components/PopoverRenameSpace.d.ts +0 -7
  595. package/dist/types/src/components/PopoverRenameSpace.d.ts.map +0 -1
  596. package/dist/types/src/components/SpacePresence.d.ts.map +0 -1
  597. package/dist/types/src/components/SpacePresence.stories.d.ts +0 -9
  598. package/dist/types/src/components/SpacePresence.stories.d.ts.map +0 -1
  599. package/dist/types/src/events.d.ts +0 -7
  600. package/dist/types/src/events.d.ts.map +0 -1
  601. package/src/capabilities/app-graph-builder.ts +0 -539
  602. package/src/capabilities/app-graph-serializer.ts +0 -76
  603. package/src/capabilities/capabilities.ts +0 -24
  604. package/src/capabilities/identity-created.ts +0 -25
  605. package/src/capabilities/intent-resolver.ts +0 -585
  606. package/src/capabilities/react-root.tsx +0 -20
  607. package/src/capabilities/react-surface.tsx +0 -349
  608. package/src/capabilities/schema-defs.ts +0 -30
  609. package/src/capabilities/schema-tool.test.ts +0 -44
  610. package/src/capabilities/schema-tools.ts +0 -125
  611. package/src/capabilities/settings.ts +0 -21
  612. package/src/capabilities/spaces-ready.ts +0 -231
  613. package/src/capabilities/state.ts +0 -45
  614. package/src/components/CollectionMain.tsx +0 -30
  615. package/src/components/MembersContainer.stories.tsx +0 -30
  616. package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +0 -80
  617. package/src/components/ObjectSettings/BaseObjectSettings.tsx +0 -47
  618. package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +0 -36
  619. package/src/components/ObjectSettings/index.ts +0 -5
  620. package/src/components/PersistenceStatus.tsx +0 -84
  621. package/src/components/PopoverRenameObject.tsx +0 -62
  622. package/src/events.ts +0 -14
@@ -0,0 +1,760 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability, Common, Plugin, UndoMapping } from '@dxos/app-framework';
8
+ import { SpaceState, getSpace } from '@dxos/client/echo';
9
+ import { Database, Obj, Query, Ref, Relation, Type } from '@dxos/echo';
10
+ import { EchoDatabaseImpl, Serializer } from '@dxos/echo-db';
11
+ import { invariant } from '@dxos/invariant';
12
+ import { Migrations } from '@dxos/migrations';
13
+ import { OperationResolver } from '@dxos/operation';
14
+ import { Operation } from '@dxos/operation';
15
+ import { ClientCapabilities } from '@dxos/plugin-client/types';
16
+ import { ObservabilityOperation } from '@dxos/plugin-observability/types';
17
+ import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
18
+ import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention/types';
19
+ import { iconValues } from '@dxos/react-ui-pickers/icons';
20
+ import { Collection, ProjectionModel, createEchoChangeCallback, getTypenameFromQuery } from '@dxos/schema';
21
+ import { hues } from '@dxos/ui-theme';
22
+
23
+ import { type JoinDialogProps } from '../../components';
24
+ import {
25
+ CREATE_OBJECT_DIALOG,
26
+ CREATE_SPACE_DIALOG,
27
+ JOIN_DIALOG,
28
+ OBJECT_RENAME_POPOVER,
29
+ SPACE_RENAME_POPOVER,
30
+ } from '../../constants';
31
+ import { SpaceEvents } from '../../types';
32
+ import { SpaceCapabilities, SpaceOperation } from '../../types';
33
+ import { COMPOSER_SPACE_LOCK, cloneObject, getNestedObjects } from '../../util';
34
+
35
+ type OperationResolverOptions = {
36
+ createInvitationUrl: (invitationCode: string) => string;
37
+ observability?: boolean;
38
+ };
39
+
40
+ export default Capability.makeModule(
41
+ Effect.fnUntraced(function* (props?: OperationResolverOptions) {
42
+ const { createInvitationUrl, observability } = props!;
43
+ const capabilityManager = yield* Capability.Service;
44
+
45
+ const resolve = (typename: string) =>
46
+ capabilityManager.getAll(Common.Capability.Metadata).find(({ id }: { id: string }) => id === typename)
47
+ ?.metadata ?? {};
48
+
49
+ return [
50
+ Capability.contributes(Common.Capability.UndoMapping, [
51
+ UndoMapping.make({
52
+ operation: SpaceOperation.DeleteField,
53
+ inverse: SpaceOperation.RestoreField,
54
+ deriveContext: (input, output) => ({
55
+ view: input.view,
56
+ field: output.field,
57
+ props: output.props,
58
+ index: output.index,
59
+ }),
60
+ message: ['field deleted label', { ns: 'dxos.org/plugin/space' }],
61
+ }),
62
+ UndoMapping.make({
63
+ operation: SpaceOperation.RemoveObjects,
64
+ inverse: SpaceOperation.RestoreObjects,
65
+ deriveContext: (_input, output) => ({
66
+ objects: output.objects,
67
+ parentCollection: output.parentCollection,
68
+ indices: output.indices,
69
+ nestedObjectsList: output.nestedObjectsList,
70
+ wasActive: output.wasActive,
71
+ }),
72
+ message: (input, _output) => {
73
+ const ns = Obj.getTypename(input.objects[0]);
74
+ return ns && input.objects.length === 1
75
+ ? ['object deleted label', { ns }]
76
+ : ['objects deleted label', { ns: 'plugin-space' }];
77
+ },
78
+ }),
79
+ ]),
80
+ Capability.contributes(Common.Capability.OperationResolver, [
81
+ //
82
+ // Open
83
+ //
84
+ OperationResolver.make({
85
+ operation: SpaceOperation.Open,
86
+ handler: (input) =>
87
+ Effect.promise(async () => {
88
+ await input.space.open();
89
+ }),
90
+ }),
91
+
92
+ //
93
+ // Close
94
+ //
95
+ OperationResolver.make({
96
+ operation: SpaceOperation.Close,
97
+ handler: (input) =>
98
+ Effect.promise(async () => {
99
+ await input.space.close();
100
+ }),
101
+ }),
102
+
103
+ //
104
+ // Join
105
+ //
106
+ OperationResolver.make({
107
+ operation: SpaceOperation.Join,
108
+ handler: Effect.fnUntraced(function* (input) {
109
+ yield* Operation.invoke(Common.LayoutOperation.UpdateDialog, {
110
+ subject: JOIN_DIALOG,
111
+ blockAlign: 'start',
112
+ props: {
113
+ initialInvitationCode: input.invitationCode,
114
+ onDone: input.onDone,
115
+ } satisfies Partial<JoinDialogProps>,
116
+ });
117
+ }),
118
+ }),
119
+
120
+ //
121
+ // WaitForObject
122
+ //
123
+ OperationResolver.make({
124
+ operation: SpaceOperation.WaitForObject,
125
+ handler: Effect.fnUntraced(function* (input) {
126
+ yield* Common.Capability.updateAtomValue(SpaceCapabilities.EphemeralState, (current) => ({
127
+ ...current,
128
+ awaiting: input.id,
129
+ }));
130
+ }),
131
+ }),
132
+
133
+ //
134
+ // OpenSettings
135
+ //
136
+ OperationResolver.make({
137
+ operation: SpaceOperation.OpenSettings,
138
+ handler: Effect.fnUntraced(function* (input) {
139
+ yield* Operation.invoke(Common.LayoutOperation.Open, {
140
+ subject: [`properties-settings${ATTENDABLE_PATH_SEPARATOR}${input.space.id}`],
141
+ workspace: input.space.id,
142
+ });
143
+ }),
144
+ }),
145
+
146
+ //
147
+ // RemoveObjects
148
+ //
149
+ OperationResolver.make({
150
+ operation: SpaceOperation.RemoveObjects,
151
+ handler: Effect.fnUntraced(function* (input) {
152
+ const layout = yield* Common.Capability.getAtomValue(Common.Capability.Layout);
153
+ const objects = input.objects as Obj.Unknown[];
154
+
155
+ // All objects must be a member of the same space.
156
+ const space = getSpace(objects[0]);
157
+ invariant(space && objects.every((obj) => Obj.isObject(obj) && getSpace(obj) === space));
158
+ const openObjectIds = new Set<string>(layout.active);
159
+
160
+ const parentCollection: Collection.Collection =
161
+ input.target ?? space.properties[Collection.Collection.typename]?.target;
162
+
163
+ const nestedObjectsList = yield* Effect.promise(() =>
164
+ Promise.all(objects.map((obj) => getNestedObjects(obj, resolve))),
165
+ );
166
+
167
+ // Capture indices before removal.
168
+ const indices = objects.map((obj) =>
169
+ Obj.instanceOf(Collection.Collection, parentCollection)
170
+ ? parentCollection.objects.findIndex((ref) => ref.target === obj)
171
+ : -1,
172
+ );
173
+
174
+ // Close objects that were open.
175
+ const wasActive = objects
176
+ .flatMap((obj, i) => [obj, ...nestedObjectsList[i]])
177
+ .filter((obj) => Obj.isObject(obj) && openObjectIds.has(Obj.getDXN(obj).toString()))
178
+ .map((obj) => Obj.getDXN(obj).toString());
179
+
180
+ for (let i = 0; i < objects.length; i++) {
181
+ const obj = objects[i];
182
+ const nestedObjects = nestedObjectsList[i];
183
+
184
+ // Remove from parent collection.
185
+ const index = parentCollection.objects.findIndex((ref) => ref.target === obj);
186
+ if (index !== -1) {
187
+ Obj.change(parentCollection, (c) => {
188
+ c.objects.splice(index, 1);
189
+ });
190
+ }
191
+
192
+ // Delete nested objects.
193
+ for (const nestedObject of nestedObjects) {
194
+ if (Obj.isObject(nestedObject)) {
195
+ Obj.getDatabase(nestedObject)?.remove(nestedObject);
196
+ } else if (Relation.isRelation(nestedObject)) {
197
+ const db = Obj.getDatabase(Relation.getSource(nestedObject));
198
+ db?.remove(nestedObject);
199
+ }
200
+ }
201
+
202
+ // Delete the object.
203
+ const db = Obj.getDatabase(obj);
204
+ db?.remove(obj);
205
+ }
206
+
207
+ if (wasActive.length > 0) {
208
+ yield* Operation.invoke(Common.LayoutOperation.Close, { subject: wasActive });
209
+ }
210
+
211
+ // Return data needed for undo.
212
+ return {
213
+ objects,
214
+ parentCollection,
215
+ indices,
216
+ nestedObjectsList,
217
+ wasActive,
218
+ };
219
+ }),
220
+ }),
221
+
222
+ //
223
+ // DeleteField
224
+ //
225
+ OperationResolver.make({
226
+ operation: SpaceOperation.DeleteField,
227
+ handler: Effect.fnUntraced(function* (input) {
228
+ const registry = yield* Capability.get(Common.Capability.AtomRegistry);
229
+ const view = input.view as any;
230
+ const db = Obj.getDatabase(view);
231
+ invariant(db);
232
+ const typename = getTypenameFromQuery(view.query.ast);
233
+ invariant(typename);
234
+ const schema = yield* Effect.promise(() => db.schemaRegistry.query({ typename }).firstOrUndefined());
235
+ invariant(schema);
236
+
237
+ // Create projection with change callbacks that wrap in Obj.change().
238
+ const projection = new ProjectionModel({
239
+ registry,
240
+ view,
241
+ baseSchema: schema.jsonSchema,
242
+ change: createEchoChangeCallback(view, schema),
243
+ });
244
+
245
+ const result = projection.deleteFieldProjection(input.fieldId);
246
+
247
+ // Return data needed for undo.
248
+ return {
249
+ field: result.deleted.field,
250
+ props: result.deleted.props,
251
+ index: result.index,
252
+ };
253
+ }),
254
+ }),
255
+
256
+ //
257
+ // OpenCreateObject
258
+ //
259
+ OperationResolver.make({
260
+ operation: SpaceOperation.OpenCreateObject,
261
+ handler: Effect.fnUntraced(function* (input) {
262
+ const ephemeralState = yield* Common.Capability.getAtomValue(SpaceCapabilities.EphemeralState);
263
+ const navigable = input.navigable ?? true;
264
+ yield* Operation.invoke(Common.LayoutOperation.UpdateDialog, {
265
+ subject: CREATE_OBJECT_DIALOG,
266
+ blockAlign: 'start',
267
+ props: {
268
+ target: input.target,
269
+ views: input.views,
270
+ typename: input.typename,
271
+ initialFormValues: input.initialFormValues,
272
+ onCreateObject: input.onCreateObject,
273
+ shouldNavigate: navigable
274
+ ? (object: Obj.Unknown) => {
275
+ const isCollection = Obj.instanceOf(Collection.Collection, object);
276
+ const isSystemCollection = Obj.instanceOf(Collection.Managed, object);
277
+ return (!isCollection && !isSystemCollection) || ephemeralState.navigableCollections;
278
+ }
279
+ : () => false,
280
+ },
281
+ });
282
+ }),
283
+ }),
284
+
285
+ //
286
+ // AddObject
287
+ //
288
+ OperationResolver.make({
289
+ operation: SpaceOperation.AddObject,
290
+ handler: Effect.fnUntraced(function* (input) {
291
+ const target = input.target as any;
292
+ const object = input.object as Obj.Unknown;
293
+ const db = Database.isDatabase(target) ? target : Obj.getDatabase(target);
294
+ invariant(db, 'Database not found.');
295
+
296
+ yield* Collection.add({
297
+ object,
298
+ target: Database.isDatabase(target) ? undefined : target,
299
+ hidden: input.hidden,
300
+ }).pipe(Effect.provide(Database.Service.layer(db)));
301
+
302
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
303
+ name: 'space.object.add',
304
+ properties: {
305
+ spaceId: db.spaceId,
306
+ objectId: object.id,
307
+ },
308
+ });
309
+
310
+ return {
311
+ id: Obj.getDXN(object).toString(),
312
+ subject: [Obj.getDXN(object).toString()],
313
+ object,
314
+ };
315
+ }),
316
+ }),
317
+
318
+ //
319
+ // Share
320
+ //
321
+ OperationResolver.make({
322
+ operation: SpaceOperation.Share,
323
+ handler: Effect.fnUntraced(function* (input) {
324
+ const { space, type, authMethod, multiUse, target } = input;
325
+ const invitation = space.share({ type, authMethod, multiUse, target });
326
+
327
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
328
+ name: 'space.share',
329
+ properties: {
330
+ spaceId: space.id,
331
+ },
332
+ });
333
+
334
+ return invitation;
335
+ }),
336
+ }),
337
+
338
+ //
339
+ // Lock
340
+ // TODO(wittjosiah): This appears to be unused.
341
+ //
342
+ OperationResolver.make({
343
+ operation: SpaceOperation.Lock,
344
+ handler: Effect.fnUntraced(function* ({ space }) {
345
+ Obj.change(space.properties, (p) => {
346
+ p[COMPOSER_SPACE_LOCK] = true;
347
+ });
348
+
349
+ if (observability) {
350
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
351
+ name: 'space.lock',
352
+ properties: { spaceId: space.id },
353
+ });
354
+ }
355
+ }),
356
+ }),
357
+
358
+ //
359
+ // Unlock
360
+ // TODO(wittjosiah): This appears to be unused.
361
+ //
362
+ OperationResolver.make({
363
+ operation: SpaceOperation.Unlock,
364
+ handler: Effect.fnUntraced(function* ({ space }) {
365
+ Obj.change(space.properties, (p) => {
366
+ p[COMPOSER_SPACE_LOCK] = false;
367
+ });
368
+
369
+ if (observability) {
370
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
371
+ name: 'space.unlock',
372
+ properties: { spaceId: space.id },
373
+ });
374
+ }
375
+ }),
376
+ }),
377
+
378
+ //
379
+ // OpenCreateSpace
380
+ //
381
+ OperationResolver.make({
382
+ operation: SpaceOperation.OpenCreateSpace,
383
+ handler: Effect.fnUntraced(function* () {
384
+ yield* Operation.invoke(Common.LayoutOperation.UpdateDialog, {
385
+ subject: CREATE_SPACE_DIALOG,
386
+ blockAlign: 'start',
387
+ });
388
+ }),
389
+ }),
390
+
391
+ //
392
+ // Create
393
+ //
394
+ OperationResolver.make({
395
+ operation: SpaceOperation.Create,
396
+ handler: Effect.fnUntraced(function* ({ name, hue: hue_, icon: icon_, edgeReplication }) {
397
+ const client = yield* Capability.get(ClientCapabilities.Client);
398
+ const hue = hue_ ?? hues[Math.floor(Math.random() * hues.length)];
399
+ const icon = icon_ ?? iconValues[Math.floor(Math.random() * iconValues.length)];
400
+ const space = yield* Effect.promise(() => client.spaces.create({ name, hue, icon }));
401
+ if (edgeReplication) {
402
+ yield* Effect.promise(() => space.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED));
403
+ }
404
+ yield* Effect.promise(() => space.waitUntilReady());
405
+
406
+ // Create root collection.
407
+ const collection = Obj.make(Collection.Collection, { objects: [] });
408
+ Obj.change(space.properties, (p) => {
409
+ p[Collection.Collection.typename] = Ref.make(collection);
410
+ // Set current migration version.
411
+ if (Migrations.versionProperty) {
412
+ p[Migrations.versionProperty] = Migrations.targetVersion;
413
+ }
414
+ });
415
+
416
+ // Create records smart collection.
417
+ Obj.change(collection, (c) => {
418
+ c.objects.push(Ref.make(Collection.makeManaged({ key: Type.getTypename(Type.PersistentType) })));
419
+ });
420
+
421
+ // Allow other plugins to add default content.
422
+ yield* Plugin.activate(SpaceEvents.SpaceCreated);
423
+ const onCreateSpaceCallbacks = yield* Capability.getAll(SpaceCapabilities.OnCreateSpace);
424
+ yield* Effect.all(
425
+ onCreateSpaceCallbacks.map((onCreateSpace) =>
426
+ onCreateSpace({ space, isDefault: false, rootCollection: collection }),
427
+ ),
428
+ );
429
+
430
+ if (observability) {
431
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
432
+ name: 'space.create',
433
+ properties: { spaceId: space.id },
434
+ });
435
+ }
436
+
437
+ return { id: space.id, subject: [space.id], space };
438
+ }),
439
+ }),
440
+
441
+ //
442
+ // Migrate
443
+ //
444
+ OperationResolver.make({
445
+ operation: SpaceOperation.Migrate,
446
+ handler: Effect.fnUntraced(function* (input) {
447
+ const { space, version: targetVersion } = input;
448
+
449
+ if (space.state.get() === SpaceState.SPACE_REQUIRES_MIGRATION) {
450
+ yield* Common.Capability.updateAtomValue(SpaceCapabilities.EphemeralState, (current) => ({
451
+ ...current,
452
+ sdkMigrationRunning: { ...current.sdkMigrationRunning, [space.id]: true },
453
+ }));
454
+ yield* Effect.promise(() => space.internal.migrate());
455
+ yield* Common.Capability.updateAtomValue(SpaceCapabilities.EphemeralState, (current) => ({
456
+ ...current,
457
+ sdkMigrationRunning: { ...current.sdkMigrationRunning, [space.id]: false },
458
+ }));
459
+ }
460
+ const result = yield* Effect.promise(() => Migrations.migrate(space, targetVersion));
461
+
462
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
463
+ name: 'space.migrate',
464
+ properties: {
465
+ spaceId: space.id,
466
+ targetVersion,
467
+ version: Migrations.versionProperty ? space.properties[Migrations.versionProperty] : undefined,
468
+ },
469
+ });
470
+
471
+ return result;
472
+ }),
473
+ }),
474
+
475
+ //
476
+ // Snapshot
477
+ //
478
+ OperationResolver.make({
479
+ operation: SpaceOperation.Snapshot,
480
+ handler: (input) =>
481
+ Effect.promise(async () => {
482
+ const db = input.db as any;
483
+ invariant(db instanceof EchoDatabaseImpl, 'Database must be an instance of EchoDatabaseImpl');
484
+ const backup = await new Serializer().export(db, input.query && Query.fromAst(input.query));
485
+ return {
486
+ snapshot: new Blob([JSON.stringify(backup, null, 2)], { type: 'application/json' }),
487
+ };
488
+ }),
489
+ }),
490
+
491
+ //
492
+ // Rename
493
+ //
494
+ OperationResolver.make({
495
+ operation: SpaceOperation.Rename,
496
+ handler: Effect.fnUntraced(function* (input) {
497
+ yield* Operation.invoke(Common.LayoutOperation.UpdatePopover, {
498
+ subject: SPACE_RENAME_POPOVER,
499
+ anchorId: `dxos.org/ui/${input.caller}/${input.space.id}`,
500
+ props: input.space,
501
+ });
502
+ }),
503
+ }),
504
+
505
+ //
506
+ // RenameObject
507
+ //
508
+ OperationResolver.make({
509
+ operation: SpaceOperation.RenameObject,
510
+ handler: Effect.fnUntraced(function* (input) {
511
+ const object = input.object as Obj.Unknown;
512
+ yield* Operation.invoke(Common.LayoutOperation.UpdatePopover, {
513
+ subject: OBJECT_RENAME_POPOVER,
514
+ anchorId: `dxos.org/ui/${input.caller}/${Obj.getDXN(object).toString()}`,
515
+ props: object,
516
+ });
517
+ }),
518
+ }),
519
+
520
+ //
521
+ // OpenMembers
522
+ //
523
+ OperationResolver.make({
524
+ operation: SpaceOperation.OpenMembers,
525
+ handler: Effect.fnUntraced(function* (input) {
526
+ yield* Operation.invoke(Common.LayoutOperation.Open, {
527
+ subject: [`members-settings${ATTENDABLE_PATH_SEPARATOR}${input.space.id}`],
528
+ workspace: input.space.id,
529
+ });
530
+ }),
531
+ }),
532
+
533
+ //
534
+ // GetShareLink
535
+ //
536
+ OperationResolver.make({
537
+ operation: SpaceOperation.GetShareLink,
538
+ handler: Effect.fnUntraced(function* (input) {
539
+ const { Invitation, InvitationEncoder } = yield* Effect.promise(
540
+ () => import('@dxos/react-client/invitations'),
541
+ );
542
+
543
+ const invitation = yield* Operation.invoke(SpaceOperation.Share, {
544
+ space: input.space,
545
+ type: Invitation.Type.DELEGATED,
546
+ authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
547
+ multiUse: true,
548
+ target: input.target,
549
+ });
550
+
551
+ // NOTE: Delegated invitations are invalid until the connecting state when keys are filled in.
552
+ const invitationCode = yield* Effect.tryPromise(
553
+ () =>
554
+ new Promise<string>((resolve) => {
555
+ invitation.subscribe((inv) => {
556
+ if (inv.state === Invitation.State.CONNECTING) {
557
+ resolve(InvitationEncoder.encode(inv));
558
+ }
559
+ });
560
+ }),
561
+ );
562
+ const url = createInvitationUrl(invitationCode);
563
+ if (input.copyToClipboard) {
564
+ yield* Effect.tryPromise(() => navigator.clipboard.writeText(url));
565
+ }
566
+ return url;
567
+ }),
568
+ }),
569
+
570
+ //
571
+ // UseStaticSchema
572
+ //
573
+ OperationResolver.make({
574
+ operation: SpaceOperation.UseStaticSchema,
575
+ handler: Effect.fnUntraced(function* (input) {
576
+ const db = input.db as Database.Database;
577
+ const client = yield* Capability.get(ClientCapabilities.Client);
578
+ const schema: any = yield* Effect.promise(() =>
579
+ (client as any).graph.schemaRegistry.query({ typename: input.typename, location: ['runtime'] }).first(),
580
+ );
581
+ const space = client.spaces.get(db.spaceId);
582
+ invariant(space, 'Space not found');
583
+
584
+ Obj.change(space.properties, (p) => {
585
+ if (!p.staticRecords) {
586
+ p.staticRecords = [];
587
+ }
588
+ if (!p.staticRecords.includes(input.typename)) {
589
+ p.staticRecords.push(input.typename);
590
+ }
591
+ });
592
+
593
+ yield* Plugin.activate(SpaceEvents.SchemaAdded);
594
+ const onSchemaAdded = yield* Capability.getAll(SpaceCapabilities.OnSchemaAdded);
595
+ yield* Effect.all(
596
+ onSchemaAdded.map((callback) => callback({ db, schema, show: input.show })),
597
+ { concurrency: 'unbounded' },
598
+ );
599
+
600
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
601
+ name: 'space.schema.use',
602
+ properties: {
603
+ spaceId: space.id,
604
+ typename: Type.getTypename(schema),
605
+ },
606
+ });
607
+
608
+ return {};
609
+ }),
610
+ }),
611
+
612
+ //
613
+ // AddSchema
614
+ //
615
+ OperationResolver.make({
616
+ operation: SpaceOperation.AddSchema,
617
+ handler: Effect.fnUntraced(function* (input) {
618
+ const db = input.db as any;
619
+ const schemas = (yield* Effect.promise(() => db.schemaRegistry.register([input.schema]))) as any[];
620
+ const schema = schemas[0];
621
+ Obj.change(schema.storedSchema, (s) => {
622
+ if (input.name) {
623
+ s.name = input.name;
624
+ }
625
+ if (input.typename) {
626
+ s.typename = input.typename;
627
+ }
628
+ if (input.version) {
629
+ s.version = input.version;
630
+ }
631
+ });
632
+
633
+ yield* Plugin.activate(SpaceEvents.SchemaAdded);
634
+ const onSchemaAdded = yield* Capability.getAll(SpaceCapabilities.OnSchemaAdded);
635
+ yield* Effect.all(
636
+ onSchemaAdded.map((callback) => callback({ db, schema, show: input.show })),
637
+ { concurrency: 'unbounded' },
638
+ );
639
+
640
+ yield* Operation.schedule(ObservabilityOperation.SendEvent, {
641
+ name: 'space.schema.add',
642
+ properties: {
643
+ spaceId: db.spaceId,
644
+ objectId: schema.id,
645
+ typename: schema.typename,
646
+ },
647
+ });
648
+
649
+ return { id: schema.id, object: schema.storedSchema, schema };
650
+ }),
651
+ }),
652
+
653
+ //
654
+ // AddRelation
655
+ //
656
+ OperationResolver.make({
657
+ operation: SpaceOperation.AddRelation,
658
+ handler: (input) =>
659
+ Effect.sync(() => {
660
+ const db = input.db as Database.Database;
661
+ const relation = db.add(
662
+ Relation.make(input.schema, {
663
+ [Relation.Source]: input.source,
664
+ [Relation.Target]: input.target,
665
+ ...input.fields,
666
+ }),
667
+ );
668
+ return { relation };
669
+ }),
670
+ }),
671
+
672
+ //
673
+ // DuplicateObject
674
+ // TODO(wittjosiah): This appears to be unused.
675
+ //
676
+ OperationResolver.make({
677
+ operation: SpaceOperation.DuplicateObject,
678
+ handler: Effect.fnUntraced(function* (input) {
679
+ const object = input.object as Obj.Unknown;
680
+ const db = Obj.getDatabase(object);
681
+ invariant(db, 'Database not found.');
682
+ const newObject = yield* Effect.promise(() => cloneObject(object, resolve, db));
683
+ yield* Operation.invoke(SpaceOperation.AddObject, { object: newObject, target: db });
684
+ }),
685
+ }),
686
+
687
+ //
688
+ // RestoreField (inverse of DeleteField)
689
+ //
690
+ OperationResolver.make({
691
+ operation: SpaceOperation.RestoreField,
692
+ handler: Effect.fnUntraced(function* (input) {
693
+ const registry = yield* Capability.get(Common.Capability.AtomRegistry);
694
+ const view = input.view as any;
695
+ const db = Obj.getDatabase(view);
696
+ invariant(db);
697
+ const typename = getTypenameFromQuery(view.query.ast);
698
+ invariant(typename);
699
+ const schema = yield* Effect.promise(() => db.schemaRegistry.query({ typename }).firstOrUndefined());
700
+ invariant(schema);
701
+
702
+ // Create projection with change callbacks that wrap in Obj.change().
703
+ const projection = new ProjectionModel({
704
+ registry,
705
+ view,
706
+ baseSchema: schema.jsonSchema,
707
+ change: createEchoChangeCallback(view, schema),
708
+ });
709
+
710
+ projection.setFieldProjection({ field: input.field, props: input.props }, input.index);
711
+ }),
712
+ }),
713
+
714
+ //
715
+ // RestoreObjects (inverse of RemoveObjects)
716
+ //
717
+ OperationResolver.make({
718
+ operation: SpaceOperation.RestoreObjects,
719
+ handler: Effect.fnUntraced(function* (input) {
720
+ const objects = input.objects as Obj.Unknown[];
721
+ const parentCollection = input.parentCollection as Collection.Collection;
722
+ const indices = input.indices as number[];
723
+ const nestedObjectsList = input.nestedObjectsList as Obj.Unknown[][];
724
+ const wasActive = input.wasActive as string[];
725
+
726
+ // Get the space from the first object.
727
+ const space = getSpace(objects[0]);
728
+ invariant(space);
729
+
730
+ // Restore objects to the space.
731
+ const restoredObjects = objects.map((obj: Obj.Unknown) => space.db.add(obj));
732
+
733
+ // Restore nested objects to the space.
734
+ nestedObjectsList.flat().forEach((obj: Obj.Unknown) => {
735
+ if (Obj.isObject(obj)) {
736
+ space.db.add(obj);
737
+ } else if (Relation.isRelation(obj)) {
738
+ space.db.add(obj);
739
+ }
740
+ });
741
+
742
+ // Restore objects to the parent collection at their original indices.
743
+ Obj.change(parentCollection, (c) => {
744
+ indices.forEach((index: number, i: number) => {
745
+ if (index !== -1) {
746
+ c.objects.splice(index, 0, Ref.make(restoredObjects[i] as Obj.Unknown));
747
+ }
748
+ });
749
+ });
750
+
751
+ // Re-open objects that were active.
752
+ if (wasActive.length > 0) {
753
+ yield* Operation.invoke(Common.LayoutOperation.Open, { subject: wasActive });
754
+ }
755
+ }),
756
+ }),
757
+ ]),
758
+ ];
759
+ }),
760
+ );