@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientPlugin.node.mjs","names":[],"sources":["../../src/commands/halo/util.ts","../../src/commands/account/login/login.ts","../../src/commands/account/logout/logout.ts","../../src/commands/account/index.ts","../../src/commands/config/view.ts","../../src/commands/config/index.ts","../../src/commands/device/util.ts","../../src/commands/device/info/info.ts","../../src/commands/device/list/list.ts","../../src/commands/device/update/update.ts","../../src/commands/device/index.ts","../../src/commands/edge/status.ts","../../src/commands/edge/index.ts","../../src/commands/halo/create/create.ts","../../src/commands/halo/credential/add/add.ts","../../src/commands/halo/credential/list/list.ts","../../src/commands/halo/credential/index.ts","../../src/commands/halo/identity/identity.ts","../../src/commands/halo/keys/keys.ts","../../src/commands/halo/seed/seed.ts","../../src/commands/halo/share/share.ts","../../src/commands/halo/update/update.ts","../../src/commands/halo/index.ts","../../src/commands/profile/util.ts","../../src/commands/profile/create.ts","../../src/commands/profile/delete.ts","../../src/commands/profile/import.ts","../../src/commands/profile/inspect.ts","../../src/commands/profile/list.ts","../../src/commands/profile/reset.ts","../../src/commands/profile/index.ts","../../src/ClientPlugin.node.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Duration from 'effect/Duration';\nimport * as Effect from 'effect/Effect';\n\nimport { FormBuilder } from '@dxos/cli-util';\nimport { type AuthenticatingInvitationObservable, Invitation } from '@dxos/client/invitations';\n\n/**\n * Pretty prints an identity with ANSI colors.\n */\nexport const printIdentity = (identity: { identityDid: string; profile?: { displayName?: string } }) =>\n FormBuilder.make({ title: 'Identity' }).pipe(\n FormBuilder.set('identityDid', identity.identityDid),\n FormBuilder.set('displayName', identity.profile?.displayName ?? '<none>'),\n FormBuilder.build,\n );\n\nconst TERMINAL_FAILURE_STATES = new Set([\n Invitation.State.CANCELLED,\n Invitation.State.TIMEOUT,\n Invitation.State.ERROR,\n Invitation.State.EXPIRED,\n]);\n\n/** Await an authenticating invitation reaching the given state. */\nexport const waitForState = (invitation: AuthenticatingInvitationObservable, state: Invitation.State) =>\n Effect.async<void, Error>((resume) => {\n const subscription = invitation.subscribe((inv) => {\n if (inv.state === state) {\n resume(Effect.void);\n } else if (TERMINAL_FAILURE_STATES.has(inv.state!)) {\n resume(Effect.fail(new Error(`Invitation failed with state: ${Invitation.State[inv.state!]}`)));\n }\n });\n return Effect.sync(() => subscription.unsubscribe());\n }).pipe(Effect.timeout(Duration.minutes(3)));\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Args from '@effect/cli/Args';\nimport * as Command from '@effect/cli/Command';\nimport * as Options from '@effect/cli/Options';\nimport * as Prompt from '@effect/cli/Prompt';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\nimport * as Match from 'effect/Match';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, Plugin } from '@dxos/app-framework';\nimport { CommandConfig, performRecoveryOAuthFlow, print } from '@dxos/cli-util';\nimport { type Client, ClientService } from '@dxos/client';\nimport { Invitation, InvitationEncoder } from '@dxos/client/invitations';\nimport { Context as DxContext } from '@dxos/context';\nimport { HubHttpClient } from '@dxos/edge-client';\nimport { invariant } from '@dxos/invariant';\nimport { ATPROTO_OAUTH_SCOPES, OAuthProvider } from '@dxos/protocols';\n\nimport { ClientOperation } from '#operations';\n\nimport { printIdentity, waitForState } from '../../halo/util';\n\ntype LoginMethod = 'email' | 'atproto' | 'device-invitation' | 'recovery-code';\n\nconst LOGIN_METHODS: LoginMethod[] = ['email', 'atproto', 'device-invitation', 'recovery-code'];\n\nconst METHOD_CHOICES = [\n { title: 'Email', value: 'email' as const },\n { title: 'AT Protocol', value: 'atproto' as const },\n { title: 'Device invitation', value: 'device-invitation' as const },\n { title: 'Recovery code', value: 'recovery-code' as const },\n];\n\nconst INPUT_PROMPT: Record<LoginMethod, string> = {\n 'email': 'Email address',\n 'atproto': 'atproto handle or DID (e.g. alice.bsky.social)',\n 'device-invitation': 'Invitation code or URL',\n 'recovery-code': 'Recovery code (seed phrase)',\n};\n\nexport const login = Command.make(\n 'login',\n {\n method: Options.choice('method', LOGIN_METHODS).pipe(\n Options.withDescription(\n 'Login method (email | atproto | device-invitation | recovery-code). Prompted if omitted.',\n ),\n Options.optional,\n ),\n input: Args.text({ name: 'input' }).pipe(\n Args.withDescription('Method input: email address / atproto handle / invitation code / recovery code.'),\n Args.optional,\n ),\n },\n Effect.fn(function* ({ method, input }) {\n const { json } = yield* CommandConfig;\n const client = yield* ClientService;\n const manager = yield* Plugin.Service;\n const { invoke } = manager.capabilities.get(Capabilities.OperationInvoker);\n // TODO(wittjosiah): How to surface this error to the user cleanly?\n invariant(!client.halo.identity.get(), 'Already logged in. Run `dx account logout` first.');\n\n const resolvedMethod: LoginMethod = Option.isSome(method)\n ? method.value\n : yield* Prompt.select({ message: 'Choose a login method:', choices: METHOD_CHOICES }).pipe(Prompt.run);\n\n const resolvedInput = Option.isSome(input)\n ? input.value\n : yield* Prompt.text({ message: `${INPUT_PROMPT[resolvedMethod]}:` }).pipe(Prompt.run);\n\n const identity = yield* Match.value(resolvedMethod).pipe(\n Match.when('atproto', () => loginWithAtproto(client, resolvedInput)),\n Match.when('email', () => loginWithEmail(client, resolvedInput, invoke)),\n Match.when('recovery-code', () => loginWithRecoveryCode(client, resolvedInput)),\n Match.when('device-invitation', () => loginWithDeviceInvitation(client, resolvedInput)),\n Match.exhaustive,\n );\n\n if (json) {\n yield* Console.log(\n JSON.stringify({ identityDid: identity.did, displayName: identity.profile?.displayName }, null, 2),\n );\n } else {\n yield* Console.log('Logged in successfully');\n yield* Console.log(print(printIdentity({ identityDid: identity.did, profile: identity.profile })));\n }\n }),\n).pipe(Command.withDescription('Log in to an existing DXOS identity (same methods as Composer).'));\n\n/**\n * atproto / Bluesky OAuth login: runs the gate recovery flow (local server + browser) and redeems\n * the resulting one-time `recoveryProof` to admit this device into the existing identity's HALO.\n */\nconst loginWithAtproto = (client: Client, handle: string) =>\n Effect.gen(function* () {\n const edgeBaseUrl = client.config.values.runtime?.services?.edge?.url;\n invariant(edgeBaseUrl, 'Edge services not configured (runtime.services.edge.url).');\n const { recoveryProof } = yield* performRecoveryOAuthFlow({\n edgeBaseUrl,\n provider: OAuthProvider.ATPROTO,\n scopes: ATPROTO_OAUTH_SCOPES,\n loginHint: handle,\n });\n return yield* Effect.tryPromise(() => client.halo.recoverIdentity({ recoveryProof }));\n });\n\n/** Recovery-code (seed phrase) login. */\nconst loginWithRecoveryCode = (client: Client, recoveryCode: string) =>\n Effect.tryPromise(() => client.halo.recoverIdentity({ recoveryCode }));\n\n/**\n * Email login, mirroring the gate's login tab (`WelcomeScreen.handleLogin`). Hub-service answers in\n * one of three ways:\n *\n * - `needsIdentity`: the address may bind a fresh Account but has no identity yet. Create one\n * locally and retry with its DID; the hub then admits it directly — there is no token because\n * there is nothing to recover — and we provision the agent as the gate does.\n * - `token`: an Account exists and the hub returned a one-time recovery token inline.\n * - neither: the link went out by email, so prompt for the token from the message.\n */\nconst loginWithEmail = (client: Client, email: string, invoke: Capabilities.OperationInvoker['invoke']) =>\n Effect.gen(function* () {\n const hubUrl = client.config.values?.runtime?.app?.env?.DX_HUB_URL;\n invariant(hubUrl, 'Hub URL not configured (runtime.app.env.DX_HUB_URL).');\n const hub = new HubHttpClient(hubUrl);\n const result = yield* Effect.tryPromise(() => hub.login(DxContext.default(), { email }));\n\n if (result.needsIdentity) {\n // `CreateIdentity` fires `IdentityCreated`, which is what provisions the personal space.\n yield* invoke(ClientOperation.CreateIdentity, { displayName: email.split('@')[0] });\n const identity = client.halo.identity.get();\n invariant(identity, 'identity should exist after create');\n // The local identity outlives any failure from here on, and the `Already logged in` guard\n // above rejects a plain retry, so a rejected request and a non-admitting response both need\n // the same recovery guidance.\n const notAdmitted = (detail: string) =>\n new Error(\n `Hub did not admit ${email} (${detail}). A local identity was created and remains bound to ` +\n 'this profile; run `dx account logout` to clear it before retrying.',\n );\n\n const retry = yield* Effect.tryPromise({\n try: () =>\n hub.login(DxContext.default(), {\n email,\n identityDid: identity.did,\n identityKey: identity.identityKey.toHex(),\n }),\n catch: (cause) => notAdmitted(cause instanceof Error ? cause.message : String(cause)),\n });\n if (!retry.admitted) {\n return yield* Effect.fail(notAdmitted('no admission granted'));\n }\n yield* invoke(ClientOperation.CreateAgent);\n return identity;\n }\n\n let token = result.token;\n if (!token) {\n yield* Console.log(`A login link was sent to ${email}. Paste the token from the email below.`);\n token = yield* Prompt.text({ message: 'Login token' }).pipe(Prompt.run);\n }\n return yield* Effect.tryPromise(() => client.halo.recoverIdentity({ token }));\n });\n\n/**\n * Device-invitation login: joins an existing identity from another authorized device.\n *\n * NOTE: p2p networking does not work in bun — this method will likely hang waiting for the peer.\n */\nconst loginWithDeviceInvitation = (client: Client, encoded: string) =>\n Effect.gen(function* () {\n let code = encoded;\n if (code.startsWith('http') || code.startsWith('socket')) {\n code = new URL(code).searchParams.get('deviceInvitationCode') ?? code;\n }\n const invitation = client.halo.join(InvitationEncoder.decode(code));\n yield* waitForState(invitation, Invitation.State.READY_FOR_AUTHENTICATION);\n const authCode = yield* Prompt.text({ message: 'Enter the authentication code' }).pipe(Prompt.run);\n yield* Effect.tryPromise(() => invitation.authenticate(authCode));\n yield* waitForState(invitation, Invitation.State.SUCCESS);\n const identity = client.halo.identity.get();\n invariant(identity, 'Device invitation completed but no identity is present.');\n return identity;\n });\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Options from '@effect/cli/Options';\nimport * as Prompt from '@effect/cli/Prompt';\nimport * as Error from '@effect/platform/Error';\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { CommandConfig } from '@dxos/cli-util';\nimport { DX_DATA, getProfilePath } from '@dxos/client-protocol';\nimport { ConfigService } from '@dxos/config';\n\nexport const logout = Command.make(\n 'logout',\n {\n force: Options.boolean('force', { ifPresent: true }).pipe(Options.withDescription('Skip confirmation prompt.')),\n },\n Effect.fnUntraced(function* ({ force }) {\n const fs = yield* FileSystem.FileSystem;\n const config = yield* ConfigService;\n const { json, profile } = yield* CommandConfig;\n const path = config.values.runtime?.client?.storage?.dataRoot ?? getProfilePath(DX_DATA, profile);\n if (!force) {\n const confirmed = yield* Prompt.confirm({\n message: `Log out of profile (${profile})? This removes the local identity and data; spaces re-sync on next login.`,\n initial: false,\n }).pipe(Prompt.run);\n if (!confirmed) {\n return;\n }\n }\n\n yield* fs.remove(path, { recursive: true }).pipe(\n Effect.catchIf(\n (e): e is Error.SystemError => e._tag === 'SystemError' && e.reason === 'NotFound',\n () => Effect.void,\n ),\n );\n // Recreate the (now empty) data root: the client's SQLite storage opens a file inside it\n // without creating the directory first, so leaving it absent makes every later command fail\n // with \"unable to open database file\" — including the login this logout exists to enable.\n yield* fs.makeDirectory(path, { recursive: true });\n if (json) {\n yield* Console.log(JSON.stringify({ profile, loggedOut: true }, null, 2));\n } else {\n yield* Console.log(`Logged out of profile (${profile}).`);\n }\n }),\n).pipe(Command.withDescription('Log out of the current profile (clears the local identity and data).'));\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\n\nimport { login } from './login';\nimport { logout } from './logout';\n\nexport const account: Command.Command<any, any, any, any> = Command.make('account').pipe(\n Command.withDescription('Log in and out of a DXOS identity.'),\n Command.withSubcommands([login, logout]),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\nimport * as Yaml from 'yaml';\n\nimport { CommandConfig } from '@dxos/cli-util';\nimport { ConfigService } from '@dxos/client';\nimport { DX_CONFIG, getProfileConfigPath } from '@dxos/client-protocol';\n\nexport const view = Command.make(\n 'view',\n {},\n Effect.fnUntraced(function* () {\n const config = yield* ConfigService;\n const { json, profile } = yield* CommandConfig;\n const configPath = getProfileConfigPath(DX_CONFIG, profile);\n\n if (json) {\n yield* Console.log(JSON.stringify(config.values, null, 2));\n } else {\n yield* Console.log(`Path: ${configPath}`);\n yield* Console.log(Yaml.stringify(config.values));\n }\n }),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\n\nimport { view } from './view';\n\nexport const config = Command.make('config').pipe(\n Command.withDescription('Config commands.'),\n Command.withSubcommands([view]),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport { FormBuilder } from '@dxos/cli-util';\nimport { Device, DeviceKind, DeviceType } from '@dxos/client/halo';\n\nconst maybeTruncateKey = (key: { toHex(): string; truncate(): string }, truncate = false) =>\n truncate ? key.truncate() : key.toHex();\n\nconst getDeviceTitle = (device: Device): string => {\n if (device.profile?.label) {\n return device.profile.label;\n }\n const platform = device.profile?.platform ?? 'Unknown';\n const os = device.profile?.os ?? 'Unknown';\n return `${platform} on ${os}`;\n};\n\nexport const mapDevices = (devices: Device[], truncateKeys = false) => {\n return devices.map((device) => ({\n label: device.profile?.label,\n type: device.profile?.type ? DeviceType[device.profile?.type] : 'UNKNOWN',\n key: maybeTruncateKey(device.deviceKey, truncateKeys),\n kind: DeviceKind[device.kind],\n platform: device.profile?.platform,\n platformVersion: device.profile?.platformVersion,\n architecture: device.profile?.architecture,\n os: device.profile?.os,\n osVersion: device.profile?.osVersion,\n presence: device?.kind === DeviceKind.CURRENT ? 'THIS DEVICE' : Device.PresenceState[device.presence],\n }));\n};\n\nexport const printDevice = (device: Device) =>\n FormBuilder.make({ title: getDeviceTitle(device) }).pipe(\n FormBuilder.set('deviceKey', device.deviceKey.truncate()),\n FormBuilder.set('label', device.profile?.label ?? '<none>'),\n FormBuilder.set('type', device.profile?.type ? DeviceType[device.profile?.type] : 'UNKNOWN'),\n FormBuilder.set('kind', DeviceKind[device.kind]),\n FormBuilder.set(\n 'presence',\n device?.kind === DeviceKind.CURRENT ? 'THIS DEVICE' : Device.PresenceState[device.presence],\n ),\n FormBuilder.set('platform', device.profile?.platform ?? '<none>'),\n FormBuilder.set('platformVersion', device.profile?.platformVersion ?? '<none>'),\n FormBuilder.set('architecture', device.profile?.architecture ?? '<none>'),\n FormBuilder.set('os', device.profile?.os ?? '<none>'),\n FormBuilder.set('osVersion', device.profile?.osVersion ?? '<none>'),\n FormBuilder.build,\n );\n\nexport const printDevices = (devices: Device[]) => {\n return devices.map(printDevice);\n};\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { CommandConfig } from '@dxos/cli-util';\nimport { print } from '@dxos/cli-util';\nimport { ClientService } from '@dxos/client';\nimport { DeviceType } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { printDevice } from '../util';\n\nexport const handler = Effect.fn(function* () {\n const { json } = yield* CommandConfig;\n const client = yield* ClientService;\n const device = client.halo.device;\n if (!device) {\n if (json) {\n yield* Console.log(JSON.stringify({ error: 'No device found' }, null, 2));\n } else {\n yield* Console.log('No device found.');\n }\n return;\n }\n\n if (json) {\n yield* Console.log(\n JSON.stringify(\n {\n deviceKey: device.deviceKey.toHex(),\n profile: {\n ...device.profile,\n type: device.profile?.type ? DeviceType[device.profile?.type] : 'UNKNOWN',\n },\n },\n null,\n 2,\n ),\n );\n } else {\n yield* Console.log(print(printDevice(device)));\n }\n});\n\nexport const info = Command.make('info', {}, handler).pipe(Command.withDescription('Show device info.'));\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { CommandConfig } from '@dxos/cli-util';\nimport { printList } from '@dxos/cli-util';\nimport { ClientService } from '@dxos/client';\n\nimport { mapDevices, printDevices } from '../util';\n\nexport const handler = Effect.fn(function* () {\n const { json } = yield* CommandConfig;\n const client = yield* ClientService;\n const devices = client.halo.devices.get();\n\n if (json) {\n yield* Console.log(JSON.stringify(mapDevices(devices), null, 2));\n } else {\n const formatted = printDevices(devices);\n yield* Console.log(printList(formatted));\n }\n});\n\nexport const list = Command.make('list', {}, handler).pipe(Command.withDescription('List devices.'));\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Options from '@effect/cli/Options';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { CommandConfig } from '@dxos/cli-util';\nimport { print } from '@dxos/cli-util';\nimport { ClientService } from '@dxos/client';\n\nimport { printDevice } from '../util';\n\nexport const handler = Effect.fn(function* ({ label }: { label: string }) {\n const { json } = yield* CommandConfig;\n const client = yield* ClientService;\n const device = client.halo.device;\n if (!device) {\n if (json) {\n yield* Console.log(JSON.stringify({ error: 'No device found' }, null, 2));\n } else {\n yield* Console.log('No device found.');\n }\n return;\n }\n\n const updatedProfile = {\n ...device.profile,\n label,\n };\n\n const devicesService = client.services.services.DevicesService;\n if (!devicesService) {\n if (json) {\n yield* Console.log(JSON.stringify({ error: 'DevicesService not found' }, null, 2));\n } else {\n yield* Console.log('DevicesService not found.');\n }\n return;\n }\n\n const updatedDevice = yield* Effect.tryPromise(() => devicesService.updateDevice(updatedProfile));\n\n if (json) {\n yield* Console.log(\n JSON.stringify(\n {\n deviceKey: updatedDevice.deviceKey.toHex(),\n profile: updatedDevice.profile,\n },\n null,\n 2,\n ),\n );\n } else {\n yield* Console.log(print(printDevice(updatedDevice)));\n }\n});\n\nexport const update = Command.make(\n 'update',\n {\n label: Options.text('label').pipe(Options.withDescription('The device label.')),\n },\n handler,\n).pipe(Command.withDescription('Update device label.'));\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\n\nimport { info } from './info';\nimport { list } from './list';\nimport { update } from './update';\n\nexport const device = Command.make('device').pipe(\n Command.withDescription('Manage HALO devices.'),\n Command.withSubcommands([info, list, update]),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { CommandConfig } from '@dxos/cli-util';\nimport { ClientService } from '@dxos/client';\nimport { createEdgeIdentity } from '@dxos/client/edge';\nimport { Context } from '@dxos/context';\n\nexport const getStatus = () =>\n Effect.gen(function* () {\n const client = yield* ClientService;\n const identity = createEdgeIdentity(client);\n client.edge.http.setIdentity(identity);\n const status = yield* Effect.tryPromise(() => client.edge.http.getStatus(Context.default()));\n\n if (yield* CommandConfig.isJson) {\n yield* Console.log(JSON.stringify(status, null, 2));\n } else if (status.problems.length > 0) {\n for (const problem of status.problems) {\n yield* Console.error(problem);\n }\n } else {\n yield* Console.log('No problems found.');\n }\n }).pipe(\n // TODO(wittjosiah): Tagged error.\n Effect.catchSome((error) => {\n if (error instanceof Error && error.message === 'Identity not available') {\n // TODO(wittjosiah): Error coloring for logs.\n return Option.some(Console.error(error.message));\n } else {\n return Option.none();\n }\n }),\n );\n\n// TODO(wittjosiah): Admin functionality to provide to specify an identity.\nexport const status = Command.make('status', {}, getStatus).pipe(\n Command.withDescription('Get the EDGE status for the current identity.'),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\n\nimport { status } from './status';\n\nexport const edge = Command.make('edge').pipe(\n Command.withDescription('EDGE commands.'),\n Command.withSubcommands([status]),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Options from '@effect/cli/Options';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, Plugin } from '@dxos/app-framework';\nimport { AppSpace } from '@dxos/app-toolkit';\nimport { CommandConfig, flushAndSync, spaceLayer } from '@dxos/cli-util';\nimport { print } from '@dxos/cli-util';\nimport { ClientService } from '@dxos/client';\nimport { invariant } from '@dxos/invariant';\nimport { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';\nimport { MembershipPolicy } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { ClientOperation } from '#operations';\n\nimport { printIdentity } from '../util';\n\nexport const handler = Effect.fn(function* ({\n agent,\n displayName,\n}: {\n agent: boolean;\n displayName: Option.Option<string>;\n}) {\n const { json } = yield* CommandConfig;\n const client = yield* ClientService;\n // TODO(wittjosiah): How to surface this error to the user cleanly?\n invariant(!client.halo.identity.get(), 'Identity already exists');\n\n const manager = yield* Plugin.Service;\n const { invoke } = manager.capabilities.get(Capabilities.OperationInvoker);\n const identity = yield* invoke(ClientOperation.CreateIdentity, {\n displayName: Option.getOrUndefined(displayName),\n });\n\n if (agent) {\n yield* invoke(ClientOperation.CreateAgent);\n }\n\n // Create personal space for the CLI identity.\n const space = yield* Effect.promise(() =>\n client.spaces.create({}, { tags: [AppSpace.PERSONAL_SPACE_TAG], membershipPolicy: MembershipPolicy.LOCKED }),\n );\n yield* Effect.promise(() => space.waitUntilReady());\n yield* Effect.promise(() => space.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED));\n yield* flushAndSync({ indexes: true }).pipe(Effect.provide(spaceLayer(Option.some(space.id))));\n\n if (json) {\n yield* Console.log(\n JSON.stringify(\n {\n identityDid: identity.identityDid,\n displayName: identity.profile?.displayName,\n },\n null,\n 2,\n ),\n );\n } else {\n yield* Console.log(print(printIdentity(identity)));\n }\n});\n\nexport const create = Command.make(\n 'create',\n {\n agent: Options.boolean('noAgent', { ifPresent: false }).pipe(\n Options.withDescription('Do not create an EDGE agent for the identity.'),\n ),\n displayName: Options.text('displayName').pipe(\n Options.withDescription('The display name of the identity.'),\n Options.optional,\n ),\n },\n handler,\n).pipe(Command.withDescription('Create a new identity.'));\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Args from '@effect/cli/Args';\nimport * as Command from '@effect/cli/Command';\nimport * as Prompt from '@effect/cli/Prompt';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { CommandConfig } from '@dxos/cli-util';\nimport { ClientService } from '@dxos/client';\nimport { invariant } from '@dxos/invariant';\nimport { schema } from '@dxos/protocols/proto';\n\nexport const handler = Effect.fn(function* ({ credential }: { credential: Option.Option<string> }) {\n const { json } = yield* CommandConfig;\n const client = yield* ClientService;\n\n let credentialHex = Option.getOrUndefined(credential);\n if (!credentialHex) {\n credentialHex = yield* Prompt.text({ message: 'Enter credential (hex string)' }).pipe(Prompt.run);\n }\n\n invariant(credentialHex, 'Invalid credential.');\n\n const identity = client.halo.identity;\n if (!identity) {\n if (json) {\n yield* Console.log(JSON.stringify({ error: 'Profile not initialized' }, null, 2));\n } else {\n yield* Console.log('Profile not initialized.');\n }\n return;\n }\n\n yield* Effect.gen(function* () {\n const codec = schema.getCodecForType('dxos.halo.credentials.Credential');\n const credentialBytes = yield* Effect.try({\n try: () => Buffer.from(credentialHex, 'hex'),\n catch: (error) => new Error(`Failed to parse hex string: ${error}`),\n });\n\n const verifyError = codec.protoType.verify(credentialBytes);\n if (verifyError) {\n yield* Effect.fail(new Error(verifyError));\n }\n\n const credentialObj = yield* Effect.try({\n try: () => codec.decode(credentialBytes),\n catch: (error) => new Error(`Failed to decode credential: ${error}`),\n });\n\n yield* Effect.tryPromise({\n try: () => client.halo.writeCredentials([credentialObj]),\n catch: (error) => new Error(`Failed to write credential: ${error}`),\n });\n\n if (json) {\n yield* Console.log(JSON.stringify({ success: true }, null, 2));\n } else {\n yield* Console.log('Credential added successfully.');\n }\n }).pipe(\n Effect.catchAll((error) =>\n Effect.gen(function* () {\n if (json) {\n yield* Console.log(\n JSON.stringify(\n {\n error: 'Invalid credential',\n message: error instanceof Error ? error.message : String(error),\n },\n null,\n 2,\n ),\n );\n } else {\n yield* Console.log('Invalid credential.');\n }\n yield* Effect.fail(error);\n }),\n ),\n );\n});\n\nexport const add = Command.make(\n 'add',\n {\n credential: Args.text({ name: 'credential' }).pipe(\n Args.withDescription('Credential as hex string.'),\n Args.optional,\n ),\n },\n handler,\n).pipe(Command.withDescription('Import credential into HALO.'));\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Options from '@effect/cli/Options';\nimport * as Console from 'effect/Console';\nimport * as Duration from 'effect/Duration';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { CommandConfig, Common, FormBuilder, getSpace, printList } from '@dxos/cli-util';\nimport { ClientService } from '@dxos/client';\nimport type { Credential } from '@dxos/client/halo';\nimport { type Key } from '@dxos/echo';\n\nconst mapCredentials = (credentials: Credential[]) => {\n return credentials.map((credential) => ({\n id: credential.id?.toHex() ?? '<unknown>',\n issuer: credential.issuer?.toHex() ?? '<unknown>',\n subject: credential.subject?.id?.toHex() ?? '<unknown>',\n type: credential.subject.assertion['@type'],\n assertion: credential.subject.assertion,\n }));\n};\n\nconst printCredential = (credential: Credential) => {\n const type = credential.subject.assertion['@type'] ?? '<unknown>';\n return FormBuilder.make({ title: type }).pipe(\n FormBuilder.option('id', Option.fromNullable(credential.id?.truncate())),\n FormBuilder.option('issuer', Option.fromNullable(credential.issuer?.truncate())),\n FormBuilder.option('subject', Option.fromNullable(credential.subject?.id?.truncate())),\n FormBuilder.build,\n );\n};\n\nexport const handler = Effect.fn(function* ({\n type,\n spaceId,\n timeout,\n delay,\n}: {\n type: Option.Option<string>;\n spaceId: Option.Option<Key.SpaceId>;\n timeout: number;\n delay: number;\n}) {\n const { json } = yield* CommandConfig;\n const client = yield* ClientService;\n let credentials: Credential[];\n\n if (Option.isSome(spaceId)) {\n // If space ID was provided, get credentials from that space.\n const space = yield* getSpace(spaceId.value);\n credentials = yield* Effect.tryPromise(() => space.internal.getCredentials());\n } else {\n // Get credentials from HALO\n const identity = client.halo.identity;\n if (!identity) {\n if (json) {\n yield* Console.log(JSON.stringify({ error: 'Profile not initialized' }, null, 2));\n } else {\n yield* Console.log('Profile not initialized.');\n }\n return;\n }\n\n // Wait for at least one credential\n const latch = yield* Effect.makeLatch();\n const subscription = client.halo.credentials.subscribe((creds) => {\n if (creds.length > 0) {\n Effect.runSync(latch.open);\n }\n });\n\n yield* latch.await.pipe(\n Effect.timeout(Duration.millis(timeout)),\n Effect.catchAll(() => Effect.void),\n Effect.ensuring(\n Effect.sync(() => {\n subscription.unsubscribe();\n }),\n ),\n );\n\n // Wait a bit more to ensure all credentials are loaded\n yield* Effect.sleep(Duration.millis(delay));\n\n credentials = client.halo.queryCredentials({ type: Option.getOrUndefined(type) });\n }\n\n if (json) {\n yield* Console.log(JSON.stringify(mapCredentials(credentials), null, 2));\n } else {\n const formatted = credentials.map(printCredential);\n yield* Console.log(printList(formatted));\n }\n});\n\nexport const list = Command.make(\n 'list',\n {\n type: Options.text('type').pipe(Options.withDescription('Filter by credential type.'), Options.optional),\n spaceId: Common.spaceId.pipe(Options.withDescription('Space ID to show credentials from.'), Options.optional),\n timeout: Options.integer('timeout').pipe(\n Options.withDescription('Time in milliseconds to wait for at least one credential before listing.'),\n Options.withDefault(500),\n ),\n delay: Options.integer('delay').pipe(\n Options.withDescription('Delay in milliseconds before listing.'),\n Options.withDefault(250),\n ),\n },\n handler,\n).pipe(Command.withDescription('List HALO credentials.'));\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\n\nimport { add } from './add';\nimport { list } from './list';\n\nexport const credential = Command.make('credential').pipe(\n Command.withDescription('Manage HALO credentials.'),\n Command.withSubcommands([add, list]),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { CommandConfig } from '@dxos/cli-util';\nimport { print } from '@dxos/cli-util';\nimport { ClientService } from '@dxos/client';\n\nimport { printIdentity } from '../util';\n\nexport const handler = Effect.fn(function* () {\n const { json } = yield* CommandConfig;\n const client = yield* ClientService;\n const identity = client.halo.identity.get();\n if (!identity) {\n if (json) {\n yield* Console.log(JSON.stringify({ error: 'Identity not initialized' }, null, 2));\n } else {\n yield* Console.log('Identity not initialized.');\n }\n } else {\n if (json) {\n yield* Console.log(\n JSON.stringify(\n {\n identityDid: identity.did,\n displayName: identity.profile?.displayName,\n },\n null,\n 2,\n ),\n );\n } else {\n yield* Console.log(print(printIdentity({ identityDid: identity.did, profile: identity.profile })));\n }\n }\n});\n\nexport const identity = Command.make('identity', {}, handler).pipe(\n Command.withDescription('Get the current identity.'),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { CommandConfig } from '@dxos/cli-util';\nimport { FormBuilder, print } from '@dxos/cli-util';\nimport { ClientService } from '@dxos/client';\n\nexport const handler = Effect.fn(function* () {\n const { json } = yield* CommandConfig;\n const client = yield* ClientService;\n const identity = client.halo.identity.get();\n const device = client.halo.device;\n\n if (json) {\n yield* Console.log(\n JSON.stringify(\n {\n identityKey: identity?.identityKey.toHex(),\n deviceKey: device?.deviceKey.toHex(),\n },\n null,\n 2,\n ),\n );\n } else {\n const builder = FormBuilder.make({ title: 'HALO Keys' }).pipe(\n FormBuilder.option('identityKey', Option.fromNullable(identity?.identityKey.truncate())),\n FormBuilder.option('deviceKey', Option.fromNullable(device?.deviceKey.truncate())),\n );\n yield* Console.log(print(FormBuilder.build(builder)));\n }\n});\n\nexport const keys = Command.make('keys', {}, handler).pipe(Command.withDescription('Show HALO keys.'));\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { CommandConfig } from '@dxos/cli-util';\nimport { ClientService } from '@dxos/client';\n\nexport const handler = Effect.fn(function* () {\n const { json } = yield* CommandConfig;\n const client = yield* ClientService;\n const identityService = client.services.services.IdentityService;\n if (!identityService) {\n if (json) {\n yield* Console.log(JSON.stringify({ error: 'IdentityService not found' }, null, 2));\n } else {\n yield* Console.log('IdentityService not found.');\n }\n return;\n }\n\n const result = yield* Effect.tryPromise(() => identityService.createRecoveryCredential({}));\n\n if (json) {\n yield* Console.log(JSON.stringify({ recoveryCode: result.recoveryCode }, null, 2));\n } else {\n yield* Console.log(result.recoveryCode);\n }\n});\n\nexport const seed = Command.make('seed', {}, handler).pipe(\n Command.withDescription('Generate a seedphrase that can be used for identity recovery.'),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Options from '@effect/cli/Options';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { CommandConfig, copyToClipboard, openBrowser, print } from '@dxos/cli-util';\nimport { FormBuilder } from '@dxos/cli-util';\nimport { ClientService } from '@dxos/client';\nimport { Invitation, InvitationEncoder, hostInvitation } from '@dxos/client/invitations';\n\nexport const handler = Effect.fn(function* ({\n lifetime,\n open,\n host,\n}: {\n lifetime: number;\n open: boolean;\n host: string;\n}) {\n const { json } = yield* CommandConfig;\n const client = yield* ClientService;\n\n // Validate up front — an invalid host inside `onConnecting` would abort after the invitation\n // is already hosted, without printing the codes.\n yield* Effect.try({\n try: () => new URL(host),\n catch: () => new Error(`--host must be an absolute URL: ${host}`),\n });\n\n // Always use persistent and delegated (auth required) due to P2P limitations\n const observable = client.halo.share({\n authMethod: Invitation.AuthMethod.SHARED_SECRET,\n persistent: true,\n lifetime,\n });\n\n const invitation = yield* hostInvitation({\n observable,\n callbacks: {\n onConnecting: (invitation) =>\n Effect.gen(function* () {\n const invitationCode = InvitationEncoder.encode(invitation);\n const authCode = invitation.authCode!;\n\n // Copy auth code to clipboard\n yield* copyToClipboard(authCode).pipe(Effect.catchAll(() => Effect.void));\n\n const url = new URL(host);\n url.searchParams.set('deviceInvitationCode', invitationCode);\n\n if (!json) {\n yield* Console.log(`\\nSecret: ${authCode} (copied to clipboard)\\n`);\n yield* Console.log(`\\nInvitation: ${invitationCode}\\n`);\n // Print the joinable URL even when not opening so it can be pasted manually.\n yield* Console.log(`\\nURL: ${url.toString()}\\n`);\n }\n\n if (open) {\n yield* openBrowser(url.toString()).pipe(\n Effect.catchAll(() => Console.error(`Failed to open browser: ${url.toString()}`)),\n );\n }\n }),\n },\n waitForSuccess: true,\n });\n\n if (json) {\n yield* Console.log(\n JSON.stringify(\n {\n invitationCode: InvitationEncoder.encode(invitation),\n authCode: invitation.authCode,\n state: Invitation.State[invitation.state],\n },\n null,\n 2,\n ),\n );\n } else {\n const builder = FormBuilder.make({ title: 'HALO Invitation' }).pipe(\n FormBuilder.set('invitationCode', InvitationEncoder.encode(invitation)),\n FormBuilder.set('authCode', invitation.authCode ?? '<none>'),\n FormBuilder.set('state', Invitation.State[invitation.state]),\n );\n yield* Console.log(print(FormBuilder.build(builder)));\n }\n});\n\nexport const share = Command.make(\n 'share',\n {\n lifetime: Options.integer('lifetime').pipe(\n Options.withDescription('Lifetime of the invitation in seconds.'),\n Options.withDefault(12 * 60 * 60), // 12 hours - HALO invitations are typically shorter-lived\n ),\n open: Options.boolean('open', { ifPresent: true }).pipe(Options.withDescription('Open browser with invitation.')),\n host: Options.text('host').pipe(\n Options.withDescription('Application Host URL.'),\n Options.withDefault('https://composer.space'),\n ),\n },\n handler,\n).pipe(Command.withDescription('Create HALO (device) invitation.'));\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Options from '@effect/cli/Options';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { CommandConfig } from '@dxos/cli-util';\nimport { print } from '@dxos/cli-util';\nimport { ClientService } from '@dxos/client';\n\nimport { printIdentity } from '../util';\n\nexport const handler = Effect.fn(function* ({ displayName }: { displayName: string }) {\n const { json } = yield* CommandConfig;\n const client = yield* ClientService;\n const identity = client.halo.identity.get();\n if (!identity) {\n if (json) {\n yield* Console.log(JSON.stringify({ error: 'Identity not initialized' }, null, 2));\n } else {\n yield* Console.log('Identity not initialized.');\n }\n return;\n }\n\n const identityService = client.services.services.IdentityService;\n if (!identityService) {\n if (json) {\n yield* Console.log(JSON.stringify({ error: 'IdentityService not found' }, null, 2));\n } else {\n yield* Console.log('IdentityService not found.');\n }\n return;\n }\n\n const updatedIdentity = yield* Effect.tryPromise(() =>\n identityService.updateProfile({\n displayName,\n }),\n );\n\n if (json) {\n yield* Console.log(\n JSON.stringify(\n {\n identityDid: updatedIdentity.did,\n displayName: updatedIdentity.profile?.displayName,\n },\n null,\n 2,\n ),\n );\n } else {\n yield* Console.log(print(printIdentity({ identityDid: updatedIdentity.did, profile: updatedIdentity.profile })));\n }\n});\n\nexport const update = Command.make(\n 'update',\n {\n displayName: Options.text('displayName').pipe(Options.withDescription('The display name of the identity.')),\n },\n handler,\n).pipe(Command.withDescription('Update identity profile.'));\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\n\nimport { create } from './create';\nimport { credential } from './credential';\nimport { identity } from './identity';\nimport { keys } from './keys';\nimport { seed } from './seed';\nimport { share } from './share';\nimport { update } from './update';\n\n// `create`, `join`, and `recover` are superseded by `dx account login`, which logs in to an\n// existing identity via the same methods as Composer (email / atproto / device-invitation /\n// recovery-code). Note: `join` was omitted and the `device-invitation` login method may hang —\n// both rely on p2p networking which does not work in bun. `create` and `share` are registered\n// for the CLI-first pairing flow (CLI hosts the device invitation; the browser joins), which\n// runs over the edge messenger rather than raw p2p.\n\nexport const halo: Command.Command<any, any, any, any> = Command.make('halo').pipe(\n Command.withDescription('Manage HALO identity.'),\n Command.withSubcommands([create, credential, identity, keys, seed, share, update]),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport { FormBuilder } from '@dxos/cli-util';\n\nexport type ProfileInfo = {\n name: string;\n isCurrent: boolean;\n fullPath: string;\n storagePath: string;\n edge?: string;\n};\n\n/**\n * Pretty prints profile creation result with ANSI colors.\n */\nexport const printProfileCreated = (name: string, path: string) =>\n FormBuilder.make({ title: 'Profile created' }).pipe(\n FormBuilder.set('name', name),\n FormBuilder.set('path', path),\n FormBuilder.build,\n );\n\n/**\n * Pretty prints profile deletion result with ANSI colors.\n */\nexport const printProfileDeleted = (name: string) =>\n FormBuilder.make({ title: 'Profile deleted' }).pipe(FormBuilder.set('name', name), FormBuilder.build);\n\n/**\n * Pretty prints profile reset result with ANSI colors.\n */\nexport const printProfileReset = (profile: string) =>\n FormBuilder.make({ title: 'Profile reset' }).pipe(FormBuilder.set('profile', profile), FormBuilder.build);\n\n/**\n * Pretty prints a profile with ANSI colors.\n */\nexport const printProfile = (profile: ProfileInfo) => {\n const title = profile.isCurrent ? `${profile.name} (current)` : profile.name;\n return FormBuilder.make({ title }).pipe(\n FormBuilder.set('fullPath', profile.fullPath),\n FormBuilder.set('storagePath', profile.storagePath),\n FormBuilder.set('edge', profile.edge ?? '<none>'),\n FormBuilder.build,\n );\n};\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Options from '@effect/cli/Options';\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Path from '@effect/platform/Path';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\nimport * as Record from 'effect/Record';\n\nimport { CommandConfig, print } from '@dxos/cli-util';\nimport { DX_CONFIG, getProfileConfigPath } from '@dxos/client-protocol';\nimport { trim } from '@dxos/util';\n\nimport { printProfileCreated } from './util';\n\n// `edgeFeatures` must match Composer's defaults (see composer-app/dx.yml): without\n// `signaling: true` the client silently falls back to an isolated in-memory signal manager and\n// device invitations hang at \"Connecting…\" (host and guest never meet in the swarm).\nconst makeTemplate = (edgeUrl: string) => trim`\n version: 1\n runtime:\n client:\n storage:\n persistent: true\n edgeFeatures:\n signaling: true\n subductionReplicator: true\n feedReplicator: true\n agents: true\n services:\n edge:\n url: ${edgeUrl}\n`;\n\nconst TEMPLATES = {\n default: makeTemplate('https://edge-production.dxos.workers.dev'),\n main: makeTemplate('https://edge-main.dxos.workers.dev'),\n dev: makeTemplate('https://edge.dxos.workers.dev'),\n local: makeTemplate('http://localhost:8787'),\n} as const;\n\nexport const create = Command.make(\n 'create',\n {\n template: Options.choice('template', Record.keys(TEMPLATES)).pipe(\n Options.withDescription('Template to use'),\n Options.withDefault('default'),\n ),\n name: Options.text('name').pipe(Options.withDescription('Profile name'), Options.optional),\n },\n Effect.fnUntraced(function* ({ template, name }) {\n const { json } = yield* CommandConfig;\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const profileName = name.pipe(Option.getOrElse(() => template));\n const configPath = getProfileConfigPath(DX_CONFIG, profileName);\n if (yield* fs.exists(configPath)) {\n throw new Error(`Profile ${profileName} already exists`);\n }\n\n yield* fs.makeDirectory(path.dirname(configPath), { recursive: true });\n yield* fs.writeFileString(configPath, TEMPLATES[template]);\n if (json) {\n yield* Console.log(JSON.stringify({ name: profileName, path: configPath }, null, 2));\n } else {\n yield* Console.log(print(printProfileCreated(profileName, configPath)));\n }\n }),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Options from '@effect/cli/Options';\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { CommandConfig, print } from '@dxos/cli-util';\nimport { DX_CONFIG, getProfileConfigPath } from '@dxos/client-protocol';\n\nimport { printProfileDeleted } from './util';\n\nexport const del = Command.make(\n 'delete',\n {\n name: Options.text('name').pipe(Options.withDescription('Profile name'), Options.optional),\n },\n Effect.fnUntraced(function* ({ name }) {\n const { json } = yield* CommandConfig;\n const fs = yield* FileSystem.FileSystem;\n const profileName = name.pipe(Option.getOrElse(() => 'default'));\n const configPath = getProfileConfigPath(DX_CONFIG, profileName);\n const pluginsPath = `${DX_CONFIG}/plugins/${profileName}.yml`;\n yield* fs.remove(configPath).pipe(Effect.ignore);\n yield* fs.remove(pluginsPath).pipe(Effect.ignore);\n if (json) {\n yield* Console.log(JSON.stringify({ name: profileName, deleted: true }, null, 2));\n } else {\n yield* Console.log(print(printProfileDeleted(profileName)));\n }\n }),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Options from '@effect/cli/Options';\nimport * as Prompt from '@effect/cli/Prompt';\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Path from '@effect/platform/Path';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { CommandConfig } from '@dxos/cli-util';\nimport { ConfigService } from '@dxos/config';\nimport { log } from '@dxos/log';\nimport type { Runtime } from '@dxos/protocols/proto/dxos/config';\n\nexport const handler = Effect.fn(function* ({\n file,\n dataDir,\n force,\n}: {\n file: string;\n dataDir: Option.Option<string>;\n force: boolean;\n}) {\n const dataDirValue = Option.getOrUndefined(dataDir);\n const { json, profile } = yield* CommandConfig;\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const config = yield* ConfigService;\n\n const { createLevel, createStorageObjects, importProfileData, decodeProfileArchive } = yield* Effect.promise(\n () => import('@dxos/client-services'),\n );\n\n let storageConfig: Runtime.Client.Storage;\n if (!dataDirValue) {\n if (!force) {\n yield* Console.log(`Will overwrite profile: ${profile}`);\n const confirmed = yield* Prompt.confirm({\n message: `Delete all data? (Profile: ${profile})`,\n initial: false,\n }).pipe(Prompt.run);\n if (!confirmed) {\n return;\n }\n }\n storageConfig = config.values.runtime!.client!.storage!;\n } else {\n const fullPath = path.resolve(dataDirValue);\n yield* Console.log(`Importing into: ${fullPath}`);\n storageConfig = {\n persistent: true,\n dataRoot: fullPath,\n };\n }\n\n if (yield* fs.exists(storageConfig.dataRoot!)) {\n log.error('data directory already exists', { path: storageConfig.dataRoot! });\n if (json) {\n yield* Console.log(JSON.stringify({ error: 'Data directory already exists' }, null, 2));\n } else {\n yield* Console.log('Data directory already exists.');\n }\n return;\n }\n\n const data = yield* fs.readFile(file);\n\n const archive = decodeProfileArchive(data);\n yield* Console.log(`Importing archive with ${archive.storage.length} entries`);\n\n const { storage } = createStorageObjects(storageConfig);\n const level = yield* Effect.tryPromise({\n try: () => createLevel(storageConfig),\n catch: (error) => new Error(`Failed to create level: ${error}`),\n });\n\n yield* Console.log('Beginning profile import...');\n yield* Effect.tryPromise({\n try: () => importProfileData({ storage, level }, archive),\n catch: (error) => new Error(`Failed to import profile data: ${error}`),\n });\n yield* Console.log('Profile import complete');\n\n if (json) {\n yield* Console.log(JSON.stringify({ success: true, profile, entries: archive.storage.length }, null, 2));\n }\n});\n\nexport const importCommand = Command.make(\n 'import',\n {\n file: Options.text('file').pipe(Options.withDescription('Archive filename.'), Options.withAlias('f')),\n dataDir: Options.text('data-dir').pipe(Options.withDescription('Storage directory.'), Options.optional),\n force: Options.boolean('force', { ifPresent: true }).pipe(Options.withDescription('Skip confirmation prompt.')),\n },\n handler,\n).pipe(Command.withDescription('Import profile.'));\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Options from '@effect/cli/Options';\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { CommandConfig, FormBuilder, print } from '@dxos/cli-util';\nimport { ProfileArchiveEntryType } from '@dxos/protocols';\nimport { arrayToBuffer } from '@dxos/util';\n\nexport const handler = Effect.fn(function* ({ file, storage }: { file: string; storage: boolean }) {\n const { json } = yield* CommandConfig;\n const fs = yield* FileSystem.FileSystem;\n\n const { decodeProfileArchive } = yield* Effect.promise(() => import('@dxos/client-services'));\n\n const data = yield* fs.readFile(file);\n\n const archive = decodeProfileArchive(data);\n\n if (json) {\n yield* Console.log(\n JSON.stringify(\n {\n meta: archive.meta,\n ...(storage ? { storage: archive.storage } : {}),\n },\n null,\n 2,\n ),\n );\n } else {\n const builder = FormBuilder.make({ title: 'Profile Archive' }).pipe(\n FormBuilder.when(\n archive.meta,\n FormBuilder.each(Object.entries(archive.meta ?? {}), ([key, value]) => FormBuilder.set(key, String(value))),\n ),\n FormBuilder.build,\n );\n yield* Console.log(print(builder));\n\n if (storage) {\n yield* Console.log('\\nStorage entries:\\n');\n for (const entry of archive.storage) {\n const key =\n typeof entry.key === 'string' ? entry.key : JSON.stringify(arrayToBuffer(entry.key).toString()).slice(1, -1);\n yield* Console.log(` ${ProfileArchiveEntryType[entry.type]} ${key}`);\n }\n }\n }\n});\n\nexport const inspect = Command.make(\n 'inspect',\n {\n file: Options.text('file').pipe(Options.withDescription('Archive filename.'), Options.withAlias('f')),\n storage: Options.boolean('storage', { ifPresent: true }).pipe(Options.withDescription('List storage entries.')),\n },\n handler,\n).pipe(Command.withDescription('Inspect profile archive.'));\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Path from '@effect/platform/Path';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\nimport * as Yaml from 'yaml';\n\nimport { CommandConfig, printList } from '@dxos/cli-util';\nimport { Config } from '@dxos/client';\nimport { DX_CONFIG, DX_DATA, getProfilePath } from '@dxos/client-protocol';\n\nimport { printProfile } from './util';\n\nexport const list = Command.make(\n 'list',\n {},\n Effect.fnUntraced(function* () {\n const { profile: currentProfile } = yield* CommandConfig;\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const profileDir = path.join(DX_CONFIG, 'profile');\n const entries = yield* fs.readDirectory(profileDir);\n const profileFiles = entries.filter((entry) => entry.endsWith('.yml'));\n const profiles = yield* Effect.forEach(profileFiles, (filename) =>\n Effect.gen(function* () {\n const name = filename.slice(0, -4);\n const configPath = path.join(profileDir, filename);\n const configContent = yield* fs\n .readFileString(configPath)\n .pipe(Effect.catchTag('SystemError', () => Effect.succeed('{}')));\n const configValues = Yaml.parse(configContent) ?? {};\n const config = new Config(configValues);\n return {\n name,\n isCurrent: name === currentProfile,\n fullPath: configPath,\n storagePath: getProfilePath(configValues?.runtime?.client?.storage?.dataRoot ?? DX_DATA, name),\n edge: config.values.runtime?.services?.edge?.url,\n };\n }),\n );\n\n const { json } = yield* CommandConfig;\n if (json) {\n yield* Console.log(JSON.stringify(profiles, null, 2));\n } else {\n const formatted = profiles.map(printProfile);\n yield* Console.log(printList(formatted));\n }\n }),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Options from '@effect/cli/Options';\nimport * as Prompt from '@effect/cli/Prompt';\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { CommandConfig, print } from '@dxos/cli-util';\nimport { DX_DATA, getProfilePath } from '@dxos/client-protocol';\nimport { ConfigService } from '@dxos/config';\n\nimport { printProfileReset } from './util';\n\nexport const reset = Command.make(\n 'reset',\n {\n force: Options.boolean('force', { ifPresent: true }).pipe(Options.withDescription('Skip confirmation prompt')),\n },\n Effect.fnUntraced(function* ({ force }) {\n const fs = yield* FileSystem.FileSystem;\n const config = yield* ConfigService;\n const { json, profile } = yield* CommandConfig;\n const path = config.values.runtime?.client?.storage?.dataRoot ?? getProfilePath(DX_DATA, profile);\n if (!force) {\n const confirmed = yield* Prompt.confirm({\n message: `Are you sure you want to reset the profile (${profile})?`,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n }\n\n yield* fs.remove(path, { recursive: true });\n if (json) {\n yield* Console.log(JSON.stringify({ profile, reset: true }, null, 2));\n } else {\n yield* Console.log(print(printProfileReset(profile)));\n }\n }),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\n\nimport { create } from './create';\nimport { del } from './delete';\nimport { importCommand } from './import';\nimport { inspect } from './inspect';\nimport { list } from './list';\nimport { reset } from './reset';\n\nexport const profile = Command.make('profile').pipe(\n Command.withDescription('Profile commands.'),\n Command.withSubcommands([create, del, importCommand, inspect, list, reset]),\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport { ActivationEvents, Capability, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\n\nimport { Client, LayerSpecs, Migrations, OperationHandler, SchemaDefs } from '#capabilities';\nimport { meta } from '#meta';\nimport { ClientEvents } from '#types';\nimport { type ClientPluginOptions } from '#types';\n\nimport { account, config, device, edge, halo, profile } from './commands';\n\nexport const ClientPlugin = Plugin.define<ClientPluginOptions>(meta).pipe(\n // TODO(wittjosiah): Could some of these commands make use of operations?\n AppPlugin.addCommandModule({ commands: [account, config, device, edge, halo, profile] }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n Plugin.addModule((options) => ({\n id: Capability.getModuleTag(Client),\n activatesOn: ActivationEvents.Startup,\n firesAfterActivation: [ClientEvents.ClientReady],\n activate: () => Client(options),\n })),\n Plugin.addModule({\n activatesOn: ClientEvents.ClientReady,\n firesBeforeActivation: [AppActivationEvents.SetupSchema],\n activate: SchemaDefs,\n }),\n Plugin.addModule({\n activatesOn: ClientEvents.ClientReady,\n firesBeforeActivation: [ClientEvents.SetupMigration],\n activate: Migrations,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvents.SetupProcessManager,\n activate: LayerSpecs,\n }),\n Plugin.make,\n);\n\nexport default ClientPlugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAa,iBAAiB,aAC5B,YAAY,KAAK,EAAE,OAAO,WAAW,CAAC,CAAC,CAAC,KACtC,YAAY,IAAI,eAAe,SAAS,WAAW,GACnD,YAAY,IAAI,eAAe,SAAS,SAAS,eAAe,QAAQ,GACxE,YAAY,KACd;AAEF,IAAM,0CAA0B,IAAI,IAAI;CACtC,WAAW,MAAM;CACjB,WAAW,MAAM;CACjB,WAAW,MAAM;CACjB,WAAW,MAAM;AACnB,CAAC;;AAGD,IAAa,gBAAgB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Q;GACtC,SAAS,+CAA+C,QAAQ;GAChE,SAAS;EACX,CAAC,IAEC;CAAA;CAIJ,OAAO,GAAG,OAAO,MAAM,EAAE,WAAW,KAAK,CAAC;CAC1C,IAAI,MACF,OAAO,QAAQ,IAAI,KAAK,UAAU;EAAE;EAAS,OAAO;CAAK,GAAG,MAAM,CAAC,CAAC;MAEpE,OAAO,QAAQ,IAAI,MAAM,kBAAkB,OAAO,CAAC,CAAC;AAExD,CAAC,CACH;;;AC/BA,IAAa,UAAU,QAAQ,KAAK,SAAS,CAAC,CAAC,KAC7C,QAAQ,gBAAgB,mBAAmB,GAC3C,QAAQ,gBAAgB;CAAC;CAAQ;CAAK;CAAe;CAAS;CAAM;AAAK,CAAC,CAC5E;;;ACFA,IAAa,eAAe,OAAO,OAA4B,IAAI,CAAC,CAAC,KAEnE,UAAU,iBAAiB,EAAE,UAAU;CAAC;CAAS;CAAQ;CAAQ;CAAM;CAAM;AAAO,EAAE,CAAC,GACvF,UAAU,0BAA0B,EAAE,UAAU,iBAAiB,CAAC,GAClE,OAAO,WAAW,aAAa;CAC7B,IAAI,WAAW,aAAa,MAAM;CAClC,aAAa,iBAAiB;CAC9B,sBAAsB,CAAC,aAAa,WAAW;CAC/C,gBAAgB,OAAO,OAAO;AAChC,EAAE,GACF,OAAO,UAAU;CACf,aAAa,aAAa;CAC1B,uBAAuB,CAAC,oBAAoB,WAAW;CACvD,UAAU;AACZ,CAAC,GACD,OAAO,UAAU;CACf,aAAa,aAAa;CAC1B,uBAAuB,CAAC,aAAa,cAAc;CACnD,UAAU;AACZ,CAAC,GACD,OAAO,UAAU;CACf,aAAa,iBAAiB;CAC9B,UAAU;AACZ,CAAC,GACD,OAAO,IACT"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Plugin } from "@dxos/app-framework";
|
|
2
|
+
import { meta } from "#meta";
|
|
3
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
4
|
+
import { OperationHandler } from "#capabilities";
|
|
5
|
+
//#region src/ClientPlugin.workerd.ts
|
|
6
|
+
var ClientPlugin = Plugin.define(meta).pipe(AppPlugin.addOperationHandlerModule({ activate: OperationHandler }), Plugin.make);
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ClientPlugin, ClientPlugin as default };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=ClientPlugin.workerd.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientPlugin.workerd.mjs","names":[],"sources":["../../src/ClientPlugin.workerd.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { OperationHandler } from '#capabilities';\nimport { meta } from '#meta';\n\nexport const ClientPlugin = Plugin.define(meta).pipe(\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n Plugin.make,\n);\n\nexport default ClientPlugin;\n"],"mappings":";;;;;AAUA,IAAa,eAAe,OAAO,OAAO,IAAI,CAAC,CAAC,KAC9C,UAAU,0BAA0B,EAAE,UAAU,iBAAiB,CAAC,GAClE,OAAO,IACT"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Capability } from "@dxos/app-framework";
|
|
2
|
+
//#region src/capabilities/node.ts
|
|
3
|
+
var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("../chunk-app-graph-builder.mjs"));
|
|
4
|
+
var Client = Capability.lazy("Client", () => import("../chunk-client.mjs"));
|
|
5
|
+
var LayerSpecs = Capability.lazy("LayerSpecs", () => import("../chunk-layer-specs.mjs"));
|
|
6
|
+
var Migrations = Capability.lazy("Migrations", () => import("../chunk-migrations.mjs"));
|
|
7
|
+
var NavigationHandler = Capability.lazy("NavigationHandler", () => import("../chunk-navigation-handler.mjs"));
|
|
8
|
+
var OperationHandler = Capability.lazy("OperationHandler", () => import("../chunk-operation-handler.mjs"));
|
|
9
|
+
var SchemaDefs = Capability.lazy("SchemaDefs", () => import("../chunk-schema-defs.mjs"));
|
|
10
|
+
//#endregion
|
|
11
|
+
export { AppGraphBuilder, Client, LayerSpecs, Migrations, NavigationHandler, OperationHandler, SchemaDefs };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=node.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.mjs","names":[],"sources":["../../../src/capabilities/node.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\nexport const Client = Capability.lazy('Client', () => import('./client'));\nexport const LayerSpecs = Capability.lazy<void, Capability.Any[]>('LayerSpecs', () => import('./layer-specs'));\nexport const Migrations = Capability.lazy('Migrations', () => import('./migrations'));\nexport const NavigationHandler = Capability.lazy(\n 'NavigationHandler',\n () => import('./navigation-handler/navigation-handler'),\n);\nexport type { NavigationHandlerOptions } from './navigation-handler';\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const SchemaDefs = Capability.lazy('SchemaDefs', () => import('./schema-defs'));\n"],"mappings":";;AAOA,IAAa,kBAAkB,WAAW,KAAK,yBAAyB,OAAO,iCAAsB;AACrG,IAAa,SAAS,WAAW,KAAK,gBAAgB,OAAO,sBAAW;AACxE,IAAa,aAAa,WAAW,KAA6B,oBAAoB,OAAO,2BAAgB;AAC7G,IAAa,aAAa,WAAW,KAAK,oBAAoB,OAAO,0BAAe;AACpF,IAAa,oBAAoB,WAAW,KAC1C,2BACM,OAAO,kCACf;AAEA,IAAa,mBAAmB,WAAW,KACzC,0BACM,OAAO,iCACf;AACA,IAAa,aAAa,WAAW,KAAK,oBAAoB,OAAO,2BAAgB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Capability } from "@dxos/app-framework";
|
|
2
|
+
//#region src/capabilities/navigation-handler/index.ts
|
|
3
|
+
var NavigationHandler = Capability.lazy("NavigationHandler", () => import("./chunk-navigation-handler.mjs"));
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/capabilities/index.ts
|
|
6
|
+
var AccountCache = Capability.lazy("AccountCache", () => import("./chunk-account-cache.mjs"));
|
|
7
|
+
var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("./chunk-app-graph-builder.mjs"));
|
|
8
|
+
var HubHttpClient = Capability.lazy("HubHttpClient", () => import("./chunk-hub-http-client.mjs"));
|
|
9
|
+
var Client = Capability.lazy("Client", () => import("./chunk-client.mjs"));
|
|
10
|
+
var LayerSpecs = Capability.lazy("LayerSpecs", () => import("./chunk-layer-specs.mjs"));
|
|
11
|
+
var Migrations = Capability.lazy("Migrations", () => import("./chunk-migrations.mjs"));
|
|
12
|
+
var NavigationTargetLoader = Capability.lazy("NavigationTargetLoader", () => import("./chunk-navigation-target-loader.mjs"));
|
|
13
|
+
var OperationHandler = Capability.lazy("OperationHandler", () => import("./chunk-operation-handler.mjs"));
|
|
14
|
+
var ReactContext = Capability.lazy("ReactContext", () => import("./chunk-react-context.mjs"));
|
|
15
|
+
var RemoteTraceMonitor = Capability.lazy("RemoteTraceMonitor", () => import("./chunk-remote-trace-monitor.mjs"));
|
|
16
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("./chunk-react-surface.mjs"));
|
|
17
|
+
var SchemaDefs = Capability.lazy("SchemaDefs", () => import("./chunk-schema-defs.mjs"));
|
|
18
|
+
var SpaceReplicationProgress = Capability.lazy("SpaceReplicationProgress", () => import("./chunk-space-replication-progress.mjs"));
|
|
19
|
+
var TraceProgress = Capability.lazy("TraceProgress", () => import("./chunk-trace-progress.mjs"));
|
|
20
|
+
//#endregion
|
|
21
|
+
export { AccountCache, AppGraphBuilder, Client, HubHttpClient, LayerSpecs, Migrations, NavigationHandler, NavigationTargetLoader, OperationHandler, ReactContext, ReactSurface, RemoteTraceMonitor, SchemaDefs, SpaceReplicationProgress, TraceProgress };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=capabilities.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/navigation-handler/index.ts","../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport type { NavigationHandlerOptions } from './navigation-handler';\n\nexport const NavigationHandler = Capability.lazy('NavigationHandler', () => import('./navigation-handler'));\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const AccountCache = Capability.lazy('AccountCache', () => import('./account-cache'));\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\nexport const HubHttpClient = Capability.lazy('HubHttpClient', () => import('./hub-http-client'));\nexport const Client = Capability.lazy('Client', () => import('./client'));\nexport const LayerSpecs = Capability.lazy<void, Capability.Any[]>('LayerSpecs', () => import('./layer-specs'));\nexport const Migrations = Capability.lazy('Migrations', () => import('./migrations'));\nexport { NavigationHandler } from './navigation-handler';\nexport type { NavigationHandlerOptions } from './navigation-handler';\nexport const NavigationTargetLoader = Capability.lazy(\n 'NavigationTargetLoader',\n () => import('./navigation-target-loader'),\n);\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactContext = Capability.lazy('ReactContext', () => import('./react-context'));\nexport const RemoteTraceMonitor = Capability.lazy('RemoteTraceMonitor', () => import('./remote-trace-monitor'));\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const SchemaDefs = Capability.lazy('SchemaDefs', () => import('./schema-defs'));\nexport const SpaceReplicationProgress = Capability.lazy(\n 'SpaceReplicationProgress',\n () => import('./space-replication-progress'),\n);\nexport const TraceProgress = Capability.lazy('TraceProgress', () => import('./trace-progress'));\n"],"mappings":";;AAQA,IAAa,oBAAoB,WAAW,KAAK,2BAA2B,OAAO,iCAAuB;;;ACD1G,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,kBAAkB,WAAW,KAAK,yBAAyB,OAAO,gCAAsB;AACrG,IAAa,gBAAgB,WAAW,KAAK,uBAAuB,OAAO,8BAAoB;AAC/F,IAAa,SAAS,WAAW,KAAK,gBAAgB,OAAO,qBAAW;AACxE,IAAa,aAAa,WAAW,KAA6B,oBAAoB,OAAO,0BAAgB;AAC7G,IAAa,aAAa,WAAW,KAAK,oBAAoB,OAAO,yBAAe;AAGpF,IAAa,yBAAyB,WAAW,KAC/C,gCACM,OAAO,uCACf;AACA,IAAa,mBAAmB,WAAW,KACzC,0BACM,OAAO,gCACf;AACA,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,qBAAqB,WAAW,KAAK,4BAA4B,OAAO,mCAAyB;AAC9G,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,aAAa,WAAW,KAAK,oBAAoB,OAAO,0BAAgB;AACrF,IAAa,2BAA2B,WAAW,KACjD,kCACM,OAAO,yCACf;AACA,IAAa,gBAAgB,WAAW,KAAK,uBAAuB,OAAO,6BAAmB"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { r as RESET_DIALOG } from "./chunk-constants.mjs";
|
|
2
|
+
import { t as useHubHttpClient } from "./chunk-hooks.mjs";
|
|
3
|
+
import { meta } from "#meta";
|
|
4
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
5
|
+
import { ClientCapabilities } from "#types";
|
|
6
|
+
import { Context } from "@dxos/context";
|
|
7
|
+
import { useCallback, useState } from "react";
|
|
8
|
+
import { useCapability, useOperationInvoker } from "@dxos/app-framework/ui";
|
|
9
|
+
import { useIdentity } from "@dxos/halo-react";
|
|
10
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { useAtom, useAtomSet } from "@effect-atom/atom-react";
|
|
12
|
+
import { Button, Icon, IconButton, Input, Message, useAsyncEffect, useTranslation } from "@dxos/react-ui";
|
|
13
|
+
import { Form } from "@dxos/react-ui-form";
|
|
14
|
+
//#region src/containers/AccountContainer/AccountContainer.tsx
|
|
15
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/containers/AccountContainer/AccountContainer.tsx";
|
|
16
|
+
var AccountContainer = () => {
|
|
17
|
+
const { t } = useTranslation(meta.profile.key);
|
|
18
|
+
const identity = useIdentity();
|
|
19
|
+
const { invokePromise } = useOperationInvoker();
|
|
20
|
+
const accountCacheAtom = useCapability(ClientCapabilities.AccountCache);
|
|
21
|
+
const [cache] = useAtom(accountCacheAtom);
|
|
22
|
+
const setCache = useAtomSet(accountCacheAtom);
|
|
23
|
+
const [resendStatus, setResendStatus] = useState(null);
|
|
24
|
+
const [accountState, setAccountState] = useState(cache.account ? "present" : "loading");
|
|
25
|
+
const [requestEmail, setRequestEmail] = useState("");
|
|
26
|
+
const [requestSubmitted, setRequestSubmitted] = useState(false);
|
|
27
|
+
const hubHttp = useHubHttpClient();
|
|
28
|
+
useAsyncEffect(async () => {
|
|
29
|
+
if (!hubHttp) return;
|
|
30
|
+
try {
|
|
31
|
+
const account = await hubHttp.getAccount(new Context(void 0, {
|
|
32
|
+
"~LogMeta": "~LogMeta",
|
|
33
|
+
F: __dxlog_file,
|
|
34
|
+
L: 44
|
|
35
|
+
}));
|
|
36
|
+
setCache((prev) => ({
|
|
37
|
+
...prev,
|
|
38
|
+
account,
|
|
39
|
+
fetchedAt: Date.now()
|
|
40
|
+
}));
|
|
41
|
+
setAccountState("present");
|
|
42
|
+
} catch (err) {
|
|
43
|
+
if (err?.data?.type === "no_account") {
|
|
44
|
+
setCache((prev) => ({
|
|
45
|
+
...prev,
|
|
46
|
+
account: void 0,
|
|
47
|
+
fetchedAt: Date.now()
|
|
48
|
+
}));
|
|
49
|
+
setAccountState("missing");
|
|
50
|
+
} else setAccountState((prev) => prev === "present" ? "present" : "error");
|
|
51
|
+
}
|
|
52
|
+
}, [hubHttp, setCache]);
|
|
53
|
+
const handleResend = useCallback(async () => {
|
|
54
|
+
if (!hubHttp) return;
|
|
55
|
+
try {
|
|
56
|
+
const result = await hubHttp.resendVerificationEmail(new Context(void 0, {
|
|
57
|
+
"~LogMeta": "~LogMeta",
|
|
58
|
+
F: __dxlog_file,
|
|
59
|
+
L: 62
|
|
60
|
+
}));
|
|
61
|
+
if (result.sent) setResendStatus(t("verification-sent.message"));
|
|
62
|
+
else if (result.cooldownSecondsRemaining) setResendStatus(t("verification-cooldown.message", { seconds: result.cooldownSecondsRemaining }));
|
|
63
|
+
else setResendStatus(t("verification-failed.message"));
|
|
64
|
+
} catch {
|
|
65
|
+
setResendStatus(t("verification-failed.message"));
|
|
66
|
+
}
|
|
67
|
+
}, [hubHttp, t]);
|
|
68
|
+
const handleRequestAccess = useCallback(async (event) => {
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
const email = requestEmail.trim();
|
|
71
|
+
if (!email || !hubHttp) return;
|
|
72
|
+
try {
|
|
73
|
+
const identityDid = identity?.did;
|
|
74
|
+
await hubHttp.requestAccess(new Context(void 0, {
|
|
75
|
+
"~LogMeta": "~LogMeta",
|
|
76
|
+
F: __dxlog_file,
|
|
77
|
+
L: 84
|
|
78
|
+
}), {
|
|
79
|
+
email,
|
|
80
|
+
identityDid
|
|
81
|
+
});
|
|
82
|
+
} catch {}
|
|
83
|
+
setRequestSubmitted(true);
|
|
84
|
+
}, [
|
|
85
|
+
hubHttp,
|
|
86
|
+
identity,
|
|
87
|
+
requestEmail
|
|
88
|
+
]);
|
|
89
|
+
const handleDeleteAccount = useCallback(() => {
|
|
90
|
+
if (!hubHttp) return;
|
|
91
|
+
invokePromise(LayoutOperation.UpdateDialog, {
|
|
92
|
+
subject: RESET_DIALOG,
|
|
93
|
+
blockAlign: "start",
|
|
94
|
+
props: {
|
|
95
|
+
mode: "reset-storage",
|
|
96
|
+
onBeforeReset: async () => {
|
|
97
|
+
await hubHttp.deleteAccount(new Context(void 0, {
|
|
98
|
+
"~LogMeta": "~LogMeta",
|
|
99
|
+
F: __dxlog_file,
|
|
100
|
+
L: 106
|
|
101
|
+
}));
|
|
102
|
+
setCache(() => ({}));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}, [
|
|
107
|
+
hubHttp,
|
|
108
|
+
invokePromise,
|
|
109
|
+
setCache
|
|
110
|
+
]);
|
|
111
|
+
const account = cache.account;
|
|
112
|
+
return /* @__PURE__ */ jsx(Form.Root, {
|
|
113
|
+
variant: "settings",
|
|
114
|
+
children: /* @__PURE__ */ jsx(Form.Viewport, {
|
|
115
|
+
scroll: true,
|
|
116
|
+
children: /* @__PURE__ */ jsx(Form.Content, { children: /* @__PURE__ */ jsx(Form.Section, {
|
|
117
|
+
title: t("account-section.title"),
|
|
118
|
+
description: t("account-section.description"),
|
|
119
|
+
children: accountState === "loading" ? null : accountState === "missing" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Message.Root, {
|
|
120
|
+
valence: "warning",
|
|
121
|
+
children: [/* @__PURE__ */ jsx(Message.Title, {
|
|
122
|
+
icon: "ph--warning--duotone",
|
|
123
|
+
children: t("no-edge-access.title")
|
|
124
|
+
}), /* @__PURE__ */ jsx(Message.Body, { children: t("no-edge-access.description") })]
|
|
125
|
+
}), /* @__PURE__ */ jsx(Form.Row, {
|
|
126
|
+
label: t("request-access.label"),
|
|
127
|
+
description: t("request-access.description"),
|
|
128
|
+
children: requestSubmitted ? /* @__PURE__ */ jsx("span", {
|
|
129
|
+
className: "text-sm text-description",
|
|
130
|
+
children: t("access-request-submitted.message")
|
|
131
|
+
}) : /* @__PURE__ */ jsxs("form", {
|
|
132
|
+
onSubmit: handleRequestAccess,
|
|
133
|
+
className: "flex gap-2 items-center justify-end",
|
|
134
|
+
children: [/* @__PURE__ */ jsx(Input.Root, { children: /* @__PURE__ */ jsx(Input.TextInput, {
|
|
135
|
+
type: "email",
|
|
136
|
+
required: true,
|
|
137
|
+
placeholder: t("access-request-email.placeholder"),
|
|
138
|
+
value: requestEmail,
|
|
139
|
+
onChange: (event) => setRequestEmail(event.target.value),
|
|
140
|
+
classNames: "min-w-64"
|
|
141
|
+
}) }), /* @__PURE__ */ jsx(Button, {
|
|
142
|
+
type: "submit",
|
|
143
|
+
density: "sm",
|
|
144
|
+
children: t("request-access.label")
|
|
145
|
+
})]
|
|
146
|
+
})
|
|
147
|
+
})] }) : accountState === "error" && !account ? /* @__PURE__ */ jsxs(Message.Root, {
|
|
148
|
+
valence: "error",
|
|
149
|
+
children: [/* @__PURE__ */ jsx(Message.Title, {
|
|
150
|
+
icon: "ph--cloud-x--duotone",
|
|
151
|
+
children: t("account-offline.title")
|
|
152
|
+
}), /* @__PURE__ */ jsx(Message.Body, { children: t("account-offline.description") })]
|
|
153
|
+
}) : account ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Form.Row, {
|
|
154
|
+
label: t("email.label"),
|
|
155
|
+
description: account.email,
|
|
156
|
+
children: account.emailVerified ? /* @__PURE__ */ jsx(Icon, {
|
|
157
|
+
icon: "ph--check-circle--duotone",
|
|
158
|
+
size: 5,
|
|
159
|
+
classNames: "text-success-text justify-self-end"
|
|
160
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
161
|
+
className: "flex flex-col gap-1 items-end",
|
|
162
|
+
children: [/* @__PURE__ */ jsx(IconButton, {
|
|
163
|
+
icon: "ph--paper-plane-tilt--regular",
|
|
164
|
+
label: t("resend-verification.label"),
|
|
165
|
+
onClick: handleResend,
|
|
166
|
+
density: "sm"
|
|
167
|
+
}), resendStatus ? /* @__PURE__ */ jsx("span", {
|
|
168
|
+
className: "text-xs text-description",
|
|
169
|
+
children: resendStatus
|
|
170
|
+
}) : null]
|
|
171
|
+
})
|
|
172
|
+
}), /* @__PURE__ */ jsx(Form.Row, {
|
|
173
|
+
label: t("delete-account.label"),
|
|
174
|
+
description: t("delete-account.description"),
|
|
175
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
176
|
+
variant: "destructive",
|
|
177
|
+
density: "sm",
|
|
178
|
+
onClick: handleDeleteAccount,
|
|
179
|
+
children: t("delete-account.label")
|
|
180
|
+
})
|
|
181
|
+
})] }) : null
|
|
182
|
+
}) })
|
|
183
|
+
})
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
AccountContainer.displayName = "AccountContainer";
|
|
187
|
+
//#endregion
|
|
188
|
+
export { AccountContainer as default };
|
|
189
|
+
|
|
190
|
+
//# sourceMappingURL=chunk-AccountContainer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-AccountContainer.mjs","names":[],"sources":["../../src/containers/AccountContainer/AccountContainer.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { useAtom, useAtomSet } from '@effect-atom/atom-react';\nimport React, { type FormEvent, useCallback, useState } from 'react';\n\nimport { useCapability, useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Context } from '@dxos/context';\nimport { useIdentity } from '@dxos/halo-react';\nimport { Button, Icon, IconButton, Input, Message, useAsyncEffect, useTranslation } from '@dxos/react-ui';\nimport { Form } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { ClientCapabilities } from '#types';\n\nimport { RESET_DIALOG } from '../../constants';\nimport { useHubHttpClient } from '../../hooks';\n\ntype AccountState = 'loading' | 'present' | 'missing' | 'error';\n\nexport const AccountContainer = () => {\n const { t } = useTranslation(meta.profile.key);\n const identity = useIdentity();\n const { invokePromise } = useOperationInvoker();\n const accountCacheAtom = useCapability(ClientCapabilities.AccountCache);\n const [cache] = useAtom(accountCacheAtom);\n const setCache = useAtomSet(accountCacheAtom);\n const [resendStatus, setResendStatus] = useState<string | null>(null);\n const [accountState, setAccountState] = useState<AccountState>(cache.account ? 'present' : 'loading');\n const [requestEmail, setRequestEmail] = useState('');\n const [requestSubmitted, setRequestSubmitted] = useState(false);\n\n // Single shared instance keeps the VP-auth handshake (request → 401 → signed\n // retry) at one round-trip per session instead of one per panel.\n const hubHttp = useHubHttpClient();\n\n useAsyncEffect(async () => {\n if (!hubHttp) {\n return;\n }\n try {\n const account = await hubHttp.getAccount(new Context());\n setCache((prev) => ({ ...prev, account, fetchedAt: Date.now() }));\n setAccountState('present');\n } catch (err: any) {\n if (err?.data?.type === 'no_account') {\n setCache((prev) => ({ ...prev, account: undefined, fetchedAt: Date.now() }));\n setAccountState('missing');\n } else {\n setAccountState((prev) => (prev === 'present' ? 'present' : 'error'));\n }\n }\n }, [hubHttp, setCache]);\n\n const handleResend = useCallback(async () => {\n if (!hubHttp) {\n return;\n }\n try {\n const result = await hubHttp.resendVerificationEmail(new Context());\n if (result.sent) {\n setResendStatus(t('verification-sent.message'));\n } else if (result.cooldownSecondsRemaining) {\n setResendStatus(t('verification-cooldown.message', { seconds: result.cooldownSecondsRemaining }));\n } else {\n setResendStatus(t('verification-failed.message'));\n }\n } catch {\n setResendStatus(t('verification-failed.message'));\n }\n }, [hubHttp, t]);\n\n const handleRequestAccess = useCallback(\n async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const email = requestEmail.trim();\n if (!email || !hubHttp) {\n return;\n }\n try {\n const identityDid = identity?.did;\n await hubHttp.requestAccess(new Context(), { email, identityDid });\n } catch {\n // Surface a generic confirmation; failure details would leak signal.\n }\n setRequestSubmitted(true);\n },\n [hubHttp, identity, requestEmail],\n );\n\n // Opens the standard reset confirmation dialog. The `onBeforeReset` hook\n // deletes the hub account first; if that fails the reset is aborted so the\n // local identity is not wiped while the server record remains.\n const handleDeleteAccount = useCallback(() => {\n if (!hubHttp) {\n return;\n }\n void invokePromise(LayoutOperation.UpdateDialog, {\n subject: RESET_DIALOG,\n blockAlign: 'start',\n props: {\n mode: 'reset-storage',\n onBeforeReset: async () => {\n await hubHttp.deleteAccount(new Context());\n setCache(() => ({}));\n },\n },\n });\n }, [hubHttp, invokePromise, setCache]);\n\n const account = cache.account;\n\n return (\n <Form.Root variant='settings'>\n <Form.Viewport scroll>\n <Form.Content>\n <Form.Section title={t('account-section.title')} description={t('account-section.description')}>\n {accountState === 'loading' ? null : accountState === 'missing' ? (\n <>\n <Message.Root valence='warning'>\n <Message.Title icon='ph--warning--duotone'>{t('no-edge-access.title')}</Message.Title>\n <Message.Body>{t('no-edge-access.description')}</Message.Body>\n </Message.Root>\n <Form.Row label={t('request-access.label')} description={t('request-access.description')}>\n {requestSubmitted ? (\n <span className='text-sm text-description'>{t('access-request-submitted.message')}</span>\n ) : (\n <form onSubmit={handleRequestAccess} className='flex gap-2 items-center justify-end'>\n <Input.Root>\n <Input.TextInput\n type='email'\n required\n placeholder={t('access-request-email.placeholder')}\n value={requestEmail}\n onChange={(event) => setRequestEmail(event.target.value)}\n classNames='min-w-64'\n />\n </Input.Root>\n <Button type='submit' density='sm'>\n {t('request-access.label')}\n </Button>\n </form>\n )}\n </Form.Row>\n </>\n ) : accountState === 'error' && !account ? (\n <Message.Root valence='error'>\n <Message.Title icon='ph--cloud-x--duotone'>{t('account-offline.title')}</Message.Title>\n <Message.Body>{t('account-offline.description')}</Message.Body>\n </Message.Root>\n ) : account ? (\n <>\n <Form.Row label={t('email.label')} description={account.email}>\n {account.emailVerified ? (\n <Icon icon='ph--check-circle--duotone' size={5} classNames='text-success-text justify-self-end' />\n ) : (\n <div className='flex flex-col gap-1 items-end'>\n <IconButton\n icon='ph--paper-plane-tilt--regular'\n label={t('resend-verification.label')}\n onClick={handleResend}\n density='sm'\n />\n {resendStatus ? <span className='text-xs text-description'>{resendStatus}</span> : null}\n </div>\n )}\n </Form.Row>\n <Form.Row label={t('delete-account.label')} description={t('delete-account.description')}>\n <Button variant='destructive' density='sm' onClick={handleDeleteAccount}>\n {t('delete-account.label')}\n </Button>\n </Form.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