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