@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,97 @@
|
|
|
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, copyToClipboard, openBrowser, print } from '@dxos/cli-util';
|
|
11
|
+
import { FormBuilder } from '@dxos/cli-util';
|
|
12
|
+
import { ClientService } from '@dxos/client';
|
|
13
|
+
import { Invitation, InvitationEncoder, hostInvitation } from '@dxos/client/invitations';
|
|
14
|
+
|
|
15
|
+
export const handler = Effect.fn(function* ({
|
|
16
|
+
lifetime,
|
|
17
|
+
open,
|
|
18
|
+
host,
|
|
19
|
+
}: {
|
|
20
|
+
lifetime: number;
|
|
21
|
+
open: boolean;
|
|
22
|
+
host: string;
|
|
23
|
+
}) {
|
|
24
|
+
const { json } = yield* CommandConfig;
|
|
25
|
+
const client = yield* ClientService;
|
|
26
|
+
|
|
27
|
+
// Always use persistent and delegated (auth required) due to P2P limitations
|
|
28
|
+
const observable = client.halo.share({
|
|
29
|
+
authMethod: Invitation.AuthMethod.SHARED_SECRET,
|
|
30
|
+
persistent: true,
|
|
31
|
+
lifetime,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const invitation = yield* hostInvitation({
|
|
35
|
+
observable,
|
|
36
|
+
callbacks: {
|
|
37
|
+
onConnecting: (invitation) =>
|
|
38
|
+
Effect.gen(function* () {
|
|
39
|
+
const invitationCode = InvitationEncoder.encode(invitation);
|
|
40
|
+
const authCode = invitation.authCode!;
|
|
41
|
+
|
|
42
|
+
// Copy auth code to clipboard
|
|
43
|
+
yield* copyToClipboard(authCode).pipe(Effect.catchAll(() => Effect.void));
|
|
44
|
+
|
|
45
|
+
if (!json) {
|
|
46
|
+
yield* Console.log(`\nSecret: ${authCode} (copied to clipboard)\n`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (open) {
|
|
50
|
+
const url = new URL(host);
|
|
51
|
+
url.searchParams.append('deviceInvitationCode', invitationCode);
|
|
52
|
+
yield* openBrowser(url.toString()).pipe(Effect.catchAll(() => Effect.void));
|
|
53
|
+
} else if (!json) {
|
|
54
|
+
yield* Console.log(`\nInvitation: ${invitationCode}\n`);
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
},
|
|
58
|
+
waitForSuccess: true,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
if (json) {
|
|
62
|
+
yield* Console.log(
|
|
63
|
+
JSON.stringify(
|
|
64
|
+
{
|
|
65
|
+
invitationCode: InvitationEncoder.encode(invitation),
|
|
66
|
+
authCode: invitation.authCode,
|
|
67
|
+
state: Invitation.State[invitation.state],
|
|
68
|
+
},
|
|
69
|
+
null,
|
|
70
|
+
2,
|
|
71
|
+
),
|
|
72
|
+
);
|
|
73
|
+
} else {
|
|
74
|
+
const builder = FormBuilder.make({ title: 'HALO Invitation' }).pipe(
|
|
75
|
+
FormBuilder.set('invitationCode', InvitationEncoder.encode(invitation)),
|
|
76
|
+
FormBuilder.set('authCode', invitation.authCode ?? '<none>'),
|
|
77
|
+
FormBuilder.set('state', Invitation.State[invitation.state]),
|
|
78
|
+
);
|
|
79
|
+
yield* Console.log(print(FormBuilder.build(builder)));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export const share = Command.make(
|
|
84
|
+
'share',
|
|
85
|
+
{
|
|
86
|
+
lifetime: Options.integer('lifetime').pipe(
|
|
87
|
+
Options.withDescription('Lifetime of the invitation in seconds.'),
|
|
88
|
+
Options.withDefault(12 * 60 * 60), // 12 hours - HALO invitations are typically shorter-lived
|
|
89
|
+
),
|
|
90
|
+
open: Options.boolean('open', { ifPresent: true }).pipe(Options.withDescription('Open browser with invitation.')),
|
|
91
|
+
host: Options.text('host').pipe(
|
|
92
|
+
Options.withDescription('Application Host URL.'),
|
|
93
|
+
Options.withDefault('https://composer.space'),
|
|
94
|
+
),
|
|
95
|
+
},
|
|
96
|
+
handler,
|
|
97
|
+
).pipe(Command.withDescription('Create HALO (device) invitation.'));
|
|
@@ -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 './update';
|
|
13
|
+
|
|
14
|
+
describe('halo update', () => {
|
|
15
|
+
it('should update identity display name', () =>
|
|
16
|
+
Effect.gen(function* () {
|
|
17
|
+
const client = yield* ClientService;
|
|
18
|
+
yield* Effect.tryPromise(() => client.halo.createIdentity());
|
|
19
|
+
yield* handler({ displayName: 'Updated Name' });
|
|
20
|
+
const logger = yield* TestConsole.TestConsole;
|
|
21
|
+
const logs = logger.logs;
|
|
22
|
+
expect(logs).toHaveLength(1);
|
|
23
|
+
const parsed = TestConsole.parseJson<{ identityKey: string; displayName: string }>(logs[0]);
|
|
24
|
+
expect(parsed).toHaveProperty('identityKey');
|
|
25
|
+
expect(parsed).toHaveProperty('displayName', 'Updated Name');
|
|
26
|
+
expect(parsed.identityKey).toBe(client.halo.identity.get()?.identityKey.toHex());
|
|
27
|
+
}).pipe(Effect.provide(TestLayer), Effect.scoped, runAndForwardErrors));
|
|
28
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
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 { printIdentity } from '../util';
|
|
15
|
+
|
|
16
|
+
export const handler = Effect.fn(function* ({ displayName }: { displayName: string }) {
|
|
17
|
+
const { json } = yield* CommandConfig;
|
|
18
|
+
const client = yield* ClientService;
|
|
19
|
+
const identity = client.halo.identity.get();
|
|
20
|
+
if (!identity) {
|
|
21
|
+
if (json) {
|
|
22
|
+
yield* Console.log(JSON.stringify({ error: 'Identity not initialized' }, null, 2));
|
|
23
|
+
} else {
|
|
24
|
+
yield* Console.log('Identity not initialized.');
|
|
25
|
+
}
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const identityService = client.services.services.IdentityService;
|
|
30
|
+
if (!identityService) {
|
|
31
|
+
if (json) {
|
|
32
|
+
yield* Console.log(JSON.stringify({ error: 'IdentityService not found' }, null, 2));
|
|
33
|
+
} else {
|
|
34
|
+
yield* Console.log('IdentityService not found.');
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const updatedIdentity = yield* Effect.tryPromise(() =>
|
|
40
|
+
identityService.updateProfile({
|
|
41
|
+
displayName,
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
if (json) {
|
|
46
|
+
yield* Console.log(
|
|
47
|
+
JSON.stringify(
|
|
48
|
+
{
|
|
49
|
+
identityKey: updatedIdentity.identityKey.toHex(),
|
|
50
|
+
displayName: updatedIdentity.profile?.displayName,
|
|
51
|
+
},
|
|
52
|
+
null,
|
|
53
|
+
2,
|
|
54
|
+
),
|
|
55
|
+
);
|
|
56
|
+
} else {
|
|
57
|
+
yield* Console.log(print(printIdentity(updatedIdentity)));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const update = Command.make(
|
|
62
|
+
'update',
|
|
63
|
+
{
|
|
64
|
+
displayName: Options.text('displayName').pipe(Options.withDescription('The display name of the identity.')),
|
|
65
|
+
},
|
|
66
|
+
handler,
|
|
67
|
+
).pipe(Command.withDescription('Update identity profile.'));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { FormBuilder } from '@dxos/cli-util';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Pretty prints an identity with ANSI colors.
|
|
9
|
+
*/
|
|
10
|
+
export const printIdentity = (identity: {
|
|
11
|
+
identityKey: { toHex(): string; truncate(): string };
|
|
12
|
+
profile?: { displayName?: string };
|
|
13
|
+
}) =>
|
|
14
|
+
FormBuilder.make({ title: 'Identity' }).pipe(
|
|
15
|
+
FormBuilder.set('identityKey', identity.identityKey.truncate()),
|
|
16
|
+
FormBuilder.set('displayName', identity.profile?.displayName ?? '<none>'),
|
|
17
|
+
FormBuilder.build,
|
|
18
|
+
);
|
|
@@ -0,0 +1,90 @@
|
|
|
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 FileSystem from '@effect/platform/FileSystem';
|
|
8
|
+
import * as Path from '@effect/platform/Path';
|
|
9
|
+
import * as Console from 'effect/Console';
|
|
10
|
+
import * as Effect from 'effect/Effect';
|
|
11
|
+
import * as Option from 'effect/Option';
|
|
12
|
+
import * as Record from 'effect/Record';
|
|
13
|
+
|
|
14
|
+
import { CommandConfig, print } from '@dxos/cli-util';
|
|
15
|
+
import { DX_CONFIG, getProfileConfigPath } from '@dxos/client-protocol';
|
|
16
|
+
import { trim } from '@dxos/util';
|
|
17
|
+
|
|
18
|
+
import { printProfileCreated } from './util';
|
|
19
|
+
|
|
20
|
+
const TEMPLATES = {
|
|
21
|
+
default: trim`
|
|
22
|
+
version: 1
|
|
23
|
+
runtime:
|
|
24
|
+
client:
|
|
25
|
+
storage:
|
|
26
|
+
persistent: true
|
|
27
|
+
services:
|
|
28
|
+
edge:
|
|
29
|
+
url: https://edge-production.dxos.workers.dev
|
|
30
|
+
`,
|
|
31
|
+
main: trim`
|
|
32
|
+
version: 1
|
|
33
|
+
runtime:
|
|
34
|
+
client:
|
|
35
|
+
storage:
|
|
36
|
+
persistent: true
|
|
37
|
+
services:
|
|
38
|
+
edge:
|
|
39
|
+
url: https://edge-main.dxos.workers.dev
|
|
40
|
+
`,
|
|
41
|
+
dev: trim`
|
|
42
|
+
version: 1
|
|
43
|
+
runtime:
|
|
44
|
+
client:
|
|
45
|
+
storage:
|
|
46
|
+
persistent: true
|
|
47
|
+
services:
|
|
48
|
+
edge:
|
|
49
|
+
url: https://edge.dxos.workers.dev
|
|
50
|
+
`,
|
|
51
|
+
local: trim`
|
|
52
|
+
version: 1
|
|
53
|
+
runtime:
|
|
54
|
+
client:
|
|
55
|
+
storage:
|
|
56
|
+
persistent: true
|
|
57
|
+
services:
|
|
58
|
+
edge:
|
|
59
|
+
url: http://localhost:8787
|
|
60
|
+
`,
|
|
61
|
+
} as const;
|
|
62
|
+
|
|
63
|
+
export const create = Command.make(
|
|
64
|
+
'create',
|
|
65
|
+
{
|
|
66
|
+
template: Options.choice('template', Record.keys(TEMPLATES)).pipe(
|
|
67
|
+
Options.withDescription('Template to use'),
|
|
68
|
+
Options.withDefault('default'),
|
|
69
|
+
),
|
|
70
|
+
name: Options.text('name').pipe(Options.withDescription('Profile name'), Options.optional),
|
|
71
|
+
},
|
|
72
|
+
Effect.fnUntraced(function* ({ template, name }) {
|
|
73
|
+
const { json } = yield* CommandConfig;
|
|
74
|
+
const fs = yield* FileSystem.FileSystem;
|
|
75
|
+
const path = yield* Path.Path;
|
|
76
|
+
const profileName = name.pipe(Option.getOrElse(() => template));
|
|
77
|
+
const configPath = getProfileConfigPath(DX_CONFIG, profileName);
|
|
78
|
+
if (yield* fs.exists(configPath)) {
|
|
79
|
+
throw new Error(`Profile ${profileName} already exists`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
yield* fs.makeDirectory(path.dirname(configPath), { recursive: true });
|
|
83
|
+
yield* fs.writeFileString(configPath, TEMPLATES[template]);
|
|
84
|
+
if (json) {
|
|
85
|
+
yield* Console.log(JSON.stringify({ name: profileName, path: configPath }, null, 2));
|
|
86
|
+
} else {
|
|
87
|
+
yield* Console.log(print(printProfileCreated(profileName, configPath)));
|
|
88
|
+
}
|
|
89
|
+
}),
|
|
90
|
+
);
|
|
@@ -0,0 +1,36 @@
|
|
|
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 FileSystem from '@effect/platform/FileSystem';
|
|
8
|
+
import * as Console from 'effect/Console';
|
|
9
|
+
import * as Effect from 'effect/Effect';
|
|
10
|
+
import * as Option from 'effect/Option';
|
|
11
|
+
|
|
12
|
+
import { CommandConfig, print } from '@dxos/cli-util';
|
|
13
|
+
import { DX_CONFIG, getProfileConfigPath } from '@dxos/client-protocol';
|
|
14
|
+
|
|
15
|
+
import { printProfileDeleted } from './util';
|
|
16
|
+
|
|
17
|
+
export const del = Command.make(
|
|
18
|
+
'delete',
|
|
19
|
+
{
|
|
20
|
+
name: Options.text('name').pipe(Options.withDescription('Profile name'), Options.optional),
|
|
21
|
+
},
|
|
22
|
+
Effect.fnUntraced(function* ({ name }) {
|
|
23
|
+
const { json } = yield* CommandConfig;
|
|
24
|
+
const fs = yield* FileSystem.FileSystem;
|
|
25
|
+
const profileName = name.pipe(Option.getOrElse(() => 'default'));
|
|
26
|
+
const configPath = getProfileConfigPath(DX_CONFIG, profileName);
|
|
27
|
+
const pluginsPath = `${DX_CONFIG}/plugins/${profileName}.yml`;
|
|
28
|
+
yield* fs.remove(configPath).pipe(Effect.ignore);
|
|
29
|
+
yield* fs.remove(pluginsPath).pipe(Effect.ignore);
|
|
30
|
+
if (json) {
|
|
31
|
+
yield* Console.log(JSON.stringify({ name: profileName, deleted: true }, null, 2));
|
|
32
|
+
} else {
|
|
33
|
+
yield* Console.log(print(printProfileDeleted(profileName)));
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
@@ -0,0 +1,101 @@
|
|
|
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 Prompt from '@effect/cli/Prompt';
|
|
8
|
+
import * as FileSystem from '@effect/platform/FileSystem';
|
|
9
|
+
import * as Path from '@effect/platform/Path';
|
|
10
|
+
import * as Console from 'effect/Console';
|
|
11
|
+
import * as Effect from 'effect/Effect';
|
|
12
|
+
import * as Option from 'effect/Option';
|
|
13
|
+
|
|
14
|
+
import { CommandConfig } from '@dxos/cli-util';
|
|
15
|
+
import { ConfigService } from '@dxos/config';
|
|
16
|
+
import { log } from '@dxos/log';
|
|
17
|
+
import type { Runtime } from '@dxos/protocols/proto/dxos/config';
|
|
18
|
+
|
|
19
|
+
export const handler = Effect.fn(function* ({
|
|
20
|
+
file,
|
|
21
|
+
dataDir,
|
|
22
|
+
force,
|
|
23
|
+
}: {
|
|
24
|
+
file: string;
|
|
25
|
+
dataDir: Option.Option<string>;
|
|
26
|
+
force: boolean;
|
|
27
|
+
}) {
|
|
28
|
+
const dataDirValue = Option.getOrUndefined(dataDir);
|
|
29
|
+
const { json, profile } = yield* CommandConfig;
|
|
30
|
+
const fs = yield* FileSystem.FileSystem;
|
|
31
|
+
const path = yield* Path.Path;
|
|
32
|
+
const config = yield* ConfigService;
|
|
33
|
+
|
|
34
|
+
const { createLevel, createStorageObjects, importProfileData, decodeProfileArchive } = yield* Effect.promise(
|
|
35
|
+
() => import('@dxos/client-services'),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
let storageConfig: Runtime.Client.Storage;
|
|
39
|
+
if (!dataDirValue) {
|
|
40
|
+
if (!force) {
|
|
41
|
+
yield* Console.log(`Will overwrite profile: ${profile}`);
|
|
42
|
+
const confirmed = yield* Prompt.confirm({
|
|
43
|
+
message: `Delete all data? (Profile: ${profile})`,
|
|
44
|
+
initial: false,
|
|
45
|
+
}).pipe(Prompt.run);
|
|
46
|
+
if (!confirmed) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
storageConfig = config.values.runtime!.client!.storage!;
|
|
51
|
+
} else {
|
|
52
|
+
const fullPath = path.resolve(dataDirValue);
|
|
53
|
+
yield* Console.log(`Importing into: ${fullPath}`);
|
|
54
|
+
storageConfig = {
|
|
55
|
+
persistent: true,
|
|
56
|
+
dataRoot: fullPath,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (yield* fs.exists(storageConfig.dataRoot!)) {
|
|
61
|
+
log.error('data directory already exists', { path: storageConfig.dataRoot! });
|
|
62
|
+
if (json) {
|
|
63
|
+
yield* Console.log(JSON.stringify({ error: 'Data directory already exists' }, null, 2));
|
|
64
|
+
} else {
|
|
65
|
+
yield* Console.log('Data directory already exists.');
|
|
66
|
+
}
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const data = yield* fs.readFile(file);
|
|
71
|
+
|
|
72
|
+
const archive = decodeProfileArchive(data);
|
|
73
|
+
yield* Console.log(`Importing archive with ${archive.storage.length} entries`);
|
|
74
|
+
|
|
75
|
+
const { storage } = createStorageObjects(storageConfig);
|
|
76
|
+
const level = yield* Effect.tryPromise({
|
|
77
|
+
try: () => createLevel(storageConfig),
|
|
78
|
+
catch: (error) => new Error(`Failed to create level: ${error}`),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
yield* Console.log('Beginning profile import...');
|
|
82
|
+
yield* Effect.tryPromise({
|
|
83
|
+
try: () => importProfileData({ storage, level }, archive),
|
|
84
|
+
catch: (error) => new Error(`Failed to import profile data: ${error}`),
|
|
85
|
+
});
|
|
86
|
+
yield* Console.log('Profile import complete');
|
|
87
|
+
|
|
88
|
+
if (json) {
|
|
89
|
+
yield* Console.log(JSON.stringify({ success: true, profile, entries: archive.storage.length }, null, 2));
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export const importCommand = Command.make(
|
|
94
|
+
'import',
|
|
95
|
+
{
|
|
96
|
+
file: Options.text('file').pipe(Options.withDescription('Archive filename.'), Options.withAlias('f')),
|
|
97
|
+
dataDir: Options.text('data-dir').pipe(Options.withDescription('Storage directory.'), Options.optional),
|
|
98
|
+
force: Options.boolean('force', { ifPresent: true }).pipe(Options.withDescription('Skip confirmation prompt.')),
|
|
99
|
+
},
|
|
100
|
+
handler,
|
|
101
|
+
).pipe(Command.withDescription('Import profile.'));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
|
|
7
|
+
import { create } from './create';
|
|
8
|
+
import { del } from './delete';
|
|
9
|
+
import { importCommand } from './import';
|
|
10
|
+
import { inspect } from './inspect';
|
|
11
|
+
import { list } from './list';
|
|
12
|
+
import { reset } from './reset';
|
|
13
|
+
|
|
14
|
+
export const profile = Command.make('profile').pipe(
|
|
15
|
+
Command.withDescription('Profile commands.'),
|
|
16
|
+
Command.withSubcommands([create, del, importCommand, inspect, list, reset]),
|
|
17
|
+
);
|
|
@@ -0,0 +1,64 @@
|
|
|
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 FileSystem from '@effect/platform/FileSystem';
|
|
8
|
+
import * as Console from 'effect/Console';
|
|
9
|
+
import * as Effect from 'effect/Effect';
|
|
10
|
+
|
|
11
|
+
import { CommandConfig, FormBuilder, print } from '@dxos/cli-util';
|
|
12
|
+
import { ProfileArchiveEntryType } from '@dxos/protocols';
|
|
13
|
+
import { arrayToBuffer } from '@dxos/util';
|
|
14
|
+
|
|
15
|
+
export const handler = Effect.fn(function* ({ file, storage }: { file: string; storage: boolean }) {
|
|
16
|
+
const { json } = yield* CommandConfig;
|
|
17
|
+
const fs = yield* FileSystem.FileSystem;
|
|
18
|
+
|
|
19
|
+
const { decodeProfileArchive } = yield* Effect.promise(() => import('@dxos/client-services'));
|
|
20
|
+
|
|
21
|
+
const data = yield* fs.readFile(file);
|
|
22
|
+
|
|
23
|
+
const archive = decodeProfileArchive(data);
|
|
24
|
+
|
|
25
|
+
if (json) {
|
|
26
|
+
yield* Console.log(
|
|
27
|
+
JSON.stringify(
|
|
28
|
+
{
|
|
29
|
+
meta: archive.meta,
|
|
30
|
+
...(storage ? { storage: archive.storage } : {}),
|
|
31
|
+
},
|
|
32
|
+
null,
|
|
33
|
+
2,
|
|
34
|
+
),
|
|
35
|
+
);
|
|
36
|
+
} else {
|
|
37
|
+
const builder = FormBuilder.make({ title: 'Profile Archive' }).pipe(
|
|
38
|
+
FormBuilder.when(
|
|
39
|
+
archive.meta,
|
|
40
|
+
FormBuilder.each(Object.entries(archive.meta ?? {}), ([key, value]) => FormBuilder.set(key, String(value))),
|
|
41
|
+
),
|
|
42
|
+
FormBuilder.build,
|
|
43
|
+
);
|
|
44
|
+
yield* Console.log(print(builder));
|
|
45
|
+
|
|
46
|
+
if (storage) {
|
|
47
|
+
yield* Console.log('\nStorage entries:\n');
|
|
48
|
+
for (const entry of archive.storage) {
|
|
49
|
+
const key =
|
|
50
|
+
typeof entry.key === 'string' ? entry.key : JSON.stringify(arrayToBuffer(entry.key).toString()).slice(1, -1);
|
|
51
|
+
yield* Console.log(` ${ProfileArchiveEntryType[entry.type]} ${key}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const inspect = Command.make(
|
|
58
|
+
'inspect',
|
|
59
|
+
{
|
|
60
|
+
file: Options.text('file').pipe(Options.withDescription('Archive filename.'), Options.withAlias('f')),
|
|
61
|
+
storage: Options.boolean('storage', { ifPresent: true }).pipe(Options.withDescription('List storage entries.')),
|
|
62
|
+
},
|
|
63
|
+
handler,
|
|
64
|
+
).pipe(Command.withDescription('Inspect profile archive.'));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Command from '@effect/cli/Command';
|
|
6
|
+
import * as FileSystem from '@effect/platform/FileSystem';
|
|
7
|
+
import * as Path from '@effect/platform/Path';
|
|
8
|
+
import * as Console from 'effect/Console';
|
|
9
|
+
import * as Effect from 'effect/Effect';
|
|
10
|
+
import * as Yaml from 'yaml';
|
|
11
|
+
|
|
12
|
+
import { CommandConfig, printList } from '@dxos/cli-util';
|
|
13
|
+
import { Config } from '@dxos/client';
|
|
14
|
+
import { DX_CONFIG, DX_DATA, getProfilePath } from '@dxos/client-protocol';
|
|
15
|
+
|
|
16
|
+
import { printProfile } from './util';
|
|
17
|
+
|
|
18
|
+
export const list = Command.make(
|
|
19
|
+
'list',
|
|
20
|
+
{},
|
|
21
|
+
Effect.fnUntraced(function* () {
|
|
22
|
+
const { profile: currentProfile } = yield* CommandConfig;
|
|
23
|
+
const fs = yield* FileSystem.FileSystem;
|
|
24
|
+
const path = yield* Path.Path;
|
|
25
|
+
const profileDir = path.join(DX_CONFIG, 'profile');
|
|
26
|
+
const entries = yield* fs.readDirectory(profileDir);
|
|
27
|
+
const profileFiles = entries.filter((entry) => entry.endsWith('.yml'));
|
|
28
|
+
const profiles = yield* Effect.forEach(profileFiles, (filename) =>
|
|
29
|
+
Effect.gen(function* () {
|
|
30
|
+
const name = filename.slice(0, -4);
|
|
31
|
+
const configPath = path.join(profileDir, filename);
|
|
32
|
+
const configContent = yield* fs
|
|
33
|
+
.readFileString(configPath)
|
|
34
|
+
.pipe(Effect.catchTag('SystemError', () => Effect.succeed('{}')));
|
|
35
|
+
const configValues = Yaml.parse(configContent) ?? {};
|
|
36
|
+
const config = new Config(configValues);
|
|
37
|
+
return {
|
|
38
|
+
name,
|
|
39
|
+
isCurrent: name === currentProfile,
|
|
40
|
+
fullPath: configPath,
|
|
41
|
+
storagePath: getProfilePath(configValues?.runtime?.client?.storage?.dataRoot ?? DX_DATA, name),
|
|
42
|
+
edge: config.values.runtime?.services?.edge?.url,
|
|
43
|
+
};
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const { json } = yield* CommandConfig;
|
|
48
|
+
if (json) {
|
|
49
|
+
yield* Console.log(JSON.stringify(profiles, null, 2));
|
|
50
|
+
} else {
|
|
51
|
+
const formatted = profiles.map(printProfile);
|
|
52
|
+
yield* Console.log(printList(formatted));
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
);
|
|
@@ -0,0 +1,45 @@
|
|
|
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 Prompt from '@effect/cli/Prompt';
|
|
8
|
+
import * as FileSystem from '@effect/platform/FileSystem';
|
|
9
|
+
import * as Console from 'effect/Console';
|
|
10
|
+
import * as Effect from 'effect/Effect';
|
|
11
|
+
|
|
12
|
+
import { CommandConfig, print } from '@dxos/cli-util';
|
|
13
|
+
import { DX_DATA, getProfilePath } from '@dxos/client-protocol';
|
|
14
|
+
import { ConfigService } from '@dxos/config';
|
|
15
|
+
|
|
16
|
+
import { printProfileReset } from './util';
|
|
17
|
+
|
|
18
|
+
export const reset = Command.make(
|
|
19
|
+
'reset',
|
|
20
|
+
{
|
|
21
|
+
force: Options.boolean('force', { ifPresent: true }).pipe(Options.withDescription('Skip confirmation prompt')),
|
|
22
|
+
},
|
|
23
|
+
Effect.fnUntraced(function* ({ force }) {
|
|
24
|
+
const fs = yield* FileSystem.FileSystem;
|
|
25
|
+
const config = yield* ConfigService;
|
|
26
|
+
const { json, profile } = yield* CommandConfig;
|
|
27
|
+
const path = config.values.runtime?.client?.storage?.dataRoot ?? getProfilePath(DX_DATA, profile);
|
|
28
|
+
if (!force) {
|
|
29
|
+
const confirmed = yield* Prompt.confirm({
|
|
30
|
+
message: `Are you sure you want to reset the profile (${profile})?`,
|
|
31
|
+
initial: false,
|
|
32
|
+
});
|
|
33
|
+
if (!confirmed) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
yield* fs.remove(path, { recursive: true });
|
|
39
|
+
if (json) {
|
|
40
|
+
yield* Console.log(JSON.stringify({ profile, reset: true }, null, 2));
|
|
41
|
+
} else {
|
|
42
|
+
yield* Console.log(print(printProfileReset(profile)));
|
|
43
|
+
}
|
|
44
|
+
}),
|
|
45
|
+
);
|