@dxos/plugin-space 0.8.2-main.fbd8ed0 → 0.8.2-staging.42af850

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 (156) hide show
  1. package/dist/lib/browser/{app-graph-builder-7X3SIPCD.mjs → app-graph-builder-DCWUULKX.mjs} +5 -5
  2. package/dist/lib/browser/{app-graph-serializer-VRU57AEZ.mjs → app-graph-serializer-MLU7XI2P.mjs} +4 -4
  3. package/dist/lib/browser/{chunk-KVRYWFZU.mjs → chunk-3LN4LJN6.mjs} +3 -8
  4. package/dist/lib/{node-esm/chunk-PIYAWT5N.mjs.map → browser/chunk-3LN4LJN6.mjs.map} +3 -3
  5. package/dist/lib/browser/{chunk-AR5R2F6B.mjs → chunk-7Y4M7GXO.mjs} +37 -31
  6. package/dist/lib/browser/{chunk-AR5R2F6B.mjs.map → chunk-7Y4M7GXO.mjs.map} +1 -1
  7. package/dist/lib/browser/{chunk-IQFFOAWD.mjs → chunk-N5QMRLKI.mjs} +2 -2
  8. package/dist/lib/browser/chunk-Q4BTFH2P.mjs +1900 -0
  9. package/dist/lib/{node-esm/chunk-FI3WV22Y.mjs.map → browser/chunk-Q4BTFH2P.mjs.map} +3 -3
  10. package/dist/lib/browser/{chunk-UBSVH2NQ.mjs → chunk-VEBKN45O.mjs} +2 -2
  11. package/dist/lib/browser/chunk-W46VVHFM.mjs +288 -0
  12. package/dist/lib/browser/chunk-W46VVHFM.mjs.map +7 -0
  13. package/dist/lib/browser/{identity-created-ANRJHNMQ.mjs → identity-created-O63SIYOF.mjs} +2 -2
  14. package/dist/lib/browser/index.mjs +9 -12
  15. package/dist/lib/browser/index.mjs.map +1 -1
  16. package/dist/lib/browser/{intent-resolver-KRINV5QI.mjs → intent-resolver-KBF3YU6I.mjs} +25 -9
  17. package/dist/lib/browser/intent-resolver-KBF3YU6I.mjs.map +7 -0
  18. package/dist/lib/browser/meta.json +1 -1
  19. package/dist/lib/browser/{react-root-J3SP2HVW.mjs → react-root-PVKJE4EZ.mjs} +6 -6
  20. package/dist/lib/browser/{react-surface-J7T2IMH4.mjs → react-surface-252P4NCK.mjs} +6 -6
  21. package/dist/lib/browser/{schema-defs-OCBY7APN.mjs → schema-defs-JMN74RNK.mjs} +2 -2
  22. package/dist/lib/browser/{schema-tools-MYC4LTQD.mjs → schema-tools-JIEMHUXV.mjs} +9 -9
  23. package/dist/lib/browser/schema-tools-JIEMHUXV.mjs.map +7 -0
  24. package/dist/lib/browser/{settings-G24447B7.mjs → settings-2IN2WLUK.mjs} +2 -2
  25. package/dist/lib/browser/{spaces-ready-5I3RKYTT.mjs → spaces-ready-L4QAGTDE.mjs} +5 -5
  26. package/dist/lib/browser/{spaces-ready-5I3RKYTT.mjs.map → spaces-ready-L4QAGTDE.mjs.map} +1 -1
  27. package/dist/lib/browser/{state-SI4B5GHC.mjs → state-6HOSHLIN.mjs} +2 -2
  28. package/dist/lib/browser/types/index.mjs +1 -7
  29. package/dist/lib/node/{app-graph-builder-C2ISDMSL.cjs → app-graph-builder-WC445X77.cjs} +40 -40
  30. package/dist/lib/node/{app-graph-serializer-VLBCR3IX.cjs → app-graph-serializer-UPQOQVMJ.cjs} +20 -20
  31. package/dist/lib/node/{chunk-DQN4ZQDW.cjs → chunk-5WLAXYE3.cjs} +40 -34
  32. package/dist/lib/node/{chunk-DQN4ZQDW.cjs.map → chunk-5WLAXYE3.cjs.map} +1 -1
  33. package/dist/lib/node/{chunk-IKIDS6XF.cjs → chunk-7GQGM4ZF.cjs} +7 -13
  34. package/dist/lib/node/{chunk-IKIDS6XF.cjs.map → chunk-7GQGM4ZF.cjs.map} +3 -3
  35. package/dist/lib/node/{chunk-SCATWJKX.cjs → chunk-COQYISES.cjs} +27 -27
  36. package/dist/lib/node/{chunk-5YHUQJVB.cjs → chunk-DXL5TDFP.cjs} +6 -6
  37. package/dist/lib/node/{chunk-K6ZO4WDJ.cjs → chunk-FXHI7JNY.cjs} +121 -130
  38. package/dist/lib/node/chunk-FXHI7JNY.cjs.map +7 -0
  39. package/dist/lib/node/chunk-Q3YZEYZT.cjs +1904 -0
  40. package/dist/lib/node/{chunk-MXBE2VET.cjs.map → chunk-Q3YZEYZT.cjs.map} +3 -3
  41. package/dist/lib/node/{identity-created-NIPYGVG3.cjs → identity-created-UXEAUGC7.cjs} +6 -6
  42. package/dist/lib/node/index.cjs +68 -72
  43. package/dist/lib/node/index.cjs.map +1 -1
  44. package/dist/lib/node/{intent-resolver-MJVRY6YE.cjs → intent-resolver-SVFJKUH7.cjs} +75 -59
  45. package/dist/lib/node/intent-resolver-SVFJKUH7.cjs.map +7 -0
  46. package/dist/lib/node/meta.json +1 -1
  47. package/dist/lib/node/{react-root-M4BZ6VXB.cjs → react-root-DDPDUMCG.cjs} +11 -11
  48. package/dist/lib/node/{react-surface-RYKSYYKM.cjs → react-surface-JUIU37BX.cjs} +44 -44
  49. package/dist/lib/node/{schema-defs-2HJLXSNK.cjs → schema-defs-XLFBG3XK.cjs} +6 -6
  50. package/dist/lib/node/{schema-tools-OE3MFYYH.cjs → schema-tools-ZG6Z2QRC.cjs} +16 -16
  51. package/dist/lib/node/schema-tools-ZG6Z2QRC.cjs.map +7 -0
  52. package/dist/lib/node/{settings-AFWO4AWK.cjs → settings-FOH7EB5C.cjs} +6 -6
  53. package/dist/lib/node/{spaces-ready-BMPXSFHF.cjs → spaces-ready-VXQYCBII.cjs} +14 -14
  54. package/dist/lib/node/{spaces-ready-BMPXSFHF.cjs.map → spaces-ready-VXQYCBII.cjs.map} +1 -1
  55. package/dist/lib/node/{state-L2ZSDKLS.cjs → state-ZT3MTZXB.cjs} +6 -6
  56. package/dist/lib/node/types/index.cjs +12 -18
  57. package/dist/lib/node/types/index.cjs.map +2 -2
  58. package/dist/lib/node-esm/{app-graph-builder-WVCQZ324.mjs → app-graph-builder-E7CCGPQJ.mjs} +5 -5
  59. package/dist/lib/node-esm/{app-graph-serializer-GEUYYXKD.mjs → app-graph-serializer-UCMSLPIA.mjs} +4 -4
  60. package/dist/lib/node-esm/{chunk-PIYAWT5N.mjs → chunk-4X4Y63ND.mjs} +3 -8
  61. package/dist/lib/{browser/chunk-KVRYWFZU.mjs.map → node-esm/chunk-4X4Y63ND.mjs.map} +3 -3
  62. package/dist/lib/node-esm/chunk-FTELJGEG.mjs +289 -0
  63. package/dist/lib/node-esm/chunk-FTELJGEG.mjs.map +7 -0
  64. package/dist/lib/node-esm/{chunk-HNKAG5CX.mjs → chunk-GH2FGJXH.mjs} +37 -31
  65. package/dist/lib/node-esm/{chunk-HNKAG5CX.mjs.map → chunk-GH2FGJXH.mjs.map} +1 -1
  66. package/dist/lib/node-esm/chunk-HL2Z2GNW.mjs +1901 -0
  67. package/dist/lib/{browser/chunk-43UQWMD3.mjs.map → node-esm/chunk-HL2Z2GNW.mjs.map} +3 -3
  68. package/dist/lib/node-esm/{chunk-5NIBYPVF.mjs → chunk-OSPEGYX3.mjs} +2 -2
  69. package/dist/lib/node-esm/{chunk-S2W6HS4A.mjs → chunk-XAZNQ3QN.mjs} +2 -2
  70. package/dist/lib/node-esm/{identity-created-O5X2FFWU.mjs → identity-created-ZECO4NH3.mjs} +2 -2
  71. package/dist/lib/node-esm/index.mjs +9 -12
  72. package/dist/lib/node-esm/index.mjs.map +1 -1
  73. package/dist/lib/node-esm/{intent-resolver-JT6EB47M.mjs → intent-resolver-K2UDBF2R.mjs} +25 -9
  74. package/dist/lib/node-esm/intent-resolver-K2UDBF2R.mjs.map +7 -0
  75. package/dist/lib/node-esm/meta.json +1 -1
  76. package/dist/lib/node-esm/{react-root-S2LW4FS7.mjs → react-root-6F7B3OVO.mjs} +6 -6
  77. package/dist/lib/node-esm/{react-surface-ZNNMO7QQ.mjs → react-surface-NP3Y6BNZ.mjs} +6 -6
  78. package/dist/lib/node-esm/{schema-defs-B74N3GQ5.mjs → schema-defs-QZJS6UXN.mjs} +2 -2
  79. package/dist/lib/node-esm/{schema-tools-YTJLA3NQ.mjs → schema-tools-2Y4D42PD.mjs} +9 -9
  80. package/dist/lib/node-esm/schema-tools-2Y4D42PD.mjs.map +7 -0
  81. package/dist/lib/node-esm/{settings-MJVSCOI4.mjs → settings-Q4XDFSYD.mjs} +2 -2
  82. package/dist/lib/node-esm/{spaces-ready-XKG57SL5.mjs → spaces-ready-JHKPD4PH.mjs} +5 -5
  83. package/dist/lib/node-esm/{spaces-ready-XKG57SL5.mjs.map → spaces-ready-JHKPD4PH.mjs.map} +1 -1
  84. package/dist/lib/node-esm/{state-QUDYGEU6.mjs → state-4ATRHSKA.mjs} +2 -2
  85. package/dist/lib/node-esm/types/index.mjs +1 -7
  86. package/dist/types/src/capabilities/capabilities.d.ts +0 -8
  87. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  88. package/dist/types/src/capabilities/index.d.ts +1 -1
  89. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  90. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  91. package/dist/types/src/capabilities/schema-tools.d.ts +1 -1
  92. package/dist/types/src/capabilities/schema-tools.d.ts.map +1 -1
  93. package/dist/types/src/index.d.ts +2 -2
  94. package/dist/types/src/index.d.ts.map +1 -1
  95. package/dist/types/src/types/index.d.ts +0 -1
  96. package/dist/types/src/types/index.d.ts.map +1 -1
  97. package/dist/types/src/types/types.d.ts +17 -1
  98. package/dist/types/src/types/types.d.ts.map +1 -1
  99. package/package.json +48 -48
  100. package/src/capabilities/capabilities.ts +0 -9
  101. package/src/capabilities/intent-resolver.ts +13 -1
  102. package/src/capabilities/schema-tools.ts +8 -8
  103. package/src/capabilities/spaces-ready.ts +1 -1
  104. package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +2 -2
  105. package/src/components/PopoverRenameObject.tsx +1 -1
  106. package/src/components/PopoverRenameSpace.tsx +1 -1
  107. package/src/index.ts +2 -2
  108. package/src/types/index.ts +0 -1
  109. package/src/types/types.ts +16 -1
  110. package/dist/lib/browser/chunk-43UQWMD3.mjs +0 -1731
  111. package/dist/lib/browser/chunk-CY35NLWL.mjs +0 -296
  112. package/dist/lib/browser/chunk-CY35NLWL.mjs.map +0 -7
  113. package/dist/lib/browser/intent-resolver-KRINV5QI.mjs.map +0 -7
  114. package/dist/lib/browser/schema-tools-MYC4LTQD.mjs.map +0 -7
  115. package/dist/lib/node/chunk-K6ZO4WDJ.cjs.map +0 -7
  116. package/dist/lib/node/chunk-MXBE2VET.cjs +0 -1735
  117. package/dist/lib/node/intent-resolver-MJVRY6YE.cjs.map +0 -7
  118. package/dist/lib/node/schema-tools-OE3MFYYH.cjs.map +0 -7
  119. package/dist/lib/node-esm/chunk-CLRCW6PU.mjs +0 -297
  120. package/dist/lib/node-esm/chunk-CLRCW6PU.mjs.map +0 -7
  121. package/dist/lib/node-esm/chunk-FI3WV22Y.mjs +0 -1732
  122. package/dist/lib/node-esm/intent-resolver-JT6EB47M.mjs.map +0 -7
  123. package/dist/lib/node-esm/schema-tools-YTJLA3NQ.mjs.map +0 -7
  124. package/dist/types/src/types/thread.d.ts +0 -223
  125. package/dist/types/src/types/thread.d.ts.map +0 -1
  126. package/src/types/thread.ts +0 -30
  127. /package/dist/lib/browser/{app-graph-builder-7X3SIPCD.mjs.map → app-graph-builder-DCWUULKX.mjs.map} +0 -0
  128. /package/dist/lib/browser/{app-graph-serializer-VRU57AEZ.mjs.map → app-graph-serializer-MLU7XI2P.mjs.map} +0 -0
  129. /package/dist/lib/browser/{chunk-IQFFOAWD.mjs.map → chunk-N5QMRLKI.mjs.map} +0 -0
  130. /package/dist/lib/browser/{chunk-UBSVH2NQ.mjs.map → chunk-VEBKN45O.mjs.map} +0 -0
  131. /package/dist/lib/browser/{identity-created-ANRJHNMQ.mjs.map → identity-created-O63SIYOF.mjs.map} +0 -0
  132. /package/dist/lib/browser/{react-root-J3SP2HVW.mjs.map → react-root-PVKJE4EZ.mjs.map} +0 -0
  133. /package/dist/lib/browser/{react-surface-J7T2IMH4.mjs.map → react-surface-252P4NCK.mjs.map} +0 -0
  134. /package/dist/lib/browser/{schema-defs-OCBY7APN.mjs.map → schema-defs-JMN74RNK.mjs.map} +0 -0
  135. /package/dist/lib/browser/{settings-G24447B7.mjs.map → settings-2IN2WLUK.mjs.map} +0 -0
  136. /package/dist/lib/browser/{state-SI4B5GHC.mjs.map → state-6HOSHLIN.mjs.map} +0 -0
  137. /package/dist/lib/node/{app-graph-builder-C2ISDMSL.cjs.map → app-graph-builder-WC445X77.cjs.map} +0 -0
  138. /package/dist/lib/node/{app-graph-serializer-VLBCR3IX.cjs.map → app-graph-serializer-UPQOQVMJ.cjs.map} +0 -0
  139. /package/dist/lib/node/{chunk-SCATWJKX.cjs.map → chunk-COQYISES.cjs.map} +0 -0
  140. /package/dist/lib/node/{chunk-5YHUQJVB.cjs.map → chunk-DXL5TDFP.cjs.map} +0 -0
  141. /package/dist/lib/node/{identity-created-NIPYGVG3.cjs.map → identity-created-UXEAUGC7.cjs.map} +0 -0
  142. /package/dist/lib/node/{react-root-M4BZ6VXB.cjs.map → react-root-DDPDUMCG.cjs.map} +0 -0
  143. /package/dist/lib/node/{react-surface-RYKSYYKM.cjs.map → react-surface-JUIU37BX.cjs.map} +0 -0
  144. /package/dist/lib/node/{schema-defs-2HJLXSNK.cjs.map → schema-defs-XLFBG3XK.cjs.map} +0 -0
  145. /package/dist/lib/node/{settings-AFWO4AWK.cjs.map → settings-FOH7EB5C.cjs.map} +0 -0
  146. /package/dist/lib/node/{state-L2ZSDKLS.cjs.map → state-ZT3MTZXB.cjs.map} +0 -0
  147. /package/dist/lib/node-esm/{app-graph-builder-WVCQZ324.mjs.map → app-graph-builder-E7CCGPQJ.mjs.map} +0 -0
  148. /package/dist/lib/node-esm/{app-graph-serializer-GEUYYXKD.mjs.map → app-graph-serializer-UCMSLPIA.mjs.map} +0 -0
  149. /package/dist/lib/node-esm/{chunk-5NIBYPVF.mjs.map → chunk-OSPEGYX3.mjs.map} +0 -0
  150. /package/dist/lib/node-esm/{chunk-S2W6HS4A.mjs.map → chunk-XAZNQ3QN.mjs.map} +0 -0
  151. /package/dist/lib/node-esm/{identity-created-O5X2FFWU.mjs.map → identity-created-ZECO4NH3.mjs.map} +0 -0
  152. /package/dist/lib/node-esm/{react-root-S2LW4FS7.mjs.map → react-root-6F7B3OVO.mjs.map} +0 -0
  153. /package/dist/lib/node-esm/{react-surface-ZNNMO7QQ.mjs.map → react-surface-NP3Y6BNZ.mjs.map} +0 -0
  154. /package/dist/lib/node-esm/{schema-defs-B74N3GQ5.mjs.map → schema-defs-QZJS6UXN.mjs.map} +0 -0
  155. /package/dist/lib/node-esm/{settings-MJVSCOI4.mjs.map → settings-Q4XDFSYD.mjs.map} +0 -0
  156. /package/dist/lib/node-esm/{state-QUDYGEU6.mjs.map → state-4ATRHSKA.mjs.map} +0 -0
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  AwaitingObject
3
- } from "./chunk-43UQWMD3.mjs";
4
- import "./chunk-AR5R2F6B.mjs";
3
+ } from "./chunk-Q4BTFH2P.mjs";
4
+ import "./chunk-7Y4M7GXO.mjs";
5
5
  import {
6
6
  SpaceCapabilities
7
- } from "./chunk-KVRYWFZU.mjs";
8
- import "./chunk-IQFFOAWD.mjs";
9
- import "./chunk-CY35NLWL.mjs";
7
+ } from "./chunk-3LN4LJN6.mjs";
8
+ import "./chunk-N5QMRLKI.mjs";
9
+ import "./chunk-W46VVHFM.mjs";
10
10
  import {
11
11
  SPACE_PLUGIN
12
12
  } from "./chunk-PTKYMZWO.mjs";
@@ -26,4 +26,4 @@ var react_root_default = () => contributes(Capabilities.ReactRoot, {
26
26
  export {
27
27
  react_root_default as default
28
28
  };
29
- //# sourceMappingURL=react-root-J3SP2HVW.mjs.map
29
+ //# sourceMappingURL=react-root-PVKJE4EZ.mjs.map
@@ -21,17 +21,17 @@ import {
21
21
  SpacePresence,
22
22
  SpaceSettingsContainer,
23
23
  SyncStatus
24
- } from "./chunk-43UQWMD3.mjs";
25
- import "./chunk-AR5R2F6B.mjs";
24
+ } from "./chunk-Q4BTFH2P.mjs";
25
+ import "./chunk-7Y4M7GXO.mjs";
26
26
  import {
27
27
  SpaceCapabilities
28
- } from "./chunk-KVRYWFZU.mjs";
29
- import "./chunk-IQFFOAWD.mjs";
28
+ } from "./chunk-3LN4LJN6.mjs";
29
+ import "./chunk-N5QMRLKI.mjs";
30
30
  import {
31
31
  CollectionType,
32
32
  HueAnnotationId,
33
33
  IconAnnotationId
34
- } from "./chunk-CY35NLWL.mjs";
34
+ } from "./chunk-W46VVHFM.mjs";
35
35
  import {
36
36
  SPACE_PLUGIN
37
37
  } from "./chunk-PTKYMZWO.mjs";
@@ -290,4 +290,4 @@ var react_surface_default = ({ createInvitationUrl }) => contributes(Capabilitie
290
290
  export {
291
291
  react_surface_default as default
292
292
  };
293
- //# sourceMappingURL=react-surface-J7T2IMH4.mjs.map
293
+ //# sourceMappingURL=react-surface-252P4NCK.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SpaceCapabilities
3
- } from "./chunk-KVRYWFZU.mjs";
3
+ } from "./chunk-3LN4LJN6.mjs";
4
4
  import "./chunk-PTKYMZWO.mjs";
5
5
 
6
6
  // packages/plugins/plugin-space/src/capabilities/schema-defs.ts
@@ -23,4 +23,4 @@ var schema_defs_default = (context) => {
23
23
  export {
24
24
  schema_defs_default as default
25
25
  };
26
- //# sourceMappingURL=schema-defs-OCBY7APN.mjs.map
26
+ //# sourceMappingURL=schema-defs-JMN74RNK.mjs.map
@@ -1,15 +1,15 @@
1
1
  // packages/plugins/plugin-space/src/capabilities/schema-tools.ts
2
2
  import { Schema, SchemaAST } from "effect";
3
+ import { createTool, ToolResult } from "@dxos/ai";
3
4
  import { Capabilities, contributes } from "@dxos/app-framework";
4
- import { defineTool, ToolResult } from "@dxos/artifact";
5
5
  import { FormatEnum, FormatEnums, SelectOptionSchema, GeoPoint, toJsonSchema } from "@dxos/echo-schema";
6
6
  import { invariant } from "@dxos/invariant";
7
7
  import { hues } from "@dxos/react-ui-theme";
8
8
  import { getSchemaFromPropertyDefinitions } from "@dxos/schema";
9
9
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/capabilities/schema-tools.ts";
10
10
  var TypeNameSchema = Schema.String.pipe(Schema.pattern(/^\w+\.\w{2,}\/[\w/]+$/i), Schema.annotations({
11
- [SchemaAST.TitleAnnotationId]: "TypeName",
12
- [SchemaAST.DescriptionAnnotationId]: "Domain-style type name path. Dashes are not allowed. Use camel case for the final component of the type name.",
11
+ title: "TypeName",
12
+ description: "Domain-style type name path. Dashes are not allowed. Use camel case for the final component of the type name.",
13
13
  [SchemaAST.ExamplesAnnotationId]: [
14
14
  "example.com/type/Document",
15
15
  "example.com/type/FlightList"
@@ -20,10 +20,10 @@ var formatDescription = `The format of the property. Additional information:
20
20
  This tuple is GeoJSON. You must specify \`${FormatEnum.GeoPoint}\` as [Longitude, Latitude]`;
21
21
  var PropertyDefinitionSchema = Schema.Struct({
22
22
  name: Schema.String.annotations({
23
- [SchemaAST.DescriptionAnnotationId]: "The name of the property."
23
+ description: "The name of the property."
24
24
  }),
25
25
  format: Schema.Union(...FormatEnums.map((format) => Schema.Literal(format))).annotations({
26
- [SchemaAST.DescriptionAnnotationId]: formatDescription
26
+ description: formatDescription
27
27
  }),
28
28
  config: Schema.optional(Schema.Struct({
29
29
  options: Schema.optional(Schema.Array(SelectOptionSchema).annotations({
@@ -33,7 +33,7 @@ var PropertyDefinitionSchema = Schema.Struct({
33
33
  }).pipe(Schema.mutable);
34
34
  var SYSTEM_NAMESPACE = "dxos.org/echo/schema";
35
35
  var schema_tools_default = () => contributes(Capabilities.Tools, [
36
- defineTool(SYSTEM_NAMESPACE, {
36
+ createTool(SYSTEM_NAMESPACE, {
37
37
  name: "list",
38
38
  description: "List registered schemas in the space.",
39
39
  caption: "Listing registered schemas...",
@@ -56,7 +56,7 @@ var schema_tools_default = () => contributes(Capabilities.Tools, [
56
56
  })));
57
57
  }
58
58
  }),
59
- defineTool(SYSTEM_NAMESPACE, {
59
+ createTool(SYSTEM_NAMESPACE, {
60
60
  name: "get",
61
61
  description: "Get a specific schema by its typename.",
62
62
  caption: "Getting schema...",
@@ -85,7 +85,7 @@ var schema_tools_default = () => contributes(Capabilities.Tools, [
85
85
  return ToolResult.Success(schema);
86
86
  }
87
87
  }),
88
- defineTool(SYSTEM_NAMESPACE, {
88
+ createTool(SYSTEM_NAMESPACE, {
89
89
  name: "create",
90
90
  description: "Create a new schema with the provided definition.",
91
91
  caption: "Creating schema...",
@@ -120,4 +120,4 @@ export {
120
120
  TypeNameSchema,
121
121
  schema_tools_default as default
122
122
  };
123
- //# sourceMappingURL=schema-tools-MYC4LTQD.mjs.map
123
+ //# sourceMappingURL=schema-tools-JIEMHUXV.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/schema-tools.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema, SchemaAST } from 'effect';\n\nimport { createTool, ToolResult } from '@dxos/ai';\nimport { Capabilities, contributes, type PromiseIntentDispatcher } from '@dxos/app-framework';\nimport { type Space } from '@dxos/client/echo';\nimport { FormatEnum, FormatEnums, SelectOptionSchema, GeoPoint, toJsonSchema } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { hues } from '@dxos/react-ui-theme';\nimport { getSchemaFromPropertyDefinitions } from '@dxos/schema';\n\n// TODO(burdon): Factor out.\ndeclare global {\n interface ToolContextExtensions {\n space?: Space;\n dispatch?: PromiseIntentDispatcher;\n }\n}\n\n// TODO(ZaymonFC): Move this somewhere common.\nexport const TypeNameSchema = Schema.String.pipe(\n Schema.pattern(/^\\w+\\.\\w{2,}\\/[\\w/]+$/i),\n Schema.annotations({\n title: 'TypeName',\n description:\n 'Domain-style type name path. Dashes are not allowed. Use camel case for the final component of the type name.',\n [SchemaAST.ExamplesAnnotationId]: ['example.com/type/Document', 'example.com/type/FlightList'],\n }),\n);\n\nconst formatDescription = `The format of the property. Additional information:\n ${FormatEnum.GeoPoint}: ${JSON.stringify(toJsonSchema(GeoPoint))}\n This tuple is GeoJSON. You must specify \\`${FormatEnum.GeoPoint}\\` as [Longitude, Latitude]`;\n\n// TODO(ZaymonFC): All properties are default optional, but maybe we should allow for required properties.\nconst PropertyDefinitionSchema = Schema.Struct({\n name: Schema.String.annotations({ description: 'The name of the property.' }),\n format: Schema.Union(...FormatEnums.map((format) => Schema.Literal(format))).annotations({\n description: formatDescription,\n }),\n config: Schema.optional(\n Schema.Struct({\n options: Schema.optional(\n Schema.Array(SelectOptionSchema)\n .annotations({\n description: `Options for SingleSelect/MultiSelect formats. Available colors: ${hues.join(', ')}`,\n })\n .pipe(Schema.mutable),\n ),\n }),\n ),\n}).pipe(Schema.mutable);\n\nconst SYSTEM_NAMESPACE = 'dxos.org/echo/schema';\n\nexport default () =>\n contributes(Capabilities.Tools, [\n createTool(SYSTEM_NAMESPACE, {\n name: 'list',\n description: 'List registered schemas in the space.',\n caption: 'Listing registered schemas...',\n schema: Schema.Struct({}),\n execute: async (_input, { extensions }) => {\n invariant(extensions?.space, 'No space.');\n const space = extensions.space;\n\n const schemas = await space.db.schemaRegistry.query({}).run();\n return ToolResult.Success(\n schemas.map((schema) => ({\n typename: schema.typename,\n version: schema.version,\n })),\n );\n },\n }),\n createTool(SYSTEM_NAMESPACE, {\n name: 'get',\n description: 'Get a specific schema by its typename.',\n caption: 'Getting schema...',\n schema: Schema.Struct({\n typename: Schema.String.annotations({\n description: 'The fully qualified typename of the schema.',\n }),\n }),\n execute: async ({ typename }, { extensions }) => {\n invariant(extensions?.space, 'No space.');\n const space = extensions.space;\n\n const schema = await space.db.schemaRegistry.query({ typename }).firstOrUndefined();\n if (!schema) {\n return ToolResult.Error(`Schema not found: ${typename}`);\n }\n\n return ToolResult.Success(schema);\n },\n }),\n createTool(SYSTEM_NAMESPACE, {\n name: 'create',\n description: 'Create a new schema with the provided definition.',\n caption: 'Creating schema...',\n schema: Schema.Struct({\n typename: TypeNameSchema.annotations({\n description:\n 'The fully qualified schema typename. Must start with a domain, and then one or more path components (e.g., \"example.com/type/TypeName\").',\n }),\n properties: Schema.Array(PropertyDefinitionSchema).pipe(\n Schema.annotations({ description: 'Array of property definitions for the schema.' }),\n Schema.mutable,\n ),\n }),\n execute: async ({ typename, properties }, { extensions }) => {\n invariant(extensions?.space, 'No space.');\n const space = extensions.space;\n\n const schema = getSchemaFromPropertyDefinitions(typename, properties);\n const [registeredSchema] = await space.db.schemaRegistry.register([schema]);\n\n return ToolResult.Success(registeredSchema);\n },\n }),\n ]);\n"],
5
+ "mappings": ";AAIA,SAASA,QAAQC,iBAAiB;AAElC,SAASC,YAAYC,kBAAkB;AACvC,SAASC,cAAcC,mBAAiD;AAExE,SAASC,YAAYC,aAAaC,oBAAoBC,UAAUC,oBAAoB;AACpF,SAASC,iBAAiB;AAC1B,SAASC,YAAY;AACrB,SAASC,wCAAwC;;AAW1C,IAAMC,iBAAiBd,OAAOe,OAAOC,KAC1ChB,OAAOiB,QAAQ,wBAAA,GACfjB,OAAOkB,YAAY;EACjBC,OAAO;EACPC,aACE;EACF,CAACnB,UAAUoB,oBAAoB,GAAG;IAAC;IAA6B;;AAClE,CAAA,CAAA;AAGF,IAAMC,oBAAoB;IACtBhB,WAAWG,QAAQ,KAAKc,KAAKC,UAAUd,aAAaD,QAAAA,CAAAA,CAAAA;8CACVH,WAAWG,QAAQ;AAGjE,IAAMgB,2BAA2BzB,OAAO0B,OAAO;EAC7CC,MAAM3B,OAAOe,OAAOG,YAAY;IAAEE,aAAa;EAA4B,CAAA;EAC3EQ,QAAQ5B,OAAO6B,MAAK,GAAItB,YAAYuB,IAAI,CAACF,WAAW5B,OAAO+B,QAAQH,MAAAA,CAAAA,CAAAA,EAAUV,YAAY;IACvFE,aAAaE;EACf,CAAA;EACAU,QAAQhC,OAAOiC,SACbjC,OAAO0B,OAAO;IACZQ,SAASlC,OAAOiC,SACdjC,OAAOmC,MAAM3B,kBAAAA,EACVU,YAAY;MACXE,aAAa,mEAAmER,KAAK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B,SAAS;IACTC,QAAQzC,OAAO0B,OAAO;MACpB0B,UAAUtC,eAAeI,YAAY;QACnCE,aACE;MACJ,CAAA;MACAoC,YAAYxD,OAAOmC,MAAMV,wBAAAA,EAA0BT,KACjDhB,OAAOkB,YAAY;QAAEE,aAAa;MAAgD,CAAA,GAClFpB,OAAOqC,OAAO;IAElB,CAAA;IACAK,SAAS,OAAO,EAAEU,UAAUI,WAAU,GAAI,EAAEZ,WAAU,MAAE;AACtDjC,gBAAUiC,YAAYC,OAAO,aAAA;;;;;;;;;AAC7B,YAAMA,QAAQD,WAAWC;AAEzB,YAAMJ,SAAS5B,iCAAiCuC,UAAUI,UAAAA;AAC1D,YAAM,CAACC,gBAAAA,IAAoB,MAAMZ,MAAME,GAAGC,eAAeU,SAAS;QAACjB;OAAO;AAE1E,aAAOtC,WAAWgD,QAAQM,gBAAAA;IAC5B;EACF,CAAA;CACD;",
6
+ "names": ["Schema", "SchemaAST", "createTool", "ToolResult", "Capabilities", "contributes", "FormatEnum", "FormatEnums", "SelectOptionSchema", "GeoPoint", "toJsonSchema", "invariant", "hues", "getSchemaFromPropertyDefinitions", "TypeNameSchema", "String", "pipe", "pattern", "annotations", "title", "description", "ExamplesAnnotationId", "formatDescription", "JSON", "stringify", "PropertyDefinitionSchema", "Struct", "name", "format", "Union", "map", "Literal", "config", "optional", "options", "Array", "join", "mutable", "SYSTEM_NAMESPACE", "Tools", "caption", "schema", "execute", "_input", "extensions", "space", "schemas", "db", "schemaRegistry", "query", "run", "Success", "typename", "version", "firstOrUndefined", "Error", "properties", "registeredSchema", "register"]
7
+ }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SpaceSettingsSchema
3
- } from "./chunk-CY35NLWL.mjs";
3
+ } from "./chunk-W46VVHFM.mjs";
4
4
  import {
5
5
  SPACE_PLUGIN
6
6
  } from "./chunk-PTKYMZWO.mjs";
@@ -21,4 +21,4 @@ var settings_default = () => {
21
21
  export {
22
22
  settings_default as default
23
23
  };
24
- //# sourceMappingURL=settings-G24447B7.mjs.map
24
+ //# sourceMappingURL=settings-2IN2WLUK.mjs.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  SpaceCapabilities
3
- } from "./chunk-KVRYWFZU.mjs";
3
+ } from "./chunk-3LN4LJN6.mjs";
4
4
  import {
5
5
  COMPOSER_SPACE_LOCK,
6
6
  SHARED
7
- } from "./chunk-IQFFOAWD.mjs";
7
+ } from "./chunk-N5QMRLKI.mjs";
8
8
  import {
9
9
  SpaceAction
10
- } from "./chunk-CY35NLWL.mjs";
10
+ } from "./chunk-W46VVHFM.mjs";
11
11
  import "./chunk-PTKYMZWO.mjs";
12
12
 
13
13
  // packages/plugins/plugin-space/src/capabilities/spaces-ready.ts
@@ -27,7 +27,7 @@ import { Filter, FQ_ID_LENGTH, parseFullyQualifiedId, SpaceState } from "@dxos/r
27
27
  import { ComplexMap, reduceGroupBy } from "@dxos/util";
28
28
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/capabilities/spaces-ready.ts";
29
29
  var ACTIVE_NODE_BROADCAST_INTERVAL = 3e4;
30
- var WAIT_FOR_OBJECT_TIMEOUT = 1e3;
30
+ var WAIT_FOR_OBJECT_TIMEOUT = 5e3;
31
31
  var spaces_ready_default = async (context) => {
32
32
  const subscriptions = new SubscriptionList();
33
33
  const spaceSubscriptions = new SubscriptionList();
@@ -197,4 +197,4 @@ var spaces_ready_default = async (context) => {
197
197
  export {
198
198
  spaces_ready_default as default
199
199
  };
200
- //# sourceMappingURL=spaces-ready-5I3RKYTT.mjs.map
200
+ //# sourceMappingURL=spaces-ready-L4QAGTDE.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/capabilities/spaces-ready.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Option } from 'effect';\n\nimport { contributes, createIntent, type PluginContext, Capabilities, LayoutAction } from '@dxos/app-framework';\nimport { SubscriptionList } from '@dxos/async';\nimport { Expando } from '@dxos/echo-schema';\nimport { scheduledEffect } from '@dxos/echo-signals/core';\nimport { live } from '@dxos/live-object';\nimport { log } from '@dxos/log';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { DeckCapabilities } from '@dxos/plugin-deck';\nimport { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';\nimport { PublicKey } from '@dxos/react-client';\nimport { Filter, FQ_ID_LENGTH, parseFullyQualifiedId, SpaceState } from '@dxos/react-client/echo';\nimport { ComplexMap, reduceGroupBy } from '@dxos/util';\n\nimport { SpaceCapabilities } from './capabilities';\nimport { SpaceAction } from '../types';\nimport { COMPOSER_SPACE_LOCK, SHARED } from '../util';\n\nconst ACTIVE_NODE_BROADCAST_INTERVAL = 30_000;\nconst WAIT_FOR_OBJECT_TIMEOUT = 1000;\n\nexport default async (context: PluginContext) => {\n const subscriptions = new SubscriptionList();\n const spaceSubscriptions = new SubscriptionList();\n\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const { graph } = context.getCapability(Capabilities.AppGraph);\n const layout = context.getCapability(Capabilities.Layout);\n const deck = context.getCapability(DeckCapabilities.DeckState);\n const attention = context.getCapability(AttentionCapabilities.Attention);\n const state = context.getCapability(SpaceCapabilities.MutableState);\n const client = context.getCapability(ClientCapabilities.Client);\n\n const defaultSpace = client.spaces.default;\n await defaultSpace.waitUntilReady();\n\n if (deck.activeDeck === 'default') {\n await dispatch(createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: defaultSpace.id }));\n }\n\n // Initialize space sharing lock in default space.\n if (typeof defaultSpace.properties[COMPOSER_SPACE_LOCK] !== 'boolean') {\n defaultSpace.properties[COMPOSER_SPACE_LOCK] = true;\n }\n\n const {\n objects: [spacesOrder],\n } = await defaultSpace.db.query(Filter.type(Expando, { key: SHARED })).run();\n if (!spacesOrder) {\n // TODO(wittjosiah): Cannot be a Folder because Spaces are not TypedObjects so can't be saved in the database.\n // Instead, we store order as an array of space ids.\n defaultSpace.db.add(live({ key: SHARED, order: [] }));\n }\n\n // Await missing objects.\n subscriptions.add(\n scheduledEffect(\n () => ({ active: layout.active }),\n ({ active }) => {\n if (active.length !== 1) {\n return;\n }\n\n const node = graph.getNode(active[0]).pipe(Option.getOrNull);\n if (!node && active[0].length === FQ_ID_LENGTH) {\n const timeout = setTimeout(async () => {\n const node = graph.getNode(active[0]).pipe(Option.getOrNull);\n if (!node) {\n await dispatch(createIntent(SpaceAction.WaitForObject, { id: active[0] }));\n }\n }, WAIT_FOR_OBJECT_TIMEOUT);\n\n return () => clearTimeout(timeout);\n }\n },\n ),\n );\n\n // Cache space names.\n subscriptions.add(\n client.spaces.subscribe(async (spaces) => {\n // TODO(wittjosiah): Remove. This is a hack to be able to migrate the default space properties.\n if (defaultSpace.state.get() === SpaceState.SPACE_REQUIRES_MIGRATION) {\n await defaultSpace.internal.migrate();\n }\n\n spaces\n .filter((space) => space.state.get() === SpaceState.SPACE_READY)\n .forEach((space) => {\n subscriptions.add(\n scheduledEffect(\n () => ({ name: space.properties.name }),\n ({ name }) => (state.spaceNames[space.id] = name),\n ),\n );\n });\n }).unsubscribe,\n );\n\n // Broadcast active node to other peers in the space.\n subscriptions.add(\n scheduledEffect(\n () => ({ current: attention.current, active: layout.active, inactive: layout.inactive }),\n ({ current, active, inactive }) => {\n const send = () => {\n const spaces = client.spaces.get();\n const identity = client.halo.identity.get();\n if (identity) {\n // Group parts by space for efficient messaging.\n const idsBySpace = reduceGroupBy(active, (id) => {\n try {\n const [spaceId] = parseFullyQualifiedId(id);\n return spaceId;\n } catch {\n return null;\n }\n });\n\n const removedBySpace = reduceGroupBy(inactive, (id) => {\n try {\n const [spaceId] = parseFullyQualifiedId(id);\n return spaceId;\n } catch {\n return null;\n }\n });\n\n // NOTE: Ensure all spaces are included so that we send the correct `removed` object arrays.\n for (const space of spaces) {\n if (!idsBySpace.has(space.id)) {\n idsBySpace.set(space.id, []);\n }\n }\n\n for (const [spaceId, added] of idsBySpace) {\n const removed = removedBySpace.get(spaceId) ?? [];\n const space = spaces.find((space) => space.id === spaceId);\n if (!space) {\n continue;\n }\n\n void space\n .postMessage('viewing', {\n identityKey: identity.identityKey.toHex(),\n attended: current,\n added,\n removed,\n })\n // TODO(burdon): This seems defensive; why would this fail? Backoff interval.\n .catch((err) => {\n log.warn('Failed to broadcast active node for presence.', { err: err.message });\n });\n }\n }\n };\n\n send();\n // Send at interval to allow peers to expire entries if they become disconnected.\n const interval = setInterval(() => send(), ACTIVE_NODE_BROADCAST_INTERVAL);\n return () => clearInterval(interval);\n },\n ),\n );\n\n // Listen for active nodes from other peers in the space.\n subscriptions.add(\n client.spaces.subscribe((spaces) => {\n spaceSubscriptions.clear();\n spaces.forEach((space) => {\n spaceSubscriptions.add(\n space.listen('viewing', (message) => {\n const { added, removed, attended } = message.payload;\n\n const identityKey = PublicKey.safeFrom(message.payload.identityKey);\n const currentIdentity = client.halo.identity.get();\n if (\n identityKey &&\n !currentIdentity?.identityKey.equals(identityKey) &&\n Array.isArray(added) &&\n Array.isArray(removed)\n ) {\n added.forEach((id) => {\n if (typeof id === 'string') {\n if (!(id in state.viewersByObject)) {\n state.viewersByObject[id] = new ComplexMap(PublicKey.hash);\n }\n state.viewersByObject[id]!.set(identityKey, {\n lastSeen: Date.now(),\n currentlyAttended: new Set(attended).has(id),\n });\n if (!state.viewersByIdentity.has(identityKey)) {\n state.viewersByIdentity.set(identityKey, new Set());\n }\n state.viewersByIdentity.get(identityKey)!.add(id);\n }\n });\n\n removed.forEach((id) => {\n if (typeof id === 'string') {\n state.viewersByObject[id]?.delete(identityKey);\n state.viewersByIdentity.get(identityKey)?.delete(id);\n // It’s okay for these to be empty sets/maps, reduces churn.\n }\n });\n }\n }),\n );\n });\n }).unsubscribe,\n );\n\n // Enable edge replication for all spaces.\n try {\n await Promise.all(\n client.spaces.get().map((space) => space.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED)),\n );\n state.enabledEdgeReplication = true;\n } catch (err) {\n log.catch(err);\n }\n\n return contributes(Capabilities.Null, null, () => {\n spaceSubscriptions.clear();\n subscriptions.clear();\n });\n};\n"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Option } from 'effect';\n\nimport { contributes, createIntent, type PluginContext, Capabilities, LayoutAction } from '@dxos/app-framework';\nimport { SubscriptionList } from '@dxos/async';\nimport { Expando } from '@dxos/echo-schema';\nimport { scheduledEffect } from '@dxos/echo-signals/core';\nimport { live } from '@dxos/live-object';\nimport { log } from '@dxos/log';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { DeckCapabilities } from '@dxos/plugin-deck';\nimport { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';\nimport { PublicKey } from '@dxos/react-client';\nimport { Filter, FQ_ID_LENGTH, parseFullyQualifiedId, SpaceState } from '@dxos/react-client/echo';\nimport { ComplexMap, reduceGroupBy } from '@dxos/util';\n\nimport { SpaceCapabilities } from './capabilities';\nimport { SpaceAction } from '../types';\nimport { COMPOSER_SPACE_LOCK, SHARED } from '../util';\n\nconst ACTIVE_NODE_BROADCAST_INTERVAL = 30_000;\nconst WAIT_FOR_OBJECT_TIMEOUT = 5_000;\n\nexport default async (context: PluginContext) => {\n const subscriptions = new SubscriptionList();\n const spaceSubscriptions = new SubscriptionList();\n\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const { graph } = context.getCapability(Capabilities.AppGraph);\n const layout = context.getCapability(Capabilities.Layout);\n const deck = context.getCapability(DeckCapabilities.DeckState);\n const attention = context.getCapability(AttentionCapabilities.Attention);\n const state = context.getCapability(SpaceCapabilities.MutableState);\n const client = context.getCapability(ClientCapabilities.Client);\n\n const defaultSpace = client.spaces.default;\n await defaultSpace.waitUntilReady();\n\n if (deck.activeDeck === 'default') {\n await dispatch(createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: defaultSpace.id }));\n }\n\n // Initialize space sharing lock in default space.\n if (typeof defaultSpace.properties[COMPOSER_SPACE_LOCK] !== 'boolean') {\n defaultSpace.properties[COMPOSER_SPACE_LOCK] = true;\n }\n\n const {\n objects: [spacesOrder],\n } = await defaultSpace.db.query(Filter.type(Expando, { key: SHARED })).run();\n if (!spacesOrder) {\n // TODO(wittjosiah): Cannot be a Folder because Spaces are not TypedObjects so can't be saved in the database.\n // Instead, we store order as an array of space ids.\n defaultSpace.db.add(live({ key: SHARED, order: [] }));\n }\n\n // Await missing objects.\n subscriptions.add(\n scheduledEffect(\n () => ({ active: layout.active }),\n ({ active }) => {\n if (active.length !== 1) {\n return;\n }\n\n const node = graph.getNode(active[0]).pipe(Option.getOrNull);\n if (!node && active[0].length === FQ_ID_LENGTH) {\n const timeout = setTimeout(async () => {\n const node = graph.getNode(active[0]).pipe(Option.getOrNull);\n if (!node) {\n await dispatch(createIntent(SpaceAction.WaitForObject, { id: active[0] }));\n }\n }, WAIT_FOR_OBJECT_TIMEOUT);\n\n return () => clearTimeout(timeout);\n }\n },\n ),\n );\n\n // Cache space names.\n subscriptions.add(\n client.spaces.subscribe(async (spaces) => {\n // TODO(wittjosiah): Remove. This is a hack to be able to migrate the default space properties.\n if (defaultSpace.state.get() === SpaceState.SPACE_REQUIRES_MIGRATION) {\n await defaultSpace.internal.migrate();\n }\n\n spaces\n .filter((space) => space.state.get() === SpaceState.SPACE_READY)\n .forEach((space) => {\n subscriptions.add(\n scheduledEffect(\n () => ({ name: space.properties.name }),\n ({ name }) => (state.spaceNames[space.id] = name),\n ),\n );\n });\n }).unsubscribe,\n );\n\n // Broadcast active node to other peers in the space.\n subscriptions.add(\n scheduledEffect(\n () => ({ current: attention.current, active: layout.active, inactive: layout.inactive }),\n ({ current, active, inactive }) => {\n const send = () => {\n const spaces = client.spaces.get();\n const identity = client.halo.identity.get();\n if (identity) {\n // Group parts by space for efficient messaging.\n const idsBySpace = reduceGroupBy(active, (id) => {\n try {\n const [spaceId] = parseFullyQualifiedId(id);\n return spaceId;\n } catch {\n return null;\n }\n });\n\n const removedBySpace = reduceGroupBy(inactive, (id) => {\n try {\n const [spaceId] = parseFullyQualifiedId(id);\n return spaceId;\n } catch {\n return null;\n }\n });\n\n // NOTE: Ensure all spaces are included so that we send the correct `removed` object arrays.\n for (const space of spaces) {\n if (!idsBySpace.has(space.id)) {\n idsBySpace.set(space.id, []);\n }\n }\n\n for (const [spaceId, added] of idsBySpace) {\n const removed = removedBySpace.get(spaceId) ?? [];\n const space = spaces.find((space) => space.id === spaceId);\n if (!space) {\n continue;\n }\n\n void space\n .postMessage('viewing', {\n identityKey: identity.identityKey.toHex(),\n attended: current,\n added,\n removed,\n })\n // TODO(burdon): This seems defensive; why would this fail? Backoff interval.\n .catch((err) => {\n log.warn('Failed to broadcast active node for presence.', { err: err.message });\n });\n }\n }\n };\n\n send();\n // Send at interval to allow peers to expire entries if they become disconnected.\n const interval = setInterval(() => send(), ACTIVE_NODE_BROADCAST_INTERVAL);\n return () => clearInterval(interval);\n },\n ),\n );\n\n // Listen for active nodes from other peers in the space.\n subscriptions.add(\n client.spaces.subscribe((spaces) => {\n spaceSubscriptions.clear();\n spaces.forEach((space) => {\n spaceSubscriptions.add(\n space.listen('viewing', (message) => {\n const { added, removed, attended } = message.payload;\n\n const identityKey = PublicKey.safeFrom(message.payload.identityKey);\n const currentIdentity = client.halo.identity.get();\n if (\n identityKey &&\n !currentIdentity?.identityKey.equals(identityKey) &&\n Array.isArray(added) &&\n Array.isArray(removed)\n ) {\n added.forEach((id) => {\n if (typeof id === 'string') {\n if (!(id in state.viewersByObject)) {\n state.viewersByObject[id] = new ComplexMap(PublicKey.hash);\n }\n state.viewersByObject[id]!.set(identityKey, {\n lastSeen: Date.now(),\n currentlyAttended: new Set(attended).has(id),\n });\n if (!state.viewersByIdentity.has(identityKey)) {\n state.viewersByIdentity.set(identityKey, new Set());\n }\n state.viewersByIdentity.get(identityKey)!.add(id);\n }\n });\n\n removed.forEach((id) => {\n if (typeof id === 'string') {\n state.viewersByObject[id]?.delete(identityKey);\n state.viewersByIdentity.get(identityKey)?.delete(id);\n // It’s okay for these to be empty sets/maps, reduces churn.\n }\n });\n }\n }),\n );\n });\n }).unsubscribe,\n );\n\n // Enable edge replication for all spaces.\n try {\n await Promise.all(\n client.spaces.get().map((space) => space.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED)),\n );\n state.enabledEdgeReplication = true;\n } catch (err) {\n log.catch(err);\n }\n\n return contributes(Capabilities.Null, null, () => {\n spaceSubscriptions.clear();\n subscriptions.clear();\n });\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;AAIA,SAASA,cAAc;AAEvB,SAASC,aAAaC,cAAkCC,cAAcC,oBAAoB;AAC1F,SAASC,wBAAwB;AACjC,SAASC,eAAe;AACxB,SAASC,uBAAuB;AAChC,SAASC,YAAY;AACrB,SAASC,WAAW;AACpB,SAASC,6BAA6B;AACtC,SAASC,0BAA0B;AACnC,SAASC,wBAAwB;AACjC,SAASC,8BAA8B;AACvC,SAASC,iBAAiB;AAC1B,SAASC,QAAQC,cAAcC,uBAAuBC,kBAAkB;AACxE,SAASC,YAAYC,qBAAqB;;AAM1C,IAAMC,iCAAiC;AACvC,IAAMC,0BAA0B;AAEhC,IAAA,uBAAe,OAAOC,YAAAA;AACpB,QAAMC,gBAAgB,IAAIC,iBAAAA;AAC1B,QAAMC,qBAAqB,IAAID,iBAAAA;AAE/B,QAAM,EAAEE,iBAAiBC,SAAQ,IAAKL,QAAQM,cAAcC,aAAaC,gBAAgB;AACzF,QAAM,EAAEC,MAAK,IAAKT,QAAQM,cAAcC,aAAaG,QAAQ;AAC7D,QAAMC,SAASX,QAAQM,cAAcC,aAAaK,MAAM;AACxD,QAAMC,OAAOb,QAAQM,cAAcQ,iBAAiBC,SAAS;AAC7D,QAAMC,YAAYhB,QAAQM,cAAcW,sBAAsBC,SAAS;AACvE,QAAMC,QAAQnB,QAAQM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BAAgB/E,EAAAA,IAAM,IAAIgF,WAAWP,UAAUQ,IAAI;cAC3D;AACAjG,oBAAM+F,gBAAgB/E,EAAAA,EAAKsD,IAAIK,aAAa;gBAC1CuB,UAAUC,KAAKC,IAAG;gBAClBC,mBAAmB,IAAIC,IAAIzB,QAAAA,EAAUR,IAAIrD,EAAAA;cAC3C,CAAA;AACA,kBAAI,CAAChB,MAAMuG,kBAAkBlC,IAAIM,WAAAA,GAAc;AAC7C3E,sBAAMuG,kBAAkBjC,IAAIK,aAAa,oBAAI2B,IAAAA,CAAAA;cAC/C;AACAtG,oBAAMuG,kBAAkBxD,IAAI4B,WAAAA,EAAc9C,IAAIb,EAAAA;YAChD;UACF,CAAA;AAEAwD,kBAAQjB,QAAQ,CAACvC,OAAAA;AACf,gBAAI,OAAOA,OAAO,UAAU;AAC1BhB,oBAAM+F,gBAAgB/E,EAAAA,GAAKwF,OAAO7B,WAAAA;AAClC3E,oBAAMuG,kBAAkBxD,IAAI4B,WAAAA,GAAc6B,OAAOxF,EAAAA;YAEnD;UACF,CAAA;QACF;MACF,CAAA,CAAA;IAEJ,CAAA;EACF,CAAA,EAAG0C,WAAW;AAIhB,MAAI;AACF,UAAM+C,QAAQC,IACZvG,OAAOI,OAAOwC,IAAG,EAAG4D,IAAI,CAACtD,UAAUA,MAAMH,SAAS0D,6BAA6BC,uBAAuBC,OAAO,CAAA,CAAA;AAE/G9G,UAAM+G,yBAAyB;EACjC,SAAShC,KAAK;AACZC,QAAIF,MAAMC,KAAAA,QAAAA;;;;;;EACZ;AAEA,SAAOiC,YAAY5H,aAAa6H,MAAM,MAAM,MAAA;AAC1CjI,uBAAmBsG,MAAK;AACxBxG,kBAAcwG,MAAK;EACrB,CAAA;AACF;",
6
6
  "names": ["Option", "contributes", "createIntent", "Capabilities", "LayoutAction", "SubscriptionList", "Expando", "scheduledEffect", "live", "log", "AttentionCapabilities", "ClientCapabilities", "DeckCapabilities", "EdgeReplicationSetting", "PublicKey", "Filter", "FQ_ID_LENGTH", "parseFullyQualifiedId", "SpaceState", "ComplexMap", "reduceGroupBy", "ACTIVE_NODE_BROADCAST_INTERVAL", "WAIT_FOR_OBJECT_TIMEOUT", "context", "subscriptions", "SubscriptionList", "spaceSubscriptions", "dispatchPromise", "dispatch", "getCapability", "Capabilities", "IntentDispatcher", "graph", "AppGraph", "layout", "Layout", "deck", "DeckCapabilities", "DeckState", "attention", "AttentionCapabilities", "Attention", "state", "SpaceCapabilities", "MutableState", "client", "ClientCapabilities", "Client", "defaultSpace", "spaces", "default", "waitUntilReady", "activeDeck", "createIntent", "LayoutAction", "SwitchWorkspace", "part", "subject", "id", "properties", "COMPOSER_SPACE_LOCK", "objects", "spacesOrder", "db", "query", "Filter", "type", "Expando", "key", "SHARED", "run", "add", "live", "order", "scheduledEffect", "active", "length", "node", "getNode", "pipe", "Option", "getOrNull", "FQ_ID_LENGTH", "timeout", "setTimeout", "SpaceAction", "WaitForObject", "clearTimeout", "subscribe", "get", "SpaceState", "SPACE_REQUIRES_MIGRATION", "internal", "migrate", "filter", "space", "SPACE_READY", "forEach", "name", "spaceNames", "unsubscribe", "current", "inactive", "send", "identity", "halo", "idsBySpace", "reduceGroupBy", "spaceId", "parseFullyQualifiedId", "removedBySpace", "has", "set", "added", "removed", "find", "postMessage", "identityKey", "toHex", "attended", "catch", "err", "log", "warn", "message", "interval", "setInterval", "clearInterval", "clear", "listen", "payload", "PublicKey", "safeFrom", "currentIdentity", "equals", "Array", "isArray", "viewersByObject", "ComplexMap", "hash", "lastSeen", "Date", "now", "currentlyAttended", "Set", "viewersByIdentity", "delete", "Promise", "all", "map", "setEdgeReplicationPreference", "EdgeReplicationSetting", "ENABLED", "enabledEdgeReplication", "contributes", "Null"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SpaceCapabilities
3
- } from "./chunk-KVRYWFZU.mjs";
3
+ } from "./chunk-3LN4LJN6.mjs";
4
4
  import {
5
5
  SPACE_PLUGIN
6
6
  } from "./chunk-PTKYMZWO.mjs";
@@ -44,4 +44,4 @@ var state_default = (context) => {
44
44
  export {
45
45
  state_default as default
46
46
  };
47
- //# sourceMappingURL=state-SI4B5GHC.mjs.map
47
+ //# sourceMappingURL=state-6HOSHLIN.mjs.map
@@ -1,5 +1,4 @@
1
1
  import {
2
- ChannelType,
3
2
  CollectionAction,
4
3
  CollectionType,
5
4
  HueAnnotationId,
@@ -10,13 +9,10 @@ import {
10
9
  SpaceAction,
11
10
  SpaceForm,
12
11
  SpaceSettingsSchema,
13
- ThreadStatus,
14
- ThreadType,
15
12
  defineObjectForm
16
- } from "../chunk-CY35NLWL.mjs";
13
+ } from "../chunk-W46VVHFM.mjs";
17
14
  import "../chunk-PTKYMZWO.mjs";
18
15
  export {
19
- ChannelType,
20
16
  CollectionAction,
21
17
  CollectionType,
22
18
  HueAnnotationId,
@@ -27,8 +23,6 @@ export {
27
23
  SpaceAction,
28
24
  SpaceForm,
29
25
  SpaceSettingsSchema,
30
- ThreadStatus,
31
- ThreadType,
32
26
  defineObjectForm
33
27
  };
34
28
  //# sourceMappingURL=index.mjs.map
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var app_graph_builder_C2ISDMSL_exports = {};
20
- __export(app_graph_builder_C2ISDMSL_exports, {
19
+ var app_graph_builder_WC445X77_exports = {};
20
+ __export(app_graph_builder_WC445X77_exports, {
21
21
  default: () => app_graph_builder_default
22
22
  });
23
- module.exports = __toCommonJS(app_graph_builder_C2ISDMSL_exports);
24
- var import_chunk_DQN4ZQDW = require("./chunk-DQN4ZQDW.cjs");
25
- var import_chunk_IKIDS6XF = require("./chunk-IKIDS6XF.cjs");
26
- var import_chunk_SCATWJKX = require("./chunk-SCATWJKX.cjs");
27
- var import_chunk_K6ZO4WDJ = require("./chunk-K6ZO4WDJ.cjs");
23
+ module.exports = __toCommonJS(app_graph_builder_WC445X77_exports);
24
+ var import_chunk_5WLAXYE3 = require("./chunk-5WLAXYE3.cjs");
25
+ var import_chunk_7GQGM4ZF = require("./chunk-7GQGM4ZF.cjs");
26
+ var import_chunk_COQYISES = require("./chunk-COQYISES.cjs");
27
+ var import_chunk_FXHI7JNY = require("./chunk-FXHI7JNY.cjs");
28
28
  var import_chunk_6P2DB4QQ = require("./chunk-6P2DB4QQ.cjs");
29
29
  var import_rx_react = require("@effect-rx/rx-react");
30
30
  var import_effect = require("effect");
@@ -39,8 +39,8 @@ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/sr
39
39
  var app_graph_builder_default = (context) => {
40
40
  const resolve = (typename) => context.getCapabilities(import_app_framework.Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
41
41
  const spacesNode = {
42
- id: import_chunk_SCATWJKX.SPACES,
43
- type: import_chunk_SCATWJKX.SPACES,
42
+ id: import_chunk_COQYISES.SPACES,
43
+ type: import_chunk_COQYISES.SPACES,
44
44
  cacheable: [
45
45
  "label",
46
46
  "role"
@@ -61,9 +61,9 @@ var app_graph_builder_default = (context) => {
61
61
  onRearrangeChildren: async (nextOrder) => {
62
62
  const { graph } = context.getCapability(import_app_framework.Capabilities.AppGraph);
63
63
  const client = context.getCapability(import_plugin_client.ClientCapabilities.Client);
64
- graph.sortEdges(import_chunk_SCATWJKX.SPACES, "outbound", nextOrder.map(({ id }) => id));
64
+ graph.sortEdges(import_chunk_COQYISES.SPACES, "outbound", nextOrder.map(({ id }) => id));
65
65
  const { objects: [spacesOrder] } = await client.spaces.default.db.query(import_echo.Filter.type(import_echo.Expando, {
66
- key: import_chunk_SCATWJKX.SHARED
66
+ key: import_chunk_COQYISES.SHARED
67
67
  })).run();
68
68
  if (spacesOrder) {
69
69
  spacesOrder.order = nextOrder.map(({ id }) => id);
@@ -85,10 +85,10 @@ var app_graph_builder_default = (context) => {
85
85
  position: "hoist",
86
86
  actions: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.id === import_plugin_graph.ROOT_ID ? import_effect.Option.some(node2) : import_effect.Option.none()), import_effect.Option.map(() => [
87
87
  {
88
- id: import_chunk_K6ZO4WDJ.SpaceAction.OpenCreateSpace._tag,
88
+ id: import_chunk_FXHI7JNY.SpaceAction.OpenCreateSpace._tag,
89
89
  data: async () => {
90
90
  const { dispatchPromise: dispatch } = context.getCapability(import_app_framework.Capabilities.IntentDispatcher);
91
- await dispatch((0, import_app_framework.createIntent)(import_chunk_K6ZO4WDJ.SpaceAction.OpenCreateSpace));
91
+ await dispatch((0, import_app_framework.createIntent)(import_chunk_FXHI7JNY.SpaceAction.OpenCreateSpace));
92
92
  },
93
93
  properties: {
94
94
  label: [
@@ -103,10 +103,10 @@ var app_graph_builder_default = (context) => {
103
103
  }
104
104
  },
105
105
  {
106
- id: import_chunk_K6ZO4WDJ.SpaceAction.Join._tag,
106
+ id: import_chunk_FXHI7JNY.SpaceAction.Join._tag,
107
107
  data: async () => {
108
108
  const { dispatchPromise: dispatch } = context.getCapability(import_app_framework.Capabilities.IntentDispatcher);
109
- await dispatch((0, import_app_framework.createIntent)(import_chunk_K6ZO4WDJ.SpaceAction.Join));
109
+ await dispatch((0, import_app_framework.createIntent)(import_chunk_FXHI7JNY.SpaceAction.Join));
110
110
  },
111
111
  properties: {
112
112
  label: [
@@ -121,12 +121,12 @@ var app_graph_builder_default = (context) => {
121
121
  }
122
122
  },
123
123
  {
124
- id: import_chunk_K6ZO4WDJ.SpaceAction.OpenMembers._tag,
124
+ id: import_chunk_FXHI7JNY.SpaceAction.OpenMembers._tag,
125
125
  data: async () => {
126
126
  const { dispatchPromise: dispatch } = context.getCapability(import_app_framework.Capabilities.IntentDispatcher);
127
127
  const client = context.getCapability(import_plugin_client.ClientCapabilities.Client);
128
- const space = (0, import_chunk_DQN4ZQDW.getActiveSpace)(context) ?? client.spaces.default;
129
- await dispatch((0, import_app_framework.createIntent)(import_chunk_K6ZO4WDJ.SpaceAction.OpenMembers, {
128
+ const space = (0, import_chunk_5WLAXYE3.getActiveSpace)(context) ?? client.spaces.default;
129
+ await dispatch((0, import_app_framework.createIntent)(import_chunk_FXHI7JNY.SpaceAction.OpenMembers, {
130
130
  space
131
131
  }));
132
132
  },
@@ -146,12 +146,12 @@ var app_graph_builder_default = (context) => {
146
146
  }
147
147
  },
148
148
  {
149
- id: import_chunk_K6ZO4WDJ.SpaceAction.OpenSettings._tag,
149
+ id: import_chunk_FXHI7JNY.SpaceAction.OpenSettings._tag,
150
150
  data: async () => {
151
151
  const { dispatchPromise: dispatch } = context.getCapability(import_app_framework.Capabilities.IntentDispatcher);
152
152
  const client = context.getCapability(import_plugin_client.ClientCapabilities.Client);
153
- const space = (0, import_chunk_DQN4ZQDW.getActiveSpace)(context) ?? client.spaces.default;
154
- await dispatch((0, import_app_framework.createIntent)(import_chunk_K6ZO4WDJ.SpaceAction.OpenSettings, {
153
+ const space = (0, import_chunk_5WLAXYE3.getActiveSpace)(context) ?? client.spaces.default;
154
+ await dispatch((0, import_app_framework.createIntent)(import_chunk_FXHI7JNY.SpaceAction.OpenSettings, {
155
155
  space
156
156
  }));
157
157
  },
@@ -181,11 +181,11 @@ var app_graph_builder_default = (context) => {
181
181
  }),
182
182
  // Create space nodes.
183
183
  (0, import_plugin_graph.createExtension)({
184
- id: import_chunk_SCATWJKX.SPACES,
184
+ id: import_chunk_COQYISES.SPACES,
185
185
  connector: (node) => {
186
186
  let query;
187
- return import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.id === import_chunk_SCATWJKX.SPACES ? import_effect.Option.some(node2) : import_effect.Option.none()), import_effect.Option.map(() => {
188
- const state = context.getCapability(import_chunk_IKIDS6XF.SpaceCapabilities.State);
187
+ return import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.id === import_chunk_COQYISES.SPACES ? import_effect.Option.some(node2) : import_effect.Option.none()), import_effect.Option.map(() => {
188
+ const state = context.getCapability(import_chunk_7GQGM4ZF.SpaceCapabilities.State);
189
189
  const client = context.getCapability(import_plugin_client.ClientCapabilities.Client);
190
190
  const spacesRx = (0, import_plugin_graph.rxFromObservable)(client.spaces);
191
191
  const isReadyRx = (0, import_plugin_graph.rxFromObservable)(client.spaces.isReady);
@@ -198,10 +198,10 @@ var app_graph_builder_default = (context) => {
198
198
  try {
199
199
  if (!query) {
200
200
  query = client.spaces.default.db.query(import_echo.Filter.type(import_echo.Expando, {
201
- key: import_chunk_SCATWJKX.SHARED
201
+ key: import_chunk_COQYISES.SHARED
202
202
  }));
203
203
  }
204
- const [spacesOrder] = get((0, import_chunk_SCATWJKX.rxFromQuery)(query));
204
+ const [spacesOrder] = get((0, import_chunk_COQYISES.rxFromQuery)(query));
205
205
  return get((0, import_plugin_graph.rxFromSignal)(() => {
206
206
  const order = spacesOrder?.order ?? [];
207
207
  const orderMap = new Map(order.map((id, index) => [
@@ -211,7 +211,7 @@ var app_graph_builder_default = (context) => {
211
211
  return [
212
212
  ...spaces.filter((space) => orderMap.has(space.id)).sort((a, b) => orderMap.get(a.id) - orderMap.get(b.id)),
213
213
  ...spaces.filter((space) => !orderMap.has(space.id))
214
- ].filter((space) => settings?.showHidden ? true : space.state.get() !== import_echo.SpaceState.SPACE_INACTIVE).map((space) => (0, import_chunk_SCATWJKX.constructSpaceNode)({
214
+ ].filter((space) => settings?.showHidden ? true : space.state.get() !== import_echo.SpaceState.SPACE_INACTIVE).map((space) => (0, import_chunk_COQYISES.constructSpaceNode)({
215
215
  space,
216
216
  navigable: state.navigableCollections,
217
217
  personal: space === client.spaces.default,
@@ -228,10 +228,10 @@ var app_graph_builder_default = (context) => {
228
228
  // Create space actions.
229
229
  (0, import_plugin_graph.createExtension)({
230
230
  id: `${import_chunk_6P2DB4QQ.SPACE_PLUGIN}/actions`,
231
- actions: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.type === import_chunk_K6ZO4WDJ.SPACE_TYPE && (0, import_echo.isSpace)(node2.data) ? import_effect.Option.some(node2.data) : import_effect.Option.none()), import_effect.Option.flatMap((space) => {
231
+ actions: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.type === import_chunk_FXHI7JNY.SPACE_TYPE && (0, import_echo.isSpace)(node2.data) ? import_effect.Option.some(node2.data) : import_effect.Option.none()), import_effect.Option.flatMap((space) => {
232
232
  const [dispatcher] = get(context.capabilities(import_app_framework.Capabilities.IntentDispatcher));
233
233
  const [client] = get(context.capabilities(import_plugin_client.ClientCapabilities.Client));
234
- const [state] = get(context.capabilities(import_chunk_IKIDS6XF.SpaceCapabilities.State));
234
+ const [state] = get(context.capabilities(import_chunk_7GQGM4ZF.SpaceCapabilities.State));
235
235
  if (!dispatcher || !client || !state) {
236
236
  return import_effect.Option.none();
237
237
  } else {
@@ -242,22 +242,22 @@ var app_graph_builder_default = (context) => {
242
242
  migrating: state.sdkMigrationRunning[space.id]
243
243
  });
244
244
  }
245
- }), import_effect.Option.map((params) => (0, import_chunk_SCATWJKX.constructSpaceActions)(params)), import_effect.Option.getOrElse(() => [])))
245
+ }), import_effect.Option.map((params) => (0, import_chunk_COQYISES.constructSpaceActions)(params)), import_effect.Option.getOrElse(() => [])))
246
246
  }),
247
247
  // Create nodes for objects in the root collection of a space.
248
248
  (0, import_plugin_graph.createExtension)({
249
249
  id: `${import_chunk_6P2DB4QQ.SPACE_PLUGIN}/root-collection`,
250
- connector: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.type === import_chunk_K6ZO4WDJ.SPACE_TYPE && (0, import_echo.isSpace)(node2.data) ? import_effect.Option.some(node2.data) : import_effect.Option.none()), import_effect.Option.map((space) => {
251
- const state = context.getCapability(import_chunk_IKIDS6XF.SpaceCapabilities.State);
250
+ connector: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.type === import_chunk_FXHI7JNY.SPACE_TYPE && (0, import_echo.isSpace)(node2.data) ? import_effect.Option.some(node2.data) : import_effect.Option.none()), import_effect.Option.map((space) => {
251
+ const state = context.getCapability(import_chunk_7GQGM4ZF.SpaceCapabilities.State);
252
252
  const spaceState = get((0, import_plugin_graph.rxFromObservable)(space.state));
253
253
  if (spaceState !== import_echo.SpaceState.SPACE_READY) {
254
254
  return [];
255
255
  }
256
- const collection = get((0, import_plugin_graph.rxFromSignal)(() => space.properties[import_chunk_K6ZO4WDJ.CollectionType.typename]?.target));
256
+ const collection = get((0, import_plugin_graph.rxFromSignal)(() => space.properties[import_chunk_FXHI7JNY.CollectionType.typename]?.target));
257
257
  if (!collection) {
258
258
  return [];
259
259
  }
260
- return get((0, import_plugin_graph.rxFromSignal)(() => (0, import_effect.pipe)(collection.objects, import_effect.Array.map((object) => object.target), import_effect.Array.filter(import_util.isNonNullable), import_effect.Array.map((object) => (0, import_chunk_SCATWJKX.createObjectNode)({
260
+ return get((0, import_plugin_graph.rxFromSignal)(() => (0, import_effect.pipe)(collection.objects, import_effect.Array.map((object) => object.target), import_effect.Array.filter(import_util.isNonNullable), import_effect.Array.map((object) => (0, import_chunk_COQYISES.createObjectNode)({
261
261
  object,
262
262
  space,
263
263
  resolve,
@@ -268,10 +268,10 @@ var app_graph_builder_default = (context) => {
268
268
  // Create nodes for objects in a collection or by its fully qualified id.
269
269
  (0, import_plugin_graph.createExtension)({
270
270
  id: `${import_chunk_6P2DB4QQ.SPACE_PLUGIN}/objects`,
271
- connector: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.data instanceof import_chunk_K6ZO4WDJ.CollectionType ? import_effect.Option.some(node2.data) : import_effect.Option.none()), import_effect.Option.map((collection) => {
272
- const state = context.getCapability(import_chunk_IKIDS6XF.SpaceCapabilities.State);
271
+ connector: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => node2.data instanceof import_chunk_FXHI7JNY.CollectionType ? import_effect.Option.some(node2.data) : import_effect.Option.none()), import_effect.Option.map((collection) => {
272
+ const state = context.getCapability(import_chunk_7GQGM4ZF.SpaceCapabilities.State);
273
273
  const space = (0, import_echo.getSpace)(collection);
274
- return get((0, import_plugin_graph.rxFromSignal)(() => (0, import_effect.pipe)(collection.objects, import_effect.Array.map((object) => object.target), import_effect.Array.filter(import_util.isNonNullable), import_effect.Array.map((object) => space && (0, import_chunk_SCATWJKX.createObjectNode)({
274
+ return get((0, import_plugin_graph.rxFromSignal)(() => (0, import_effect.pipe)(collection.objects, import_effect.Array.map((object) => object.target), import_effect.Array.filter(import_util.isNonNullable), import_effect.Array.map((object) => space && (0, import_chunk_COQYISES.createObjectNode)({
275
275
  object,
276
276
  space,
277
277
  resolve,
@@ -285,7 +285,7 @@ var app_graph_builder_default = (context) => {
285
285
  actions: (node) => import_rx_react.Rx.make((get) => (0, import_effect.pipe)(get(node), import_effect.Option.flatMap((node2) => (0, import_echo.isEchoObject)(node2.data) ? import_effect.Option.some(node2.data) : import_effect.Option.none()), import_effect.Option.flatMap((object) => {
286
286
  const [dispatcher] = get(context.capabilities(import_app_framework.Capabilities.IntentDispatcher));
287
287
  const [appGraph] = get(context.capabilities(import_app_framework.Capabilities.AppGraph));
288
- const [state] = get(context.capabilities(import_chunk_IKIDS6XF.SpaceCapabilities.State));
288
+ const [state] = get(context.capabilities(import_chunk_7GQGM4ZF.SpaceCapabilities.State));
289
289
  if (!dispatcher || !appGraph || !state) {
290
290
  return import_effect.Option.none();
291
291
  } else {
@@ -296,7 +296,7 @@ var app_graph_builder_default = (context) => {
296
296
  navigable: get((0, import_plugin_graph.rxFromSignal)(() => state.navigableCollections))
297
297
  });
298
298
  }
299
- }), import_effect.Option.map((params) => (0, import_chunk_SCATWJKX.constructObjectActions)(params)), import_effect.Option.getOrElse(() => [])))
299
+ }), import_effect.Option.map((params) => (0, import_chunk_COQYISES.constructObjectActions)(params)), import_effect.Option.getOrElse(() => [])))
300
300
  }),
301
301
  // Object settings plank companion.
302
302
  (0, import_plugin_graph.createExtension)({
@@ -325,4 +325,4 @@ var app_graph_builder_default = (context) => {
325
325
  })
326
326
  ]);
327
327
  };
328
- //# sourceMappingURL=app-graph-builder-C2ISDMSL.cjs.map
328
+ //# sourceMappingURL=app-graph-builder-WC445X77.cjs.map
@@ -16,14 +16,14 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var app_graph_serializer_VLBCR3IX_exports = {};
20
- __export(app_graph_serializer_VLBCR3IX_exports, {
19
+ var app_graph_serializer_UPQOQVMJ_exports = {};
20
+ __export(app_graph_serializer_UPQOQVMJ_exports, {
21
21
  default: () => app_graph_serializer_default
22
22
  });
23
- module.exports = __toCommonJS(app_graph_serializer_VLBCR3IX_exports);
24
- var import_chunk_5YHUQJVB = require("./chunk-5YHUQJVB.cjs");
25
- var import_chunk_SCATWJKX = require("./chunk-SCATWJKX.cjs");
26
- var import_chunk_K6ZO4WDJ = require("./chunk-K6ZO4WDJ.cjs");
23
+ module.exports = __toCommonJS(app_graph_serializer_UPQOQVMJ_exports);
24
+ var import_chunk_DXL5TDFP = require("./chunk-DXL5TDFP.cjs");
25
+ var import_chunk_COQYISES = require("./chunk-COQYISES.cjs");
26
+ var import_chunk_FXHI7JNY = require("./chunk-FXHI7JNY.cjs");
27
27
  var import_chunk_6P2DB4QQ = require("./chunk-6P2DB4QQ.cjs");
28
28
  var import_app_framework = require("@dxos/app-framework");
29
29
  var import_echo = require("@dxos/client/echo");
@@ -31,27 +31,27 @@ var import_live_object = require("@dxos/live-object");
31
31
  var DIRECTORY_TYPE = "text/directory";
32
32
  var app_graph_serializer_default = (context) => (0, import_app_framework.contributes)(import_app_framework.Capabilities.AppGraphSerializer, [
33
33
  {
34
- inputType: import_chunk_SCATWJKX.SPACES,
34
+ inputType: import_chunk_COQYISES.SPACES,
35
35
  outputType: DIRECTORY_TYPE,
36
36
  serialize: (node) => ({
37
- name: import_chunk_5YHUQJVB.translations_default[0]["en-US"][import_chunk_6P2DB4QQ.SPACE_PLUGIN]["spaces label"],
38
- data: import_chunk_5YHUQJVB.translations_default[0]["en-US"][import_chunk_6P2DB4QQ.SPACE_PLUGIN]["spaces label"],
37
+ name: import_chunk_DXL5TDFP.translations_default[0]["en-US"][import_chunk_6P2DB4QQ.SPACE_PLUGIN]["spaces label"],
38
+ data: import_chunk_DXL5TDFP.translations_default[0]["en-US"][import_chunk_6P2DB4QQ.SPACE_PLUGIN]["spaces label"],
39
39
  type: DIRECTORY_TYPE
40
40
  }),
41
41
  deserialize: () => {
42
42
  }
43
43
  },
44
44
  {
45
- inputType: import_chunk_K6ZO4WDJ.SPACE_TYPE,
45
+ inputType: import_chunk_FXHI7JNY.SPACE_TYPE,
46
46
  outputType: DIRECTORY_TYPE,
47
47
  serialize: (node) => ({
48
- name: node.data.properties.name ?? import_chunk_5YHUQJVB.translations_default[0]["en-US"][import_chunk_6P2DB4QQ.SPACE_PLUGIN]["unnamed space label"],
49
- data: node.data.properties.name ?? import_chunk_5YHUQJVB.translations_default[0]["en-US"][import_chunk_6P2DB4QQ.SPACE_PLUGIN]["unnamed space label"],
48
+ name: node.data.properties.name ?? import_chunk_DXL5TDFP.translations_default[0]["en-US"][import_chunk_6P2DB4QQ.SPACE_PLUGIN]["unnamed space label"],
49
+ data: node.data.properties.name ?? import_chunk_DXL5TDFP.translations_default[0]["en-US"][import_chunk_6P2DB4QQ.SPACE_PLUGIN]["unnamed space label"],
50
50
  type: DIRECTORY_TYPE
51
51
  }),
52
52
  deserialize: async (data) => {
53
53
  const { dispatchPromise: dispatch } = context.getCapability(import_app_framework.Capabilities.IntentDispatcher);
54
- const result = await dispatch((0, import_app_framework.createIntent)(import_chunk_K6ZO4WDJ.SpaceAction.Create, {
54
+ const result = await dispatch((0, import_app_framework.createIntent)(import_chunk_FXHI7JNY.SpaceAction.Create, {
55
55
  name: data.name,
56
56
  edgeReplication: true
57
57
  }));
@@ -59,23 +59,23 @@ var app_graph_serializer_default = (context) => (0, import_app_framework.contrib
59
59
  }
60
60
  },
61
61
  {
62
- inputType: import_chunk_K6ZO4WDJ.CollectionType.typename,
62
+ inputType: import_chunk_FXHI7JNY.CollectionType.typename,
63
63
  outputType: DIRECTORY_TYPE,
64
64
  serialize: (node) => ({
65
- name: node.data.name ?? import_chunk_5YHUQJVB.translations_default[0]["en-US"][import_chunk_K6ZO4WDJ.CollectionType.typename]["object name placeholder"],
66
- data: node.data.name ?? import_chunk_5YHUQJVB.translations_default[0]["en-US"][import_chunk_K6ZO4WDJ.CollectionType.typename]["object name placeholder"],
65
+ name: node.data.name ?? import_chunk_DXL5TDFP.translations_default[0]["en-US"][import_chunk_FXHI7JNY.CollectionType.typename]["object name placeholder"],
66
+ data: node.data.name ?? import_chunk_DXL5TDFP.translations_default[0]["en-US"][import_chunk_FXHI7JNY.CollectionType.typename]["object name placeholder"],
67
67
  type: DIRECTORY_TYPE
68
68
  }),
69
69
  deserialize: async (data, ancestors) => {
70
70
  const space = ancestors.find(import_echo.isSpace);
71
- const collection = ancestors.findLast((ancestor) => ancestor instanceof import_chunk_K6ZO4WDJ.CollectionType) ?? space?.properties[import_chunk_K6ZO4WDJ.CollectionType.typename]?.target;
71
+ const collection = ancestors.findLast((ancestor) => ancestor instanceof import_chunk_FXHI7JNY.CollectionType) ?? space?.properties[import_chunk_FXHI7JNY.CollectionType.typename]?.target;
72
72
  if (!space || !collection) {
73
73
  return;
74
74
  }
75
75
  const { dispatchPromise: dispatch } = context.getCapability(import_app_framework.Capabilities.IntentDispatcher);
76
- const result = await dispatch((0, import_app_framework.createIntent)(import_chunk_K6ZO4WDJ.SpaceAction.AddObject, {
76
+ const result = await dispatch((0, import_app_framework.createIntent)(import_chunk_FXHI7JNY.SpaceAction.AddObject, {
77
77
  target: collection,
78
- object: (0, import_live_object.live)(import_chunk_K6ZO4WDJ.CollectionType, {
78
+ object: (0, import_live_object.live)(import_chunk_FXHI7JNY.CollectionType, {
79
79
  name: data.name,
80
80
  objects: [],
81
81
  views: {}
@@ -85,4 +85,4 @@ var app_graph_serializer_default = (context) => (0, import_app_framework.contrib
85
85
  }
86
86
  }
87
87
  ]);
88
- //# sourceMappingURL=app-graph-serializer-VLBCR3IX.cjs.map
88
+ //# sourceMappingURL=app-graph-serializer-UPQOQVMJ.cjs.map