@dxos/client-services 0.8.4-main.a4bbb77 → 0.8.4-main.abd8ff62ef
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-FZDVFED2.mjs → chunk-KW4WMU5R.mjs} +2698 -4599
- package/dist/lib/browser/chunk-KW4WMU5R.mjs.map +7 -0
- package/dist/lib/browser/chunk-QCWEHHJW.mjs +24 -0
- package/dist/lib/browser/chunk-QCWEHHJW.mjs.map +7 -0
- package/dist/lib/browser/chunk-XJRPB3GA.mjs +22 -0
- package/dist/lib/browser/chunk-XJRPB3GA.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +490 -228
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/diagnostics/browser-diagnostics-broadcast.mjs +88 -0
- package/dist/lib/browser/packlets/diagnostics/browser-diagnostics-broadcast.mjs.map +7 -0
- package/dist/lib/browser/packlets/diagnostics/diagnostics-broadcast.mjs +11 -0
- package/dist/lib/browser/packlets/diagnostics/diagnostics-broadcast.mjs.map +7 -0
- package/dist/lib/browser/packlets/locks/browser.mjs +86 -0
- package/dist/lib/browser/packlets/locks/browser.mjs.map +7 -0
- package/dist/lib/browser/packlets/locks/node.mjs +48 -0
- package/dist/lib/browser/packlets/locks/node.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +60 -90
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/chunk-2DT3MZRL.mjs +22 -0
- package/dist/lib/node-esm/chunk-2DT3MZRL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2SZHAWBN.mjs +24 -0
- package/dist/lib/node-esm/chunk-2SZHAWBN.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JDTIU3EP.mjs → chunk-NDMKP2CH.mjs} +2621 -4391
- package/dist/lib/node-esm/chunk-NDMKP2CH.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +490 -228
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/packlets/diagnostics/browser-diagnostics-broadcast.mjs +88 -0
- package/dist/lib/node-esm/packlets/diagnostics/browser-diagnostics-broadcast.mjs.map +7 -0
- package/dist/lib/node-esm/packlets/diagnostics/diagnostics-broadcast.mjs +11 -0
- package/dist/lib/node-esm/packlets/diagnostics/diagnostics-broadcast.mjs.map +7 -0
- package/dist/lib/node-esm/packlets/locks/browser.mjs +86 -0
- package/dist/lib/node-esm/packlets/locks/browser.mjs.map +7 -0
- package/dist/lib/node-esm/packlets/locks/node.mjs +48 -0
- package/dist/lib/node-esm/packlets/locks/node.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +60 -90
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/packlets/agents/edge-agent-manager.d.ts +3 -2
- package/dist/types/src/packlets/agents/edge-agent-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/agents/edge-agent-service.d.ts +2 -1
- package/dist/types/src/packlets/agents/edge-agent-service.d.ts.map +1 -1
- package/dist/types/src/packlets/devices/devices-service.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/devtools.d.ts +2 -2
- package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/feeds.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/keys.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/metadata.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/network.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/spaces.d.ts.map +1 -1
- package/dist/types/src/packlets/diagnostics/browser-diagnostics-broadcast.d.ts.map +1 -1
- package/dist/types/src/packlets/diagnostics/diagnostics-broadcast.d.ts.map +1 -1
- package/dist/types/src/packlets/diagnostics/diagnostics-collector.d.ts.map +1 -1
- package/dist/types/src/packlets/diagnostics/diagnostics.d.ts +2 -3
- package/dist/types/src/packlets/diagnostics/diagnostics.d.ts.map +1 -1
- package/dist/types/src/packlets/diagnostics/index.d.ts +1 -1
- package/dist/types/src/packlets/diagnostics/index.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/authenticator.d.ts +2 -2
- package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/contacts-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +6 -6
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-recovery-manager.d.ts +8 -7
- package/dist/types/src/packlets/identity/identity-recovery-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts +6 -10
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +8 -11
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +6 -5
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/edge-invitation-handler.d.ts +1 -1
- package/dist/types/src/packlets/invitations/edge-invitation-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-guest-extenstion.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-host-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts +7 -4
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-state.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-topology.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts +4 -4
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts +3 -3
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts +3 -3
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +4 -3
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/utils.d.ts.map +1 -1
- package/dist/types/src/packlets/locks/browser.d.ts.map +1 -1
- package/dist/types/src/packlets/locks/index.d.ts +1 -1
- package/dist/types/src/packlets/locks/index.d.ts.map +1 -1
- package/dist/types/src/packlets/locks/node.d.ts.map +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts +4 -0
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/network/network-service.d.ts +5 -4
- package/dist/types/src/packlets/network/network-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/client-rpc-server.d.ts +5 -5
- package/dist/types/src/packlets/services/client-rpc-server.d.ts.map +1 -1
- package/dist/types/src/packlets/services/feed-syncer.d.ts +59 -0
- package/dist/types/src/packlets/services/feed-syncer.d.ts.map +1 -0
- package/dist/types/src/packlets/services/feed-syncer.test.d.ts +2 -0
- package/dist/types/src/packlets/services/feed-syncer.test.d.ts.map +1 -0
- package/dist/types/src/packlets/services/platform.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +13 -9
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +20 -7
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-registry.d.ts.map +1 -1
- package/dist/types/src/packlets/services/util.d.ts.map +1 -1
- package/dist/types/src/packlets/space-export/archive-format.d.ts +9 -0
- package/dist/types/src/packlets/space-export/archive-format.d.ts.map +1 -0
- package/dist/types/src/packlets/space-export/index.d.ts +4 -1
- package/dist/types/src/packlets/space-export/index.d.ts.map +1 -1
- package/dist/types/src/packlets/space-export/serialized-space-reader.d.ts +23 -0
- package/dist/types/src/packlets/space-export/serialized-space-reader.d.ts.map +1 -0
- package/dist/types/src/packlets/space-export/serialized-space-writer.d.ts +36 -0
- package/dist/types/src/packlets/space-export/serialized-space-writer.d.ts.map +1 -0
- package/dist/types/src/packlets/space-export/space-archive-reader.d.ts +9 -1
- package/dist/types/src/packlets/space-export/space-archive-reader.d.ts.map +1 -1
- package/dist/types/src/packlets/space-export/space-archive-writer.d.ts +7 -1
- package/dist/types/src/packlets/space-export/space-archive-writer.d.ts.map +1 -1
- package/dist/types/src/packlets/space-export/space-archive.test.d.ts +2 -0
- package/dist/types/src/packlets/space-export/space-archive.test.d.ts.map +1 -0
- package/dist/types/src/packlets/spaces/automerge-space-state.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +28 -17
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +26 -9
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/edge-feed-replicator.d.ts +2 -2
- package/dist/types/src/packlets/spaces/edge-feed-replicator.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/epoch-migrations.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/genesis.d.ts +2 -1
- package/dist/types/src/packlets/spaces/genesis.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts +6 -9
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +10 -7
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/level.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/profile-archive.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/storage.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/util.d.ts.map +1 -1
- package/dist/types/src/packlets/system/system-service.d.ts +1 -1
- package/dist/types/src/packlets/system/system-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/credential-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts +6 -3
- package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +6 -5
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/worker/worker-runtime.d.ts +41 -4
- package/dist/types/src/packlets/worker/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/worker/worker-session.d.ts +2 -4
- package/dist/types/src/packlets/worker/worker-session.d.ts.map +1 -1
- package/dist/types/src/testing/setup.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +70 -55
- package/src/index.ts +1 -0
- package/src/packlets/agents/edge-agent-manager.ts +8 -5
- package/src/packlets/agents/edge-agent-service.ts +15 -3
- package/src/packlets/devices/devices-service.test.ts +0 -1
- package/src/packlets/devices/devices-service.ts +1 -1
- package/src/packlets/devtools/devtools.ts +2 -3
- package/src/packlets/diagnostics/diagnostics.ts +1 -2
- package/src/packlets/diagnostics/index.ts +1 -1
- package/src/packlets/identity/authenticator.ts +2 -2
- package/src/packlets/identity/contacts-service.ts +0 -1
- package/src/packlets/identity/identity-manager.test.ts +5 -5
- package/src/packlets/identity/identity-manager.ts +23 -22
- package/src/packlets/identity/identity-recovery-manager.ts +22 -18
- package/src/packlets/identity/identity-service.test.ts +6 -27
- package/src/packlets/identity/identity-service.ts +13 -81
- package/src/packlets/identity/identity.test.ts +6 -6
- package/src/packlets/identity/identity.ts +11 -34
- package/src/packlets/invitations/device-invitation-protocol.ts +8 -7
- package/src/packlets/invitations/edge-invitation-handler.ts +9 -5
- package/src/packlets/invitations/invitation-guest-extenstion.ts +6 -4
- package/src/packlets/invitations/invitation-host-extension.ts +13 -14
- package/src/packlets/invitations/invitation-protocol.ts +7 -4
- package/src/packlets/invitations/invitation-state.ts +1 -15
- package/src/packlets/invitations/invitations-handler.test.ts +4 -5
- package/src/packlets/invitations/invitations-handler.ts +74 -22
- package/src/packlets/invitations/invitations-manager.ts +40 -15
- package/src/packlets/invitations/invitations-service.ts +9 -9
- package/src/packlets/invitations/space-invitation-protocol.test.ts +17 -16
- package/src/packlets/invitations/space-invitation-protocol.ts +11 -16
- package/src/packlets/locks/index.ts +1 -1
- package/src/packlets/logging/logging-service.ts +20 -16
- package/src/packlets/network/network-service.test.ts +0 -1
- package/src/packlets/network/network-service.ts +10 -8
- package/src/packlets/services/client-rpc-server.ts +19 -16
- package/src/packlets/services/feed-syncer.test.ts +340 -0
- package/src/packlets/services/feed-syncer.ts +337 -0
- package/src/packlets/services/platform.ts +7 -1
- package/src/packlets/services/service-context.test.ts +3 -2
- package/src/packlets/services/service-context.ts +138 -56
- package/src/packlets/services/service-host.test.ts +8 -8
- package/src/packlets/services/service-host.ts +70 -40
- package/src/packlets/services/service-registry.test.ts +0 -1
- package/src/packlets/space-export/archive-format.ts +42 -0
- package/src/packlets/space-export/index.ts +4 -1
- package/src/packlets/space-export/serialized-space-reader.ts +111 -0
- package/src/packlets/space-export/serialized-space-writer.ts +253 -0
- package/src/packlets/space-export/space-archive-reader.ts +64 -3
- package/src/packlets/space-export/space-archive-writer.ts +41 -3
- package/src/packlets/space-export/space-archive.test.ts +461 -0
- package/src/packlets/spaces/data-space-manager.test.ts +79 -13
- package/src/packlets/spaces/data-space-manager.ts +115 -115
- package/src/packlets/spaces/data-space.ts +58 -33
- package/src/packlets/spaces/edge-feed-replicator.test.ts +2 -2
- package/src/packlets/spaces/edge-feed-replicator.ts +12 -10
- package/src/packlets/spaces/epoch-migrations.ts +5 -5
- package/src/packlets/spaces/genesis.ts +6 -1
- package/src/packlets/spaces/notarization-plugin.test.ts +2 -2
- package/src/packlets/spaces/notarization-plugin.ts +10 -9
- package/src/packlets/spaces/spaces-service.test.ts +18 -11
- package/src/packlets/spaces/spaces-service.ts +123 -24
- package/src/packlets/storage/storage.ts +4 -4
- package/src/packlets/testing/invitation-utils.ts +10 -6
- package/src/packlets/testing/test-builder.ts +36 -10
- package/src/packlets/worker/worker-runtime.ts +188 -17
- package/src/packlets/worker/worker-session.ts +12 -18
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-FZDVFED2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JDTIU3EP.mjs.map +0 -7
- package/dist/types/src/packlets/identity/default-space-state-machine.d.ts +0 -19
- package/dist/types/src/packlets/identity/default-space-state-machine.d.ts.map +0 -1
- package/src/packlets/identity/default-space-state-machine.ts +0 -44
package/package.json
CHANGED
|
@@ -1,13 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.abd8ff62ef",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
|
-
"sideEffects":
|
|
13
|
+
"sideEffects": false,
|
|
10
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#locks-platform": {
|
|
17
|
+
"source": {
|
|
18
|
+
"browser": "./src/packlets/locks/browser.ts",
|
|
19
|
+
"default": "./src/packlets/locks/node.ts"
|
|
20
|
+
},
|
|
21
|
+
"types": "./dist/types/src/packlets/locks/node.d.ts",
|
|
22
|
+
"browser": "./dist/lib/browser/packlets/locks/browser.mjs",
|
|
23
|
+
"default": "./dist/lib/node-esm/packlets/locks/node.mjs"
|
|
24
|
+
},
|
|
25
|
+
"#diagnostics-broadcast": {
|
|
26
|
+
"source": {
|
|
27
|
+
"browser": "./src/packlets/diagnostics/browser-diagnostics-broadcast.ts",
|
|
28
|
+
"default": "./src/packlets/diagnostics/diagnostics-broadcast.ts"
|
|
29
|
+
},
|
|
30
|
+
"types": "./dist/types/src/packlets/diagnostics/diagnostics-broadcast.d.ts",
|
|
31
|
+
"browser": "./dist/lib/browser/packlets/diagnostics/browser-diagnostics-broadcast.mjs",
|
|
32
|
+
"default": "./dist/lib/node-esm/packlets/diagnostics/diagnostics-broadcast.mjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
11
35
|
"exports": {
|
|
12
36
|
".": {
|
|
13
37
|
"source": "./src/index.ts",
|
|
@@ -22,73 +46,64 @@
|
|
|
22
46
|
"node": "./dist/lib/node-esm/testing/index.mjs"
|
|
23
47
|
}
|
|
24
48
|
},
|
|
25
|
-
"browser": {
|
|
26
|
-
"jsondown": false,
|
|
27
|
-
"./src/packlets/locks/node.ts": "./src/packlets/locks/browser.ts",
|
|
28
|
-
"./src/packlets/diagnostics/diagnostics-broadcast.ts": "./src/packlets/diagnostics/browser-diagnostics-broadcast.ts",
|
|
29
|
-
"./testing.js": "./dist/lib/browser/packlets/testing/index.mjs"
|
|
30
|
-
},
|
|
31
49
|
"types": "dist/types/src/index.d.ts",
|
|
32
|
-
"typesVersions": {
|
|
33
|
-
"*": {
|
|
34
|
-
"testing": [
|
|
35
|
-
"dist/types/src/testing/index.d.ts"
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
50
|
"files": [
|
|
40
|
-
"testing.d.ts",
|
|
41
|
-
"testing.js",
|
|
42
51
|
"dist",
|
|
43
52
|
"src"
|
|
44
53
|
],
|
|
45
54
|
"dependencies": {
|
|
46
|
-
"@automerge/automerge": "3.
|
|
47
|
-
"@automerge/automerge-repo": "2.
|
|
55
|
+
"@automerge/automerge": "3.2.3",
|
|
56
|
+
"@automerge/automerge-repo": "2.5.1",
|
|
57
|
+
"@effect/experimental": "0.58.0",
|
|
58
|
+
"@effect/sql": "0.49.0",
|
|
59
|
+
"@effect/sql-sqlite-node": "0.50.1",
|
|
48
60
|
"@obsidize/tar-browserify": "^5.2.0",
|
|
49
61
|
"cbor-x": "^1.5.4",
|
|
62
|
+
"effect": "3.20.0",
|
|
50
63
|
"platform": "^1.3.6",
|
|
51
|
-
"@dxos/async": "0.8.4-main.
|
|
52
|
-
"@dxos/client-protocol": "0.8.4-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/debug": "0.8.4-main.
|
|
58
|
-
"@dxos/echo
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/echo-pipeline": "0.8.4-main.
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/edge-client": "0.8.4-main.
|
|
64
|
-
"@dxos/feed
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/invariant": "0.8.4-main.
|
|
67
|
-
"@dxos/keyring": "0.8.4-main.
|
|
68
|
-
"@dxos/keys": "0.8.4-main.
|
|
69
|
-
"@dxos/kv-store": "0.8.4-main.
|
|
70
|
-
"@dxos/lock-file": "0.8.4-main.
|
|
71
|
-
"@dxos/log": "0.8.4-main.
|
|
72
|
-
"@dxos/messaging": "0.8.4-main.
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/rpc": "0.8.4-main.
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/teleport
|
|
80
|
-
"@dxos/teleport-extension-
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/tracing": "0.8.4-main.
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
64
|
+
"@dxos/async": "0.8.4-main.abd8ff62ef",
|
|
65
|
+
"@dxos/client-protocol": "0.8.4-main.abd8ff62ef",
|
|
66
|
+
"@dxos/codec-protobuf": "0.8.4-main.abd8ff62ef",
|
|
67
|
+
"@dxos/credentials": "0.8.4-main.abd8ff62ef",
|
|
68
|
+
"@dxos/context": "0.8.4-main.abd8ff62ef",
|
|
69
|
+
"@dxos/crypto": "0.8.4-main.abd8ff62ef",
|
|
70
|
+
"@dxos/debug": "0.8.4-main.abd8ff62ef",
|
|
71
|
+
"@dxos/echo": "0.8.4-main.abd8ff62ef",
|
|
72
|
+
"@dxos/echo-db": "0.8.4-main.abd8ff62ef",
|
|
73
|
+
"@dxos/echo-pipeline": "0.8.4-main.abd8ff62ef",
|
|
74
|
+
"@dxos/config": "0.8.4-main.abd8ff62ef",
|
|
75
|
+
"@dxos/effect": "0.8.4-main.abd8ff62ef",
|
|
76
|
+
"@dxos/edge-client": "0.8.4-main.abd8ff62ef",
|
|
77
|
+
"@dxos/feed": "0.8.4-main.abd8ff62ef",
|
|
78
|
+
"@dxos/feed-store": "0.8.4-main.abd8ff62ef",
|
|
79
|
+
"@dxos/invariant": "0.8.4-main.abd8ff62ef",
|
|
80
|
+
"@dxos/keyring": "0.8.4-main.abd8ff62ef",
|
|
81
|
+
"@dxos/keys": "0.8.4-main.abd8ff62ef",
|
|
82
|
+
"@dxos/kv-store": "0.8.4-main.abd8ff62ef",
|
|
83
|
+
"@dxos/lock-file": "0.8.4-main.abd8ff62ef",
|
|
84
|
+
"@dxos/log": "0.8.4-main.abd8ff62ef",
|
|
85
|
+
"@dxos/messaging": "0.8.4-main.abd8ff62ef",
|
|
86
|
+
"@dxos/node-std": "0.8.4-main.abd8ff62ef",
|
|
87
|
+
"@dxos/protocols": "0.8.4-main.abd8ff62ef",
|
|
88
|
+
"@dxos/random-access-storage": "0.8.4-main.abd8ff62ef",
|
|
89
|
+
"@dxos/echo-protocol": "0.8.4-main.abd8ff62ef",
|
|
90
|
+
"@dxos/rpc": "0.8.4-main.abd8ff62ef",
|
|
91
|
+
"@dxos/sql-sqlite": "0.8.4-main.abd8ff62ef",
|
|
92
|
+
"@dxos/teleport": "0.8.4-main.abd8ff62ef",
|
|
93
|
+
"@dxos/teleport-extension-gossip": "0.8.4-main.abd8ff62ef",
|
|
94
|
+
"@dxos/teleport-extension-object-sync": "0.8.4-main.abd8ff62ef",
|
|
95
|
+
"@dxos/tracing": "0.8.4-main.abd8ff62ef",
|
|
96
|
+
"@dxos/timeframe": "0.8.4-main.abd8ff62ef",
|
|
97
|
+
"@dxos/network-manager": "0.8.4-main.abd8ff62ef",
|
|
98
|
+
"@dxos/util": "0.8.4-main.abd8ff62ef",
|
|
99
|
+
"@dxos/websocket-rpc": "0.8.4-main.abd8ff62ef"
|
|
85
100
|
},
|
|
86
101
|
"devDependencies": {
|
|
87
102
|
"@types/platform": "^1.3.4",
|
|
88
103
|
"@types/readable-stream": "^2.3.9",
|
|
89
104
|
"get-port-please": "^3.1.1",
|
|
90
|
-
"@dxos/signal": "0.8.4-main.
|
|
91
|
-
"@dxos/test-utils": "0.8.4-main.
|
|
105
|
+
"@dxos/signal": "0.8.4-main.abd8ff62ef",
|
|
106
|
+
"@dxos/test-utils": "0.8.4-main.abd8ff62ef"
|
|
92
107
|
},
|
|
93
108
|
"publishConfig": {
|
|
94
109
|
"access": "public"
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './packlets/identity';
|
|
|
8
8
|
export * from './packlets/invitations';
|
|
9
9
|
export * from './packlets/locks';
|
|
10
10
|
export * from './packlets/services';
|
|
11
|
+
export * from './packlets/space-export';
|
|
11
12
|
export * from './packlets/spaces';
|
|
12
13
|
export * from './packlets/storage';
|
|
13
14
|
export * from './packlets/worker';
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { DeferredTask, Event, scheduleTask, synchronized } from '@dxos/async';
|
|
6
|
+
import { Context } from '@dxos/context';
|
|
6
7
|
import { Resource } from '@dxos/context';
|
|
7
8
|
import { type EdgeHttpClient } from '@dxos/edge-client';
|
|
8
9
|
import { invariant } from '@dxos/invariant';
|
|
@@ -50,12 +51,12 @@ export class EdgeAgentManager extends Resource {
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
@synchronized
|
|
53
|
-
public async createAgent(): Promise<void> {
|
|
54
|
+
public async createAgent(ctx: Context): Promise<void> {
|
|
54
55
|
invariant(this.isOpen);
|
|
55
56
|
invariant(this._edgeHttpClient);
|
|
56
57
|
invariant(this._edgeFeatures?.agents);
|
|
57
58
|
|
|
58
|
-
const response = await this._edgeHttpClient.createAgent({
|
|
59
|
+
const response = await this._edgeHttpClient.createAgent(ctx, {
|
|
59
60
|
identityKey: this._identity.identityKey.toHex(),
|
|
60
61
|
haloSpaceId: this._identity.haloSpaceId,
|
|
61
62
|
haloSpaceKey: this._identity.haloSpaceKey.toHex(),
|
|
@@ -92,7 +93,7 @@ export class EdgeAgentManager extends Resource {
|
|
|
92
93
|
|
|
93
94
|
this._lastKnownDeviceCount = this._identity.authorizedDeviceKeys.size;
|
|
94
95
|
this._fetchAgentStatusTask = new DeferredTask(this._ctx, async () => {
|
|
95
|
-
await this._fetchAgentStatus();
|
|
96
|
+
await this._fetchAgentStatus(this._ctx);
|
|
96
97
|
});
|
|
97
98
|
this._fetchAgentStatusTask.schedule();
|
|
98
99
|
|
|
@@ -117,11 +118,13 @@ export class EdgeAgentManager extends Resource {
|
|
|
117
118
|
this._lastKnownDeviceCount = 0;
|
|
118
119
|
}
|
|
119
120
|
|
|
120
|
-
protected async _fetchAgentStatus(): Promise<void> {
|
|
121
|
+
protected async _fetchAgentStatus(ctx: Context): Promise<void> {
|
|
121
122
|
invariant(this._edgeHttpClient);
|
|
122
123
|
try {
|
|
123
124
|
log('fetching agent status');
|
|
124
|
-
const { agent } = await this._edgeHttpClient.getAgentStatus({
|
|
125
|
+
const { agent } = await this._edgeHttpClient.getAgentStatus(ctx, {
|
|
126
|
+
ownerIdentityKey: this._identity.identityKey,
|
|
127
|
+
});
|
|
125
128
|
const wasAgentCreatedDuringQuery = this._agentStatus === EdgeAgentStatus.ACTIVE;
|
|
126
129
|
if (!wasAgentCreatedDuringQuery) {
|
|
127
130
|
const deviceKey = agent.deviceKey ? PublicKey.fromHex(agent.deviceKey) : undefined;
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type RequestOptions } from '@dxos/codec-protobuf';
|
|
5
6
|
import { Stream } from '@dxos/codec-protobuf/stream';
|
|
7
|
+
import { Context } from '@dxos/context';
|
|
6
8
|
import { type EdgeConnection } from '@dxos/edge-client';
|
|
7
9
|
import { EdgeAgentStatus } from '@dxos/protocols';
|
|
8
10
|
import {
|
|
@@ -25,7 +27,17 @@ export class EdgeAgentServiceImpl implements EdgeAgentService {
|
|
|
25
27
|
queryEdgeStatus(): Stream<QueryEdgeStatusResponse> {
|
|
26
28
|
return new Stream(({ ctx, next }) => {
|
|
27
29
|
const update = () => {
|
|
28
|
-
next({
|
|
30
|
+
next({
|
|
31
|
+
status: this._edgeConnection?.status ?? {
|
|
32
|
+
state: EdgeStatus.ConnectionState.NOT_CONNECTED,
|
|
33
|
+
rtt: 0,
|
|
34
|
+
uptime: 0,
|
|
35
|
+
rateBytesUp: 0,
|
|
36
|
+
rateBytesDown: 0,
|
|
37
|
+
messagesSent: 0,
|
|
38
|
+
messagesReceived: 0,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
29
41
|
};
|
|
30
42
|
|
|
31
43
|
this._edgeConnection?.statusChanged.on(ctx, update);
|
|
@@ -33,8 +45,8 @@ export class EdgeAgentServiceImpl implements EdgeAgentService {
|
|
|
33
45
|
});
|
|
34
46
|
}
|
|
35
47
|
|
|
36
|
-
async createAgent(): Promise<void> {
|
|
37
|
-
return (await this._agentManagerProvider()).createAgent();
|
|
48
|
+
async createAgent(_request: void, options?: RequestOptions): Promise<void> {
|
|
49
|
+
return (await this._agentManagerProvider()).createAgent(options?.ctx ?? Context.default());
|
|
38
50
|
}
|
|
39
51
|
|
|
40
52
|
queryAgentStatus(): Stream<QueryAgentStatusResponse> {
|
|
@@ -11,7 +11,6 @@ import { type Device, type DevicesService } from '@dxos/protocols/proto/dxos/cli
|
|
|
11
11
|
|
|
12
12
|
import { type ServiceContext } from '../services';
|
|
13
13
|
import { createServiceContext } from '../testing';
|
|
14
|
-
|
|
15
14
|
import { DevicesServiceImpl } from './devices-service';
|
|
16
15
|
|
|
17
16
|
describe('DevicesService', () => {
|
|
@@ -44,7 +44,7 @@ export class DevicesServiceImpl implements DevicesService {
|
|
|
44
44
|
presence = Device.PresenceState.ONLINE;
|
|
45
45
|
} else if (profile.os?.toUpperCase() === 'EDGE') {
|
|
46
46
|
presence =
|
|
47
|
-
this._edgeConnection?.status === EdgeStatus.CONNECTED
|
|
47
|
+
this._edgeConnection?.status.state === EdgeStatus.ConnectionState.CONNECTED
|
|
48
48
|
? Device.PresenceState.ONLINE
|
|
49
49
|
: Device.PresenceState.OFFLINE;
|
|
50
50
|
} else {
|
|
@@ -42,7 +42,6 @@ import {
|
|
|
42
42
|
} from '@dxos/protocols/proto/dxos/devtools/host';
|
|
43
43
|
|
|
44
44
|
import { type ServiceContext } from '../services';
|
|
45
|
-
|
|
46
45
|
import { subscribeToFeedBlocks, subscribeToFeeds } from './feeds';
|
|
47
46
|
import { subscribeToKeyringKeys } from './keys';
|
|
48
47
|
import { subscribeToMetadata } from './metadata';
|
|
@@ -53,7 +52,7 @@ export class DevtoolsHostEvents {
|
|
|
53
52
|
readonly ready = new AsyncEvent();
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
export type
|
|
55
|
+
export type DevtoolsServiceProps = {
|
|
57
56
|
events: DevtoolsHostEvents;
|
|
58
57
|
config: Config;
|
|
59
58
|
context: ServiceContext;
|
|
@@ -63,7 +62,7 @@ export type DevtoolsServiceParams = {
|
|
|
63
62
|
* @deprecated
|
|
64
63
|
*/
|
|
65
64
|
export class DevtoolsServiceImpl implements DevtoolsHost {
|
|
66
|
-
constructor(private readonly params:
|
|
65
|
+
constructor(private readonly params: DevtoolsServiceProps) {}
|
|
67
66
|
|
|
68
67
|
events(_request: void): Stream<Event> {
|
|
69
68
|
return new Stream<Event>(({ next }) => {
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import { type SubscribeToFeedsResponse } from '@dxos/protocols/proto/dxos/devtools/host';
|
|
24
24
|
import { type SwarmInfo } from '@dxos/protocols/proto/dxos/devtools/swarm';
|
|
25
25
|
import { type Epoch } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
26
|
-
import { type Resource
|
|
26
|
+
import { type Resource } from '@dxos/protocols/proto/dxos/tracing';
|
|
27
27
|
import { TRACE_PROCESSOR } from '@dxos/tracing';
|
|
28
28
|
|
|
29
29
|
import { DXOS_VERSION } from '../../version';
|
|
@@ -62,7 +62,6 @@ export type Diagnostics = {
|
|
|
62
62
|
|
|
63
63
|
export type TraceDiagnostic = {
|
|
64
64
|
resources: Record<string, Resource>;
|
|
65
|
-
spans: Span[];
|
|
66
65
|
logs: LogEntry[];
|
|
67
66
|
};
|
|
68
67
|
|
|
@@ -27,7 +27,7 @@ export const createAuthProvider =
|
|
|
27
27
|
return Credential.encode(credential);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
export type
|
|
30
|
+
export type TrustedKeySetAuthVerifierProps = {
|
|
31
31
|
// TODO(dmaretskyi): Change to `isTrusted: (key) => bool`.
|
|
32
32
|
trustedKeysProvider: () => ComplexSet<PublicKey>;
|
|
33
33
|
update: Event<void>;
|
|
@@ -44,7 +44,7 @@ export type TrustedKeySetAuthVerifierParams = {
|
|
|
44
44
|
export class TrustedKeySetAuthVerifier {
|
|
45
45
|
private _ctx = new Context();
|
|
46
46
|
|
|
47
|
-
constructor(private readonly _params:
|
|
47
|
+
constructor(private readonly _params: TrustedKeySetAuthVerifierProps) {}
|
|
48
48
|
|
|
49
49
|
async close(): Promise<void> {
|
|
50
50
|
await this._ctx.dispose();
|
|
@@ -11,7 +11,6 @@ import { type Contact, type ContactBook, type ContactsService } from '@dxos/prot
|
|
|
11
11
|
import { ComplexMap, ComplexSet } from '@dxos/util';
|
|
12
12
|
|
|
13
13
|
import { type DataSpaceManager } from '../spaces';
|
|
14
|
-
|
|
15
14
|
import { type IdentityManager } from './identity-manager';
|
|
16
15
|
|
|
17
16
|
export class ContactsServiceImpl implements ContactsService {
|
|
@@ -64,7 +64,7 @@ describe('identity/identity-manager', () => {
|
|
|
64
64
|
test('creates identity', async () => {
|
|
65
65
|
const { identityManager } = await setupPeer();
|
|
66
66
|
await identityManager.open(new Context());
|
|
67
|
-
onTestFinished(() => identityManager.close());
|
|
67
|
+
onTestFinished(() => identityManager.close(Context.default()));
|
|
68
68
|
|
|
69
69
|
const identity = await identityManager.createIdentity();
|
|
70
70
|
expect(identity).to.exist;
|
|
@@ -77,7 +77,7 @@ describe('identity/identity-manager', () => {
|
|
|
77
77
|
await peer1.metadataStore.load();
|
|
78
78
|
await peer1.identityManager.open(new Context());
|
|
79
79
|
const identity1 = await peer1.identityManager.createIdentity();
|
|
80
|
-
await peer1.identityManager.close();
|
|
80
|
+
await peer1.identityManager.close(Context.default());
|
|
81
81
|
await peer1.feedStore.close();
|
|
82
82
|
await peer1.metadataStore.close();
|
|
83
83
|
|
|
@@ -95,7 +95,7 @@ describe('identity/identity-manager', () => {
|
|
|
95
95
|
test('update profile', async () => {
|
|
96
96
|
const { identityManager } = await setupPeer();
|
|
97
97
|
await identityManager.open(new Context());
|
|
98
|
-
onTestFinished(() => identityManager.close());
|
|
98
|
+
onTestFinished(() => identityManager.close(Context.default()));
|
|
99
99
|
|
|
100
100
|
const identity = await identityManager.createIdentity();
|
|
101
101
|
expect(identity.profileDocument?.displayName).to.be.undefined;
|
|
@@ -112,7 +112,7 @@ describe('identity/identity-manager', () => {
|
|
|
112
112
|
peerKey: identity1.deviceKey.toHex(),
|
|
113
113
|
identityKey: identity1.identityKey.toHex(),
|
|
114
114
|
});
|
|
115
|
-
await identity1.joinNetwork();
|
|
115
|
+
await identity1.joinNetwork(Context.default());
|
|
116
116
|
|
|
117
117
|
const peer2 = await setupPeer({ signalContext });
|
|
118
118
|
|
|
@@ -148,7 +148,7 @@ describe('identity/identity-manager', () => {
|
|
|
148
148
|
peerKey: identity2.deviceKey.toHex(),
|
|
149
149
|
identityKey: identity2.identityKey.toHex(),
|
|
150
150
|
});
|
|
151
|
-
await identity2.joinNetwork();
|
|
151
|
+
await identity2.joinNetwork(Context.default());
|
|
152
152
|
|
|
153
153
|
// Identity2 is not yet ready at this point. Peer1 needs to admit peer2 device key and feed keys.
|
|
154
154
|
await peer2.identityManager.acceptIdentity(identity2, identityRecord);
|
|
@@ -13,7 +13,6 @@ import { invariant } from '@dxos/invariant';
|
|
|
13
13
|
import { type Keyring } from '@dxos/keyring';
|
|
14
14
|
import { PublicKey } from '@dxos/keys';
|
|
15
15
|
import { log } from '@dxos/log';
|
|
16
|
-
import { trace } from '@dxos/protocols';
|
|
17
16
|
import { Device, DeviceKind } from '@dxos/protocols/proto/dxos/client/services';
|
|
18
17
|
import { type Runtime } from '@dxos/protocols/proto/dxos/config';
|
|
19
18
|
import { type FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
@@ -28,7 +27,7 @@ import {
|
|
|
28
27
|
import { Gossip, Presence } from '@dxos/teleport-extension-gossip';
|
|
29
28
|
import { Timeframe } from '@dxos/timeframe';
|
|
30
29
|
import { trace as Trace } from '@dxos/tracing';
|
|
31
|
-
import { deferFunction, isNode } from '@dxos/util';
|
|
30
|
+
import { deferFunction, isNode, isTauri } from '@dxos/util';
|
|
32
31
|
|
|
33
32
|
import { createAuthProvider } from './authenticator';
|
|
34
33
|
import { Identity } from './identity';
|
|
@@ -36,14 +35,14 @@ import { Identity } from './identity';
|
|
|
36
35
|
const DEVICE_PRESENCE_ANNOUNCE_INTERVAL = 10_000;
|
|
37
36
|
const DEVICE_PRESENCE_OFFLINE_TIMEOUT = 20_000;
|
|
38
37
|
|
|
39
|
-
interface
|
|
38
|
+
interface ConstructSpaceProps {
|
|
40
39
|
spaceRecord: SpaceMetadata;
|
|
41
40
|
swarmIdentity: SwarmIdentity;
|
|
42
41
|
identityKey: PublicKey;
|
|
43
42
|
gossip: Gossip;
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
export type
|
|
45
|
+
export type JoinIdentityProps = {
|
|
47
46
|
identityKey: PublicKey;
|
|
48
47
|
deviceKey: PublicKey;
|
|
49
48
|
haloSpaceKey: PublicKey;
|
|
@@ -67,7 +66,7 @@ export type CreateIdentityOptions = {
|
|
|
67
66
|
deviceProfile?: DeviceProfileDocument;
|
|
68
67
|
};
|
|
69
68
|
|
|
70
|
-
export type
|
|
69
|
+
export type IdentityManagerProps = {
|
|
71
70
|
metadataStore: MetadataStore;
|
|
72
71
|
keyring: Keyring;
|
|
73
72
|
feedStore: FeedStore<FeedMessage>;
|
|
@@ -95,7 +94,7 @@ export class IdentityManager {
|
|
|
95
94
|
private _identity?: Identity;
|
|
96
95
|
|
|
97
96
|
// TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
|
|
98
|
-
constructor(params:
|
|
97
|
+
constructor(params: IdentityManagerProps) {
|
|
99
98
|
this._metadataStore = params.metadataStore;
|
|
100
99
|
this._keyring = params.keyring;
|
|
101
100
|
this._feedStore = params.feedStore;
|
|
@@ -112,8 +111,7 @@ export class IdentityManager {
|
|
|
112
111
|
|
|
113
112
|
@Trace.span({ showInBrowserTimeline: true })
|
|
114
113
|
async open(ctx: Context): Promise<void> {
|
|
115
|
-
|
|
116
|
-
log.trace('dxos.halo.identity-manager.open', trace.begin({ id: traceId }));
|
|
114
|
+
log('opening identity manager');
|
|
117
115
|
|
|
118
116
|
const identityRecord = this._metadataStore.getIdentityRecord();
|
|
119
117
|
log('identity record', { identityRecord });
|
|
@@ -128,15 +126,14 @@ export class IdentityManager {
|
|
|
128
126
|
|
|
129
127
|
this.stateUpdate.emit();
|
|
130
128
|
}
|
|
131
|
-
log
|
|
129
|
+
log('opened identity manager');
|
|
132
130
|
}
|
|
133
131
|
|
|
134
|
-
async close(): Promise<void> {
|
|
135
|
-
await this._identity?.close(
|
|
132
|
+
async close(ctx: Context): Promise<void> {
|
|
133
|
+
await this._identity?.close(ctx);
|
|
136
134
|
}
|
|
137
135
|
|
|
138
|
-
async createIdentity({ profile, deviceProfile }: CreateIdentityOptions = {}): Promise<Identity> {
|
|
139
|
-
// TODO(nf): populate using context from ServiceContext?
|
|
136
|
+
async createIdentity({ profile, deviceProfile }: CreateIdentityOptions = {}, ctx?: Context): Promise<Identity> {
|
|
140
137
|
invariant(!this._identity, 'Identity already exists.');
|
|
141
138
|
log('creating identity...');
|
|
142
139
|
|
|
@@ -153,7 +150,7 @@ export class IdentityManager {
|
|
|
153
150
|
};
|
|
154
151
|
|
|
155
152
|
const identity = await this._constructIdentity(identityRecord);
|
|
156
|
-
await identity.open(
|
|
153
|
+
await identity.open(ctx ?? Context.default());
|
|
157
154
|
|
|
158
155
|
{
|
|
159
156
|
const generator = new CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
|
|
@@ -211,28 +208,32 @@ export class IdentityManager {
|
|
|
211
208
|
return identity;
|
|
212
209
|
}
|
|
213
210
|
|
|
214
|
-
// TODO(nf): receive platform info rather than generating it here.
|
|
215
211
|
createDefaultDeviceProfile(): DeviceProfileDocument {
|
|
212
|
+
// See TODOs in credentials.proto.
|
|
216
213
|
let type: DeviceType;
|
|
217
|
-
// TODO(nf): call Platform service instead?
|
|
218
214
|
if (isNode()) {
|
|
219
215
|
type = DeviceType.AGENT;
|
|
220
216
|
} else {
|
|
221
217
|
if (platform.name?.startsWith('iOS') || platform.name?.startsWith('Android')) {
|
|
222
218
|
type = DeviceType.MOBILE;
|
|
223
|
-
} else if ((
|
|
219
|
+
} else if (isTauri() || !platform.name) {
|
|
220
|
+
// Tauri's __TAURI__ global isn't available in web workers. Fallback: WKWebView
|
|
221
|
+
// (Tauri on macOS) reports null for platform.name; all standard browsers don't.
|
|
224
222
|
type = DeviceType.NATIVE;
|
|
225
223
|
} else {
|
|
226
224
|
type = DeviceType.BROWSER;
|
|
227
225
|
}
|
|
228
226
|
}
|
|
229
227
|
|
|
228
|
+
const os = platform.os?.family === 'OS X' ? 'macOS' : platform.os?.family;
|
|
229
|
+
const name = type === DeviceType.NATIVE || type === DeviceType.MOBILE ? 'App' : platform.name;
|
|
230
|
+
|
|
230
231
|
return {
|
|
231
232
|
type,
|
|
232
|
-
platform:
|
|
233
|
+
platform: name,
|
|
233
234
|
platformVersion: platform.version,
|
|
234
235
|
architecture: typeof platform.os?.architecture === 'number' ? String(platform.os.architecture) : undefined,
|
|
235
|
-
os
|
|
236
|
+
os,
|
|
236
237
|
osVersion: platform.os?.version,
|
|
237
238
|
};
|
|
238
239
|
}
|
|
@@ -240,7 +241,7 @@ export class IdentityManager {
|
|
|
240
241
|
/**
|
|
241
242
|
* Prepare an identity object as the first step of acceptIdentity flow.
|
|
242
243
|
*/
|
|
243
|
-
async prepareIdentity(params:
|
|
244
|
+
async prepareIdentity(params: JoinIdentityProps, ctx?: Context) {
|
|
244
245
|
log('accepting identity', { params });
|
|
245
246
|
invariant(!this._identity, 'Identity already exists.');
|
|
246
247
|
|
|
@@ -256,7 +257,7 @@ export class IdentityManager {
|
|
|
256
257
|
},
|
|
257
258
|
};
|
|
258
259
|
const identity = await this._constructIdentity(identityRecord);
|
|
259
|
-
await identity.open(
|
|
260
|
+
await identity.open(ctx ?? Context.default());
|
|
260
261
|
return { identity, identityRecord };
|
|
261
262
|
}
|
|
262
263
|
|
|
@@ -395,7 +396,7 @@ export class IdentityManager {
|
|
|
395
396
|
return identity;
|
|
396
397
|
}
|
|
397
398
|
|
|
398
|
-
private async _constructSpace({ spaceRecord, swarmIdentity, identityKey, gossip }:
|
|
399
|
+
private async _constructSpace({ spaceRecord, swarmIdentity, identityKey, gossip }: ConstructSpaceProps) {
|
|
399
400
|
return this._spaceManager.constructSpace({
|
|
400
401
|
metadata: {
|
|
401
402
|
key: spaceRecord.key,
|