@dxos/plugin-client 0.8.4-main.72ec0f3 → 0.8.4-main.7996785055
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.
- package/dist/lib/browser/DevicesContainer-6AMXWDQC.mjs +270 -0
- package/dist/lib/browser/DevicesContainer-6AMXWDQC.mjs.map +7 -0
- package/dist/lib/browser/JoinDialog-V6E5PRDR.mjs +61 -0
- package/dist/lib/browser/JoinDialog-V6E5PRDR.mjs.map +7 -0
- package/dist/lib/browser/ProfileContainer-NY67SRMY.mjs +172 -0
- package/dist/lib/browser/ProfileContainer-NY67SRMY.mjs.map +7 -0
- package/dist/lib/browser/RecoveryCodeDialog-EI2PAJSC.mjs +61 -0
- package/dist/lib/browser/RecoveryCodeDialog-EI2PAJSC.mjs.map +7 -0
- package/dist/lib/browser/RecoveryCredentialsContainer-EY7S2Z5D.mjs +59 -0
- package/dist/lib/browser/RecoveryCredentialsContainer-EY7S2Z5D.mjs.map +7 -0
- package/dist/lib/browser/ResetDialog-IG33IDFF.mjs +54 -0
- package/dist/lib/browser/ResetDialog-IG33IDFF.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-VALIFJHW.mjs +125 -0
- package/dist/lib/browser/app-graph-builder-VALIFJHW.mjs.map +7 -0
- package/dist/lib/browser/chunk-5JMLFUGB.mjs +177 -0
- package/dist/lib/browser/chunk-5JMLFUGB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RDIG75CA.mjs → chunk-AYDQURY2.mjs} +35 -13
- package/dist/lib/browser/chunk-AYDQURY2.mjs.map +7 -0
- package/dist/lib/browser/chunk-C2DNTTWV.mjs +18 -0
- package/dist/lib/browser/chunk-C2DNTTWV.mjs.map +7 -0
- package/dist/lib/browser/chunk-HSFDKP5D.mjs +15 -0
- package/dist/lib/browser/chunk-HSFDKP5D.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZRVMXLDR.mjs → chunk-JHSBBOCI.mjs} +2 -2
- package/dist/lib/browser/chunk-JHSBBOCI.mjs.map +7 -0
- package/dist/lib/browser/chunk-RGQBPDPU.mjs +8 -0
- package/dist/lib/browser/chunk-RGQBPDPU.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +1071 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/client-ZBVFWBCD.mjs +95 -0
- package/dist/lib/browser/client-ZBVFWBCD.mjs.map +7 -0
- package/dist/lib/browser/create-agent-RVXHS2OH.mjs +35 -0
- package/dist/lib/browser/create-agent-RVXHS2OH.mjs.map +7 -0
- package/dist/lib/browser/create-identity-4WNBRKDW.mjs +31 -0
- package/dist/lib/browser/create-identity-4WNBRKDW.mjs.map +7 -0
- package/dist/lib/browser/create-passkey-2EEPMDV5.mjs +90 -0
- package/dist/lib/browser/create-passkey-2EEPMDV5.mjs.map +7 -0
- package/dist/lib/browser/create-recovery-code-BPF6HKWF.mjs +45 -0
- package/dist/lib/browser/create-recovery-code-BPF6HKWF.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +76 -84
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/join-identity-DVJMX65P.mjs +28 -0
- package/dist/lib/browser/join-identity-DVJMX65P.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/migrations-I3DAEO7O.mjs +26 -0
- package/dist/lib/browser/migrations-I3DAEO7O.mjs.map +7 -0
- package/dist/lib/browser/operation-handler-C4KCDS7Z.mjs +17 -0
- package/dist/lib/browser/operation-handler-C4KCDS7Z.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/react-context-YAEJ65GW.mjs +27 -0
- package/dist/lib/browser/react-context-YAEJ65GW.mjs.map +7 -0
- package/dist/lib/browser/react-surface-FLUCQMIE.mjs +78 -0
- package/dist/lib/browser/react-surface-FLUCQMIE.mjs.map +7 -0
- package/dist/lib/browser/recover-identity-74HATOKZ.mjs +27 -0
- package/dist/lib/browser/recover-identity-74HATOKZ.mjs.map +7 -0
- package/dist/lib/browser/redeem-passkey-FUNL7BVW.mjs +55 -0
- package/dist/lib/browser/redeem-passkey-FUNL7BVW.mjs.map +7 -0
- package/dist/lib/browser/redeem-token-GIPESPST.mjs +38 -0
- package/dist/lib/browser/redeem-token-GIPESPST.mjs.map +7 -0
- package/dist/lib/browser/reset-storage-GLHDCVZ4.mjs +27 -0
- package/dist/lib/browser/reset-storage-GLHDCVZ4.mjs.map +7 -0
- package/dist/lib/browser/schema-defs-VNCHLGPQ.mjs +29 -0
- package/dist/lib/browser/schema-defs-VNCHLGPQ.mjs.map +7 -0
- package/dist/lib/browser/share-identity-VWFBNFO3.mjs +32 -0
- package/dist/lib/browser/share-identity-VWFBNFO3.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +22 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +9 -4
- package/dist/lib/node-esm/DevicesContainer-FCHPW753.mjs +271 -0
- package/dist/lib/node-esm/DevicesContainer-FCHPW753.mjs.map +7 -0
- package/dist/lib/node-esm/JoinDialog-PQHUAN5Y.mjs +62 -0
- package/dist/lib/node-esm/JoinDialog-PQHUAN5Y.mjs.map +7 -0
- package/dist/lib/node-esm/ProfileContainer-H24VZJE3.mjs +173 -0
- package/dist/lib/node-esm/ProfileContainer-H24VZJE3.mjs.map +7 -0
- package/dist/lib/node-esm/RecoveryCodeDialog-PWBHIQ6D.mjs +62 -0
- package/dist/lib/node-esm/RecoveryCodeDialog-PWBHIQ6D.mjs.map +7 -0
- package/dist/lib/node-esm/RecoveryCredentialsContainer-BLURHMW6.mjs +60 -0
- package/dist/lib/node-esm/RecoveryCredentialsContainer-BLURHMW6.mjs.map +7 -0
- package/dist/lib/node-esm/ResetDialog-NSALOOOA.mjs +55 -0
- package/dist/lib/node-esm/ResetDialog-NSALOOOA.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-44YGDMXN.mjs +126 -0
- package/dist/lib/node-esm/app-graph-builder-44YGDMXN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-42EQVH2Q.mjs +10 -0
- package/dist/lib/node-esm/chunk-42EQVH2Q.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-VENKFPBC.mjs → chunk-5NENK2KO.mjs} +35 -13
- package/dist/lib/node-esm/chunk-5NENK2KO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QT3EQXDU.mjs → chunk-BOTJSPCT.mjs} +2 -2
- package/dist/lib/node-esm/chunk-BOTJSPCT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ETBW54NV.mjs +20 -0
- package/dist/lib/node-esm/chunk-ETBW54NV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-FU7MBWDD.mjs +178 -0
- package/dist/lib/node-esm/chunk-FU7MBWDD.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-VLNCZYIC.mjs +16 -0
- package/dist/lib/node-esm/chunk-VLNCZYIC.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +1072 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/client-OFM3CBYZ.mjs +96 -0
- package/dist/lib/node-esm/client-OFM3CBYZ.mjs.map +7 -0
- package/dist/lib/node-esm/create-agent-QIWBTZSQ.mjs +36 -0
- package/dist/lib/node-esm/create-agent-QIWBTZSQ.mjs.map +7 -0
- package/dist/lib/node-esm/create-identity-P7WDMAE7.mjs +32 -0
- package/dist/lib/node-esm/create-identity-P7WDMAE7.mjs.map +7 -0
- package/dist/lib/node-esm/create-passkey-77HCW3ES.mjs +91 -0
- package/dist/lib/node-esm/create-passkey-77HCW3ES.mjs.map +7 -0
- package/dist/lib/node-esm/create-recovery-code-CCDGTSPG.mjs +46 -0
- package/dist/lib/node-esm/create-recovery-code-CCDGTSPG.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +76 -84
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/join-identity-NOGEP7RA.mjs +29 -0
- package/dist/lib/node-esm/join-identity-NOGEP7RA.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/migrations-UXF725OZ.mjs +27 -0
- package/dist/lib/node-esm/migrations-UXF725OZ.mjs.map +7 -0
- package/dist/lib/node-esm/operation-handler-KC5K4KGW.mjs +18 -0
- package/dist/lib/node-esm/operation-handler-KC5K4KGW.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/react-context-QBDHUDWD.mjs +28 -0
- package/dist/lib/node-esm/react-context-QBDHUDWD.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-P5WSXPAW.mjs +79 -0
- package/dist/lib/node-esm/react-surface-P5WSXPAW.mjs.map +7 -0
- package/dist/lib/node-esm/recover-identity-DTFXXLZD.mjs +28 -0
- package/dist/lib/node-esm/recover-identity-DTFXXLZD.mjs.map +7 -0
- package/dist/lib/node-esm/redeem-passkey-BXNNAV2J.mjs +56 -0
- package/dist/lib/node-esm/redeem-passkey-BXNNAV2J.mjs.map +7 -0
- package/dist/lib/node-esm/redeem-token-XBW7OPDA.mjs +39 -0
- package/dist/lib/node-esm/redeem-token-XBW7OPDA.mjs.map +7 -0
- package/dist/lib/node-esm/reset-storage-SXIZA4DV.mjs +28 -0
- package/dist/lib/node-esm/reset-storage-SXIZA4DV.mjs.map +7 -0
- package/dist/lib/node-esm/schema-defs-2UZZD4Q4.mjs +30 -0
- package/dist/lib/node-esm/schema-defs-2UZZD4Q4.mjs.map +7 -0
- package/dist/lib/node-esm/share-identity-TEHV6CZC.mjs +33 -0
- package/dist/lib/node-esm/share-identity-TEHV6CZC.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +23 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +9 -4
- package/dist/types/src/ClientPlugin.d.ts +2 -1
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/client/client.d.ts +8 -0
- package/dist/types/src/capabilities/client/client.d.ts.map +1 -0
- package/dist/types/src/capabilities/client/index.d.ts +18 -0
- package/dist/types/src/capabilities/client/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +7 -19
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations/index.d.ts +3 -0
- package/dist/types/src/capabilities/migrations/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/migrations/migrations.d.ts +5 -0
- package/dist/types/src/capabilities/migrations/migrations.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler/index.d.ts +4 -0
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context/index.d.ts +7 -0
- package/dist/types/src/capabilities/react-context/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context/react-context.d.ts +10 -0
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +9 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema-defs/index.d.ts +3 -0
- package/dist/types/src/capabilities/schema-defs/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema-defs/schema-defs.d.ts +5 -0
- package/dist/types/src/capabilities/schema-defs/schema-defs.d.ts.map +1 -0
- package/dist/types/src/cli/commands/config/index.d.ts +5 -0
- package/dist/types/src/cli/commands/config/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/config/view.d.ts +5 -0
- package/dist/types/src/cli/commands/config/view.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/index.d.ts +7 -0
- package/dist/types/src/cli/commands/device/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/info/index.d.ts +2 -0
- package/dist/types/src/cli/commands/device/info/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/info/info.d.ts +7 -0
- package/dist/types/src/cli/commands/device/info/info.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/info/info.test.d.ts +2 -0
- package/dist/types/src/cli/commands/device/info/info.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/list/index.d.ts +2 -0
- package/dist/types/src/cli/commands/device/list/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/list/list.d.ts +7 -0
- package/dist/types/src/cli/commands/device/list/list.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/list/list.test.d.ts +2 -0
- package/dist/types/src/cli/commands/device/list/list.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/update/index.d.ts +2 -0
- package/dist/types/src/cli/commands/device/update/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/update/update.d.ts +11 -0
- package/dist/types/src/cli/commands/device/update/update.d.ts.map +1 -0
- package/dist/types/src/cli/commands/device/util.d.ts +16 -0
- package/dist/types/src/cli/commands/device/util.d.ts.map +1 -0
- package/dist/types/src/cli/commands/edge/index.d.ts +5 -0
- package/dist/types/src/cli/commands/edge/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/edge/status.d.ts +7 -0
- package/dist/types/src/cli/commands/edge/status.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/create/create.d.ts +15 -0
- package/dist/types/src/cli/commands/halo/create/create.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/create/create.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/create/create.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/create/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/create/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/credential/add/add.d.ts +13 -0
- package/dist/types/src/cli/commands/halo/credential/add/add.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/credential/add/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/credential/add/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/credential/index.d.ts +12 -0
- package/dist/types/src/cli/commands/halo/credential/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/credential/list/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/credential/list/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/credential/list/list.d.ts +19 -0
- package/dist/types/src/cli/commands/halo/credential/list/list.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/credential/list/list.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/credential/list/list.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/identity/identity.d.ts +7 -0
- package/dist/types/src/cli/commands/halo/identity/identity.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/identity/identity.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/identity/identity.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/identity/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/identity/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/index.d.ts +3 -0
- package/dist/types/src/cli/commands/halo/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/join/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/join/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/join/join.d.ts +8 -0
- package/dist/types/src/cli/commands/halo/join/join.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/join/join.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/join/join.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/keys/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/keys/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/keys/keys.d.ts +7 -0
- package/dist/types/src/cli/commands/halo/keys/keys.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/keys/keys.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/keys/keys.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/recover/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/recover/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/recover/recover.d.ts +7 -0
- package/dist/types/src/cli/commands/halo/recover/recover.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/recover/recover.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/recover/recover.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/seed/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/seed/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/seed/seed.d.ts +7 -0
- package/dist/types/src/cli/commands/halo/seed/seed.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/share/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/share/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/share/share.d.ts +15 -0
- package/dist/types/src/cli/commands/halo/share/share.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/update/index.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/update/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/update/update.d.ts +11 -0
- package/dist/types/src/cli/commands/halo/update/update.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/update/update.test.d.ts +2 -0
- package/dist/types/src/cli/commands/halo/update/update.test.d.ts.map +1 -0
- package/dist/types/src/cli/commands/halo/util.d.ts +13 -0
- package/dist/types/src/cli/commands/halo/util.d.ts.map +1 -0
- package/dist/types/src/cli/commands/index.d.ts +6 -0
- package/dist/types/src/cli/commands/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/create.d.ts +10 -0
- package/dist/types/src/cli/commands/profile/create.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/delete.d.ts +8 -0
- package/dist/types/src/cli/commands/profile/delete.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/import.d.ts +17 -0
- package/dist/types/src/cli/commands/profile/import.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/index.d.ts +19 -0
- package/dist/types/src/cli/commands/profile/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/inspect.d.ts +13 -0
- package/dist/types/src/cli/commands/profile/inspect.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/list.d.ts +6 -0
- package/dist/types/src/cli/commands/profile/list.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/reset.d.ts +8 -0
- package/dist/types/src/cli/commands/profile/reset.d.ts.map +1 -0
- package/dist/types/src/cli/commands/profile/util.d.ts +24 -0
- package/dist/types/src/cli/commands/profile/util.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +4 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/cli/testing/test-console.d.ts +37 -0
- package/dist/types/src/cli/testing/test-console.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -6
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +4 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.d.ts.map +1 -0
- package/dist/types/src/{components → containers/DevicesContainer}/DevicesContainer.stories.d.ts +10 -54
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DevicesContainer/index.d.ts +3 -0
- package/dist/types/src/containers/DevicesContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/JoinDialog}/JoinDialog.d.ts +0 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.d.ts.map +1 -0
- package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts +15 -0
- package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/JoinDialog/index.d.ts +3 -0
- package/dist/types/src/containers/JoinDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.stories.d.ts +14 -0
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ProfileContainer/index.d.ts +3 -0
- package/dist/types/src/containers/ProfileContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.d.ts +0 -1
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.stories.d.ts +16 -0
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCodeDialog/index.d.ts +4 -0
- package/dist/types/src/containers/RecoveryCodeDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.d.ts +14 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/index.d.ts +3 -0
- package/dist/types/src/containers/RecoveryCredentialsContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts +9 -0
- package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts.map +1 -0
- package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts +19 -0
- package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ResetDialog/index.d.ts +4 -0
- package/dist/types/src/containers/ResetDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +10 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-agent.d.ts +5 -0
- package/dist/types/src/operations/create-agent.d.ts.map +1 -0
- package/dist/types/src/operations/create-identity.d.ts +5 -0
- package/dist/types/src/operations/create-identity.d.ts.map +1 -0
- package/dist/types/src/operations/create-passkey.d.ts +5 -0
- package/dist/types/src/operations/create-passkey.d.ts.map +1 -0
- package/dist/types/src/operations/create-recovery-code.d.ts +5 -0
- package/dist/types/src/operations/create-recovery-code.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +36 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/join-identity.d.ts +5 -0
- package/dist/types/src/operations/join-identity.d.ts.map +1 -0
- package/dist/types/src/operations/recover-identity.d.ts +5 -0
- package/dist/types/src/operations/recover-identity.d.ts.map +1 -0
- package/dist/types/src/operations/redeem-passkey.d.ts +5 -0
- package/dist/types/src/operations/redeem-passkey.d.ts.map +1 -0
- package/dist/types/src/operations/redeem-token.d.ts +5 -0
- package/dist/types/src/operations/redeem-token.d.ts.map +1 -0
- package/dist/types/src/operations/reset-storage.d.ts +5 -0
- package/dist/types/src/operations/reset-storage.d.ts.map +1 -0
- package/dist/types/src/operations/share-identity.d.ts +5 -0
- package/dist/types/src/operations/share-identity.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/initializeIdentity.d.ts +13 -0
- package/dist/types/src/testing/initializeIdentity.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -48
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +10 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +9 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +36 -31
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +74 -38
- package/src/ClientPlugin.ts +45 -55
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +97 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/client/client.ts +79 -0
- package/src/capabilities/client/index.ts +7 -0
- package/src/capabilities/index.ts +7 -11
- package/src/capabilities/migrations/index.ts +7 -0
- package/src/capabilities/migrations/migrations.ts +30 -0
- package/src/capabilities/operation-handler/index.ts +11 -0
- package/src/capabilities/operation-handler/operation-handler.ts +16 -0
- package/src/capabilities/react-context/index.ts +7 -0
- package/src/capabilities/react-context/react-context.tsx +25 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +74 -0
- package/src/capabilities/schema-defs/index.ts +7 -0
- package/src/capabilities/schema-defs/schema-defs.ts +36 -0
- package/src/cli/commands/config/index.ts +12 -0
- package/src/cli/commands/config/view.ts +29 -0
- package/src/cli/commands/device/index.ts +14 -0
- package/src/cli/commands/device/info/index.ts +5 -0
- package/src/cli/commands/device/info/info.test.ts +28 -0
- package/src/cli/commands/device/info/info.ts +48 -0
- package/src/cli/commands/device/list/index.ts +5 -0
- package/src/cli/commands/device/list/list.test.ts +30 -0
- package/src/cli/commands/device/list/list.ts +28 -0
- package/src/cli/commands/device/update/index.ts +5 -0
- package/src/cli/commands/device/update/update.ts +68 -0
- package/src/cli/commands/device/util.ts +55 -0
- package/src/cli/commands/edge/index.ts +12 -0
- package/src/cli/commands/edge/status.ts +46 -0
- package/src/cli/commands/halo/create/create.test.ts +52 -0
- package/src/cli/commands/halo/create/create.ts +82 -0
- package/src/cli/commands/halo/create/index.ts +5 -0
- package/src/cli/commands/halo/credential/add/add.ts +97 -0
- package/src/cli/commands/halo/credential/add/index.ts +5 -0
- package/src/cli/commands/halo/credential/index.ts +13 -0
- package/src/cli/commands/halo/credential/list/index.ts +5 -0
- package/src/cli/commands/halo/credential/list/list.test.ts +27 -0
- package/src/cli/commands/halo/credential/list/list.ts +115 -0
- package/src/cli/commands/halo/identity/identity.test.ts +40 -0
- package/src/cli/commands/halo/identity/identity.ts +45 -0
- package/src/cli/commands/halo/identity/index.ts +5 -0
- package/src/cli/commands/halo/index.ts +21 -0
- package/src/cli/commands/halo/join/index.ts +5 -0
- package/src/cli/commands/halo/join/join.test.ts +10 -0
- package/src/cli/commands/halo/join/join.ts +87 -0
- package/src/cli/commands/halo/keys/index.ts +5 -0
- package/src/cli/commands/halo/keys/keys.test.ts +29 -0
- package/src/cli/commands/halo/keys/keys.ts +40 -0
- package/src/cli/commands/halo/recover/index.ts +5 -0
- package/src/cli/commands/halo/recover/recover.test.ts +10 -0
- package/src/cli/commands/halo/recover/recover.ts +44 -0
- package/src/cli/commands/halo/seed/index.ts +5 -0
- package/src/cli/commands/halo/seed/seed.ts +36 -0
- package/src/cli/commands/halo/share/index.ts +5 -0
- package/src/cli/commands/halo/share/share.ts +97 -0
- package/src/cli/commands/halo/update/index.ts +5 -0
- package/src/cli/commands/halo/update/update.test.ts +28 -0
- package/src/cli/commands/halo/update/update.ts +67 -0
- package/src/cli/commands/halo/util.ts +18 -0
- package/src/cli/commands/index.ts +9 -0
- package/src/cli/commands/profile/create.ts +90 -0
- package/src/cli/commands/profile/delete.ts +36 -0
- package/src/cli/commands/profile/import.ts +101 -0
- package/src/cli/commands/profile/index.ts +17 -0
- package/src/cli/commands/profile/inspect.ts +64 -0
- package/src/cli/commands/profile/list.ts +55 -0
- package/src/cli/commands/profile/reset.ts +45 -0
- package/src/cli/commands/profile/util.ts +48 -0
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +34 -0
- package/src/cli/testing/test-console.ts +88 -0
- package/src/components/index.ts +0 -7
- package/src/constants.ts +9 -0
- package/src/{components → containers/DevicesContainer}/DevicesContainer.stories.tsx +15 -10
- package/src/{components → containers/DevicesContainer}/DevicesContainer.tsx +60 -66
- package/src/containers/DevicesContainer/index.ts +7 -0
- package/src/containers/JoinDialog/JoinDialog.stories.tsx +43 -0
- package/src/containers/JoinDialog/JoinDialog.tsx +56 -0
- package/src/containers/JoinDialog/index.ts +7 -0
- package/src/{components → containers/ProfileContainer}/ProfileContainer.stories.tsx +4 -4
- package/src/{components → containers/ProfileContainer}/ProfileContainer.tsx +65 -54
- package/src/containers/ProfileContainer/index.ts +7 -0
- package/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.stories.tsx +4 -4
- package/src/{components → containers/RecoveryCodeDialog}/RecoveryCodeDialog.tsx +28 -27
- package/src/containers/RecoveryCodeDialog/index.ts +8 -0
- package/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.tsx +47 -0
- package/src/{components → containers/RecoveryCredentialsContainer}/RecoveryCredentialsContainer.tsx +22 -23
- package/src/containers/RecoveryCredentialsContainer/index.ts +7 -0
- package/src/containers/ResetDialog/ResetDialog.stories.tsx +73 -0
- package/src/containers/ResetDialog/ResetDialog.tsx +50 -0
- package/src/containers/ResetDialog/index.ts +8 -0
- package/src/containers/index.ts +15 -0
- package/src/index.ts +1 -2
- package/src/meta.ts +3 -3
- package/src/operations/create-agent.ts +27 -0
- package/src/operations/create-identity.ts +30 -0
- package/src/operations/create-passkey.ts +64 -0
- package/src/operations/create-recovery-code.ts +35 -0
- package/src/operations/definitions.ts +107 -0
- package/src/operations/index.ts +20 -0
- package/src/operations/join-identity.ts +29 -0
- package/src/operations/recover-identity.ts +29 -0
- package/src/operations/redeem-passkey.ts +55 -0
- package/src/operations/redeem-token.ts +32 -0
- package/src/operations/reset-storage.ts +28 -0
- package/src/operations/share-identity.ts +27 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/initializeIdentity.ts +24 -0
- package/src/translations.ts +6 -3
- package/src/types/capabilities.ts +16 -0
- package/src/types/events.ts +15 -0
- package/src/types/index.ts +2 -0
- package/src/types/schema.ts +27 -19
- package/dist/lib/browser/app-graph-builder-ARY4H3VC.mjs +0 -124
- package/dist/lib/browser/app-graph-builder-ARY4H3VC.mjs.map +0 -7
- package/dist/lib/browser/chunk-4G4YWIUQ.mjs +0 -686
- package/dist/lib/browser/chunk-4G4YWIUQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-4LRO3Y2O.mjs +0 -19
- package/dist/lib/browser/chunk-4LRO3Y2O.mjs.map +0 -7
- package/dist/lib/browser/chunk-N5UR2HOE.mjs +0 -18
- package/dist/lib/browser/chunk-N5UR2HOE.mjs.map +0 -7
- package/dist/lib/browser/chunk-RDIG75CA.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZRVMXLDR.mjs.map +0 -7
- package/dist/lib/browser/client-O7U3MQ6J.mjs +0 -43
- package/dist/lib/browser/client-O7U3MQ6J.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-KLK7PJZK.mjs +0 -305
- package/dist/lib/browser/intent-resolver-KLK7PJZK.mjs.map +0 -7
- package/dist/lib/browser/migrations-RUAKBBTF.mjs +0 -23
- package/dist/lib/browser/migrations-RUAKBBTF.mjs.map +0 -7
- package/dist/lib/browser/react-context-PCT5C3BN.mjs +0 -25
- package/dist/lib/browser/react-context-PCT5C3BN.mjs.map +0 -7
- package/dist/lib/browser/react-surface-RCXEA65V.mjs +0 -66
- package/dist/lib/browser/react-surface-RCXEA65V.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-UNNBAEFW.mjs +0 -25
- package/dist/lib/browser/schema-defs-UNNBAEFW.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-LLM25DRR.mjs +0 -125
- package/dist/lib/node-esm/app-graph-builder-LLM25DRR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6ANOJ7ZM.mjs +0 -19
- package/dist/lib/node-esm/chunk-6ANOJ7ZM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7M7VWQJW.mjs +0 -20
- package/dist/lib/node-esm/chunk-7M7VWQJW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DJ6XKSE4.mjs +0 -687
- package/dist/lib/node-esm/chunk-DJ6XKSE4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QT3EQXDU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VENKFPBC.mjs.map +0 -7
- package/dist/lib/node-esm/client-6MTNT7M6.mjs +0 -44
- package/dist/lib/node-esm/client-6MTNT7M6.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-YR2C224X.mjs +0 -306
- package/dist/lib/node-esm/intent-resolver-YR2C224X.mjs.map +0 -7
- package/dist/lib/node-esm/migrations-ASF2SAUR.mjs +0 -24
- package/dist/lib/node-esm/migrations-ASF2SAUR.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-F4QOBWSP.mjs +0 -26
- package/dist/lib/node-esm/react-context-F4QOBWSP.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-SQBRXVMZ.mjs +0 -67
- package/dist/lib/node-esm/react-surface-SQBRXVMZ.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-MSIT2KK2.mjs +0 -26
- package/dist/lib/node-esm/schema-defs-MSIT2KK2.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -9
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/client.d.ts +0 -9
- package/dist/types/src/capabilities/client.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -8
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/migrations.d.ts +0 -4
- package/dist/types/src/capabilities/migrations.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context.d.ts +0 -8
- package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -8
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +0 -4
- package/dist/types/src/capabilities/schema-defs.d.ts.map +0 -1
- package/dist/types/src/components/DevicesContainer.d.ts.map +0 -1
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +0 -1
- package/dist/types/src/components/ProfileContainer.d.ts.map +0 -1
- package/dist/types/src/components/ProfileContainer.stories.d.ts +0 -60
- package/dist/types/src/components/ProfileContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +0 -1
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +0 -62
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +0 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +0 -60
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ResetDialog.d.ts +0 -7
- package/dist/types/src/components/ResetDialog.d.ts.map +0 -1
- package/dist/types/src/components/ResetDialog.stories.d.ts +0 -65
- package/dist/types/src/components/ResetDialog.stories.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -8
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -115
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/client.ts +0 -43
- package/src/capabilities/intent-resolver.ts +0 -251
- package/src/capabilities/migrations.ts +0 -25
- package/src/capabilities/react-context.tsx +0 -22
- package/src/capabilities/react-surface.tsx +0 -67
- package/src/capabilities/schema-defs.ts +0 -29
- package/src/components/JoinDialog.tsx +0 -54
- package/src/components/RecoveryCredentialsContainer.stories.tsx +0 -42
- package/src/components/ResetDialog.stories.tsx +0 -52
- package/src/components/ResetDialog.tsx +0 -50
- package/src/events.ts +0 -15
- /package/dist/types/src/{components → containers/DevicesContainer}/DevicesContainer.d.ts +0 -0
- /package/dist/types/src/{components → containers/ProfileContainer}/ProfileContainer.d.ts +0 -0
- /package/dist/types/src/{components → containers/RecoveryCredentialsContainer}/RecoveryCredentialsContainer.d.ts +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
11
|
+
|
|
12
|
+
import { JOIN_DIALOG, RECOVERY_CODE_DIALOG, RESET_DIALOG } from '../../constants';
|
|
13
|
+
import {
|
|
14
|
+
DevicesContainer,
|
|
15
|
+
JoinDialog,
|
|
16
|
+
ProfileContainer,
|
|
17
|
+
RecoveryCodeDialog,
|
|
18
|
+
type RecoveryCodeDialogProps,
|
|
19
|
+
RecoveryCredentialsContainer,
|
|
20
|
+
ResetDialog,
|
|
21
|
+
type ResetDialogProps,
|
|
22
|
+
} from '../../containers';
|
|
23
|
+
import { Account, type ClientPluginOptions } from '../../types';
|
|
24
|
+
|
|
25
|
+
type ReactSurfaceOptions = Pick<ClientPluginOptions, 'onReset'> & {
|
|
26
|
+
createInvitationUrl: (invitationCode: string) => string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default Capability.makeModule(
|
|
30
|
+
Effect.fnUntraced(function* ({ createInvitationUrl, onReset }: ReactSurfaceOptions) {
|
|
31
|
+
const capabilityManager = yield* Capability.Service;
|
|
32
|
+
|
|
33
|
+
return Capability.contributes(Capabilities.ReactSurface, [
|
|
34
|
+
Surface.create({
|
|
35
|
+
id: Account.Profile,
|
|
36
|
+
role: 'article',
|
|
37
|
+
filter: (data): data is any => data.subject === Account.Profile,
|
|
38
|
+
component: () => <ProfileContainer />,
|
|
39
|
+
}),
|
|
40
|
+
Surface.create({
|
|
41
|
+
id: Account.Devices,
|
|
42
|
+
role: 'article',
|
|
43
|
+
filter: (data): data is any => data.subject === Account.Devices,
|
|
44
|
+
component: () => <DevicesContainer createInvitationUrl={createInvitationUrl} />,
|
|
45
|
+
}),
|
|
46
|
+
Surface.create({
|
|
47
|
+
id: Account.Security,
|
|
48
|
+
role: 'article',
|
|
49
|
+
filter: (data): data is any => data.subject === Account.Security,
|
|
50
|
+
component: () => <RecoveryCredentialsContainer />,
|
|
51
|
+
}),
|
|
52
|
+
Surface.create({
|
|
53
|
+
id: JOIN_DIALOG,
|
|
54
|
+
role: 'dialog',
|
|
55
|
+
filter: (data): data is { props: JoinPanelProps } => data.component === JOIN_DIALOG,
|
|
56
|
+
component: ({ data }: { data: any }) => <JoinDialog {...data.props} />,
|
|
57
|
+
}),
|
|
58
|
+
Surface.create({
|
|
59
|
+
id: RECOVERY_CODE_DIALOG,
|
|
60
|
+
role: 'dialog',
|
|
61
|
+
filter: (data): data is { props: RecoveryCodeDialogProps } => data.component === RECOVERY_CODE_DIALOG,
|
|
62
|
+
component: ({ data }: { data: any }) => <RecoveryCodeDialog {...data.props} />,
|
|
63
|
+
}),
|
|
64
|
+
Surface.create({
|
|
65
|
+
id: RESET_DIALOG,
|
|
66
|
+
role: 'dialog',
|
|
67
|
+
filter: (data): data is { props: ResetDialogProps } => data.component === RESET_DIALOG,
|
|
68
|
+
component: ({ data }: { data: any }) => (
|
|
69
|
+
<ResetDialog {...data.props} onReset={onReset} capabilityManager={capabilityManager} />
|
|
70
|
+
),
|
|
71
|
+
}),
|
|
72
|
+
]);
|
|
73
|
+
}),
|
|
74
|
+
);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
import { type Type } from '@dxos/echo';
|
|
10
|
+
|
|
11
|
+
import { ClientCapabilities } from '../../types';
|
|
12
|
+
|
|
13
|
+
export default Capability.makeModule(
|
|
14
|
+
Effect.fnUntraced(function* () {
|
|
15
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
16
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
17
|
+
const schemasAtom = yield* Capability.atom(AppCapabilities.Schema);
|
|
18
|
+
|
|
19
|
+
// TODO(wittjosiah): Unregister schemas when they are disabled.
|
|
20
|
+
let previous: Type.AnyEntity[] = [];
|
|
21
|
+
const cancel = registry.subscribe(
|
|
22
|
+
schemasAtom,
|
|
23
|
+
async (_schemas: any[]) => {
|
|
24
|
+
// TODO(wittjosiah): This doesn't seem to de-dupe schemas as expected.
|
|
25
|
+
const schemas = Array.from(new Set(_schemas.flat())) as Type.AnyEntity[];
|
|
26
|
+
// TODO(wittjosiah): Filter out schemas which the client has already registered.
|
|
27
|
+
const newSchemas = schemas.filter((schema) => !previous.includes(schema));
|
|
28
|
+
previous = schemas;
|
|
29
|
+
await client.addTypes(newSchemas);
|
|
30
|
+
},
|
|
31
|
+
{ immediate: true },
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cancel()));
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
|
|
7
|
+
import { view } from './view';
|
|
8
|
+
|
|
9
|
+
export const config = Command.make('config').pipe(
|
|
10
|
+
Command.withDescription('Config commands.'),
|
|
11
|
+
Command.withSubcommands([view]),
|
|
12
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
import * as Console from 'effect/Console';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import * as Yaml from 'yaml';
|
|
9
|
+
|
|
10
|
+
import { CommandConfig } from '@dxos/cli-util';
|
|
11
|
+
import { ConfigService } from '@dxos/client';
|
|
12
|
+
import { DX_CONFIG, getProfileConfigPath } from '@dxos/client-protocol';
|
|
13
|
+
|
|
14
|
+
export const view = Command.make(
|
|
15
|
+
'view',
|
|
16
|
+
{},
|
|
17
|
+
Effect.fnUntraced(function* () {
|
|
18
|
+
const config = yield* ConfigService;
|
|
19
|
+
const { json, profile } = yield* CommandConfig;
|
|
20
|
+
const configPath = getProfileConfigPath(DX_CONFIG, profile);
|
|
21
|
+
|
|
22
|
+
if (json) {
|
|
23
|
+
yield* Console.log(JSON.stringify(config.values, null, 2));
|
|
24
|
+
} else {
|
|
25
|
+
yield* Console.log(`Path: ${configPath}`);
|
|
26
|
+
yield* Console.log(Yaml.stringify(config.values));
|
|
27
|
+
}
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
|
|
7
|
+
import { info } from './info';
|
|
8
|
+
import { list } from './list';
|
|
9
|
+
import { update } from './update';
|
|
10
|
+
|
|
11
|
+
export const device = Command.make('device').pipe(
|
|
12
|
+
Command.withDescription('Manage HALO devices.'),
|
|
13
|
+
Command.withSubcommands([info, list, update]),
|
|
14
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { TestConsole, TestLayer } from '@dxos/cli-util/testing';
|
|
9
|
+
import { ClientService } from '@dxos/client';
|
|
10
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
11
|
+
|
|
12
|
+
import { handler } from './info';
|
|
13
|
+
|
|
14
|
+
describe('device info', () => {
|
|
15
|
+
it('should show device info', () =>
|
|
16
|
+
Effect.gen(function* () {
|
|
17
|
+
const client = yield* ClientService;
|
|
18
|
+
yield* Effect.tryPromise(() => client.halo.createIdentity());
|
|
19
|
+
yield* handler();
|
|
20
|
+
const logger = yield* TestConsole.TestConsole;
|
|
21
|
+
const logs = logger.logs;
|
|
22
|
+
expect(logs).toHaveLength(1);
|
|
23
|
+
const parsed = TestConsole.parseJson<{ deviceKey: string; profile: unknown }>(logs[0]);
|
|
24
|
+
expect(parsed).toHaveProperty('deviceKey');
|
|
25
|
+
expect(parsed).toHaveProperty('profile');
|
|
26
|
+
expect(parsed.deviceKey).toBe(client.halo.device?.deviceKey.toHex());
|
|
27
|
+
}).pipe(Effect.provide(TestLayer), Effect.scoped, runAndForwardErrors));
|
|
28
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
import * as Console from 'effect/Console';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
|
|
9
|
+
import { CommandConfig } from '@dxos/cli-util';
|
|
10
|
+
import { print } from '@dxos/cli-util';
|
|
11
|
+
import { ClientService } from '@dxos/client';
|
|
12
|
+
import { DeviceType } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
13
|
+
|
|
14
|
+
import { printDevice } from '../util';
|
|
15
|
+
|
|
16
|
+
export const handler = Effect.fn(function* () {
|
|
17
|
+
const { json } = yield* CommandConfig;
|
|
18
|
+
const client = yield* ClientService;
|
|
19
|
+
const device = client.halo.device;
|
|
20
|
+
if (!device) {
|
|
21
|
+
if (json) {
|
|
22
|
+
yield* Console.log(JSON.stringify({ error: 'No device found' }, null, 2));
|
|
23
|
+
} else {
|
|
24
|
+
yield* Console.log('No device found.');
|
|
25
|
+
}
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (json) {
|
|
30
|
+
yield* Console.log(
|
|
31
|
+
JSON.stringify(
|
|
32
|
+
{
|
|
33
|
+
deviceKey: device.deviceKey.toHex(),
|
|
34
|
+
profile: {
|
|
35
|
+
...device.profile,
|
|
36
|
+
type: device.profile?.type ? DeviceType[device.profile?.type] : 'UNKNOWN',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
null,
|
|
40
|
+
2,
|
|
41
|
+
),
|
|
42
|
+
);
|
|
43
|
+
} else {
|
|
44
|
+
yield* Console.log(print(printDevice(device)));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const info = Command.make('info', {}, handler).pipe(Command.withDescription('Show device info.'));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { TestConsole, TestLayer } from '@dxos/cli-util/testing';
|
|
9
|
+
import { ClientService } from '@dxos/client';
|
|
10
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
11
|
+
|
|
12
|
+
import { handler } from './list';
|
|
13
|
+
|
|
14
|
+
describe('device list', () => {
|
|
15
|
+
it('should list devices', () =>
|
|
16
|
+
Effect.gen(function* () {
|
|
17
|
+
const client = yield* ClientService;
|
|
18
|
+
yield* Effect.tryPromise(() => client.halo.createIdentity());
|
|
19
|
+
yield* handler();
|
|
20
|
+
const logger = yield* TestConsole.TestConsole;
|
|
21
|
+
const logs = logger.logs;
|
|
22
|
+
expect(logs).toHaveLength(1);
|
|
23
|
+
const parsed = TestConsole.parseJson<Array<{ key: string; type: string; kind: string }>>(logs[0]);
|
|
24
|
+
expect(Array.isArray(parsed)).toBe(true);
|
|
25
|
+
expect(parsed.length).toBeGreaterThan(0);
|
|
26
|
+
expect(parsed[0]).toHaveProperty('key');
|
|
27
|
+
expect(parsed[0]).toHaveProperty('type');
|
|
28
|
+
expect(parsed[0]).toHaveProperty('kind');
|
|
29
|
+
}).pipe(Effect.provide(TestLayer), Effect.scoped, runAndForwardErrors));
|
|
30
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
import * as Console from 'effect/Console';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
|
|
9
|
+
import { CommandConfig } from '@dxos/cli-util';
|
|
10
|
+
import { printList } from '@dxos/cli-util';
|
|
11
|
+
import { ClientService } from '@dxos/client';
|
|
12
|
+
|
|
13
|
+
import { mapDevices, printDevices } from '../util';
|
|
14
|
+
|
|
15
|
+
export const handler = Effect.fn(function* () {
|
|
16
|
+
const { json } = yield* CommandConfig;
|
|
17
|
+
const client = yield* ClientService;
|
|
18
|
+
const devices = client.halo.devices.get();
|
|
19
|
+
|
|
20
|
+
if (json) {
|
|
21
|
+
yield* Console.log(JSON.stringify(mapDevices(devices), null, 2));
|
|
22
|
+
} else {
|
|
23
|
+
const formatted = printDevices(devices);
|
|
24
|
+
yield* Console.log(printList(formatted));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const list = Command.make('list', {}, handler).pipe(Command.withDescription('List devices.'));
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
import * as Options from '@effect/cli/Options';
|
|
7
|
+
import * as Console from 'effect/Console';
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
9
|
+
|
|
10
|
+
import { CommandConfig } from '@dxos/cli-util';
|
|
11
|
+
import { print } from '@dxos/cli-util';
|
|
12
|
+
import { ClientService } from '@dxos/client';
|
|
13
|
+
|
|
14
|
+
import { printDevice } from '../util';
|
|
15
|
+
|
|
16
|
+
export const handler = Effect.fn(function* ({ label }: { label: string }) {
|
|
17
|
+
const { json } = yield* CommandConfig;
|
|
18
|
+
const client = yield* ClientService;
|
|
19
|
+
const device = client.halo.device;
|
|
20
|
+
if (!device) {
|
|
21
|
+
if (json) {
|
|
22
|
+
yield* Console.log(JSON.stringify({ error: 'No device found' }, null, 2));
|
|
23
|
+
} else {
|
|
24
|
+
yield* Console.log('No device found.');
|
|
25
|
+
}
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const updatedProfile = {
|
|
30
|
+
...device.profile,
|
|
31
|
+
label,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const devicesService = client.services.services.DevicesService;
|
|
35
|
+
if (!devicesService) {
|
|
36
|
+
if (json) {
|
|
37
|
+
yield* Console.log(JSON.stringify({ error: 'DevicesService not found' }, null, 2));
|
|
38
|
+
} else {
|
|
39
|
+
yield* Console.log('DevicesService not found.');
|
|
40
|
+
}
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const updatedDevice = yield* Effect.tryPromise(() => devicesService.updateDevice(updatedProfile));
|
|
45
|
+
|
|
46
|
+
if (json) {
|
|
47
|
+
yield* Console.log(
|
|
48
|
+
JSON.stringify(
|
|
49
|
+
{
|
|
50
|
+
deviceKey: updatedDevice.deviceKey.toHex(),
|
|
51
|
+
profile: updatedDevice.profile,
|
|
52
|
+
},
|
|
53
|
+
null,
|
|
54
|
+
2,
|
|
55
|
+
),
|
|
56
|
+
);
|
|
57
|
+
} else {
|
|
58
|
+
yield* Console.log(print(printDevice(updatedDevice)));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export const update = Command.make(
|
|
63
|
+
'update',
|
|
64
|
+
{
|
|
65
|
+
label: Options.text('label').pipe(Options.withDescription('The device label.')),
|
|
66
|
+
},
|
|
67
|
+
handler,
|
|
68
|
+
).pipe(Command.withDescription('Update device label.'));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { FormBuilder } from '@dxos/cli-util';
|
|
6
|
+
import { Device, DeviceKind, DeviceType } from '@dxos/client/halo';
|
|
7
|
+
|
|
8
|
+
const maybeTruncateKey = (key: { toHex(): string; truncate(): string }, truncate = false) =>
|
|
9
|
+
truncate ? key.truncate() : key.toHex();
|
|
10
|
+
|
|
11
|
+
const getDeviceTitle = (device: Device): string => {
|
|
12
|
+
if (device.profile?.label) {
|
|
13
|
+
return device.profile.label;
|
|
14
|
+
}
|
|
15
|
+
const platform = device.profile?.platform ?? 'Unknown';
|
|
16
|
+
const os = device.profile?.os ?? 'Unknown';
|
|
17
|
+
return `${platform} on ${os}`;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const mapDevices = (devices: Device[], truncateKeys = false) => {
|
|
21
|
+
return devices.map((device) => ({
|
|
22
|
+
label: device.profile?.label,
|
|
23
|
+
type: device.profile?.type ? DeviceType[device.profile?.type] : 'UNKNOWN',
|
|
24
|
+
key: maybeTruncateKey(device.deviceKey, truncateKeys),
|
|
25
|
+
kind: DeviceKind[device.kind],
|
|
26
|
+
platform: device.profile?.platform,
|
|
27
|
+
platformVersion: device.profile?.platformVersion,
|
|
28
|
+
architecture: device.profile?.architecture,
|
|
29
|
+
os: device.profile?.os,
|
|
30
|
+
osVersion: device.profile?.osVersion,
|
|
31
|
+
presence: device?.kind === DeviceKind.CURRENT ? 'THIS DEVICE' : Device.PresenceState[device.presence],
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const printDevice = (device: Device) =>
|
|
36
|
+
FormBuilder.make({ title: getDeviceTitle(device) }).pipe(
|
|
37
|
+
FormBuilder.set('deviceKey', device.deviceKey.truncate()),
|
|
38
|
+
FormBuilder.set('label', device.profile?.label ?? '<none>'),
|
|
39
|
+
FormBuilder.set('type', device.profile?.type ? DeviceType[device.profile?.type] : 'UNKNOWN'),
|
|
40
|
+
FormBuilder.set('kind', DeviceKind[device.kind]),
|
|
41
|
+
FormBuilder.set(
|
|
42
|
+
'presence',
|
|
43
|
+
device?.kind === DeviceKind.CURRENT ? 'THIS DEVICE' : Device.PresenceState[device.presence],
|
|
44
|
+
),
|
|
45
|
+
FormBuilder.set('platform', device.profile?.platform ?? '<none>'),
|
|
46
|
+
FormBuilder.set('platformVersion', device.profile?.platformVersion ?? '<none>'),
|
|
47
|
+
FormBuilder.set('architecture', device.profile?.architecture ?? '<none>'),
|
|
48
|
+
FormBuilder.set('os', device.profile?.os ?? '<none>'),
|
|
49
|
+
FormBuilder.set('osVersion', device.profile?.osVersion ?? '<none>'),
|
|
50
|
+
FormBuilder.build,
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export const printDevices = (devices: Device[]) => {
|
|
54
|
+
return devices.map(printDevice);
|
|
55
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
|
|
7
|
+
import { status } from './status';
|
|
8
|
+
|
|
9
|
+
export const edge = Command.make('edge').pipe(
|
|
10
|
+
Command.withDescription('EDGE commands.'),
|
|
11
|
+
Command.withSubcommands([status]),
|
|
12
|
+
);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
import * as Console from 'effect/Console';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import * as Option from 'effect/Option';
|
|
9
|
+
|
|
10
|
+
import { CommandConfig } from '@dxos/cli-util';
|
|
11
|
+
import { ClientService } from '@dxos/client';
|
|
12
|
+
import { createEdgeIdentity } from '@dxos/client/edge';
|
|
13
|
+
import { Context } from '@dxos/context';
|
|
14
|
+
|
|
15
|
+
export const getStatus = () =>
|
|
16
|
+
Effect.gen(function* () {
|
|
17
|
+
const client = yield* ClientService;
|
|
18
|
+
const identity = createEdgeIdentity(client);
|
|
19
|
+
client.edge.http.setIdentity(identity);
|
|
20
|
+
const status = yield* Effect.tryPromise(() => client.edge.http.getStatus(Context.default()));
|
|
21
|
+
|
|
22
|
+
if (yield* CommandConfig.isJson) {
|
|
23
|
+
yield* Console.log(JSON.stringify(status, null, 2));
|
|
24
|
+
} else if (status.problems.length > 0) {
|
|
25
|
+
for (const problem of status.problems) {
|
|
26
|
+
yield* Console.error(problem);
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
yield* Console.log('No problems found.');
|
|
30
|
+
}
|
|
31
|
+
}).pipe(
|
|
32
|
+
// TODO(wittjosiah): Tagged error.
|
|
33
|
+
Effect.catchSome((error) => {
|
|
34
|
+
if (error instanceof Error && error.message === 'Identity not available') {
|
|
35
|
+
// TODO(wittjosiah): Error coloring for logs.
|
|
36
|
+
return Option.some(Console.error(error.message));
|
|
37
|
+
} else {
|
|
38
|
+
return Option.none();
|
|
39
|
+
}
|
|
40
|
+
}),
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
// TODO(wittjosiah): Admin functionality to provide to specify an identity.
|
|
44
|
+
export const status = Command.make('status', {}, getStatus).pipe(
|
|
45
|
+
Command.withDescription('Get the EDGE status for the current identity.'),
|
|
46
|
+
);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
|
+
import * as Option from 'effect/Option';
|
|
9
|
+
|
|
10
|
+
import { OperationPlugin } from '@dxos/app-framework';
|
|
11
|
+
import { fromPlugins } from '@dxos/app-framework/testing';
|
|
12
|
+
import { TestConsole, TestLayer } from '@dxos/cli-util/testing';
|
|
13
|
+
import { ClientService } from '@dxos/client';
|
|
14
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
15
|
+
import { ObservabilityPlugin } from '@dxos/plugin-observability/cli';
|
|
16
|
+
|
|
17
|
+
import { ClientPlugin } from '../../../plugin';
|
|
18
|
+
|
|
19
|
+
import { handler } from './create';
|
|
20
|
+
|
|
21
|
+
const layer = Layer.merge(TestLayer, fromPlugins([ClientPlugin({}), OperationPlugin(), ObservabilityPlugin()]));
|
|
22
|
+
|
|
23
|
+
// TODO(wittjosiah): Fix these tests.
|
|
24
|
+
describe.skip('halo create', () => {
|
|
25
|
+
it('should create an identity without a display name', () =>
|
|
26
|
+
Effect.gen(function* () {
|
|
27
|
+
const client = yield* ClientService;
|
|
28
|
+
yield* handler({ agent: false, displayName: Option.none() });
|
|
29
|
+
const logger = yield* TestConsole.TestConsole;
|
|
30
|
+
const logs = logger.logs;
|
|
31
|
+
expect(logs).toHaveLength(1);
|
|
32
|
+
const parsedIdentity = TestConsole.parseJson(logs[0]);
|
|
33
|
+
expect(parsedIdentity).toEqual({
|
|
34
|
+
identityKey: client.halo.identity.get()?.identityKey.toHex(),
|
|
35
|
+
displayName: client.halo.identity.get()?.profile?.displayName,
|
|
36
|
+
});
|
|
37
|
+
}).pipe(Effect.provide(layer), Effect.scoped, runAndForwardErrors));
|
|
38
|
+
|
|
39
|
+
it('should create an identity with a display name', () =>
|
|
40
|
+
Effect.gen(function* () {
|
|
41
|
+
const client = yield* ClientService;
|
|
42
|
+
yield* handler({ agent: false, displayName: Option.some('Example') });
|
|
43
|
+
const logger = yield* TestConsole.TestConsole;
|
|
44
|
+
const logs = logger.logs;
|
|
45
|
+
expect(logs).toHaveLength(1);
|
|
46
|
+
const parsedIdentity = TestConsole.parseJson(logs[0]);
|
|
47
|
+
expect(parsedIdentity).toEqual({
|
|
48
|
+
identityKey: client.halo.identity.get()?.identityKey.toHex(),
|
|
49
|
+
displayName: client.halo.identity.get()?.profile?.displayName,
|
|
50
|
+
});
|
|
51
|
+
}).pipe(Effect.provide(layer), Effect.scoped, runAndForwardErrors));
|
|
52
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
import * as Options from '@effect/cli/Options';
|
|
7
|
+
import * as Console from 'effect/Console';
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
9
|
+
import * as Option from 'effect/Option';
|
|
10
|
+
|
|
11
|
+
import { Capabilities, Plugin } from '@dxos/app-framework';
|
|
12
|
+
import { CommandConfig, flushAndSync, spaceLayer } from '@dxos/cli-util';
|
|
13
|
+
import { print } from '@dxos/cli-util';
|
|
14
|
+
import { ClientService } from '@dxos/client';
|
|
15
|
+
import { invariant } from '@dxos/invariant';
|
|
16
|
+
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
17
|
+
import { MembershipPolicy } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
18
|
+
|
|
19
|
+
import { ClientOperation } from '../../../../operations';
|
|
20
|
+
import { printIdentity } from '../util';
|
|
21
|
+
|
|
22
|
+
export const handler = Effect.fn(function* ({
|
|
23
|
+
agent,
|
|
24
|
+
displayName,
|
|
25
|
+
}: {
|
|
26
|
+
agent: boolean;
|
|
27
|
+
displayName: Option.Option<string>;
|
|
28
|
+
}) {
|
|
29
|
+
const { json } = yield* CommandConfig;
|
|
30
|
+
const client = yield* ClientService;
|
|
31
|
+
// TODO(wittjosiah): How to surface this error to the user cleanly?
|
|
32
|
+
invariant(!client.halo.identity.get(), 'Identity already exists');
|
|
33
|
+
|
|
34
|
+
const manager = yield* Plugin.Service;
|
|
35
|
+
const { invoke } = manager.capabilities.get(Capabilities.OperationInvoker);
|
|
36
|
+
const identity = yield* invoke(ClientOperation.CreateIdentity, {
|
|
37
|
+
displayName: Option.getOrUndefined(displayName),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
if (agent) {
|
|
41
|
+
yield* invoke(ClientOperation.CreateAgent);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Create personal space for the CLI identity.
|
|
45
|
+
const { PERSONAL_SPACE_TAG, setPersonalSpace } = yield* Effect.tryPromise(() => import('@dxos/app-toolkit'));
|
|
46
|
+
const space = yield* Effect.promise(() =>
|
|
47
|
+
client.spaces.create({}, { tags: [PERSONAL_SPACE_TAG], membershipPolicy: MembershipPolicy.LOCKED }),
|
|
48
|
+
);
|
|
49
|
+
yield* Effect.promise(() => space.waitUntilReady());
|
|
50
|
+
yield* Effect.promise(() => space.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED));
|
|
51
|
+
setPersonalSpace(space);
|
|
52
|
+
yield* flushAndSync({ indexes: true }).pipe(Effect.provide(spaceLayer(Option.some(space.id))));
|
|
53
|
+
|
|
54
|
+
if (json) {
|
|
55
|
+
yield* Console.log(
|
|
56
|
+
JSON.stringify(
|
|
57
|
+
{
|
|
58
|
+
identityKey: identity.identityKey.toHex(),
|
|
59
|
+
displayName: identity.profile?.displayName,
|
|
60
|
+
},
|
|
61
|
+
null,
|
|
62
|
+
2,
|
|
63
|
+
),
|
|
64
|
+
);
|
|
65
|
+
} else {
|
|
66
|
+
yield* Console.log(print(printIdentity(identity)));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export const create = Command.make(
|
|
71
|
+
'create',
|
|
72
|
+
{
|
|
73
|
+
agent: Options.boolean('noAgent', { ifPresent: false }).pipe(
|
|
74
|
+
Options.withDescription('Do not create an EDGE agent for the identity.'),
|
|
75
|
+
),
|
|
76
|
+
displayName: Options.text('displayName').pipe(
|
|
77
|
+
Options.withDescription('The display name of the identity.'),
|
|
78
|
+
Options.optional,
|
|
79
|
+
),
|
|
80
|
+
},
|
|
81
|
+
handler,
|
|
82
|
+
).pipe(Command.withDescription('Create a new identity.'));
|