@dxos/plugin-client 0.8.4-main.f9ba587 → 0.8.4-main.fcc0d83b33

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 (498) hide show
  1. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  2. package/dist/lib/browser/chunk-M37DHX5L.mjs +131 -0
  3. package/dist/lib/browser/chunk-M37DHX5L.mjs.map +7 -0
  4. package/dist/lib/browser/chunk-RPMM5NKJ.mjs +175 -0
  5. package/dist/lib/browser/chunk-RPMM5NKJ.mjs.map +7 -0
  6. package/dist/lib/browser/chunk-VAIJSQYA.mjs +12 -0
  7. package/dist/lib/browser/chunk-VAIJSQYA.mjs.map +7 -0
  8. package/dist/lib/browser/cli/index.mjs +1027 -0
  9. package/dist/lib/browser/cli/index.mjs.map +7 -0
  10. package/dist/lib/browser/create-agent-JV3EM3TV.mjs +26 -0
  11. package/dist/lib/browser/create-agent-JV3EM3TV.mjs.map +7 -0
  12. package/dist/lib/browser/create-identity-ZITQKEVZ.mjs +30 -0
  13. package/dist/lib/browser/create-identity-ZITQKEVZ.mjs.map +7 -0
  14. package/dist/lib/browser/create-passkey-NCP4XA7C.mjs +81 -0
  15. package/dist/lib/browser/create-passkey-NCP4XA7C.mjs.map +7 -0
  16. package/dist/lib/browser/create-recovery-code-L5LA3GAP.mjs +36 -0
  17. package/dist/lib/browser/create-recovery-code-L5LA3GAP.mjs.map +7 -0
  18. package/dist/lib/browser/index.mjs +62 -141
  19. package/dist/lib/browser/index.mjs.map +4 -4
  20. package/dist/lib/browser/join-identity-3W6PJLKN.mjs +27 -0
  21. package/dist/lib/browser/join-identity-3W6PJLKN.mjs.map +7 -0
  22. package/dist/lib/browser/meta.json +1 -1
  23. package/dist/lib/browser/operations/index.mjs +13 -0
  24. package/dist/lib/browser/operations/index.mjs.map +7 -0
  25. package/dist/lib/browser/recover-identity-KL6QY4GI.mjs +26 -0
  26. package/dist/lib/browser/recover-identity-KL6QY4GI.mjs.map +7 -0
  27. package/dist/lib/browser/redeem-passkey-NDEWSJTM.mjs +66 -0
  28. package/dist/lib/browser/redeem-passkey-NDEWSJTM.mjs.map +7 -0
  29. package/dist/lib/browser/redeem-token-YLWAVFXD.mjs +29 -0
  30. package/dist/lib/browser/redeem-token-YLWAVFXD.mjs.map +7 -0
  31. package/dist/lib/browser/reset-storage-OBHEGA6Z.mjs +26 -0
  32. package/dist/lib/browser/reset-storage-OBHEGA6Z.mjs.map +7 -0
  33. package/dist/lib/browser/share-identity-FTFHFSZQ.mjs +31 -0
  34. package/dist/lib/browser/share-identity-FTFHFSZQ.mjs.map +7 -0
  35. package/dist/lib/browser/testing/index.mjs +22 -0
  36. package/dist/lib/browser/testing/index.mjs.map +7 -0
  37. package/dist/lib/browser/translations.mjs +74 -0
  38. package/dist/lib/browser/translations.mjs.map +7 -0
  39. package/dist/lib/browser/types/index.mjs +14 -0
  40. package/dist/lib/node-esm/chunk-G77YYPR6.mjs +176 -0
  41. package/dist/lib/node-esm/chunk-G77YYPR6.mjs.map +7 -0
  42. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  43. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  44. package/dist/lib/node-esm/chunk-OHKM7GJW.mjs +14 -0
  45. package/dist/lib/node-esm/chunk-OHKM7GJW.mjs.map +7 -0
  46. package/dist/lib/node-esm/{chunk-GDJMDBWM.mjs → chunk-UBY7FBQ7.mjs} +39 -18
  47. package/dist/lib/node-esm/chunk-UBY7FBQ7.mjs.map +7 -0
  48. package/dist/lib/node-esm/cli/index.mjs +1028 -0
  49. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  50. package/dist/lib/node-esm/create-agent-Y4BPVDV7.mjs +27 -0
  51. package/dist/lib/node-esm/create-agent-Y4BPVDV7.mjs.map +7 -0
  52. package/dist/lib/node-esm/create-identity-367SQSX6.mjs +31 -0
  53. package/dist/lib/node-esm/create-identity-367SQSX6.mjs.map +7 -0
  54. package/dist/lib/node-esm/create-passkey-WMWK2ETT.mjs +82 -0
  55. package/dist/lib/node-esm/create-passkey-WMWK2ETT.mjs.map +7 -0
  56. package/dist/lib/node-esm/create-recovery-code-VJGE5HJL.mjs +37 -0
  57. package/dist/lib/node-esm/create-recovery-code-VJGE5HJL.mjs.map +7 -0
  58. package/dist/lib/node-esm/index.mjs +62 -141
  59. package/dist/lib/node-esm/index.mjs.map +4 -4
  60. package/dist/lib/node-esm/join-identity-IRIRO2VT.mjs +28 -0
  61. package/dist/lib/node-esm/join-identity-IRIRO2VT.mjs.map +7 -0
  62. package/dist/lib/node-esm/meta.json +1 -1
  63. package/dist/lib/node-esm/operations/index.mjs +14 -0
  64. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  65. package/dist/lib/node-esm/recover-identity-LJCY4BCJ.mjs +27 -0
  66. package/dist/lib/node-esm/recover-identity-LJCY4BCJ.mjs.map +7 -0
  67. package/dist/lib/node-esm/redeem-passkey-PT7QWFJE.mjs +67 -0
  68. package/dist/lib/node-esm/redeem-passkey-PT7QWFJE.mjs.map +7 -0
  69. package/dist/lib/node-esm/redeem-token-BHKHEXJM.mjs +30 -0
  70. package/dist/lib/node-esm/redeem-token-BHKHEXJM.mjs.map +7 -0
  71. package/dist/lib/node-esm/reset-storage-VPUZJOUV.mjs +27 -0
  72. package/dist/lib/node-esm/reset-storage-VPUZJOUV.mjs.map +7 -0
  73. package/dist/lib/node-esm/share-identity-SZ3REIRC.mjs +32 -0
  74. package/dist/lib/node-esm/share-identity-SZ3REIRC.mjs.map +7 -0
  75. package/dist/lib/node-esm/testing/index.mjs +23 -0
  76. package/dist/lib/node-esm/testing/index.mjs.map +7 -0
  77. package/dist/lib/node-esm/translations.mjs +75 -0
  78. package/dist/lib/node-esm/translations.mjs.map +7 -0
  79. package/dist/lib/node-esm/types/index.mjs +15 -0
  80. package/dist/lib/node-esm/types/index.mjs.map +7 -0
  81. package/dist/types/src/ClientPlugin.d.ts +3 -2
  82. package/dist/types/src/ClientPlugin.d.ts.map +1 -1
  83. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  84. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/client.d.ts +6 -7
  86. package/dist/types/src/capabilities/client.d.ts.map +1 -1
  87. package/dist/types/src/capabilities/index.d.ts +28 -15
  88. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  89. package/dist/types/src/capabilities/migrations.d.ts +3 -2
  90. package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
  91. package/dist/types/src/capabilities/navigation-handler/index.d.ts +4 -0
  92. package/dist/types/src/capabilities/navigation-handler/index.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts +15 -0
  94. package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/node.d.ts +21 -0
  96. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  98. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  99. package/dist/types/src/capabilities/react-context.d.ts +4 -2
  100. package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
  101. package/dist/types/src/capabilities/react-surface.d.ts +4 -3
  102. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  103. package/dist/types/src/capabilities/schema-defs.d.ts +3 -2
  104. package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
  105. package/dist/types/src/cli/commands/config/index.d.ts +5 -0
  106. package/dist/types/src/cli/commands/config/index.d.ts.map +1 -0
  107. package/dist/types/src/cli/commands/config/view.d.ts +5 -0
  108. package/dist/types/src/cli/commands/config/view.d.ts.map +1 -0
  109. package/dist/types/src/cli/commands/device/index.d.ts +7 -0
  110. package/dist/types/src/cli/commands/device/index.d.ts.map +1 -0
  111. package/dist/types/src/cli/commands/device/info/index.d.ts +2 -0
  112. package/dist/types/src/cli/commands/device/info/index.d.ts.map +1 -0
  113. package/dist/types/src/cli/commands/device/info/info.d.ts +7 -0
  114. package/dist/types/src/cli/commands/device/info/info.d.ts.map +1 -0
  115. package/dist/types/src/cli/commands/device/info/info.test.d.ts +2 -0
  116. package/dist/types/src/cli/commands/device/info/info.test.d.ts.map +1 -0
  117. package/dist/types/src/cli/commands/device/list/index.d.ts +2 -0
  118. package/dist/types/src/cli/commands/device/list/index.d.ts.map +1 -0
  119. package/dist/types/src/cli/commands/device/list/list.d.ts +7 -0
  120. package/dist/types/src/cli/commands/device/list/list.d.ts.map +1 -0
  121. package/dist/types/src/cli/commands/device/list/list.test.d.ts +2 -0
  122. package/dist/types/src/cli/commands/device/list/list.test.d.ts.map +1 -0
  123. package/dist/types/src/cli/commands/device/update/index.d.ts +2 -0
  124. package/dist/types/src/cli/commands/device/update/index.d.ts.map +1 -0
  125. package/dist/types/src/cli/commands/device/update/update.d.ts +11 -0
  126. package/dist/types/src/cli/commands/device/update/update.d.ts.map +1 -0
  127. package/dist/types/src/cli/commands/device/util.d.ts +16 -0
  128. package/dist/types/src/cli/commands/device/util.d.ts.map +1 -0
  129. package/dist/types/src/cli/commands/edge/index.d.ts +5 -0
  130. package/dist/types/src/cli/commands/edge/index.d.ts.map +1 -0
  131. package/dist/types/src/cli/commands/edge/status.d.ts +7 -0
  132. package/dist/types/src/cli/commands/edge/status.d.ts.map +1 -0
  133. package/dist/types/src/cli/commands/halo/create/create.d.ts +15 -0
  134. package/dist/types/src/cli/commands/halo/create/create.d.ts.map +1 -0
  135. package/dist/types/src/cli/commands/halo/create/create.test.d.ts +2 -0
  136. package/dist/types/src/cli/commands/halo/create/create.test.d.ts.map +1 -0
  137. package/dist/types/src/cli/commands/halo/create/index.d.ts +2 -0
  138. package/dist/types/src/cli/commands/halo/create/index.d.ts.map +1 -0
  139. package/dist/types/src/cli/commands/halo/credential/add/add.d.ts +13 -0
  140. package/dist/types/src/cli/commands/halo/credential/add/add.d.ts.map +1 -0
  141. package/dist/types/src/cli/commands/halo/credential/add/index.d.ts +2 -0
  142. package/dist/types/src/cli/commands/halo/credential/add/index.d.ts.map +1 -0
  143. package/dist/types/src/cli/commands/halo/credential/index.d.ts +12 -0
  144. package/dist/types/src/cli/commands/halo/credential/index.d.ts.map +1 -0
  145. package/dist/types/src/cli/commands/halo/credential/list/index.d.ts +2 -0
  146. package/dist/types/src/cli/commands/halo/credential/list/index.d.ts.map +1 -0
  147. package/dist/types/src/cli/commands/halo/credential/list/list.d.ts +19 -0
  148. package/dist/types/src/cli/commands/halo/credential/list/list.d.ts.map +1 -0
  149. package/dist/types/src/cli/commands/halo/credential/list/list.test.d.ts +2 -0
  150. package/dist/types/src/cli/commands/halo/credential/list/list.test.d.ts.map +1 -0
  151. package/dist/types/src/cli/commands/halo/identity/identity.d.ts +7 -0
  152. package/dist/types/src/cli/commands/halo/identity/identity.d.ts.map +1 -0
  153. package/dist/types/src/cli/commands/halo/identity/identity.test.d.ts +2 -0
  154. package/dist/types/src/cli/commands/halo/identity/identity.test.d.ts.map +1 -0
  155. package/dist/types/src/cli/commands/halo/identity/index.d.ts +2 -0
  156. package/dist/types/src/cli/commands/halo/identity/index.d.ts.map +1 -0
  157. package/dist/types/src/cli/commands/halo/index.d.ts +3 -0
  158. package/dist/types/src/cli/commands/halo/index.d.ts.map +1 -0
  159. package/dist/types/src/cli/commands/halo/join/index.d.ts +2 -0
  160. package/dist/types/src/cli/commands/halo/join/index.d.ts.map +1 -0
  161. package/dist/types/src/cli/commands/halo/join/join.d.ts +8 -0
  162. package/dist/types/src/cli/commands/halo/join/join.d.ts.map +1 -0
  163. package/dist/types/src/cli/commands/halo/join/join.test.d.ts +2 -0
  164. package/dist/types/src/cli/commands/halo/join/join.test.d.ts.map +1 -0
  165. package/dist/types/src/cli/commands/halo/keys/index.d.ts +2 -0
  166. package/dist/types/src/cli/commands/halo/keys/index.d.ts.map +1 -0
  167. package/dist/types/src/cli/commands/halo/keys/keys.d.ts +7 -0
  168. package/dist/types/src/cli/commands/halo/keys/keys.d.ts.map +1 -0
  169. package/dist/types/src/cli/commands/halo/keys/keys.test.d.ts +2 -0
  170. package/dist/types/src/cli/commands/halo/keys/keys.test.d.ts.map +1 -0
  171. package/dist/types/src/cli/commands/halo/recover/index.d.ts +2 -0
  172. package/dist/types/src/cli/commands/halo/recover/index.d.ts.map +1 -0
  173. package/dist/types/src/cli/commands/halo/recover/recover.d.ts +7 -0
  174. package/dist/types/src/cli/commands/halo/recover/recover.d.ts.map +1 -0
  175. package/dist/types/src/cli/commands/halo/recover/recover.test.d.ts +2 -0
  176. package/dist/types/src/cli/commands/halo/recover/recover.test.d.ts.map +1 -0
  177. package/dist/types/src/cli/commands/halo/seed/index.d.ts +2 -0
  178. package/dist/types/src/cli/commands/halo/seed/index.d.ts.map +1 -0
  179. package/dist/types/src/cli/commands/halo/seed/seed.d.ts +7 -0
  180. package/dist/types/src/cli/commands/halo/seed/seed.d.ts.map +1 -0
  181. package/dist/types/src/cli/commands/halo/share/index.d.ts +2 -0
  182. package/dist/types/src/cli/commands/halo/share/index.d.ts.map +1 -0
  183. package/dist/types/src/cli/commands/halo/share/share.d.ts +15 -0
  184. package/dist/types/src/cli/commands/halo/share/share.d.ts.map +1 -0
  185. package/dist/types/src/cli/commands/halo/update/index.d.ts +2 -0
  186. package/dist/types/src/cli/commands/halo/update/index.d.ts.map +1 -0
  187. package/dist/types/src/cli/commands/halo/update/update.d.ts +11 -0
  188. package/dist/types/src/cli/commands/halo/update/update.d.ts.map +1 -0
  189. package/dist/types/src/cli/commands/halo/update/update.test.d.ts +2 -0
  190. package/dist/types/src/cli/commands/halo/update/update.test.d.ts.map +1 -0
  191. package/dist/types/src/cli/commands/halo/util.d.ts +13 -0
  192. package/dist/types/src/cli/commands/halo/util.d.ts.map +1 -0
  193. package/dist/types/src/cli/commands/index.d.ts +6 -0
  194. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  195. package/dist/types/src/cli/commands/profile/create.d.ts +10 -0
  196. package/dist/types/src/cli/commands/profile/create.d.ts.map +1 -0
  197. package/dist/types/src/cli/commands/profile/delete.d.ts +8 -0
  198. package/dist/types/src/cli/commands/profile/delete.d.ts.map +1 -0
  199. package/dist/types/src/cli/commands/profile/import.d.ts +17 -0
  200. package/dist/types/src/cli/commands/profile/import.d.ts.map +1 -0
  201. package/dist/types/src/cli/commands/profile/index.d.ts +19 -0
  202. package/dist/types/src/cli/commands/profile/index.d.ts.map +1 -0
  203. package/dist/types/src/cli/commands/profile/inspect.d.ts +13 -0
  204. package/dist/types/src/cli/commands/profile/inspect.d.ts.map +1 -0
  205. package/dist/types/src/cli/commands/profile/list.d.ts +6 -0
  206. package/dist/types/src/cli/commands/profile/list.d.ts.map +1 -0
  207. package/dist/types/src/cli/commands/profile/reset.d.ts +8 -0
  208. package/dist/types/src/cli/commands/profile/reset.d.ts.map +1 -0
  209. package/dist/types/src/cli/commands/profile/util.d.ts +24 -0
  210. package/dist/types/src/cli/commands/profile/util.d.ts.map +1 -0
  211. package/dist/types/src/cli/index.d.ts +2 -0
  212. package/dist/types/src/cli/index.d.ts.map +1 -0
  213. package/dist/types/src/cli/plugin.d.ts +4 -0
  214. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  215. package/dist/types/src/cli/testing/test-console.d.ts +37 -0
  216. package/dist/types/src/cli/testing/test-console.d.ts.map +1 -0
  217. package/dist/types/src/components/index.d.ts +0 -6
  218. package/dist/types/src/components/index.d.ts.map +1 -1
  219. package/dist/types/src/constants.d.ts +4 -0
  220. package/dist/types/src/constants.d.ts.map +1 -0
  221. package/dist/types/src/containers/DevicesContainer/DevicesContainer.d.ts.map +1 -0
  222. package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts +184 -0
  223. package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts.map +1 -0
  224. package/dist/types/src/containers/DevicesContainer/index.d.ts +2 -0
  225. package/dist/types/src/containers/DevicesContainer/index.d.ts.map +1 -0
  226. package/dist/types/src/{components → containers/JoinDialog}/JoinDialog.d.ts +0 -1
  227. package/dist/types/src/containers/JoinDialog/JoinDialog.d.ts.map +1 -0
  228. package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts +15 -0
  229. package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts.map +1 -0
  230. package/dist/types/src/containers/JoinDialog/index.d.ts +2 -0
  231. package/dist/types/src/containers/JoinDialog/index.d.ts.map +1 -0
  232. package/dist/types/src/containers/ProfileContainer/ProfileContainer.d.ts.map +1 -0
  233. package/dist/types/src/containers/ProfileContainer/ProfileContainer.stories.d.ts +14 -0
  234. package/dist/types/src/containers/ProfileContainer/ProfileContainer.stories.d.ts.map +1 -0
  235. package/dist/types/src/containers/ProfileContainer/index.d.ts +2 -0
  236. package/dist/types/src/containers/ProfileContainer/index.d.ts.map +1 -0
  237. package/dist/types/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.d.ts +0 -1
  238. package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.d.ts.map +1 -0
  239. package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.stories.d.ts +16 -0
  240. package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.stories.d.ts.map +1 -0
  241. package/dist/types/src/containers/RecoveryCodeDialog/index.d.ts +4 -0
  242. package/dist/types/src/containers/RecoveryCodeDialog/index.d.ts.map +1 -0
  243. package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.d.ts +4 -0
  244. package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.d.ts.map +1 -0
  245. package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.d.ts +14 -0
  246. package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.d.ts.map +1 -0
  247. package/dist/types/src/containers/RecoveryCredentialsContainer/index.d.ts +2 -0
  248. package/dist/types/src/containers/RecoveryCredentialsContainer/index.d.ts.map +1 -0
  249. package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts +9 -0
  250. package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts.map +1 -0
  251. package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts +19 -0
  252. package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts.map +1 -0
  253. package/dist/types/src/containers/ResetDialog/index.d.ts +4 -0
  254. package/dist/types/src/containers/ResetDialog/index.d.ts.map +1 -0
  255. package/dist/types/src/containers/index.d.ts +10 -0
  256. package/dist/types/src/containers/index.d.ts.map +1 -0
  257. package/dist/types/src/index.d.ts +2 -4
  258. package/dist/types/src/index.d.ts.map +1 -1
  259. package/dist/types/src/meta.d.ts +2 -3
  260. package/dist/types/src/meta.d.ts.map +1 -1
  261. package/dist/types/src/operations/create-agent.d.ts +5 -0
  262. package/dist/types/src/operations/create-agent.d.ts.map +1 -0
  263. package/dist/types/src/operations/create-identity.d.ts +5 -0
  264. package/dist/types/src/operations/create-identity.d.ts.map +1 -0
  265. package/dist/types/src/operations/create-passkey.d.ts +5 -0
  266. package/dist/types/src/operations/create-passkey.d.ts.map +1 -0
  267. package/dist/types/src/operations/create-recovery-code.d.ts +5 -0
  268. package/dist/types/src/operations/create-recovery-code.d.ts.map +1 -0
  269. package/dist/types/src/operations/definitions.d.ts +36 -0
  270. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  271. package/dist/types/src/operations/index.d.ts +4 -0
  272. package/dist/types/src/operations/index.d.ts.map +1 -0
  273. package/dist/types/src/operations/join-identity.d.ts +5 -0
  274. package/dist/types/src/operations/join-identity.d.ts.map +1 -0
  275. package/dist/types/src/operations/recover-identity.d.ts +5 -0
  276. package/dist/types/src/operations/recover-identity.d.ts.map +1 -0
  277. package/dist/types/src/operations/redeem-passkey.d.ts +5 -0
  278. package/dist/types/src/operations/redeem-passkey.d.ts.map +1 -0
  279. package/dist/types/src/operations/redeem-token.d.ts +5 -0
  280. package/dist/types/src/operations/redeem-token.d.ts.map +1 -0
  281. package/dist/types/src/operations/reset-storage.d.ts +5 -0
  282. package/dist/types/src/operations/reset-storage.d.ts.map +1 -0
  283. package/dist/types/src/operations/share-identity.d.ts +5 -0
  284. package/dist/types/src/operations/share-identity.d.ts.map +1 -0
  285. package/dist/types/src/testing/index.d.ts +2 -0
  286. package/dist/types/src/testing/index.d.ts.map +1 -0
  287. package/dist/types/src/testing/initializeIdentity.d.ts +13 -0
  288. package/dist/types/src/testing/initializeIdentity.d.ts.map +1 -0
  289. package/dist/types/src/translations.d.ts +2 -48
  290. package/dist/types/src/translations.d.ts.map +1 -1
  291. package/dist/types/src/types/capabilities.d.ts +9 -0
  292. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  293. package/dist/types/src/types/events.d.ts +9 -0
  294. package/dist/types/src/types/events.d.ts.map +1 -0
  295. package/dist/types/src/types/index.d.ts +4 -0
  296. package/dist/types/src/types/index.d.ts.map +1 -0
  297. package/dist/types/src/{types.d.ts → types/schema.d.ts} +42 -31
  298. package/dist/types/src/types/schema.d.ts.map +1 -0
  299. package/dist/types/tsconfig.tsbuildinfo +1 -1
  300. package/package.json +95 -51
  301. package/src/ClientPlugin.ts +57 -65
  302. package/src/capabilities/app-graph-builder.ts +87 -103
  303. package/src/capabilities/client.ts +71 -33
  304. package/src/capabilities/index.ts +14 -10
  305. package/src/capabilities/migrations.ts +22 -17
  306. package/src/capabilities/navigation-handler/index.ts +9 -0
  307. package/src/capabilities/navigation-handler/navigation-handler.ts +64 -0
  308. package/src/capabilities/node.ts +13 -0
  309. package/src/capabilities/operation-handler.ts +16 -0
  310. package/src/capabilities/react-context.tsx +17 -12
  311. package/src/capabilities/react-surface.tsx +52 -49
  312. package/src/capabilities/schema-defs.ts +28 -21
  313. package/src/cli/commands/config/index.ts +12 -0
  314. package/src/cli/commands/config/view.ts +29 -0
  315. package/src/cli/commands/device/index.ts +14 -0
  316. package/src/cli/commands/device/info/index.ts +5 -0
  317. package/src/cli/commands/device/info/info.test.ts +28 -0
  318. package/src/cli/commands/device/info/info.ts +48 -0
  319. package/src/cli/commands/device/list/index.ts +5 -0
  320. package/src/cli/commands/device/list/list.test.ts +30 -0
  321. package/src/cli/commands/device/list/list.ts +28 -0
  322. package/src/cli/commands/device/update/index.ts +5 -0
  323. package/src/cli/commands/device/update/update.ts +68 -0
  324. package/src/cli/commands/device/util.ts +55 -0
  325. package/src/cli/commands/edge/index.ts +12 -0
  326. package/src/cli/commands/edge/status.ts +46 -0
  327. package/src/cli/commands/halo/create/create.test.ts +51 -0
  328. package/src/cli/commands/halo/create/create.ts +82 -0
  329. package/src/cli/commands/halo/create/index.ts +5 -0
  330. package/src/cli/commands/halo/credential/add/add.ts +97 -0
  331. package/src/cli/commands/halo/credential/add/index.ts +5 -0
  332. package/src/cli/commands/halo/credential/index.ts +13 -0
  333. package/src/cli/commands/halo/credential/list/index.ts +5 -0
  334. package/src/cli/commands/halo/credential/list/list.test.ts +27 -0
  335. package/src/cli/commands/halo/credential/list/list.ts +115 -0
  336. package/src/cli/commands/halo/identity/identity.test.ts +40 -0
  337. package/src/cli/commands/halo/identity/identity.ts +45 -0
  338. package/src/cli/commands/halo/identity/index.ts +5 -0
  339. package/src/cli/commands/halo/index.ts +21 -0
  340. package/src/cli/commands/halo/join/index.ts +5 -0
  341. package/src/cli/commands/halo/join/join.test.ts +10 -0
  342. package/src/cli/commands/halo/join/join.ts +87 -0
  343. package/src/cli/commands/halo/keys/index.ts +5 -0
  344. package/src/cli/commands/halo/keys/keys.test.ts +29 -0
  345. package/src/cli/commands/halo/keys/keys.ts +40 -0
  346. package/src/cli/commands/halo/recover/index.ts +5 -0
  347. package/src/cli/commands/halo/recover/recover.test.ts +10 -0
  348. package/src/cli/commands/halo/recover/recover.ts +44 -0
  349. package/src/cli/commands/halo/seed/index.ts +5 -0
  350. package/src/cli/commands/halo/seed/seed.ts +36 -0
  351. package/src/cli/commands/halo/share/index.ts +5 -0
  352. package/src/cli/commands/halo/share/share.ts +97 -0
  353. package/src/cli/commands/halo/update/index.ts +5 -0
  354. package/src/cli/commands/halo/update/update.test.ts +28 -0
  355. package/src/cli/commands/halo/update/update.ts +67 -0
  356. package/src/cli/commands/halo/util.ts +18 -0
  357. package/src/cli/commands/index.ts +9 -0
  358. package/src/cli/commands/profile/create.ts +90 -0
  359. package/src/cli/commands/profile/delete.ts +36 -0
  360. package/src/cli/commands/profile/import.ts +101 -0
  361. package/src/cli/commands/profile/index.ts +17 -0
  362. package/src/cli/commands/profile/inspect.ts +64 -0
  363. package/src/cli/commands/profile/list.ts +55 -0
  364. package/src/cli/commands/profile/reset.ts +45 -0
  365. package/src/cli/commands/profile/util.ts +48 -0
  366. package/src/cli/index.ts +5 -0
  367. package/src/cli/plugin.ts +31 -0
  368. package/src/cli/testing/test-console.ts +87 -0
  369. package/src/components/index.ts +0 -7
  370. package/src/constants.ts +9 -0
  371. package/src/containers/DevicesContainer/DevicesContainer.stories.tsx +52 -0
  372. package/src/{components → containers/DevicesContainer}/DevicesContainer.tsx +97 -114
  373. package/src/containers/DevicesContainer/index.ts +5 -0
  374. package/src/containers/JoinDialog/JoinDialog.stories.tsx +43 -0
  375. package/src/containers/JoinDialog/JoinDialog.tsx +56 -0
  376. package/src/containers/JoinDialog/index.ts +5 -0
  377. package/src/containers/ProfileContainer/ProfileContainer.stories.tsx +28 -0
  378. package/src/{components → containers/ProfileContainer}/ProfileContainer.tsx +70 -67
  379. package/src/containers/ProfileContainer/index.ts +5 -0
  380. package/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.stories.tsx +11 -12
  381. package/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.tsx +29 -28
  382. package/src/containers/RecoveryCodeDialog/index.ts +8 -0
  383. package/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.tsx +47 -0
  384. package/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.tsx +66 -0
  385. package/src/containers/RecoveryCredentialsContainer/index.ts +5 -0
  386. package/src/containers/ResetDialog/ResetDialog.stories.tsx +73 -0
  387. package/src/containers/ResetDialog/ResetDialog.tsx +52 -0
  388. package/src/containers/ResetDialog/index.ts +8 -0
  389. package/src/containers/index.ts +15 -0
  390. package/src/index.ts +2 -5
  391. package/src/meta.ts +8 -5
  392. package/src/operations/create-agent.ts +26 -0
  393. package/src/operations/create-identity.ts +29 -0
  394. package/src/operations/create-passkey.ts +88 -0
  395. package/src/operations/create-recovery-code.ts +34 -0
  396. package/src/operations/definitions.ts +107 -0
  397. package/src/operations/index.ts +20 -0
  398. package/src/operations/join-identity.ts +28 -0
  399. package/src/operations/recover-identity.ts +28 -0
  400. package/src/operations/redeem-passkey.ts +85 -0
  401. package/src/operations/redeem-token.ts +31 -0
  402. package/src/operations/reset-storage.ts +27 -0
  403. package/src/operations/share-identity.ts +26 -0
  404. package/src/testing/index.ts +5 -0
  405. package/src/testing/initializeIdentity.ts +24 -0
  406. package/src/translations.ts +57 -44
  407. package/src/types/capabilities.ts +16 -0
  408. package/src/types/events.ts +15 -0
  409. package/src/types/index.ts +7 -0
  410. package/src/{types.ts → types/schema.ts} +29 -22
  411. package/dist/lib/browser/app-graph-builder-3EILEBWW.mjs +0 -123
  412. package/dist/lib/browser/app-graph-builder-3EILEBWW.mjs.map +0 -7
  413. package/dist/lib/browser/chunk-64ANQXYZ.mjs +0 -693
  414. package/dist/lib/browser/chunk-64ANQXYZ.mjs.map +0 -7
  415. package/dist/lib/browser/chunk-AWXKL4UR.mjs +0 -18
  416. package/dist/lib/browser/chunk-AWXKL4UR.mjs.map +0 -7
  417. package/dist/lib/browser/chunk-CAF2COXW.mjs +0 -19
  418. package/dist/lib/browser/chunk-CAF2COXW.mjs.map +0 -7
  419. package/dist/lib/browser/chunk-GS3LDHYD.mjs +0 -12
  420. package/dist/lib/browser/chunk-GS3LDHYD.mjs.map +0 -7
  421. package/dist/lib/browser/chunk-Q7TFRFHI.mjs +0 -111
  422. package/dist/lib/browser/chunk-Q7TFRFHI.mjs.map +0 -7
  423. package/dist/lib/browser/client-JFNMEFOK.mjs +0 -37
  424. package/dist/lib/browser/client-JFNMEFOK.mjs.map +0 -7
  425. package/dist/lib/browser/intent-resolver-YGAQVXI2.mjs +0 -305
  426. package/dist/lib/browser/intent-resolver-YGAQVXI2.mjs.map +0 -7
  427. package/dist/lib/browser/migrations-5COKGS4E.mjs +0 -23
  428. package/dist/lib/browser/migrations-5COKGS4E.mjs.map +0 -7
  429. package/dist/lib/browser/react-context-GBNYT5QK.mjs +0 -24
  430. package/dist/lib/browser/react-context-GBNYT5QK.mjs.map +0 -7
  431. package/dist/lib/browser/react-surface-YKQAUE2M.mjs +0 -66
  432. package/dist/lib/browser/react-surface-YKQAUE2M.mjs.map +0 -7
  433. package/dist/lib/browser/schema-defs-6L7W2RHL.mjs +0 -25
  434. package/dist/lib/browser/schema-defs-6L7W2RHL.mjs.map +0 -7
  435. package/dist/lib/browser/types.mjs +0 -10
  436. package/dist/lib/node-esm/app-graph-builder-GINHOE7A.mjs +0 -124
  437. package/dist/lib/node-esm/app-graph-builder-GINHOE7A.mjs.map +0 -7
  438. package/dist/lib/node-esm/chunk-3BUB64JB.mjs +0 -19
  439. package/dist/lib/node-esm/chunk-3BUB64JB.mjs.map +0 -7
  440. package/dist/lib/node-esm/chunk-GDJMDBWM.mjs.map +0 -7
  441. package/dist/lib/node-esm/chunk-K4PIKBQQ.mjs +0 -694
  442. package/dist/lib/node-esm/chunk-K4PIKBQQ.mjs.map +0 -7
  443. package/dist/lib/node-esm/chunk-SZLX4BVJ.mjs +0 -14
  444. package/dist/lib/node-esm/chunk-SZLX4BVJ.mjs.map +0 -7
  445. package/dist/lib/node-esm/chunk-UMO3ETDV.mjs +0 -20
  446. package/dist/lib/node-esm/chunk-UMO3ETDV.mjs.map +0 -7
  447. package/dist/lib/node-esm/client-XDYQARBL.mjs +0 -38
  448. package/dist/lib/node-esm/client-XDYQARBL.mjs.map +0 -7
  449. package/dist/lib/node-esm/intent-resolver-IN7YG7N7.mjs +0 -306
  450. package/dist/lib/node-esm/intent-resolver-IN7YG7N7.mjs.map +0 -7
  451. package/dist/lib/node-esm/migrations-FE4PDX6W.mjs +0 -24
  452. package/dist/lib/node-esm/migrations-FE4PDX6W.mjs.map +0 -7
  453. package/dist/lib/node-esm/react-context-UCK43H3Z.mjs +0 -25
  454. package/dist/lib/node-esm/react-context-UCK43H3Z.mjs.map +0 -7
  455. package/dist/lib/node-esm/react-surface-HDHC6XHQ.mjs +0 -67
  456. package/dist/lib/node-esm/react-surface-HDHC6XHQ.mjs.map +0 -7
  457. package/dist/lib/node-esm/schema-defs-GZIVMHLW.mjs +0 -26
  458. package/dist/lib/node-esm/schema-defs-GZIVMHLW.mjs.map +0 -7
  459. package/dist/lib/node-esm/types.mjs +0 -11
  460. package/dist/types/src/capabilities/capabilities.d.ts +0 -10
  461. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  462. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -8
  463. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  464. package/dist/types/src/components/DevicesContainer.d.ts.map +0 -1
  465. package/dist/types/src/components/DevicesContainer.stories.d.ts +0 -8
  466. package/dist/types/src/components/DevicesContainer.stories.d.ts.map +0 -1
  467. package/dist/types/src/components/JoinDialog.d.ts.map +0 -1
  468. package/dist/types/src/components/ProfileContainer.d.ts.map +0 -1
  469. package/dist/types/src/components/ProfileContainer.stories.d.ts +0 -8
  470. package/dist/types/src/components/ProfileContainer.stories.d.ts.map +0 -1
  471. package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +0 -1
  472. package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +0 -8
  473. package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +0 -1
  474. package/dist/types/src/components/RecoveryCredentialsContainer.d.ts +0 -4
  475. package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +0 -1
  476. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +0 -8
  477. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +0 -1
  478. package/dist/types/src/components/ResetDialog.d.ts +0 -7
  479. package/dist/types/src/components/ResetDialog.d.ts.map +0 -1
  480. package/dist/types/src/components/ResetDialog.stories.d.ts +0 -10
  481. package/dist/types/src/components/ResetDialog.stories.d.ts.map +0 -1
  482. package/dist/types/src/events.d.ts +0 -8
  483. package/dist/types/src/events.d.ts.map +0 -1
  484. package/dist/types/src/types.d.ts.map +0 -1
  485. package/src/capabilities/capabilities.ts +0 -17
  486. package/src/capabilities/intent-resolver.ts +0 -250
  487. package/src/components/DevicesContainer.stories.tsx +0 -49
  488. package/src/components/JoinDialog.tsx +0 -53
  489. package/src/components/ProfileContainer.stories.tsx +0 -29
  490. package/src/components/RecoveryCredentialsContainer.stories.tsx +0 -44
  491. package/src/components/RecoveryCredentialsContainer.tsx +0 -73
  492. package/src/components/ResetDialog.stories.tsx +0 -53
  493. package/src/components/ResetDialog.tsx +0 -49
  494. package/src/events.ts +0 -15
  495. /package/dist/lib/browser/{types.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  496. /package/dist/lib/{node-esm/types.mjs.map → browser/types/index.mjs.map} +0 -0
  497. /package/dist/types/src/{components → containers/DevicesContainer}/DevicesContainer.d.ts +0 -0
  498. /package/dist/types/src/{components → containers/ProfileContainer}/ProfileContainer.d.ts +0 -0
@@ -0,0 +1,1028 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import "../chunk-HSLMI22Q.mjs";
3
+
4
+ // src/cli/plugin.ts
5
+ import { ActivationEvents, Capability, Plugin as Plugin2 } from "@dxos/app-framework";
6
+ import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
7
+ import { Client, OperationHandler, SchemaDefs } from "#capabilities";
8
+ import { meta } from "#meta";
9
+ import { ClientEvents } from "#types";
10
+
11
+ // src/cli/commands/config/index.ts
12
+ import * as Command2 from "@effect/cli/Command";
13
+
14
+ // src/cli/commands/config/view.ts
15
+ import * as Command from "@effect/cli/Command";
16
+ import * as Console from "effect/Console";
17
+ import * as Effect from "effect/Effect";
18
+ import * as Yaml from "yaml";
19
+ import { CommandConfig } from "@dxos/cli-util";
20
+ import { ConfigService } from "@dxos/client";
21
+ import { DX_CONFIG, getProfileConfigPath } from "@dxos/client-protocol";
22
+ var view = Command.make("view", {}, Effect.fnUntraced(function* () {
23
+ const config2 = yield* ConfigService;
24
+ const { json, profile: profile2 } = yield* CommandConfig;
25
+ const configPath = getProfileConfigPath(DX_CONFIG, profile2);
26
+ if (json) {
27
+ yield* Console.log(JSON.stringify(config2.values, null, 2));
28
+ } else {
29
+ yield* Console.log(`Path: ${configPath}`);
30
+ yield* Console.log(Yaml.stringify(config2.values));
31
+ }
32
+ }));
33
+
34
+ // src/cli/commands/config/index.ts
35
+ var config = Command2.make("config").pipe(Command2.withDescription("Config commands."), Command2.withSubcommands([
36
+ view
37
+ ]));
38
+
39
+ // src/cli/commands/device/index.ts
40
+ import * as Command6 from "@effect/cli/Command";
41
+
42
+ // src/cli/commands/device/info/info.ts
43
+ import * as Command3 from "@effect/cli/Command";
44
+ import * as Console2 from "effect/Console";
45
+ import * as Effect2 from "effect/Effect";
46
+ import { CommandConfig as CommandConfig2 } from "@dxos/cli-util";
47
+ import { print } from "@dxos/cli-util";
48
+ import { ClientService } from "@dxos/client";
49
+ import { DeviceType as DeviceType2 } from "@dxos/protocols/proto/dxos/halo/credentials";
50
+
51
+ // src/cli/commands/device/util.ts
52
+ import { FormBuilder } from "@dxos/cli-util";
53
+ import { Device, DeviceKind, DeviceType } from "@dxos/client/halo";
54
+ var maybeTruncateKey = (key, truncate = false) => truncate ? key.truncate() : key.toHex();
55
+ var getDeviceTitle = (device2) => {
56
+ if (device2.profile?.label) {
57
+ return device2.profile.label;
58
+ }
59
+ const platform = device2.profile?.platform ?? "Unknown";
60
+ const os = device2.profile?.os ?? "Unknown";
61
+ return `${platform} on ${os}`;
62
+ };
63
+ var mapDevices = (devices, truncateKeys = false) => {
64
+ return devices.map((device2) => ({
65
+ label: device2.profile?.label,
66
+ type: device2.profile?.type ? DeviceType[device2.profile?.type] : "UNKNOWN",
67
+ key: maybeTruncateKey(device2.deviceKey, truncateKeys),
68
+ kind: DeviceKind[device2.kind],
69
+ platform: device2.profile?.platform,
70
+ platformVersion: device2.profile?.platformVersion,
71
+ architecture: device2.profile?.architecture,
72
+ os: device2.profile?.os,
73
+ osVersion: device2.profile?.osVersion,
74
+ presence: device2?.kind === DeviceKind.CURRENT ? "THIS DEVICE" : Device.PresenceState[device2.presence]
75
+ }));
76
+ };
77
+ var printDevice = (device2) => FormBuilder.make({
78
+ title: getDeviceTitle(device2)
79
+ }).pipe(FormBuilder.set("deviceKey", device2.deviceKey.truncate()), FormBuilder.set("label", device2.profile?.label ?? "<none>"), FormBuilder.set("type", device2.profile?.type ? DeviceType[device2.profile?.type] : "UNKNOWN"), FormBuilder.set("kind", DeviceKind[device2.kind]), FormBuilder.set("presence", device2?.kind === DeviceKind.CURRENT ? "THIS DEVICE" : Device.PresenceState[device2.presence]), FormBuilder.set("platform", device2.profile?.platform ?? "<none>"), FormBuilder.set("platformVersion", device2.profile?.platformVersion ?? "<none>"), FormBuilder.set("architecture", device2.profile?.architecture ?? "<none>"), FormBuilder.set("os", device2.profile?.os ?? "<none>"), FormBuilder.set("osVersion", device2.profile?.osVersion ?? "<none>"), FormBuilder.build);
80
+ var printDevices = (devices) => {
81
+ return devices.map(printDevice);
82
+ };
83
+
84
+ // src/cli/commands/device/info/info.ts
85
+ var handler = Effect2.fn(function* () {
86
+ const { json } = yield* CommandConfig2;
87
+ const client = yield* ClientService;
88
+ const device2 = client.halo.device;
89
+ if (!device2) {
90
+ if (json) {
91
+ yield* Console2.log(JSON.stringify({
92
+ error: "No device found"
93
+ }, null, 2));
94
+ } else {
95
+ yield* Console2.log("No device found.");
96
+ }
97
+ return;
98
+ }
99
+ if (json) {
100
+ yield* Console2.log(JSON.stringify({
101
+ deviceKey: device2.deviceKey.toHex(),
102
+ profile: {
103
+ ...device2.profile,
104
+ type: device2.profile?.type ? DeviceType2[device2.profile?.type] : "UNKNOWN"
105
+ }
106
+ }, null, 2));
107
+ } else {
108
+ yield* Console2.log(print(printDevice(device2)));
109
+ }
110
+ });
111
+ var info = Command3.make("info", {}, handler).pipe(Command3.withDescription("Show device info."));
112
+
113
+ // src/cli/commands/device/list/list.ts
114
+ import * as Command4 from "@effect/cli/Command";
115
+ import * as Console3 from "effect/Console";
116
+ import * as Effect3 from "effect/Effect";
117
+ import { CommandConfig as CommandConfig3 } from "@dxos/cli-util";
118
+ import { printList } from "@dxos/cli-util";
119
+ import { ClientService as ClientService2 } from "@dxos/client";
120
+ var handler2 = Effect3.fn(function* () {
121
+ const { json } = yield* CommandConfig3;
122
+ const client = yield* ClientService2;
123
+ const devices = client.halo.devices.get();
124
+ if (json) {
125
+ yield* Console3.log(JSON.stringify(mapDevices(devices), null, 2));
126
+ } else {
127
+ const formatted = printDevices(devices);
128
+ yield* Console3.log(printList(formatted));
129
+ }
130
+ });
131
+ var list = Command4.make("list", {}, handler2).pipe(Command4.withDescription("List devices."));
132
+
133
+ // src/cli/commands/device/update/update.ts
134
+ import * as Command5 from "@effect/cli/Command";
135
+ import * as Options from "@effect/cli/Options";
136
+ import * as Console4 from "effect/Console";
137
+ import * as Effect4 from "effect/Effect";
138
+ import { CommandConfig as CommandConfig4 } from "@dxos/cli-util";
139
+ import { print as print2 } from "@dxos/cli-util";
140
+ import { ClientService as ClientService3 } from "@dxos/client";
141
+ var handler3 = Effect4.fn(function* ({ label }) {
142
+ const { json } = yield* CommandConfig4;
143
+ const client = yield* ClientService3;
144
+ const device2 = client.halo.device;
145
+ if (!device2) {
146
+ if (json) {
147
+ yield* Console4.log(JSON.stringify({
148
+ error: "No device found"
149
+ }, null, 2));
150
+ } else {
151
+ yield* Console4.log("No device found.");
152
+ }
153
+ return;
154
+ }
155
+ const updatedProfile = {
156
+ ...device2.profile,
157
+ label
158
+ };
159
+ const devicesService = client.services.services.DevicesService;
160
+ if (!devicesService) {
161
+ if (json) {
162
+ yield* Console4.log(JSON.stringify({
163
+ error: "DevicesService not found"
164
+ }, null, 2));
165
+ } else {
166
+ yield* Console4.log("DevicesService not found.");
167
+ }
168
+ return;
169
+ }
170
+ const updatedDevice = yield* Effect4.tryPromise(() => devicesService.updateDevice(updatedProfile));
171
+ if (json) {
172
+ yield* Console4.log(JSON.stringify({
173
+ deviceKey: updatedDevice.deviceKey.toHex(),
174
+ profile: updatedDevice.profile
175
+ }, null, 2));
176
+ } else {
177
+ yield* Console4.log(print2(printDevice(updatedDevice)));
178
+ }
179
+ });
180
+ var update = Command5.make("update", {
181
+ label: Options.text("label").pipe(Options.withDescription("The device label."))
182
+ }, handler3).pipe(Command5.withDescription("Update device label."));
183
+
184
+ // src/cli/commands/device/index.ts
185
+ var device = Command6.make("device").pipe(Command6.withDescription("Manage HALO devices."), Command6.withSubcommands([
186
+ info,
187
+ list,
188
+ update
189
+ ]));
190
+
191
+ // src/cli/commands/edge/index.ts
192
+ import * as Command8 from "@effect/cli/Command";
193
+
194
+ // src/cli/commands/edge/status.ts
195
+ import * as Command7 from "@effect/cli/Command";
196
+ import * as Console5 from "effect/Console";
197
+ import * as Effect5 from "effect/Effect";
198
+ import * as Option from "effect/Option";
199
+ import { CommandConfig as CommandConfig5 } from "@dxos/cli-util";
200
+ import { ClientService as ClientService4 } from "@dxos/client";
201
+ import { createEdgeIdentity } from "@dxos/client/edge";
202
+ import { Context } from "@dxos/context";
203
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/cli/commands/edge/status.ts";
204
+ var getStatus = () => Effect5.gen(function* () {
205
+ const client = yield* ClientService4;
206
+ const identity2 = createEdgeIdentity(client);
207
+ client.edge.http.setIdentity(identity2);
208
+ const status2 = yield* Effect5.tryPromise(() => client.edge.http.getStatus(Context.default(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 16 })));
209
+ if (yield* CommandConfig5.isJson) {
210
+ yield* Console5.log(JSON.stringify(status2, null, 2));
211
+ } else if (status2.problems.length > 0) {
212
+ for (const problem of status2.problems) {
213
+ yield* Console5.error(problem);
214
+ }
215
+ } else {
216
+ yield* Console5.log("No problems found.");
217
+ }
218
+ }).pipe(
219
+ // TODO(wittjosiah): Tagged error.
220
+ Effect5.catchSome((error2) => {
221
+ if (error2 instanceof Error && error2.message === "Identity not available") {
222
+ return Option.some(Console5.error(error2.message));
223
+ } else {
224
+ return Option.none();
225
+ }
226
+ })
227
+ );
228
+ var status = Command7.make("status", {}, getStatus).pipe(Command7.withDescription("Get the EDGE status for the current identity."));
229
+
230
+ // src/cli/commands/edge/index.ts
231
+ var edge = Command8.make("edge").pipe(Command8.withDescription("EDGE commands."), Command8.withSubcommands([
232
+ status
233
+ ]));
234
+
235
+ // src/cli/commands/halo/index.ts
236
+ import * as Command18 from "@effect/cli/Command";
237
+
238
+ // src/cli/commands/halo/create/create.ts
239
+ import * as Command9 from "@effect/cli/Command";
240
+ import * as Options2 from "@effect/cli/Options";
241
+ import * as Console6 from "effect/Console";
242
+ import * as Effect6 from "effect/Effect";
243
+ import * as Option2 from "effect/Option";
244
+ import { Capabilities, Plugin } from "@dxos/app-framework";
245
+ import { PERSONAL_SPACE_TAG } from "@dxos/app-toolkit";
246
+ import { CommandConfig as CommandConfig6, flushAndSync, spaceLayer } from "@dxos/cli-util";
247
+ import { print as print3 } from "@dxos/cli-util";
248
+ import { ClientService as ClientService5 } from "@dxos/client";
249
+ import { invariant } from "@dxos/invariant";
250
+ import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
251
+ import { MembershipPolicy } from "@dxos/protocols/proto/dxos/halo/credentials";
252
+ import { ClientOperation } from "#operations";
253
+
254
+ // src/cli/commands/halo/util.ts
255
+ import { FormBuilder as FormBuilder2 } from "@dxos/cli-util";
256
+ var printIdentity = (identity2) => FormBuilder2.make({
257
+ title: "Identity"
258
+ }).pipe(FormBuilder2.set("identityKey", identity2.identityKey.truncate()), FormBuilder2.set("displayName", identity2.profile?.displayName ?? "<none>"), FormBuilder2.build);
259
+
260
+ // src/cli/commands/halo/create/create.ts
261
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-client/src/cli/commands/halo/create/create.ts";
262
+ var handler4 = Effect6.fn(function* ({ agent, displayName }) {
263
+ const { json } = yield* CommandConfig6;
264
+ const client = yield* ClientService5;
265
+ invariant(!client.halo.identity.get(), "Identity already exists", { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 23, S: this, A: ["!client.halo.identity.get()", "'Identity already exists'"] });
266
+ const manager = yield* Plugin.Service;
267
+ const { invoke } = manager.capabilities.get(Capabilities.OperationInvoker);
268
+ const identity2 = yield* invoke(ClientOperation.CreateIdentity, {
269
+ displayName: Option2.getOrUndefined(displayName)
270
+ });
271
+ if (agent) {
272
+ yield* invoke(ClientOperation.CreateAgent);
273
+ }
274
+ const space = yield* Effect6.promise(() => client.spaces.create({}, {
275
+ tags: [
276
+ PERSONAL_SPACE_TAG
277
+ ],
278
+ membershipPolicy: MembershipPolicy.LOCKED
279
+ }));
280
+ yield* Effect6.promise(() => space.waitUntilReady());
281
+ yield* Effect6.promise(() => space.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED));
282
+ yield* flushAndSync({
283
+ indexes: true
284
+ }).pipe(Effect6.provide(spaceLayer(Option2.some(space.id))));
285
+ if (json) {
286
+ yield* Console6.log(JSON.stringify({
287
+ identityKey: identity2.identityKey.toHex(),
288
+ displayName: identity2.profile?.displayName
289
+ }, null, 2));
290
+ } else {
291
+ yield* Console6.log(print3(printIdentity(identity2)));
292
+ }
293
+ });
294
+ var create = Command9.make("create", {
295
+ agent: Options2.boolean("noAgent", {
296
+ ifPresent: false
297
+ }).pipe(Options2.withDescription("Do not create an EDGE agent for the identity.")),
298
+ displayName: Options2.text("displayName").pipe(Options2.withDescription("The display name of the identity."), Options2.optional)
299
+ }, handler4).pipe(Command9.withDescription("Create a new identity."));
300
+
301
+ // src/cli/commands/halo/credential/index.ts
302
+ import * as Command12 from "@effect/cli/Command";
303
+
304
+ // src/cli/commands/halo/credential/add/add.ts
305
+ import * as Args from "@effect/cli/Args";
306
+ import * as Command10 from "@effect/cli/Command";
307
+ import * as Prompt from "@effect/cli/Prompt";
308
+ import * as Console7 from "effect/Console";
309
+ import * as Effect7 from "effect/Effect";
310
+ import * as Option3 from "effect/Option";
311
+ import { CommandConfig as CommandConfig7 } from "@dxos/cli-util";
312
+ import { ClientService as ClientService6 } from "@dxos/client";
313
+ import { invariant as invariant2 } from "@dxos/invariant";
314
+ import { schema } from "@dxos/protocols/proto";
315
+ var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-client/src/cli/commands/halo/credential/add/add.ts";
316
+ var handler5 = Effect7.fn(function* ({ credential: credential2 }) {
317
+ const { json } = yield* CommandConfig7;
318
+ const client = yield* ClientService6;
319
+ let credentialHex = Option3.getOrUndefined(credential2);
320
+ if (!credentialHex) {
321
+ credentialHex = yield* Prompt.text({
322
+ message: "Enter credential (hex string)"
323
+ }).pipe(Prompt.run);
324
+ }
325
+ invariant2(credentialHex, "Invalid credential.", { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 23, S: this, A: ["credentialHex", "'Invalid credential.'"] });
326
+ const identity2 = client.halo.identity;
327
+ if (!identity2) {
328
+ if (json) {
329
+ yield* Console7.log(JSON.stringify({
330
+ error: "Profile not initialized"
331
+ }, null, 2));
332
+ } else {
333
+ yield* Console7.log("Profile not initialized.");
334
+ }
335
+ return;
336
+ }
337
+ yield* Effect7.gen(function* () {
338
+ const codec = schema.getCodecForType("dxos.halo.credentials.Credential");
339
+ const credentialBytes = yield* Effect7.try({
340
+ try: () => Buffer.from(credentialHex, "hex"),
341
+ catch: (error2) => new Error(`Failed to parse hex string: ${error2}`)
342
+ });
343
+ const verifyError = codec.protoType.verify(credentialBytes);
344
+ if (verifyError) {
345
+ yield* Effect7.fail(new Error(verifyError));
346
+ }
347
+ const credentialObj = yield* Effect7.try({
348
+ try: () => codec.decode(credentialBytes),
349
+ catch: (error2) => new Error(`Failed to decode credential: ${error2}`)
350
+ });
351
+ yield* Effect7.tryPromise({
352
+ try: () => client.halo.writeCredentials([
353
+ credentialObj
354
+ ]),
355
+ catch: (error2) => new Error(`Failed to write credential: ${error2}`)
356
+ });
357
+ if (json) {
358
+ yield* Console7.log(JSON.stringify({
359
+ success: true
360
+ }, null, 2));
361
+ } else {
362
+ yield* Console7.log("Credential added successfully.");
363
+ }
364
+ }).pipe(Effect7.catchAll((error2) => Effect7.gen(function* () {
365
+ if (json) {
366
+ yield* Console7.log(JSON.stringify({
367
+ error: "Invalid credential",
368
+ message: error2 instanceof Error ? error2.message : String(error2)
369
+ }, null, 2));
370
+ } else {
371
+ yield* Console7.log("Invalid credential.");
372
+ }
373
+ yield* Effect7.fail(error2);
374
+ })));
375
+ });
376
+ var add = Command10.make("add", {
377
+ credential: Args.text({
378
+ name: "credential"
379
+ }).pipe(Args.withDescription("Credential as hex string."), Args.optional)
380
+ }, handler5).pipe(Command10.withDescription("Import credential into HALO."));
381
+
382
+ // src/cli/commands/halo/credential/list/list.ts
383
+ import * as Command11 from "@effect/cli/Command";
384
+ import * as Options3 from "@effect/cli/Options";
385
+ import * as Console8 from "effect/Console";
386
+ import * as Duration from "effect/Duration";
387
+ import * as Effect8 from "effect/Effect";
388
+ import * as Option4 from "effect/Option";
389
+ import { CommandConfig as CommandConfig8, Common, FormBuilder as FormBuilder3, getSpace, printList as printList2 } from "@dxos/cli-util";
390
+ import { ClientService as ClientService7 } from "@dxos/client";
391
+ var mapCredentials = (credentials) => {
392
+ return credentials.map((credential2) => ({
393
+ id: credential2.id?.toHex() ?? "<unknown>",
394
+ issuer: credential2.issuer?.toHex() ?? "<unknown>",
395
+ subject: credential2.subject?.id?.toHex() ?? "<unknown>",
396
+ type: credential2.subject.assertion["@type"],
397
+ assertion: credential2.subject.assertion
398
+ }));
399
+ };
400
+ var printCredential = (credential2) => {
401
+ const type = credential2.subject.assertion["@type"] ?? "<unknown>";
402
+ return FormBuilder3.make({
403
+ title: type
404
+ }).pipe(FormBuilder3.option("id", Option4.fromNullable(credential2.id?.truncate())), FormBuilder3.option("issuer", Option4.fromNullable(credential2.issuer?.truncate())), FormBuilder3.option("subject", Option4.fromNullable(credential2.subject?.id?.truncate())), FormBuilder3.build);
405
+ };
406
+ var handler6 = Effect8.fn(function* ({ type, spaceId, timeout: timeout2, delay }) {
407
+ const { json } = yield* CommandConfig8;
408
+ const client = yield* ClientService7;
409
+ let credentials;
410
+ if (Option4.isSome(spaceId)) {
411
+ const space = yield* getSpace(spaceId.value);
412
+ credentials = yield* Effect8.tryPromise(() => space.internal.getCredentials());
413
+ } else {
414
+ const identity2 = client.halo.identity;
415
+ if (!identity2) {
416
+ if (json) {
417
+ yield* Console8.log(JSON.stringify({
418
+ error: "Profile not initialized"
419
+ }, null, 2));
420
+ } else {
421
+ yield* Console8.log("Profile not initialized.");
422
+ }
423
+ return;
424
+ }
425
+ const latch = yield* Effect8.makeLatch();
426
+ const subscription = client.halo.credentials.subscribe((creds) => {
427
+ if (creds.length > 0) {
428
+ Effect8.runSync(latch.open);
429
+ }
430
+ });
431
+ yield* latch.await.pipe(Effect8.timeout(Duration.millis(timeout2)), Effect8.catchAll(() => Effect8.void), Effect8.ensuring(Effect8.sync(() => {
432
+ subscription.unsubscribe();
433
+ })));
434
+ yield* Effect8.sleep(Duration.millis(delay));
435
+ credentials = client.halo.queryCredentials({
436
+ type: Option4.getOrUndefined(type)
437
+ });
438
+ }
439
+ if (json) {
440
+ yield* Console8.log(JSON.stringify(mapCredentials(credentials), null, 2));
441
+ } else {
442
+ const formatted = credentials.map(printCredential);
443
+ yield* Console8.log(printList2(formatted));
444
+ }
445
+ });
446
+ var list2 = Command11.make("list", {
447
+ type: Options3.text("type").pipe(Options3.withDescription("Filter by credential type."), Options3.optional),
448
+ spaceId: Common.spaceId.pipe(Options3.withDescription("Space ID to show credentials from."), Options3.optional),
449
+ timeout: Options3.integer("timeout").pipe(Options3.withDescription("Time in milliseconds to wait for at least one credential before listing."), Options3.withDefault(500)),
450
+ delay: Options3.integer("delay").pipe(Options3.withDescription("Delay in milliseconds before listing."), Options3.withDefault(250))
451
+ }, handler6).pipe(Command11.withDescription("List HALO credentials."));
452
+
453
+ // src/cli/commands/halo/credential/index.ts
454
+ var credential = Command12.make("credential").pipe(Command12.withDescription("Manage HALO credentials."), Command12.withSubcommands([
455
+ add,
456
+ list2
457
+ ]));
458
+
459
+ // src/cli/commands/halo/identity/identity.ts
460
+ import * as Command13 from "@effect/cli/Command";
461
+ import * as Console9 from "effect/Console";
462
+ import * as Effect9 from "effect/Effect";
463
+ import { CommandConfig as CommandConfig9 } from "@dxos/cli-util";
464
+ import { print as print4 } from "@dxos/cli-util";
465
+ import { ClientService as ClientService8 } from "@dxos/client";
466
+ var handler7 = Effect9.fn(function* () {
467
+ const { json } = yield* CommandConfig9;
468
+ const client = yield* ClientService8;
469
+ const identity2 = client.halo.identity.get();
470
+ if (!identity2) {
471
+ if (json) {
472
+ yield* Console9.log(JSON.stringify({
473
+ error: "Identity not initialized"
474
+ }, null, 2));
475
+ } else {
476
+ yield* Console9.log("Identity not initialized.");
477
+ }
478
+ } else {
479
+ if (json) {
480
+ yield* Console9.log(JSON.stringify({
481
+ identityKey: identity2.identityKey.toHex(),
482
+ displayName: identity2.profile?.displayName
483
+ }, null, 2));
484
+ } else {
485
+ yield* Console9.log(print4(printIdentity(identity2)));
486
+ }
487
+ }
488
+ });
489
+ var identity = Command13.make("identity", {}, handler7).pipe(Command13.withDescription("Get the current identity."));
490
+
491
+ // src/cli/commands/halo/keys/keys.ts
492
+ import * as Command14 from "@effect/cli/Command";
493
+ import * as Console10 from "effect/Console";
494
+ import * as Effect10 from "effect/Effect";
495
+ import * as Option5 from "effect/Option";
496
+ import { CommandConfig as CommandConfig10 } from "@dxos/cli-util";
497
+ import { FormBuilder as FormBuilder4, print as print5 } from "@dxos/cli-util";
498
+ import { ClientService as ClientService9 } from "@dxos/client";
499
+ var handler8 = Effect10.fn(function* () {
500
+ const { json } = yield* CommandConfig10;
501
+ const client = yield* ClientService9;
502
+ const identity2 = client.halo.identity.get();
503
+ const device2 = client.halo.device;
504
+ if (json) {
505
+ yield* Console10.log(JSON.stringify({
506
+ identityKey: identity2?.identityKey.toHex(),
507
+ deviceKey: device2?.deviceKey.toHex()
508
+ }, null, 2));
509
+ } else {
510
+ const builder = FormBuilder4.make({
511
+ title: "HALO Keys"
512
+ }).pipe(FormBuilder4.option("identityKey", Option5.fromNullable(identity2?.identityKey.truncate())), FormBuilder4.option("deviceKey", Option5.fromNullable(device2?.deviceKey.truncate())));
513
+ yield* Console10.log(print5(FormBuilder4.build(builder)));
514
+ }
515
+ });
516
+ var keys = Command14.make("keys", {}, handler8).pipe(Command14.withDescription("Show HALO keys."));
517
+
518
+ // src/cli/commands/halo/recover/recover.ts
519
+ import * as Args2 from "@effect/cli/Args";
520
+ import * as Command15 from "@effect/cli/Command";
521
+ import * as Console11 from "effect/Console";
522
+ import * as Effect11 from "effect/Effect";
523
+ import { CommandConfig as CommandConfig11, print as print6 } from "@dxos/cli-util";
524
+ import { ClientService as ClientService10 } from "@dxos/client";
525
+ import { invariant as invariant3 } from "@dxos/invariant";
526
+ var __dxlog_file4 = "/__w/dxos/dxos/packages/plugins/plugin-client/src/cli/commands/halo/recover/recover.ts";
527
+ var recover = Command15.make("recover", {
528
+ recoveryCode: Args2.text({
529
+ name: "recoveryCode"
530
+ }).pipe(Args2.withDescription("The recovery code seed phrase."))
531
+ }, Effect11.fn(function* ({ recoveryCode }) {
532
+ const { json } = yield* CommandConfig11;
533
+ const client = yield* ClientService10;
534
+ invariant3(!client.halo.identity.get(), "Identity already exists", { "~LogMeta": "~LogMeta", F: __dxlog_file4, L: 20, S: this, A: ["!client.halo.identity.get()", "'Identity already exists'"] });
535
+ const identity2 = yield* Effect11.tryPromise(() => client.halo.recoverIdentity({
536
+ recoveryCode
537
+ }));
538
+ if (json) {
539
+ yield* Console11.log(JSON.stringify({
540
+ identityKey: identity2.identityKey.toHex(),
541
+ displayName: identity2.profile?.displayName
542
+ }, null, 2));
543
+ } else {
544
+ yield* Console11.log("Identity recovered successfully");
545
+ yield* Console11.log(print6(printIdentity(identity2)));
546
+ }
547
+ })).pipe(Command15.withDescription("Recover an existing identity using a recovery code."));
548
+
549
+ // src/cli/commands/halo/seed/seed.ts
550
+ import * as Command16 from "@effect/cli/Command";
551
+ import * as Console12 from "effect/Console";
552
+ import * as Effect12 from "effect/Effect";
553
+ import { CommandConfig as CommandConfig12 } from "@dxos/cli-util";
554
+ import { ClientService as ClientService11 } from "@dxos/client";
555
+ var handler9 = Effect12.fn(function* () {
556
+ const { json } = yield* CommandConfig12;
557
+ const client = yield* ClientService11;
558
+ const identityService = client.services.services.IdentityService;
559
+ if (!identityService) {
560
+ if (json) {
561
+ yield* Console12.log(JSON.stringify({
562
+ error: "IdentityService not found"
563
+ }, null, 2));
564
+ } else {
565
+ yield* Console12.log("IdentityService not found.");
566
+ }
567
+ return;
568
+ }
569
+ const result = yield* Effect12.tryPromise(() => identityService.createRecoveryCredential({}));
570
+ if (json) {
571
+ yield* Console12.log(JSON.stringify({
572
+ recoveryCode: result.recoveryCode
573
+ }, null, 2));
574
+ } else {
575
+ yield* Console12.log(result.recoveryCode);
576
+ }
577
+ });
578
+ var seed = Command16.make("seed", {}, handler9).pipe(Command16.withDescription("Generate a seedphrase that can be used for identity recovery."));
579
+
580
+ // src/cli/commands/halo/update/update.ts
581
+ import * as Command17 from "@effect/cli/Command";
582
+ import * as Options4 from "@effect/cli/Options";
583
+ import * as Console13 from "effect/Console";
584
+ import * as Effect13 from "effect/Effect";
585
+ import { CommandConfig as CommandConfig13 } from "@dxos/cli-util";
586
+ import { print as print7 } from "@dxos/cli-util";
587
+ import { ClientService as ClientService12 } from "@dxos/client";
588
+ var handler10 = Effect13.fn(function* ({ displayName }) {
589
+ const { json } = yield* CommandConfig13;
590
+ const client = yield* ClientService12;
591
+ const identity2 = client.halo.identity.get();
592
+ if (!identity2) {
593
+ if (json) {
594
+ yield* Console13.log(JSON.stringify({
595
+ error: "Identity not initialized"
596
+ }, null, 2));
597
+ } else {
598
+ yield* Console13.log("Identity not initialized.");
599
+ }
600
+ return;
601
+ }
602
+ const identityService = client.services.services.IdentityService;
603
+ if (!identityService) {
604
+ if (json) {
605
+ yield* Console13.log(JSON.stringify({
606
+ error: "IdentityService not found"
607
+ }, null, 2));
608
+ } else {
609
+ yield* Console13.log("IdentityService not found.");
610
+ }
611
+ return;
612
+ }
613
+ const updatedIdentity = yield* Effect13.tryPromise(() => identityService.updateProfile({
614
+ displayName
615
+ }));
616
+ if (json) {
617
+ yield* Console13.log(JSON.stringify({
618
+ identityKey: updatedIdentity.identityKey.toHex(),
619
+ displayName: updatedIdentity.profile?.displayName
620
+ }, null, 2));
621
+ } else {
622
+ yield* Console13.log(print7(printIdentity(updatedIdentity)));
623
+ }
624
+ });
625
+ var update2 = Command17.make("update", {
626
+ displayName: Options4.text("displayName").pipe(Options4.withDescription("The display name of the identity."))
627
+ }, handler10).pipe(Command17.withDescription("Update identity profile."));
628
+
629
+ // src/cli/commands/halo/index.ts
630
+ var halo = Command18.make("halo").pipe(Command18.withDescription("Manage HALO identity."), Command18.withSubcommands([
631
+ create,
632
+ credential,
633
+ identity,
634
+ keys,
635
+ recover,
636
+ seed,
637
+ update2
638
+ ]));
639
+
640
+ // src/cli/commands/profile/index.ts
641
+ import * as Command25 from "@effect/cli/Command";
642
+
643
+ // src/cli/commands/profile/create.ts
644
+ import * as Command19 from "@effect/cli/Command";
645
+ import * as Options5 from "@effect/cli/Options";
646
+ import * as FileSystem from "@effect/platform/FileSystem";
647
+ import * as Path from "@effect/platform/Path";
648
+ import * as Console14 from "effect/Console";
649
+ import * as Effect14 from "effect/Effect";
650
+ import * as Option6 from "effect/Option";
651
+ import * as Record from "effect/Record";
652
+ import { CommandConfig as CommandConfig14, print as print8 } from "@dxos/cli-util";
653
+ import { DX_CONFIG as DX_CONFIG2, getProfileConfigPath as getProfileConfigPath2 } from "@dxos/client-protocol";
654
+ import { trim } from "@dxos/util";
655
+
656
+ // src/cli/commands/profile/util.ts
657
+ import { FormBuilder as FormBuilder5 } from "@dxos/cli-util";
658
+ var printProfileCreated = (name, path) => FormBuilder5.make({
659
+ title: "Profile created"
660
+ }).pipe(FormBuilder5.set("name", name), FormBuilder5.set("path", path), FormBuilder5.build);
661
+ var printProfileDeleted = (name) => FormBuilder5.make({
662
+ title: "Profile deleted"
663
+ }).pipe(FormBuilder5.set("name", name), FormBuilder5.build);
664
+ var printProfileReset = (profile2) => FormBuilder5.make({
665
+ title: "Profile reset"
666
+ }).pipe(FormBuilder5.set("profile", profile2), FormBuilder5.build);
667
+ var printProfile = (profile2) => {
668
+ const title = profile2.isCurrent ? `${profile2.name} (current)` : profile2.name;
669
+ return FormBuilder5.make({
670
+ title
671
+ }).pipe(FormBuilder5.set("fullPath", profile2.fullPath), FormBuilder5.set("storagePath", profile2.storagePath), FormBuilder5.set("edge", profile2.edge ?? "<none>"), FormBuilder5.build);
672
+ };
673
+
674
+ // src/cli/commands/profile/create.ts
675
+ var TEMPLATES = {
676
+ default: trim`
677
+ version: 1
678
+ runtime:
679
+ client:
680
+ storage:
681
+ persistent: true
682
+ services:
683
+ edge:
684
+ url: https://edge-production.dxos.workers.dev
685
+ `,
686
+ main: trim`
687
+ version: 1
688
+ runtime:
689
+ client:
690
+ storage:
691
+ persistent: true
692
+ services:
693
+ edge:
694
+ url: https://edge-main.dxos.workers.dev
695
+ `,
696
+ dev: trim`
697
+ version: 1
698
+ runtime:
699
+ client:
700
+ storage:
701
+ persistent: true
702
+ services:
703
+ edge:
704
+ url: https://edge.dxos.workers.dev
705
+ `,
706
+ local: trim`
707
+ version: 1
708
+ runtime:
709
+ client:
710
+ storage:
711
+ persistent: true
712
+ services:
713
+ edge:
714
+ url: http://localhost:8787
715
+ `
716
+ };
717
+ var create2 = Command19.make("create", {
718
+ template: Options5.choice("template", Record.keys(TEMPLATES)).pipe(Options5.withDescription("Template to use"), Options5.withDefault("default")),
719
+ name: Options5.text("name").pipe(Options5.withDescription("Profile name"), Options5.optional)
720
+ }, Effect14.fnUntraced(function* ({ template, name }) {
721
+ const { json } = yield* CommandConfig14;
722
+ const fs = yield* FileSystem.FileSystem;
723
+ const path = yield* Path.Path;
724
+ const profileName = name.pipe(Option6.getOrElse(() => template));
725
+ const configPath = getProfileConfigPath2(DX_CONFIG2, profileName);
726
+ if (yield* fs.exists(configPath)) {
727
+ throw new Error(`Profile ${profileName} already exists`);
728
+ }
729
+ yield* fs.makeDirectory(path.dirname(configPath), {
730
+ recursive: true
731
+ });
732
+ yield* fs.writeFileString(configPath, TEMPLATES[template]);
733
+ if (json) {
734
+ yield* Console14.log(JSON.stringify({
735
+ name: profileName,
736
+ path: configPath
737
+ }, null, 2));
738
+ } else {
739
+ yield* Console14.log(print8(printProfileCreated(profileName, configPath)));
740
+ }
741
+ }));
742
+
743
+ // src/cli/commands/profile/delete.ts
744
+ import * as Command20 from "@effect/cli/Command";
745
+ import * as Options6 from "@effect/cli/Options";
746
+ import * as FileSystem3 from "@effect/platform/FileSystem";
747
+ import * as Console15 from "effect/Console";
748
+ import * as Effect15 from "effect/Effect";
749
+ import * as Option7 from "effect/Option";
750
+ import { CommandConfig as CommandConfig15, print as print9 } from "@dxos/cli-util";
751
+ import { DX_CONFIG as DX_CONFIG3, getProfileConfigPath as getProfileConfigPath3 } from "@dxos/client-protocol";
752
+ var del = Command20.make("delete", {
753
+ name: Options6.text("name").pipe(Options6.withDescription("Profile name"), Options6.optional)
754
+ }, Effect15.fnUntraced(function* ({ name }) {
755
+ const { json } = yield* CommandConfig15;
756
+ const fs = yield* FileSystem3.FileSystem;
757
+ const profileName = name.pipe(Option7.getOrElse(() => "default"));
758
+ const configPath = getProfileConfigPath3(DX_CONFIG3, profileName);
759
+ const pluginsPath = `${DX_CONFIG3}/plugins/${profileName}.yml`;
760
+ yield* fs.remove(configPath).pipe(Effect15.ignore);
761
+ yield* fs.remove(pluginsPath).pipe(Effect15.ignore);
762
+ if (json) {
763
+ yield* Console15.log(JSON.stringify({
764
+ name: profileName,
765
+ deleted: true
766
+ }, null, 2));
767
+ } else {
768
+ yield* Console15.log(print9(printProfileDeleted(profileName)));
769
+ }
770
+ }));
771
+
772
+ // src/cli/commands/profile/import.ts
773
+ import * as Command21 from "@effect/cli/Command";
774
+ import * as Options7 from "@effect/cli/Options";
775
+ import * as Prompt2 from "@effect/cli/Prompt";
776
+ import * as FileSystem5 from "@effect/platform/FileSystem";
777
+ import * as Path3 from "@effect/platform/Path";
778
+ import * as Console16 from "effect/Console";
779
+ import * as Effect16 from "effect/Effect";
780
+ import * as Option8 from "effect/Option";
781
+ import { CommandConfig as CommandConfig16 } from "@dxos/cli-util";
782
+ import { ConfigService as ConfigService2 } from "@dxos/config";
783
+ import { log as log17 } from "@dxos/log";
784
+ var __dxlog_file5 = "/__w/dxos/dxos/packages/plugins/plugin-client/src/cli/commands/profile/import.ts";
785
+ var handler11 = Effect16.fn(function* ({ file, dataDir, force }) {
786
+ const dataDirValue = Option8.getOrUndefined(dataDir);
787
+ const { json, profile: profile2 } = yield* CommandConfig16;
788
+ const fs = yield* FileSystem5.FileSystem;
789
+ const path = yield* Path3.Path;
790
+ const config2 = yield* ConfigService2;
791
+ const { createLevel, createStorageObjects, importProfileData, decodeProfileArchive } = yield* Effect16.promise(() => import("@dxos/client-services"));
792
+ let storageConfig;
793
+ if (!dataDirValue) {
794
+ if (!force) {
795
+ yield* Console16.log(`Will overwrite profile: ${profile2}`);
796
+ const confirmed = yield* Prompt2.confirm({
797
+ message: `Delete all data? (Profile: ${profile2})`,
798
+ initial: false
799
+ }).pipe(Prompt2.run);
800
+ if (!confirmed) {
801
+ return;
802
+ }
803
+ }
804
+ storageConfig = config2.values.runtime.client.storage;
805
+ } else {
806
+ const fullPath = path.resolve(dataDirValue);
807
+ yield* Console16.log(`Importing into: ${fullPath}`);
808
+ storageConfig = {
809
+ persistent: true,
810
+ dataRoot: fullPath
811
+ };
812
+ }
813
+ if (yield* fs.exists(storageConfig.dataRoot)) {
814
+ log17.error("data directory already exists", {
815
+ path: storageConfig.dataRoot
816
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file5, L: 44, S: this });
817
+ if (json) {
818
+ yield* Console16.log(JSON.stringify({
819
+ error: "Data directory already exists"
820
+ }, null, 2));
821
+ } else {
822
+ yield* Console16.log("Data directory already exists.");
823
+ }
824
+ return;
825
+ }
826
+ const data = yield* fs.readFile(file);
827
+ const archive = decodeProfileArchive(data);
828
+ yield* Console16.log(`Importing archive with ${archive.storage.length} entries`);
829
+ const { storage } = createStorageObjects(storageConfig);
830
+ const level = yield* Effect16.tryPromise({
831
+ try: () => createLevel(storageConfig),
832
+ catch: (error2) => new Error(`Failed to create level: ${error2}`)
833
+ });
834
+ yield* Console16.log("Beginning profile import...");
835
+ yield* Effect16.tryPromise({
836
+ try: () => importProfileData({
837
+ storage,
838
+ level
839
+ }, archive),
840
+ catch: (error2) => new Error(`Failed to import profile data: ${error2}`)
841
+ });
842
+ yield* Console16.log("Profile import complete");
843
+ if (json) {
844
+ yield* Console16.log(JSON.stringify({
845
+ success: true,
846
+ profile: profile2,
847
+ entries: archive.storage.length
848
+ }, null, 2));
849
+ }
850
+ });
851
+ var importCommand = Command21.make("import", {
852
+ file: Options7.text("file").pipe(Options7.withDescription("Archive filename."), Options7.withAlias("f")),
853
+ dataDir: Options7.text("data-dir").pipe(Options7.withDescription("Storage directory."), Options7.optional),
854
+ force: Options7.boolean("force", {
855
+ ifPresent: true
856
+ }).pipe(Options7.withDescription("Skip confirmation prompt."))
857
+ }, handler11).pipe(Command21.withDescription("Import profile."));
858
+
859
+ // src/cli/commands/profile/inspect.ts
860
+ import * as Command22 from "@effect/cli/Command";
861
+ import * as Options8 from "@effect/cli/Options";
862
+ import * as FileSystem7 from "@effect/platform/FileSystem";
863
+ import * as Console17 from "effect/Console";
864
+ import * as Effect17 from "effect/Effect";
865
+ import { CommandConfig as CommandConfig17, FormBuilder as FormBuilder6, print as print10 } from "@dxos/cli-util";
866
+ import { ProfileArchiveEntryType } from "@dxos/protocols";
867
+ import { arrayToBuffer } from "@dxos/util";
868
+ var handler12 = Effect17.fn(function* ({ file, storage }) {
869
+ const { json } = yield* CommandConfig17;
870
+ const fs = yield* FileSystem7.FileSystem;
871
+ const { decodeProfileArchive } = yield* Effect17.promise(() => import("@dxos/client-services"));
872
+ const data = yield* fs.readFile(file);
873
+ const archive = decodeProfileArchive(data);
874
+ if (json) {
875
+ yield* Console17.log(JSON.stringify({
876
+ meta: archive.meta,
877
+ ...storage ? {
878
+ storage: archive.storage
879
+ } : {}
880
+ }, null, 2));
881
+ } else {
882
+ const builder = FormBuilder6.make({
883
+ title: "Profile Archive"
884
+ }).pipe(FormBuilder6.when(archive.meta, FormBuilder6.each(Object.entries(archive.meta ?? {}), ([key, value]) => FormBuilder6.set(key, String(value)))), FormBuilder6.build);
885
+ yield* Console17.log(print10(builder));
886
+ if (storage) {
887
+ yield* Console17.log("\nStorage entries:\n");
888
+ for (const entry of archive.storage) {
889
+ const key = typeof entry.key === "string" ? entry.key : JSON.stringify(arrayToBuffer(entry.key).toString()).slice(1, -1);
890
+ yield* Console17.log(` ${ProfileArchiveEntryType[entry.type]} ${key}`);
891
+ }
892
+ }
893
+ }
894
+ });
895
+ var inspect = Command22.make("inspect", {
896
+ file: Options8.text("file").pipe(Options8.withDescription("Archive filename."), Options8.withAlias("f")),
897
+ storage: Options8.boolean("storage", {
898
+ ifPresent: true
899
+ }).pipe(Options8.withDescription("List storage entries."))
900
+ }, handler12).pipe(Command22.withDescription("Inspect profile archive."));
901
+
902
+ // src/cli/commands/profile/list.ts
903
+ import * as Command23 from "@effect/cli/Command";
904
+ import * as FileSystem9 from "@effect/platform/FileSystem";
905
+ import * as Path5 from "@effect/platform/Path";
906
+ import * as Console18 from "effect/Console";
907
+ import * as Effect18 from "effect/Effect";
908
+ import * as Yaml2 from "yaml";
909
+ import { CommandConfig as CommandConfig18, printList as printList3 } from "@dxos/cli-util";
910
+ import { Config } from "@dxos/client";
911
+ import { DX_CONFIG as DX_CONFIG4, DX_DATA, getProfilePath } from "@dxos/client-protocol";
912
+ var list3 = Command23.make("list", {}, Effect18.fnUntraced(function* () {
913
+ const { profile: currentProfile } = yield* CommandConfig18;
914
+ const fs = yield* FileSystem9.FileSystem;
915
+ const path = yield* Path5.Path;
916
+ const profileDir = path.join(DX_CONFIG4, "profile");
917
+ const entries = yield* fs.readDirectory(profileDir);
918
+ const profileFiles = entries.filter((entry) => entry.endsWith(".yml"));
919
+ const profiles = yield* Effect18.forEach(profileFiles, (filename) => Effect18.gen(function* () {
920
+ const name = filename.slice(0, -4);
921
+ const configPath = path.join(profileDir, filename);
922
+ const configContent = yield* fs.readFileString(configPath).pipe(Effect18.catchTag("SystemError", () => Effect18.succeed("{}")));
923
+ const configValues = Yaml2.parse(configContent) ?? {};
924
+ const config2 = new Config(configValues);
925
+ return {
926
+ name,
927
+ isCurrent: name === currentProfile,
928
+ fullPath: configPath,
929
+ storagePath: getProfilePath(configValues?.runtime?.client?.storage?.dataRoot ?? DX_DATA, name),
930
+ edge: config2.values.runtime?.services?.edge?.url
931
+ };
932
+ }));
933
+ const { json } = yield* CommandConfig18;
934
+ if (json) {
935
+ yield* Console18.log(JSON.stringify(profiles, null, 2));
936
+ } else {
937
+ const formatted = profiles.map(printProfile);
938
+ yield* Console18.log(printList3(formatted));
939
+ }
940
+ }));
941
+
942
+ // src/cli/commands/profile/reset.ts
943
+ import * as Command24 from "@effect/cli/Command";
944
+ import * as Options9 from "@effect/cli/Options";
945
+ import * as Prompt3 from "@effect/cli/Prompt";
946
+ import * as FileSystem11 from "@effect/platform/FileSystem";
947
+ import * as Console19 from "effect/Console";
948
+ import * as Effect19 from "effect/Effect";
949
+ import { CommandConfig as CommandConfig19, print as print11 } from "@dxos/cli-util";
950
+ import { DX_DATA as DX_DATA2, getProfilePath as getProfilePath2 } from "@dxos/client-protocol";
951
+ import { ConfigService as ConfigService3 } from "@dxos/config";
952
+ var reset = Command24.make("reset", {
953
+ force: Options9.boolean("force", {
954
+ ifPresent: true
955
+ }).pipe(Options9.withDescription("Skip confirmation prompt"))
956
+ }, Effect19.fnUntraced(function* ({ force }) {
957
+ const fs = yield* FileSystem11.FileSystem;
958
+ const config2 = yield* ConfigService3;
959
+ const { json, profile: profile2 } = yield* CommandConfig19;
960
+ const path = config2.values.runtime?.client?.storage?.dataRoot ?? getProfilePath2(DX_DATA2, profile2);
961
+ if (!force) {
962
+ const confirmed = yield* Prompt3.confirm({
963
+ message: `Are you sure you want to reset the profile (${profile2})?`,
964
+ initial: false
965
+ });
966
+ if (!confirmed) {
967
+ return;
968
+ }
969
+ }
970
+ yield* fs.remove(path, {
971
+ recursive: true
972
+ });
973
+ if (json) {
974
+ yield* Console19.log(JSON.stringify({
975
+ profile: profile2,
976
+ reset: true
977
+ }, null, 2));
978
+ } else {
979
+ yield* Console19.log(print11(printProfileReset(profile2)));
980
+ }
981
+ }));
982
+
983
+ // src/cli/commands/profile/index.ts
984
+ var profile = Command25.make("profile").pipe(Command25.withDescription("Profile commands."), Command25.withSubcommands([
985
+ create2,
986
+ del,
987
+ importCommand,
988
+ inspect,
989
+ list3,
990
+ reset
991
+ ]));
992
+
993
+ // src/cli/plugin.ts
994
+ var ClientPlugin = Plugin2.define(meta).pipe(
995
+ // TODO(wittjosiah): Could some of these commands make use of operations?
996
+ AppPlugin.addCommandModule({
997
+ commands: [
998
+ config,
999
+ device,
1000
+ edge,
1001
+ halo,
1002
+ profile
1003
+ ]
1004
+ }),
1005
+ AppPlugin.addOperationHandlerModule({
1006
+ activate: OperationHandler
1007
+ }),
1008
+ Plugin2.addModule((options) => ({
1009
+ id: Capability.getModuleTag(Client),
1010
+ activatesOn: ActivationEvents.Startup,
1011
+ firesAfterActivation: [
1012
+ ClientEvents.ClientReady
1013
+ ],
1014
+ activate: () => Client(options)
1015
+ })),
1016
+ Plugin2.addModule({
1017
+ activatesOn: ClientEvents.ClientReady,
1018
+ firesBeforeActivation: [
1019
+ AppActivationEvents.SetupSchema
1020
+ ],
1021
+ activate: SchemaDefs
1022
+ }),
1023
+ Plugin2.make
1024
+ );
1025
+ export {
1026
+ ClientPlugin
1027
+ };
1028
+ //# sourceMappingURL=index.mjs.map