@dxos/plugin-client 0.8.3 → 0.8.4-main.1068cf700f

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 (436) hide show
  1. package/dist/lib/browser/app-graph-builder-DTETNB5U.mjs +119 -0
  2. package/dist/lib/browser/app-graph-builder-DTETNB5U.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-4BZGRIFS.mjs +293 -0
  4. package/dist/lib/browser/chunk-4BZGRIFS.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-G7C3S2BE.mjs +15 -0
  6. package/dist/lib/browser/chunk-G7C3S2BE.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-MY6BJCB6.mjs +18 -0
  8. package/dist/lib/browser/chunk-MY6BJCB6.mjs.map +7 -0
  9. package/dist/lib/browser/cli/index.mjs +1049 -0
  10. package/dist/lib/browser/cli/index.mjs.map +7 -0
  11. package/dist/lib/browser/client-XOQQ5POJ.mjs +86 -0
  12. package/dist/lib/browser/client-XOQQ5POJ.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +81 -86
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/migrations-YNQ7L5GT.mjs +24 -0
  17. package/dist/lib/browser/migrations-YNQ7L5GT.mjs.map +7 -0
  18. package/dist/lib/browser/operation-resolver-N4YCJ4KS.mjs +299 -0
  19. package/dist/lib/browser/operation-resolver-N4YCJ4KS.mjs.map +7 -0
  20. package/dist/lib/browser/react-context-FDXHIBZL.mjs +24 -0
  21. package/dist/lib/browser/react-context-FDXHIBZL.mjs.map +7 -0
  22. package/dist/lib/browser/react-surface-ZP3FLVRS.mjs +676 -0
  23. package/dist/lib/browser/react-surface-ZP3FLVRS.mjs.map +7 -0
  24. package/dist/lib/browser/schema-defs-AYXOYD2M.mjs +27 -0
  25. package/dist/lib/browser/schema-defs-AYXOYD2M.mjs.map +7 -0
  26. package/dist/lib/browser/types/index.mjs +15 -0
  27. package/dist/lib/node-esm/app-graph-builder-PFKVFRXI.mjs +120 -0
  28. package/dist/lib/node-esm/app-graph-builder-PFKVFRXI.mjs.map +7 -0
  29. package/dist/lib/node-esm/chunk-JAF64TFQ.mjs +295 -0
  30. package/dist/lib/node-esm/chunk-JAF64TFQ.mjs.map +7 -0
  31. package/dist/lib/node-esm/chunk-MUOMX53G.mjs +20 -0
  32. package/dist/lib/node-esm/chunk-MUOMX53G.mjs.map +7 -0
  33. package/dist/lib/node-esm/chunk-PRAFFO54.mjs +16 -0
  34. package/dist/lib/node-esm/chunk-PRAFFO54.mjs.map +7 -0
  35. package/dist/lib/node-esm/cli/index.mjs +1050 -0
  36. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  37. package/dist/lib/node-esm/client-3YIMWKR7.mjs +87 -0
  38. package/dist/lib/node-esm/client-3YIMWKR7.mjs.map +7 -0
  39. package/dist/lib/node-esm/index.mjs +81 -86
  40. package/dist/lib/node-esm/index.mjs.map +4 -4
  41. package/dist/lib/node-esm/meta.json +1 -1
  42. package/dist/lib/node-esm/migrations-ZH5GNG4U.mjs +25 -0
  43. package/dist/lib/node-esm/migrations-ZH5GNG4U.mjs.map +7 -0
  44. package/dist/lib/node-esm/operation-resolver-CHGWI5P2.mjs +300 -0
  45. package/dist/lib/node-esm/operation-resolver-CHGWI5P2.mjs.map +7 -0
  46. package/dist/lib/node-esm/react-context-7Z2TVUTV.mjs +25 -0
  47. package/dist/lib/node-esm/react-context-7Z2TVUTV.mjs.map +7 -0
  48. package/dist/lib/node-esm/react-surface-BHJMHIMH.mjs +677 -0
  49. package/dist/lib/node-esm/react-surface-BHJMHIMH.mjs.map +7 -0
  50. package/dist/lib/node-esm/schema-defs-TV2SCKSH.mjs +28 -0
  51. package/dist/lib/node-esm/schema-defs-TV2SCKSH.mjs.map +7 -0
  52. package/dist/lib/node-esm/types/index.mjs +16 -0
  53. package/dist/types/src/ClientPlugin.d.ts +2 -1
  54. package/dist/types/src/ClientPlugin.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  56. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  57. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  58. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  59. package/dist/types/src/capabilities/client/client.d.ts +8 -0
  60. package/dist/types/src/capabilities/client/client.d.ts.map +1 -0
  61. package/dist/types/src/capabilities/client/index.d.ts +18 -0
  62. package/dist/types/src/capabilities/client/index.d.ts.map +1 -0
  63. package/dist/types/src/capabilities/index.d.ts +7 -19
  64. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  65. package/dist/types/src/capabilities/migrations/index.d.ts +3 -0
  66. package/dist/types/src/capabilities/migrations/index.d.ts.map +1 -0
  67. package/dist/types/src/capabilities/migrations/migrations.d.ts +5 -0
  68. package/dist/types/src/capabilities/migrations/migrations.d.ts.map +1 -0
  69. package/dist/types/src/capabilities/operation-resolver/index.d.ts +5 -0
  70. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  71. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +8 -0
  72. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  73. package/dist/types/src/capabilities/react-context/index.d.ts +7 -0
  74. package/dist/types/src/capabilities/react-context/index.d.ts.map +1 -0
  75. package/dist/types/src/capabilities/react-context/react-context.d.ts +10 -0
  76. package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -0
  77. package/dist/types/src/capabilities/react-surface/index.d.ts +5 -0
  78. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +9 -0
  80. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/schema-defs/index.d.ts +3 -0
  82. package/dist/types/src/capabilities/schema-defs/index.d.ts.map +1 -0
  83. package/dist/types/src/capabilities/schema-defs/schema-defs.d.ts +5 -0
  84. package/dist/types/src/capabilities/schema-defs/schema-defs.d.ts.map +1 -0
  85. package/dist/types/src/cli/commands/config/index.d.ts +5 -0
  86. package/dist/types/src/cli/commands/config/index.d.ts.map +1 -0
  87. package/dist/types/src/cli/commands/config/view.d.ts +5 -0
  88. package/dist/types/src/cli/commands/config/view.d.ts.map +1 -0
  89. package/dist/types/src/cli/commands/device/index.d.ts +7 -0
  90. package/dist/types/src/cli/commands/device/index.d.ts.map +1 -0
  91. package/dist/types/src/cli/commands/device/info/index.d.ts +2 -0
  92. package/dist/types/src/cli/commands/device/info/index.d.ts.map +1 -0
  93. package/dist/types/src/cli/commands/device/info/info.d.ts +7 -0
  94. package/dist/types/src/cli/commands/device/info/info.d.ts.map +1 -0
  95. package/dist/types/src/cli/commands/device/info/info.test.d.ts +2 -0
  96. package/dist/types/src/cli/commands/device/info/info.test.d.ts.map +1 -0
  97. package/dist/types/src/cli/commands/device/list/index.d.ts +2 -0
  98. package/dist/types/src/cli/commands/device/list/index.d.ts.map +1 -0
  99. package/dist/types/src/cli/commands/device/list/list.d.ts +7 -0
  100. package/dist/types/src/cli/commands/device/list/list.d.ts.map +1 -0
  101. package/dist/types/src/cli/commands/device/list/list.test.d.ts +2 -0
  102. package/dist/types/src/cli/commands/device/list/list.test.d.ts.map +1 -0
  103. package/dist/types/src/cli/commands/device/update/index.d.ts +2 -0
  104. package/dist/types/src/cli/commands/device/update/index.d.ts.map +1 -0
  105. package/dist/types/src/cli/commands/device/update/update.d.ts +11 -0
  106. package/dist/types/src/cli/commands/device/update/update.d.ts.map +1 -0
  107. package/dist/types/src/cli/commands/device/util.d.ts +16 -0
  108. package/dist/types/src/cli/commands/device/util.d.ts.map +1 -0
  109. package/dist/types/src/cli/commands/edge/index.d.ts +5 -0
  110. package/dist/types/src/cli/commands/edge/index.d.ts.map +1 -0
  111. package/dist/types/src/cli/commands/edge/status.d.ts +7 -0
  112. package/dist/types/src/cli/commands/edge/status.d.ts.map +1 -0
  113. package/dist/types/src/cli/commands/halo/create/create.d.ts +15 -0
  114. package/dist/types/src/cli/commands/halo/create/create.d.ts.map +1 -0
  115. package/dist/types/src/cli/commands/halo/create/create.test.d.ts +2 -0
  116. package/dist/types/src/cli/commands/halo/create/create.test.d.ts.map +1 -0
  117. package/dist/types/src/cli/commands/halo/create/index.d.ts +2 -0
  118. package/dist/types/src/cli/commands/halo/create/index.d.ts.map +1 -0
  119. package/dist/types/src/cli/commands/halo/credential/add/add.d.ts +13 -0
  120. package/dist/types/src/cli/commands/halo/credential/add/add.d.ts.map +1 -0
  121. package/dist/types/src/cli/commands/halo/credential/add/index.d.ts +2 -0
  122. package/dist/types/src/cli/commands/halo/credential/add/index.d.ts.map +1 -0
  123. package/dist/types/src/cli/commands/halo/credential/index.d.ts +12 -0
  124. package/dist/types/src/cli/commands/halo/credential/index.d.ts.map +1 -0
  125. package/dist/types/src/cli/commands/halo/credential/list/index.d.ts +2 -0
  126. package/dist/types/src/cli/commands/halo/credential/list/index.d.ts.map +1 -0
  127. package/dist/types/src/cli/commands/halo/credential/list/list.d.ts +19 -0
  128. package/dist/types/src/cli/commands/halo/credential/list/list.d.ts.map +1 -0
  129. package/dist/types/src/cli/commands/halo/credential/list/list.test.d.ts +2 -0
  130. package/dist/types/src/cli/commands/halo/credential/list/list.test.d.ts.map +1 -0
  131. package/dist/types/src/cli/commands/halo/identity/identity.d.ts +7 -0
  132. package/dist/types/src/cli/commands/halo/identity/identity.d.ts.map +1 -0
  133. package/dist/types/src/cli/commands/halo/identity/identity.test.d.ts +2 -0
  134. package/dist/types/src/cli/commands/halo/identity/identity.test.d.ts.map +1 -0
  135. package/dist/types/src/cli/commands/halo/identity/index.d.ts +2 -0
  136. package/dist/types/src/cli/commands/halo/identity/index.d.ts.map +1 -0
  137. package/dist/types/src/cli/commands/halo/index.d.ts +3 -0
  138. package/dist/types/src/cli/commands/halo/index.d.ts.map +1 -0
  139. package/dist/types/src/cli/commands/halo/join/index.d.ts +2 -0
  140. package/dist/types/src/cli/commands/halo/join/index.d.ts.map +1 -0
  141. package/dist/types/src/cli/commands/halo/join/join.d.ts +8 -0
  142. package/dist/types/src/cli/commands/halo/join/join.d.ts.map +1 -0
  143. package/dist/types/src/cli/commands/halo/join/join.test.d.ts +2 -0
  144. package/dist/types/src/cli/commands/halo/join/join.test.d.ts.map +1 -0
  145. package/dist/types/src/cli/commands/halo/keys/index.d.ts +2 -0
  146. package/dist/types/src/cli/commands/halo/keys/index.d.ts.map +1 -0
  147. package/dist/types/src/cli/commands/halo/keys/keys.d.ts +7 -0
  148. package/dist/types/src/cli/commands/halo/keys/keys.d.ts.map +1 -0
  149. package/dist/types/src/cli/commands/halo/keys/keys.test.d.ts +2 -0
  150. package/dist/types/src/cli/commands/halo/keys/keys.test.d.ts.map +1 -0
  151. package/dist/types/src/cli/commands/halo/recover/index.d.ts +2 -0
  152. package/dist/types/src/cli/commands/halo/recover/index.d.ts.map +1 -0
  153. package/dist/types/src/cli/commands/halo/recover/recover.d.ts +7 -0
  154. package/dist/types/src/cli/commands/halo/recover/recover.d.ts.map +1 -0
  155. package/dist/types/src/cli/commands/halo/recover/recover.test.d.ts +2 -0
  156. package/dist/types/src/cli/commands/halo/recover/recover.test.d.ts.map +1 -0
  157. package/dist/types/src/cli/commands/halo/seed/index.d.ts +2 -0
  158. package/dist/types/src/cli/commands/halo/seed/index.d.ts.map +1 -0
  159. package/dist/types/src/cli/commands/halo/seed/seed.d.ts +7 -0
  160. package/dist/types/src/cli/commands/halo/seed/seed.d.ts.map +1 -0
  161. package/dist/types/src/cli/commands/halo/share/index.d.ts +2 -0
  162. package/dist/types/src/cli/commands/halo/share/index.d.ts.map +1 -0
  163. package/dist/types/src/cli/commands/halo/share/share.d.ts +15 -0
  164. package/dist/types/src/cli/commands/halo/share/share.d.ts.map +1 -0
  165. package/dist/types/src/cli/commands/halo/update/index.d.ts +2 -0
  166. package/dist/types/src/cli/commands/halo/update/index.d.ts.map +1 -0
  167. package/dist/types/src/cli/commands/halo/update/update.d.ts +11 -0
  168. package/dist/types/src/cli/commands/halo/update/update.d.ts.map +1 -0
  169. package/dist/types/src/cli/commands/halo/update/update.test.d.ts +2 -0
  170. package/dist/types/src/cli/commands/halo/update/update.test.d.ts.map +1 -0
  171. package/dist/types/src/cli/commands/halo/util.d.ts +13 -0
  172. package/dist/types/src/cli/commands/halo/util.d.ts.map +1 -0
  173. package/dist/types/src/cli/commands/index.d.ts +6 -0
  174. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  175. package/dist/types/src/cli/commands/profile/create.d.ts +9 -0
  176. package/dist/types/src/cli/commands/profile/create.d.ts.map +1 -0
  177. package/dist/types/src/cli/commands/profile/delete.d.ts +8 -0
  178. package/dist/types/src/cli/commands/profile/delete.d.ts.map +1 -0
  179. package/dist/types/src/cli/commands/profile/import.d.ts +17 -0
  180. package/dist/types/src/cli/commands/profile/import.d.ts.map +1 -0
  181. package/dist/types/src/cli/commands/profile/index.d.ts +19 -0
  182. package/dist/types/src/cli/commands/profile/index.d.ts.map +1 -0
  183. package/dist/types/src/cli/commands/profile/inspect.d.ts +13 -0
  184. package/dist/types/src/cli/commands/profile/inspect.d.ts.map +1 -0
  185. package/dist/types/src/cli/commands/profile/list.d.ts +6 -0
  186. package/dist/types/src/cli/commands/profile/list.d.ts.map +1 -0
  187. package/dist/types/src/cli/commands/profile/reset.d.ts +8 -0
  188. package/dist/types/src/cli/commands/profile/reset.d.ts.map +1 -0
  189. package/dist/types/src/cli/commands/profile/util.d.ts +24 -0
  190. package/dist/types/src/cli/commands/profile/util.d.ts.map +1 -0
  191. package/dist/types/src/cli/index.d.ts +2 -0
  192. package/dist/types/src/cli/index.d.ts.map +1 -0
  193. package/dist/types/src/cli/plugin.d.ts +4 -0
  194. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  195. package/dist/types/src/cli/testing/test-console.d.ts +37 -0
  196. package/dist/types/src/cli/testing/test-console.d.ts.map +1 -0
  197. package/dist/types/src/components/DevicesContainer.d.ts.map +1 -1
  198. package/dist/types/src/components/DevicesContainer.stories.d.ts +178 -5
  199. package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
  200. package/dist/types/src/components/JoinDialog.d.ts +0 -1
  201. package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
  202. package/dist/types/src/components/ProfileContainer.d.ts.map +1 -1
  203. package/dist/types/src/components/ProfileContainer.stories.d.ts +11 -5
  204. package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -1
  205. package/dist/types/src/components/RecoveryCodeDialog.d.ts +0 -1
  206. package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
  207. package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +13 -5
  208. package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +1 -1
  209. package/dist/types/src/components/RecoveryCredentialsContainer.d.ts +1 -1
  210. package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +1 -1
  211. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +11 -5
  212. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -1
  213. package/dist/types/src/components/ResetDialog.d.ts +5 -3
  214. package/dist/types/src/components/ResetDialog.d.ts.map +1 -1
  215. package/dist/types/src/components/ResetDialog.stories.d.ts +13 -4
  216. package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -1
  217. package/dist/types/src/constants.d.ts +4 -0
  218. package/dist/types/src/constants.d.ts.map +1 -0
  219. package/dist/types/src/index.d.ts +3 -3
  220. package/dist/types/src/index.d.ts.map +1 -1
  221. package/dist/types/src/meta.d.ts +2 -3
  222. package/dist/types/src/meta.d.ts.map +1 -1
  223. package/dist/types/src/translations.d.ts +2 -48
  224. package/dist/types/src/translations.d.ts.map +1 -1
  225. package/dist/types/src/types/capabilities.d.ts +10 -0
  226. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  227. package/dist/types/src/types/events.d.ts +9 -0
  228. package/dist/types/src/types/events.d.ts.map +1 -0
  229. package/dist/types/src/types/index.d.ts +4 -0
  230. package/dist/types/src/types/index.d.ts.map +1 -0
  231. package/dist/types/src/types/schema.d.ts +296 -0
  232. package/dist/types/src/types/schema.d.ts.map +1 -0
  233. package/dist/types/tsconfig.tsbuildinfo +1 -1
  234. package/package.json +60 -46
  235. package/src/ClientPlugin.ts +42 -61
  236. package/src/capabilities/app-graph-builder/app-graph-builder.ts +96 -0
  237. package/src/capabilities/app-graph-builder/index.ts +7 -0
  238. package/src/capabilities/client/client.ts +75 -0
  239. package/src/capabilities/client/index.ts +7 -0
  240. package/src/capabilities/index.ts +7 -11
  241. package/src/capabilities/migrations/index.ts +7 -0
  242. package/src/capabilities/migrations/migrations.ts +30 -0
  243. package/src/capabilities/operation-resolver/index.ts +7 -0
  244. package/src/capabilities/operation-resolver/operation-resolver.ts +249 -0
  245. package/src/capabilities/react-context/index.ts +7 -0
  246. package/src/capabilities/react-context/react-context.tsx +25 -0
  247. package/src/capabilities/react-surface/index.ts +7 -0
  248. package/src/capabilities/react-surface/react-surface.tsx +75 -0
  249. package/src/capabilities/schema-defs/index.ts +7 -0
  250. package/src/capabilities/schema-defs/schema-defs.ts +36 -0
  251. package/src/cli/commands/config/index.ts +12 -0
  252. package/src/cli/commands/config/view.ts +26 -0
  253. package/src/cli/commands/device/index.ts +14 -0
  254. package/src/cli/commands/device/info/index.ts +5 -0
  255. package/src/cli/commands/device/info/info.test.ts +29 -0
  256. package/src/cli/commands/device/info/info.ts +50 -0
  257. package/src/cli/commands/device/list/index.ts +5 -0
  258. package/src/cli/commands/device/list/list.test.ts +31 -0
  259. package/src/cli/commands/device/list/list.ts +30 -0
  260. package/src/cli/commands/device/update/index.ts +5 -0
  261. package/src/cli/commands/device/update/update.ts +70 -0
  262. package/src/cli/commands/device/util.ts +55 -0
  263. package/src/cli/commands/edge/index.ts +12 -0
  264. package/src/cli/commands/edge/status.ts +45 -0
  265. package/src/cli/commands/halo/create/create.test.ts +52 -0
  266. package/src/cli/commands/halo/create/create.ts +75 -0
  267. package/src/cli/commands/halo/create/index.ts +5 -0
  268. package/src/cli/commands/halo/credential/add/add.ts +97 -0
  269. package/src/cli/commands/halo/credential/add/index.ts +5 -0
  270. package/src/cli/commands/halo/credential/index.ts +13 -0
  271. package/src/cli/commands/halo/credential/list/index.ts +5 -0
  272. package/src/cli/commands/halo/credential/list/list.test.ts +28 -0
  273. package/src/cli/commands/halo/credential/list/list.ts +118 -0
  274. package/src/cli/commands/halo/identity/identity.test.ts +40 -0
  275. package/src/cli/commands/halo/identity/identity.ts +46 -0
  276. package/src/cli/commands/halo/identity/index.ts +5 -0
  277. package/src/cli/commands/halo/index.ts +21 -0
  278. package/src/cli/commands/halo/join/index.ts +5 -0
  279. package/src/cli/commands/halo/join/join.test.ts +10 -0
  280. package/src/cli/commands/halo/join/join.ts +87 -0
  281. package/src/cli/commands/halo/keys/index.ts +5 -0
  282. package/src/cli/commands/halo/keys/keys.test.ts +29 -0
  283. package/src/cli/commands/halo/keys/keys.ts +42 -0
  284. package/src/cli/commands/halo/recover/index.ts +5 -0
  285. package/src/cli/commands/halo/recover/recover.test.ts +10 -0
  286. package/src/cli/commands/halo/recover/recover.ts +44 -0
  287. package/src/cli/commands/halo/seed/index.ts +5 -0
  288. package/src/cli/commands/halo/seed/seed.ts +38 -0
  289. package/src/cli/commands/halo/share/index.ts +5 -0
  290. package/src/cli/commands/halo/share/share.ts +97 -0
  291. package/src/cli/commands/halo/update/index.ts +5 -0
  292. package/src/cli/commands/halo/update/update.test.ts +29 -0
  293. package/src/cli/commands/halo/update/update.ts +69 -0
  294. package/src/cli/commands/halo/util.ts +18 -0
  295. package/src/cli/commands/index.ts +9 -0
  296. package/src/cli/commands/profile/create.ts +87 -0
  297. package/src/cli/commands/profile/delete.ts +33 -0
  298. package/src/cli/commands/profile/import.ts +101 -0
  299. package/src/cli/commands/profile/index.ts +17 -0
  300. package/src/cli/commands/profile/inspect.ts +64 -0
  301. package/src/cli/commands/profile/list.ts +54 -0
  302. package/src/cli/commands/profile/reset.ts +45 -0
  303. package/src/cli/commands/profile/util.ts +48 -0
  304. package/src/cli/index.ts +5 -0
  305. package/src/cli/plugin.ts +34 -0
  306. package/src/cli/testing/test-console.ts +88 -0
  307. package/src/components/DevicesContainer.stories.tsx +19 -18
  308. package/src/components/DevicesContainer.tsx +72 -92
  309. package/src/components/JoinDialog.tsx +15 -17
  310. package/src/components/ProfileContainer.stories.tsx +8 -9
  311. package/src/components/ProfileContainer.tsx +67 -64
  312. package/src/components/RecoveryCodeDialog.stories.tsx +10 -11
  313. package/src/components/RecoveryCodeDialog.tsx +5 -7
  314. package/src/components/RecoveryCredentialsContainer.stories.tsx +16 -16
  315. package/src/components/RecoveryCredentialsContainer.tsx +49 -54
  316. package/src/components/ResetDialog.stories.tsx +37 -18
  317. package/src/components/ResetDialog.tsx +26 -22
  318. package/src/constants.ts +9 -0
  319. package/src/index.ts +3 -3
  320. package/src/meta.ts +8 -5
  321. package/src/translations.ts +11 -6
  322. package/src/types/capabilities.ts +16 -0
  323. package/src/types/events.ts +15 -0
  324. package/src/types/index.ts +7 -0
  325. package/src/types/schema.ts +243 -0
  326. package/dist/lib/browser/app-graph-builder-CBRN2DMK.mjs +0 -123
  327. package/dist/lib/browser/app-graph-builder-CBRN2DMK.mjs.map +0 -7
  328. package/dist/lib/browser/chunk-5MC5HCIM.mjs +0 -693
  329. package/dist/lib/browser/chunk-5MC5HCIM.mjs.map +0 -7
  330. package/dist/lib/browser/chunk-IA3AVM4I.mjs +0 -111
  331. package/dist/lib/browser/chunk-IA3AVM4I.mjs.map +0 -7
  332. package/dist/lib/browser/chunk-MCEXD5XH.mjs +0 -12
  333. package/dist/lib/browser/chunk-MCEXD5XH.mjs.map +0 -7
  334. package/dist/lib/browser/chunk-PSSNS4C6.mjs +0 -18
  335. package/dist/lib/browser/chunk-PSSNS4C6.mjs.map +0 -7
  336. package/dist/lib/browser/chunk-UCVFWBKT.mjs +0 -19
  337. package/dist/lib/browser/chunk-UCVFWBKT.mjs.map +0 -7
  338. package/dist/lib/browser/client-NMS3MSFP.mjs +0 -37
  339. package/dist/lib/browser/client-NMS3MSFP.mjs.map +0 -7
  340. package/dist/lib/browser/intent-resolver-SLQZMO6I.mjs +0 -305
  341. package/dist/lib/browser/intent-resolver-SLQZMO6I.mjs.map +0 -7
  342. package/dist/lib/browser/migrations-QRQV6ZAM.mjs +0 -23
  343. package/dist/lib/browser/migrations-QRQV6ZAM.mjs.map +0 -7
  344. package/dist/lib/browser/react-context-IE2O2OYK.mjs +0 -24
  345. package/dist/lib/browser/react-context-IE2O2OYK.mjs.map +0 -7
  346. package/dist/lib/browser/react-surface-QFC2G27R.mjs +0 -66
  347. package/dist/lib/browser/react-surface-QFC2G27R.mjs.map +0 -7
  348. package/dist/lib/browser/schema-defs-DNRDVQQJ.mjs +0 -25
  349. package/dist/lib/browser/schema-defs-DNRDVQQJ.mjs.map +0 -7
  350. package/dist/lib/browser/types.mjs +0 -10
  351. package/dist/lib/node/app-graph-builder-BEEYM3A5.cjs +0 -134
  352. package/dist/lib/node/app-graph-builder-BEEYM3A5.cjs.map +0 -7
  353. package/dist/lib/node/chunk-BEJWU2NE.cjs +0 -718
  354. package/dist/lib/node/chunk-BEJWU2NE.cjs.map +0 -7
  355. package/dist/lib/node/chunk-BL6EBWOS.cjs +0 -131
  356. package/dist/lib/node/chunk-BL6EBWOS.cjs.map +0 -7
  357. package/dist/lib/node/chunk-CIYUKY3J.cjs +0 -37
  358. package/dist/lib/node/chunk-CIYUKY3J.cjs.map +0 -7
  359. package/dist/lib/node/chunk-DJKWB5L6.cjs +0 -35
  360. package/dist/lib/node/chunk-DJKWB5L6.cjs.map +0 -7
  361. package/dist/lib/node/chunk-DNKJCPU7.cjs +0 -38
  362. package/dist/lib/node/chunk-DNKJCPU7.cjs.map +0 -7
  363. package/dist/lib/node/client-Q3EQS4HA.cjs +0 -51
  364. package/dist/lib/node/client-Q3EQS4HA.cjs.map +0 -7
  365. package/dist/lib/node/index.cjs +0 -175
  366. package/dist/lib/node/index.cjs.map +0 -7
  367. package/dist/lib/node/intent-resolver-QURURONO.cjs +0 -312
  368. package/dist/lib/node/intent-resolver-QURURONO.cjs.map +0 -7
  369. package/dist/lib/node/meta.json +0 -1
  370. package/dist/lib/node/migrations-6FEWMF7U.cjs +0 -39
  371. package/dist/lib/node/migrations-6FEWMF7U.cjs.map +0 -7
  372. package/dist/lib/node/react-context-JS7Y5ZOK.cjs +0 -48
  373. package/dist/lib/node/react-context-JS7Y5ZOK.cjs.map +0 -7
  374. package/dist/lib/node/react-surface-RGRHOPVK.cjs +0 -82
  375. package/dist/lib/node/react-surface-RGRHOPVK.cjs.map +0 -7
  376. package/dist/lib/node/schema-defs-TA52ARBO.cjs +0 -41
  377. package/dist/lib/node/schema-defs-TA52ARBO.cjs.map +0 -7
  378. package/dist/lib/node/types.cjs +0 -32
  379. package/dist/lib/node/types.cjs.map +0 -7
  380. package/dist/lib/node-esm/app-graph-builder-OZEAAKNT.mjs +0 -124
  381. package/dist/lib/node-esm/app-graph-builder-OZEAAKNT.mjs.map +0 -7
  382. package/dist/lib/node-esm/chunk-37E3EI46.mjs +0 -19
  383. package/dist/lib/node-esm/chunk-37E3EI46.mjs.map +0 -7
  384. package/dist/lib/node-esm/chunk-FJYSQRBO.mjs +0 -20
  385. package/dist/lib/node-esm/chunk-FJYSQRBO.mjs.map +0 -7
  386. package/dist/lib/node-esm/chunk-HM7VB4ZV.mjs +0 -14
  387. package/dist/lib/node-esm/chunk-HM7VB4ZV.mjs.map +0 -7
  388. package/dist/lib/node-esm/chunk-STGGUFV2.mjs +0 -112
  389. package/dist/lib/node-esm/chunk-STGGUFV2.mjs.map +0 -7
  390. package/dist/lib/node-esm/chunk-WHKQMAO5.mjs +0 -694
  391. package/dist/lib/node-esm/chunk-WHKQMAO5.mjs.map +0 -7
  392. package/dist/lib/node-esm/client-EBFQZRSF.mjs +0 -38
  393. package/dist/lib/node-esm/client-EBFQZRSF.mjs.map +0 -7
  394. package/dist/lib/node-esm/intent-resolver-MV55C5ED.mjs +0 -306
  395. package/dist/lib/node-esm/intent-resolver-MV55C5ED.mjs.map +0 -7
  396. package/dist/lib/node-esm/migrations-AK43ZE6G.mjs +0 -24
  397. package/dist/lib/node-esm/migrations-AK43ZE6G.mjs.map +0 -7
  398. package/dist/lib/node-esm/react-context-6N7NMUJE.mjs +0 -25
  399. package/dist/lib/node-esm/react-context-6N7NMUJE.mjs.map +0 -7
  400. package/dist/lib/node-esm/react-surface-JUYTGBEM.mjs +0 -67
  401. package/dist/lib/node-esm/react-surface-JUYTGBEM.mjs.map +0 -7
  402. package/dist/lib/node-esm/schema-defs-O2KQQXJH.mjs +0 -26
  403. package/dist/lib/node-esm/schema-defs-O2KQQXJH.mjs.map +0 -7
  404. package/dist/lib/node-esm/types.mjs +0 -11
  405. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  406. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  407. package/dist/types/src/capabilities/capabilities.d.ts +0 -10
  408. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  409. package/dist/types/src/capabilities/client.d.ts +0 -9
  410. package/dist/types/src/capabilities/client.d.ts.map +0 -1
  411. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -8
  412. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  413. package/dist/types/src/capabilities/migrations.d.ts +0 -4
  414. package/dist/types/src/capabilities/migrations.d.ts.map +0 -1
  415. package/dist/types/src/capabilities/react-context.d.ts +0 -8
  416. package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
  417. package/dist/types/src/capabilities/react-surface.d.ts +0 -8
  418. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  419. package/dist/types/src/capabilities/schema-defs.d.ts +0 -4
  420. package/dist/types/src/capabilities/schema-defs.d.ts.map +0 -1
  421. package/dist/types/src/events.d.ts +0 -8
  422. package/dist/types/src/events.d.ts.map +0 -1
  423. package/dist/types/src/types.d.ts +0 -136
  424. package/dist/types/src/types.d.ts.map +0 -1
  425. package/src/capabilities/app-graph-builder.ts +0 -113
  426. package/src/capabilities/capabilities.ts +0 -17
  427. package/src/capabilities/client.ts +0 -41
  428. package/src/capabilities/intent-resolver.ts +0 -250
  429. package/src/capabilities/migrations.ts +0 -25
  430. package/src/capabilities/react-context.tsx +0 -20
  431. package/src/capabilities/react-surface.tsx +0 -67
  432. package/src/capabilities/schema-defs.ts +0 -29
  433. package/src/events.ts +0 -15
  434. package/src/types.ts +0 -131
  435. /package/dist/lib/browser/{types.mjs.map → types/index.mjs.map} +0 -0
  436. /package/dist/lib/node-esm/{types.mjs.map → types/index.mjs.map} +0 -0
@@ -1,693 +0,0 @@
1
- import {
2
- ClientAction
3
- } from "./chunk-IA3AVM4I.mjs";
4
- import {
5
- CLIENT_PLUGIN
6
- } from "./chunk-MCEXD5XH.mjs";
7
-
8
- // packages/plugins/plugin-client/src/components/DevicesContainer.tsx
9
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
10
- import { Check, X } from "@phosphor-icons/react";
11
- import React, { useCallback, useEffect, useState } from "react";
12
- import { QR } from "react-qr-rounded";
13
- import { createIntent, useIntentDispatcher } from "@dxos/app-framework";
14
- import { log } from "@dxos/log";
15
- import { useClient, useMulticastObservable } from "@dxos/react-client";
16
- import { useDevices } from "@dxos/react-client/halo";
17
- import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
18
- import { useNetworkStatus } from "@dxos/react-client/mesh";
19
- import { Button, Clipboard, IconButton, List, useId, useTranslation } from "@dxos/react-ui";
20
- import { ControlFrame, ControlFrameItem, ControlGroup, ControlItem, ControlPage, ControlSection } from "@dxos/react-ui-form";
21
- import { StackItem } from "@dxos/react-ui-stack";
22
- import { getSize, mx } from "@dxos/react-ui-theme";
23
- import { AuthCode, Centered, DeviceListItem, Emoji, Viewport } from "@dxos/shell/react";
24
- import { hexToEmoji } from "@dxos/util";
25
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-client/src/components/DevicesContainer.tsx";
26
- var DevicesContainer = ({ createInvitationUrl }) => {
27
- var _effect = _useSignals();
28
- try {
29
- const { t } = useTranslation("os");
30
- const { dispatchPromise: dispatch } = useIntentDispatcher();
31
- const devices = useDevices();
32
- const { swarm: connectionState } = useNetworkStatus();
33
- const handleResetStorage = useCallback(() => dispatch(createIntent(ClientAction.ResetStorage)), [
34
- dispatch
35
- ]);
36
- const handleRecover = useCallback(() => dispatch(createIntent(ClientAction.ResetStorage, {
37
- mode: "recover"
38
- })), [
39
- dispatch
40
- ]);
41
- const handleJoinNewIdentity = useCallback(() => dispatch(createIntent(ClientAction.ResetStorage, {
42
- mode: "join new identity"
43
- })), [
44
- dispatch
45
- ]);
46
- return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(StackItem.Content, {
47
- classNames: "block overflow-y-auto"
48
- }, /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
49
- title: t("devices verbose label", {
50
- ns: CLIENT_PLUGIN
51
- }),
52
- description: t("devices description", {
53
- ns: CLIENT_PLUGIN
54
- })
55
- }, /* @__PURE__ */ React.createElement(ControlFrame, null, /* @__PURE__ */ React.createElement(ControlFrameItem, {
56
- title: t("devices label", {
57
- ns: CLIENT_PLUGIN
58
- })
59
- }, /* @__PURE__ */ React.createElement(List, null, devices.map((device) => {
60
- return /* @__PURE__ */ React.createElement(DeviceListItem, {
61
- key: device.deviceKey.toHex(),
62
- device,
63
- connectionState
64
- });
65
- }))), createInvitationUrl && /* @__PURE__ */ React.createElement(ControlFrameItem, {
66
- title: "Add device"
67
- }, /* @__PURE__ */ React.createElement(DeviceInvitation, {
68
- createInvitationUrl
69
- })))), /* @__PURE__ */ React.createElement(ControlSection, {
70
- title: t("danger zone title", {
71
- ns: CLIENT_PLUGIN
72
- }),
73
- description: t("danger zone description", {
74
- ns: CLIENT_PLUGIN
75
- })
76
- }, /* @__PURE__ */ React.createElement(ControlGroup, null, /* @__PURE__ */ React.createElement(ControlItem, {
77
- title: t("reset device label"),
78
- description: t("reset device description", {
79
- ns: CLIENT_PLUGIN
80
- })
81
- }, /* @__PURE__ */ React.createElement(Button, {
82
- variant: "destructive",
83
- onClick: handleResetStorage,
84
- "data-testid": "devicesContainer.reset"
85
- }, t("reset device label"))), /* @__PURE__ */ React.createElement(ControlItem, {
86
- title: t("recover identity label"),
87
- description: t("recover identity description", {
88
- ns: CLIENT_PLUGIN
89
- })
90
- }, /* @__PURE__ */ React.createElement(Button, {
91
- variant: "destructive",
92
- onClick: handleRecover,
93
- "data-testid": "devicesContainer.recover"
94
- }, t("recover identity label"))), /* @__PURE__ */ React.createElement(ControlItem, {
95
- title: t("join new identity label"),
96
- description: t("join new identity description", {
97
- ns: CLIENT_PLUGIN
98
- })
99
- }, /* @__PURE__ */ React.createElement(Button, {
100
- variant: "destructive",
101
- onClick: handleJoinNewIdentity,
102
- "data-testid": "devicesContainer.joinExisting"
103
- }, t("join new identity label"))))))));
104
- } finally {
105
- _effect.f();
106
- }
107
- };
108
- var DeviceInvitation = (props) => {
109
- var _effect = _useSignals();
110
- try {
111
- const client = useClient();
112
- const [invitation, setInvitation] = useState();
113
- const onInvitationCreate = useCallback(() => {
114
- const invitation2 = client.halo.share();
115
- if (client.config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
116
- const subscription = invitation2.subscribe((invitation3) => {
117
- const invitationCode = InvitationEncoder.encode(invitation3);
118
- if (invitation3.state === Invitation.State.CONNECTING) {
119
- log.info(JSON.stringify({
120
- invitationCode,
121
- authCode: invitation3.authCode
122
- }), void 0, {
123
- F: __dxlog_file,
124
- L: 141,
125
- S: void 0,
126
- C: (f, a) => f(...a)
127
- });
128
- subscription.unsubscribe();
129
- }
130
- });
131
- }
132
- setInvitation(invitation2);
133
- }, [
134
- client
135
- ]);
136
- const onInvitationDone = useCallback(() => {
137
- setInvitation(void 0);
138
- }, []);
139
- if (invitation) {
140
- return /* @__PURE__ */ React.createElement(DeviceInvitationImpl, {
141
- ...props,
142
- invitation,
143
- onInvitationCreate,
144
- onInvitationDone
145
- });
146
- } else {
147
- return /* @__PURE__ */ React.createElement(InvitationSection, {
148
- ...props,
149
- onInvitationCreate,
150
- onInvitationDone
151
- });
152
- }
153
- } finally {
154
- _effect.f();
155
- }
156
- };
157
- var DeviceInvitationImpl = ({ invitation: invitationObservable, createInvitationUrl, onInvitationDone, onInvitationCreate }) => {
158
- var _effect = _useSignals();
159
- try {
160
- const invitation = useMulticastObservable(invitationObservable);
161
- const url = createInvitationUrl(InvitationEncoder.encode(invitation));
162
- useEffect(() => {
163
- if (invitation.state >= Invitation.State.SUCCESS) {
164
- onInvitationDone();
165
- }
166
- }, [
167
- invitation.state
168
- ]);
169
- return /* @__PURE__ */ React.createElement(InvitationSection, {
170
- ...invitation,
171
- url,
172
- onInvitationDone,
173
- onInvitationCreate
174
- });
175
- } finally {
176
- _effect.f();
177
- }
178
- };
179
- var InvitationSection = ({ state = -1, authCode, invitationId = "never", url = "never", onInvitationDone = () => {
180
- }, onInvitationCreate = () => {
181
- } }) => {
182
- var _effect = _useSignals();
183
- try {
184
- const { t } = useTranslation(CLIENT_PLUGIN);
185
- const activeView = state < 0 ? "init" : state >= Invitation.State.CANCELLED ? "complete" : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode ? "auth-code" : "qr-code";
186
- return activeView === "init" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", {
187
- className: "text-description mbe-2"
188
- }, t("add device description")), /* @__PURE__ */ React.createElement(IconButton, {
189
- icon: "ph--plus--regular",
190
- label: t("create device invitation label"),
191
- disabled: state >= 0,
192
- classNames: "is-full",
193
- "data-testid": "devicesContainer.createInvitation",
194
- onClick: onInvitationCreate
195
- })) : /* @__PURE__ */ React.createElement(Viewport.Root, {
196
- activeView
197
- }, /* @__PURE__ */ React.createElement(Viewport.Views, null, /* @__PURE__ */ React.createElement(Viewport.View, {
198
- id: "init"
199
- }), /* @__PURE__ */ React.createElement(Viewport.View, {
200
- id: "complete"
201
- }, /* @__PURE__ */ React.createElement(InvitationComplete, {
202
- statusValue: state
203
- })), /* @__PURE__ */ React.createElement(Viewport.View, {
204
- id: "auth-code"
205
- }, /* @__PURE__ */ React.createElement(InvitationAuthCode, {
206
- id: invitationId,
207
- code: authCode ?? "never",
208
- onCancel: onInvitationDone
209
- })), /* @__PURE__ */ React.createElement(Viewport.View, {
210
- id: "qr-code"
211
- }, /* @__PURE__ */ React.createElement(InvitationQR, {
212
- id: invitationId,
213
- url,
214
- onCancel: onInvitationDone
215
- }))));
216
- } finally {
217
- _effect.f();
218
- }
219
- };
220
- var InvitationQR = ({ id, url, onCancel }) => {
221
- var _effect = _useSignals();
222
- try {
223
- const { t } = useTranslation("os");
224
- const qrLabel = useId("devices-container__qr-code");
225
- const emoji = hexToEmoji(id);
226
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", {
227
- className: "text-description"
228
- }, t("qr code description", {
229
- ns: CLIENT_PLUGIN
230
- })), /* @__PURE__ */ React.createElement("div", {
231
- role: "group",
232
- className: "grid grid-cols-[1fr_min-content] mlb-2 gap-2"
233
- }, /* @__PURE__ */ React.createElement("div", {
234
- role: "none",
235
- className: "is-full aspect-square relative text-description"
236
- }, /* @__PURE__ */ React.createElement(QR, {
237
- rounding: 100,
238
- backgroundColor: "transparent",
239
- color: "currentColor",
240
- "aria-labelledby": qrLabel,
241
- errorCorrectionLevel: "Q",
242
- cutout: true
243
- }, url ?? "never"), /* @__PURE__ */ React.createElement(Centered, null, /* @__PURE__ */ React.createElement(Emoji, {
244
- text: emoji
245
- }))), /* @__PURE__ */ React.createElement("span", {
246
- id: qrLabel,
247
- className: "sr-only"
248
- }, t("qr label"))), /* @__PURE__ */ React.createElement("div", {
249
- className: "flex justify-center"
250
- }, /* @__PURE__ */ React.createElement("div", {
251
- className: "flex gap-2"
252
- }, /* @__PURE__ */ React.createElement(Clipboard.Button, {
253
- value: url ?? "never"
254
- }), /* @__PURE__ */ React.createElement(Button, {
255
- variant: "ghost",
256
- onClick: onCancel
257
- }, t("cancel label")))));
258
- } finally {
259
- _effect.f();
260
- }
261
- };
262
- var InvitationAuthCode = ({ id, code, onCancel }) => {
263
- var _effect = _useSignals();
264
- try {
265
- const { t } = useTranslation("os");
266
- const emoji = hexToEmoji(id);
267
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", {
268
- className: "text-description"
269
- }, t("auth other device emoji message")), emoji && /* @__PURE__ */ React.createElement(Emoji, {
270
- text: emoji,
271
- className: "mli-auto mlb-2 text-center"
272
- }), /* @__PURE__ */ React.createElement("p", {
273
- className: "text-description"
274
- }, t("auth code message")), /* @__PURE__ */ React.createElement(AuthCode, {
275
- code,
276
- large: true,
277
- classNames: "mli-auto mlb-2 text-center grow"
278
- }), /* @__PURE__ */ React.createElement(Button, {
279
- variant: "ghost",
280
- onClick: onCancel
281
- }, t("cancel label")));
282
- } finally {
283
- _effect.f();
284
- }
285
- };
286
- var InvitationComplete = ({ statusValue }) => {
287
- var _effect = _useSignals();
288
- try {
289
- return statusValue > 0 ? /* @__PURE__ */ React.createElement(Check, {
290
- className: mx("m-1.5", getSize(6))
291
- }) : /* @__PURE__ */ React.createElement(X, {
292
- className: mx("m-1.5", getSize(6))
293
- });
294
- } finally {
295
- _effect.f();
296
- }
297
- };
298
-
299
- // packages/plugins/plugin-client/src/components/JoinDialog.tsx
300
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
301
- import React2, { useCallback as useCallback2 } from "react";
302
- import { createIntent as createIntent2, LayoutAction, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
303
- import { ObservabilityAction } from "@dxos/plugin-observability/types";
304
- import { Dialog, useTranslation as useTranslation2 } from "@dxos/react-ui";
305
- import { JoinPanel } from "@dxos/shell/react";
306
- var JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;
307
- var JoinDialog = (props) => {
308
- var _effect = _useSignals2();
309
- try {
310
- const { dispatchPromise: dispatch } = useIntentDispatcher2();
311
- const { t } = useTranslation2(CLIENT_PLUGIN);
312
- const handleCancelResetStorage = useCallback2(() => dispatch(createIntent2(ClientAction.ShareIdentity)), [
313
- dispatch
314
- ]);
315
- const handleDone = useCallback2(async (result) => {
316
- if (result?.identityKey) {
317
- await Promise.all([
318
- dispatch(createIntent2(LayoutAction.UpdateDialog, {
319
- part: "dialog",
320
- options: {
321
- state: false
322
- }
323
- })),
324
- dispatch(createIntent2(ObservabilityAction.SendEvent, {
325
- name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
326
- }))
327
- ]);
328
- }
329
- }, [
330
- dispatch
331
- ]);
332
- return /* @__PURE__ */ React2.createElement(Dialog.Content, null, /* @__PURE__ */ React2.createElement(Dialog.Title, {
333
- classNames: "sr-only"
334
- }, t("join space label", {
335
- ns: "os"
336
- })), /* @__PURE__ */ React2.createElement(JoinPanel, {
337
- mode: "halo-only",
338
- ...props,
339
- exitActionParent: /* @__PURE__ */ React2.createElement(Dialog.Close, {
340
- asChild: true
341
- }),
342
- doneActionParent: /* @__PURE__ */ React2.createElement(Dialog.Close, {
343
- asChild: true
344
- }),
345
- onCancelResetStorage: handleCancelResetStorage,
346
- onDone: handleDone
347
- }));
348
- } finally {
349
- _effect.f();
350
- }
351
- };
352
-
353
- // packages/plugins/plugin-client/src/components/ProfileContainer.tsx
354
- import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
355
- import { Schema } from "effect";
356
- import React3, { useCallback as useCallback3, useMemo, useState as useState2 } from "react";
357
- import { debounce } from "@dxos/async";
358
- import { useClient as useClient2 } from "@dxos/react-client";
359
- import { useIdentity } from "@dxos/react-client/halo";
360
- import { ButtonGroup, Clipboard as Clipboard2, Input, useTranslation as useTranslation3 } from "@dxos/react-ui";
361
- import { Form, ControlItem as ControlItem2, ControlItemInput, ControlSection as ControlSection2, ControlPage as ControlPage2 } from "@dxos/react-ui-form";
362
- import { EmojiPickerBlock, HuePicker } from "@dxos/react-ui-pickers";
363
- import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
364
- import { hexToHue, hexToEmoji as hexToEmoji2 } from "@dxos/util";
365
- var getDefaultHueValue = (identity) => hexToHue(identity?.identityKey.toHex() ?? "0");
366
- var getDefaultEmojiValue = (identity) => hexToEmoji2(identity?.identityKey.toHex() ?? "0");
367
- var getHueValue = (identity) => identity?.profile?.data?.hue || getDefaultHueValue(identity);
368
- var getEmojiValue = (identity) => identity?.profile?.data?.emoji || getDefaultEmojiValue(identity);
369
- var ProfileContainer = () => {
370
- var _effect = _useSignals3();
371
- try {
372
- const { t } = useTranslation3(CLIENT_PLUGIN);
373
- const client = useClient2();
374
- const identity = useIdentity();
375
- const [displayName, setDisplayNameDirectly] = useState2(identity?.profile?.displayName ?? "");
376
- const [emoji, setEmojiDirectly] = useState2(getEmojiValue(identity));
377
- const [hue, setHueDirectly] = useState2(getHueValue(identity));
378
- const updateProfile = useMemo(() => debounce((profile) => client.halo.updateProfile({
379
- displayName: profile.displayName,
380
- data: {
381
- emoji: profile.emoji,
382
- hue: profile.hue
383
- }
384
- }), 2e3), []);
385
- const handleSave = useCallback3((profile) => {
386
- setDisplayNameDirectly(profile.displayName);
387
- setEmojiDirectly(profile.emoji);
388
- setHueDirectly(profile.hue);
389
- updateProfile(profile);
390
- }, [
391
- identity
392
- ]);
393
- const values = useMemo(() => ({
394
- displayName,
395
- emoji,
396
- hue,
397
- did: identity?.did
398
- }), [
399
- identity,
400
- displayName,
401
- emoji,
402
- hue
403
- ]);
404
- const customElements = useMemo(() => ({
405
- displayName: ({ type, label, getValue, onValueChange }) => {
406
- const handleChange = useCallback3(({ target: { value } }) => onValueChange(type, value), [
407
- onValueChange,
408
- type
409
- ]);
410
- return /* @__PURE__ */ React3.createElement(ControlItemInput, {
411
- title: label,
412
- description: t("display name description")
413
- }, /* @__PURE__ */ React3.createElement(Input.TextInput, {
414
- value: getValue(),
415
- onChange: handleChange,
416
- placeholder: t("display name input placeholder"),
417
- classNames: "min-is-64"
418
- }));
419
- },
420
- emoji: ({ type, label, getValue, onValueChange }) => {
421
- const handleChange = useCallback3((nextEmoji) => onValueChange(type, nextEmoji), [
422
- onValueChange,
423
- type
424
- ]);
425
- const handleEmojiReset = useCallback3(() => onValueChange(type, getDefaultEmojiValue(identity)), [
426
- onValueChange,
427
- type
428
- ]);
429
- return /* @__PURE__ */ React3.createElement(ControlItem2, {
430
- title: label,
431
- description: t("icon description")
432
- }, /* @__PURE__ */ React3.createElement(EmojiPickerBlock, {
433
- triggerVariant: "default",
434
- emoji: getValue(),
435
- onChangeEmoji: handleChange,
436
- onClickClear: handleEmojiReset,
437
- classNames: "justify-self-end"
438
- }));
439
- },
440
- hue: ({ type, label, getValue, onValueChange }) => {
441
- const handleChange = useCallback3((nextHue) => onValueChange(type, nextHue), [
442
- onValueChange,
443
- type
444
- ]);
445
- const handleHueReset = useCallback3(() => onValueChange(type, getDefaultHueValue(identity)), [
446
- onValueChange,
447
- type
448
- ]);
449
- return /* @__PURE__ */ React3.createElement(ControlItem2, {
450
- title: label,
451
- description: t("hue description")
452
- }, /* @__PURE__ */ React3.createElement(HuePicker, {
453
- value: getValue(),
454
- onChange: handleChange,
455
- onReset: handleHueReset,
456
- classNames: "[--hue-preview-size:1.5rem] justify-self-end"
457
- }));
458
- },
459
- // TODO(wittjosiah): We need text input annotations for disabled and copyable.
460
- did: ({ label, getValue }) => {
461
- return /* @__PURE__ */ React3.createElement(ControlItemInput, {
462
- title: label,
463
- description: t("did description")
464
- }, /* @__PURE__ */ React3.createElement(ButtonGroup, null, /* @__PURE__ */ React3.createElement(Input.TextInput, {
465
- value: getValue(),
466
- disabled: true,
467
- classNames: "min-is-64"
468
- }), /* @__PURE__ */ React3.createElement(Clipboard2.IconButton, {
469
- value: getValue() ?? ""
470
- })));
471
- }
472
- }), [
473
- t
474
- ]);
475
- return /* @__PURE__ */ React3.createElement(StackItem2.Content, {
476
- classNames: "block overflow-y-auto"
477
- }, /* @__PURE__ */ React3.createElement(ControlPage2, null, /* @__PURE__ */ React3.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React3.createElement(ControlSection2, {
478
- title: t("profile label"),
479
- description: t("profile description")
480
- }, /* @__PURE__ */ React3.createElement(Form, {
481
- schema: ProfileSchema,
482
- values,
483
- autoSave: true,
484
- onSave: handleSave,
485
- Custom: customElements,
486
- classNames: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content] gap-4",
487
- outerSpacing: false
488
- })))));
489
- } finally {
490
- _effect.f();
491
- }
492
- };
493
- var ProfileSchema = Schema.Struct({
494
- displayName: Schema.String.annotations({
495
- title: "Display name"
496
- }),
497
- emoji: Schema.String.annotations({
498
- title: "Avatar"
499
- }),
500
- hue: Schema.String.annotations({
501
- title: "Color"
502
- }),
503
- did: Schema.String.annotations({
504
- title: "DID"
505
- })
506
- });
507
-
508
- // packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx
509
- import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
510
- import React4, { useCallback as useCallback4, useState as useState3 } from "react";
511
- import { AlertDialog, Button as Button2, Clipboard as Clipboard3, Input as Input2, useTranslation as useTranslation4 } from "@dxos/react-ui";
512
- var RECOVERY_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;
513
- var RecoveryCodeDialog = ({ code }) => {
514
- var _effect = _useSignals4();
515
- try {
516
- const { t } = useTranslation4(CLIENT_PLUGIN);
517
- const [confirmation, setConfirmation] = useState3(false);
518
- const handleConfirmation = useCallback4((checked) => setConfirmation(checked), []);
519
- return /* @__PURE__ */ React4.createElement(AlertDialog.Content, {
520
- classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
521
- }, /* @__PURE__ */ React4.createElement(AlertDialog.Title, null, t("recovery code dialog title")), /* @__PURE__ */ React4.createElement("p", {
522
- className: "py-4"
523
- }, t("recovery code dialog description")), /* @__PURE__ */ React4.createElement(Clipboard3.Provider, null, /* @__PURE__ */ React4.createElement(Code, {
524
- code
525
- })), /* @__PURE__ */ React4.createElement("div", {
526
- className: "flex flex-col py-4 gap-2"
527
- }, /* @__PURE__ */ React4.createElement("p", null, t("recovery code dialog warning 1")), /* @__PURE__ */ React4.createElement("p", null, t("recovery code dialog warning 2"))), /* @__PURE__ */ React4.createElement("div", {
528
- className: "flex items-center gap-2 pbe-4"
529
- }, /* @__PURE__ */ React4.createElement(Input2.Root, null, /* @__PURE__ */ React4.createElement(Input2.Checkbox, {
530
- "data-testid": "recoveryCode.confirm",
531
- checked: confirmation,
532
- onCheckedChange: handleConfirmation
533
- }), /* @__PURE__ */ React4.createElement(Input2.Label, null, t("recovery code confirmation label")))), /* @__PURE__ */ React4.createElement("div", {
534
- className: "flex justify-end"
535
- }, /* @__PURE__ */ React4.createElement(AlertDialog.Action, {
536
- asChild: true
537
- }, /* @__PURE__ */ React4.createElement(Button2, {
538
- "data-testid": "recoveryCode.continue",
539
- variant: "primary",
540
- disabled: !confirmation
541
- }, t("continue label")))));
542
- } finally {
543
- _effect.f();
544
- }
545
- };
546
- var Code = ({ code }) => {
547
- var _effect = _useSignals4();
548
- try {
549
- const words = code.split(" ");
550
- return /* @__PURE__ */ React4.createElement("div", {
551
- className: "relative p-2 border border-separator rounded group"
552
- }, /* @__PURE__ */ React4.createElement(Clipboard3.IconButton, {
553
- value: code,
554
- classNames: "absolute top-2 right-2 invisible group-hover:visible"
555
- }), /* @__PURE__ */ React4.createElement("div", {
556
- className: "grid grid-cols-4"
557
- }, words.map((word, i) => /* @__PURE__ */ React4.createElement("div", {
558
- key: i,
559
- className: "flex items-center p-2 gap-2"
560
- }, /* @__PURE__ */ React4.createElement("div", {
561
- className: "w-4 text-xs text-center text-subdued"
562
- }, i + 1), /* @__PURE__ */ React4.createElement("div", {
563
- className: "text-sm"
564
- }, word)))));
565
- } finally {
566
- _effect.f();
567
- }
568
- };
569
-
570
- // packages/plugins/plugin-client/src/components/RecoveryCredentialsContainer.tsx
571
- import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
572
- import React5 from "react";
573
- import { createIntent as createIntent3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
574
- import { useCredentials } from "@dxos/react-client/halo";
575
- import { Icon, IconButton as IconButton2, List as List2, ListItem, useTranslation as useTranslation5, Message } from "@dxos/react-ui";
576
- import { ControlGroup as ControlGroup2, ControlItem as ControlItem3, ControlPage as ControlPage3, ControlSection as ControlSection3 } from "@dxos/react-ui-form";
577
- import { StackItem as StackItem3 } from "@dxos/react-ui-stack";
578
- var MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;
579
- var RecoveryCredentialsContainer = () => {
580
- var _effect = _useSignals5();
581
- try {
582
- const { t } = useTranslation5(CLIENT_PLUGIN);
583
- const { dispatchPromise: dispatch } = useIntentDispatcher3();
584
- const credentials = useCredentials();
585
- const recoveryCredentials = credentials.filter((credential) => credential.subject.assertion["@type"] === "dxos.halo.credentials.IdentityRecovery");
586
- return /* @__PURE__ */ React5.createElement(StackItem3.Content, {
587
- classNames: "block overflow-y-auto"
588
- }, /* @__PURE__ */ React5.createElement(ControlPage3, null, /* @__PURE__ */ React5.createElement(ControlSection3, {
589
- title: t("recovery setup dialog title"),
590
- description: t("recovery setup dialog description")
591
- }, /* @__PURE__ */ React5.createElement(ControlGroup2, null, /* @__PURE__ */ React5.createElement(ControlItem3, {
592
- title: t("create passkey label"),
593
- description: t("create passkey description")
594
- }, /* @__PURE__ */ React5.createElement(IconButton2, {
595
- label: t("create passkey label"),
596
- icon: "ph--key--duotone",
597
- variant: "primary",
598
- size: 5,
599
- onClick: () => dispatch(createIntent3(ClientAction.CreatePasskey))
600
- })), /* @__PURE__ */ React5.createElement(ControlItem3, {
601
- title: t("create recovery code label"),
602
- description: t("create recovery code description")
603
- }, /* @__PURE__ */ React5.createElement(IconButton2, {
604
- label: t("create recovery code label"),
605
- icon: "ph--receipt--duotone",
606
- variant: "default",
607
- size: 5,
608
- onClick: () => dispatch(createIntent3(ClientAction.CreateRecoveryCode))
609
- })))), /* @__PURE__ */ React5.createElement(ControlSection3, {
610
- title: t("credentials list label")
611
- }, recoveryCredentials.length < 1 ? /* @__PURE__ */ React5.createElement(Message.Root, {
612
- valence: "error",
613
- classNames: "container-max-width"
614
- }, /* @__PURE__ */ React5.createElement(Message.Title, {
615
- icon: "ph--shield-warning--duotone"
616
- }, t("no credentials title")), /* @__PURE__ */ React5.createElement(Message.Content, null, t("no credentials message"))) : /* @__PURE__ */ React5.createElement(List2, {
617
- classNames: "container-max-width pli-2"
618
- }, recoveryCredentials.map((credential) => /* @__PURE__ */ React5.createElement(ListItem.Root, {
619
- key: credential.id?.toHex()
620
- }, /* @__PURE__ */ React5.createElement(ListItem.Endcap, null, /* @__PURE__ */ React5.createElement(Icon, {
621
- icon: "ph--key--regular",
622
- size: 5
623
- })), /* @__PURE__ */ React5.createElement(ListItem.Heading, null, credential.issuanceDate.toLocaleString())))))));
624
- } finally {
625
- _effect.f();
626
- }
627
- };
628
-
629
- // packages/plugins/plugin-client/src/components/ResetDialog.tsx
630
- import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
631
- import React6, { useCallback as useCallback5 } from "react";
632
- import { createIntent as createIntent4, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
633
- import { useClient as useClient3 } from "@dxos/react-client";
634
- import { Dialog as Dialog2, useTranslation as useTranslation6 } from "@dxos/react-ui";
635
- import { ConfirmReset } from "@dxos/shell/react";
636
- var RESET_DIALOG = `${CLIENT_PLUGIN}/ResetDialog`;
637
- var ResetDialog = ({ mode, onReset }) => {
638
- var _effect = _useSignals6();
639
- try {
640
- const { t } = useTranslation6(CLIENT_PLUGIN);
641
- const { dispatchPromise: dispatch } = useIntentDispatcher4();
642
- const client = useClient3();
643
- const handleReset = useCallback5(async () => {
644
- await client.reset();
645
- const target = mode === "join new identity" ? "deviceInvitation" : mode === "recover" ? "recoverIdentity" : void 0;
646
- await onReset?.({
647
- target
648
- });
649
- }, [
650
- dispatch,
651
- client,
652
- mode,
653
- onReset
654
- ]);
655
- const handleCancel = useCallback5(() => {
656
- void dispatch(createIntent4(LayoutAction2.UpdateDialog, {
657
- part: "dialog",
658
- options: {
659
- state: false
660
- }
661
- }));
662
- }, [
663
- dispatch
664
- ]);
665
- return /* @__PURE__ */ React6.createElement(Dialog2.Content, {
666
- classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
667
- }, /* @__PURE__ */ React6.createElement(Dialog2.Title, {
668
- classNames: "sr-only"
669
- }, t("reset dialog title")), /* @__PURE__ */ React6.createElement(Dialog2.Description, {
670
- classNames: "sr-only"
671
- }, t("reset dialog description")), /* @__PURE__ */ React6.createElement(ConfirmReset, {
672
- active: true,
673
- mode,
674
- onConfirm: handleReset,
675
- onCancel: handleCancel
676
- }));
677
- } finally {
678
- _effect.f();
679
- }
680
- };
681
-
682
- export {
683
- DevicesContainer,
684
- JOIN_DIALOG,
685
- JoinDialog,
686
- ProfileContainer,
687
- RECOVERY_CODE_DIALOG,
688
- RecoveryCodeDialog,
689
- RecoveryCredentialsContainer,
690
- RESET_DIALOG,
691
- ResetDialog
692
- };
693
- //# sourceMappingURL=chunk-5MC5HCIM.mjs.map