@dxos/client-services 0.8.4-main.7ace549 → 0.8.4-main.8360d9e660
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-NXGWBEOK.mjs → chunk-FRMIC6UB.mjs} +1529 -1308
- package/dist/lib/browser/chunk-FRMIC6UB.mjs.map +7 -0
- package/dist/lib/browser/chunk-NQSC7HOE.mjs +22 -0
- package/dist/lib/browser/chunk-NQSC7HOE.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/index.mjs +441 -66
- 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 +93 -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 +126 -0
- package/dist/lib/browser/packlets/locks/browser.mjs.map +7 -0
- package/dist/lib/browser/packlets/locks/node.mjs +66 -0
- package/dist/lib/browser/packlets/locks/node.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +24 -12
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- 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-AO4R6IID.mjs → chunk-6ONWVRY5.mjs} +972 -620
- package/dist/lib/node-esm/chunk-6ONWVRY5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PKEGMOQ4.mjs +22 -0
- package/dist/lib/node-esm/chunk-PKEGMOQ4.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +441 -66
- 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 +93 -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 +126 -0
- package/dist/lib/node-esm/packlets/locks/browser.mjs.map +7 -0
- package/dist/lib/node-esm/packlets/locks/node.mjs +66 -0
- package/dist/lib/node-esm/packlets/locks/node.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +24 -12
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- 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/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/default-space-state-machine.d.ts +2 -2
- package/dist/types/src/packlets/identity/default-space-state-machine.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +4 -4
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-recovery-manager.d.ts +2 -2
- package/dist/types/src/packlets/identity/identity-recovery-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +2 -2
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +2 -2
- package/dist/types/src/packlets/invitations/device-invitation-protocol.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/locks/index.d.ts +1 -1
- package/dist/types/src/packlets/locks/index.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/services/client-rpc-server.d.ts +2 -2
- 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 +12 -7
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +19 -5
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/space-export/space-archive-writer.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +10 -5
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +2 -2
- 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/notarization-plugin.d.ts +6 -6
- package/dist/types/src/packlets/spaces/notarization-plugin.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 +31 -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 -2
- package/dist/types/src/packlets/worker/worker-session.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 -48
- package/src/packlets/devtools/devtools.ts +2 -2
- package/src/packlets/diagnostics/index.ts +1 -1
- package/src/packlets/identity/authenticator.ts +2 -2
- package/src/packlets/identity/default-space-state-machine.ts +2 -2
- package/src/packlets/identity/identity-manager.ts +6 -6
- package/src/packlets/identity/identity-recovery-manager.ts +2 -2
- package/src/packlets/identity/identity.ts +2 -2
- package/src/packlets/invitations/device-invitation-protocol.ts +2 -2
- package/src/packlets/invitations/invitations-handler.ts +6 -6
- package/src/packlets/locks/index.ts +1 -1
- package/src/packlets/logging/logging-service.ts +4 -0
- package/src/packlets/services/client-rpc-server.ts +4 -4
- package/src/packlets/services/feed-syncer.test.ts +340 -0
- package/src/packlets/services/feed-syncer.ts +330 -0
- package/src/packlets/services/platform.ts +7 -1
- package/src/packlets/services/service-context.ts +108 -24
- package/src/packlets/services/service-host.ts +58 -16
- package/src/packlets/space-export/space-archive-writer.ts +3 -2
- package/src/packlets/spaces/data-space-manager.ts +35 -16
- package/src/packlets/spaces/data-space.ts +9 -5
- package/src/packlets/spaces/edge-feed-replicator.ts +2 -2
- package/src/packlets/spaces/epoch-migrations.ts +2 -2
- package/src/packlets/spaces/notarization-plugin.test.ts +2 -2
- package/src/packlets/spaces/notarization-plugin.ts +6 -6
- package/src/packlets/testing/invitation-utils.ts +7 -4
- package/src/packlets/testing/test-builder.ts +36 -10
- package/src/packlets/worker/worker-runtime.ts +149 -11
- package/src/packlets/worker/worker-session.ts +8 -8
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-NXGWBEOK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AO4R6IID.mjs.map +0 -7
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.8360d9e660",
|
|
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,12 +46,6 @@
|
|
|
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
50
|
"typesVersions": {
|
|
33
51
|
"*": {
|
|
@@ -37,58 +55,62 @@
|
|
|
37
55
|
}
|
|
38
56
|
},
|
|
39
57
|
"files": [
|
|
40
|
-
"testing.d.ts",
|
|
41
|
-
"testing.js",
|
|
42
58
|
"dist",
|
|
43
59
|
"src"
|
|
44
60
|
],
|
|
45
61
|
"dependencies": {
|
|
46
|
-
"@automerge/automerge": "3.
|
|
47
|
-
"@automerge/automerge-repo": "2.
|
|
62
|
+
"@automerge/automerge": "3.2.3",
|
|
63
|
+
"@automerge/automerge-repo": "2.5.1",
|
|
64
|
+
"@effect/experimental": "0.58.0",
|
|
65
|
+
"@effect/sql": "0.49.0",
|
|
66
|
+
"@effect/sql-sqlite-node": "0.50.1",
|
|
48
67
|
"@obsidize/tar-browserify": "^5.2.0",
|
|
49
68
|
"cbor-x": "^1.5.4",
|
|
69
|
+
"effect": "3.19.16",
|
|
50
70
|
"platform": "^1.3.6",
|
|
51
|
-
"@dxos/async": "0.8.4-main.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/config": "0.8.4-main.
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/credentials": "0.8.4-main.
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/debug": "0.8.4-main.
|
|
59
|
-
"@dxos/echo": "0.8.4-main.
|
|
60
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
61
|
-
"@dxos/echo-
|
|
62
|
-
"@dxos/echo-
|
|
63
|
-
"@dxos/edge-client": "0.8.4-main.
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/keyring": "0.8.4-main.
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/node-std": "0.8.4-main.
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/teleport
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
71
|
+
"@dxos/async": "0.8.4-main.8360d9e660",
|
|
72
|
+
"@dxos/codec-protobuf": "0.8.4-main.8360d9e660",
|
|
73
|
+
"@dxos/client-protocol": "0.8.4-main.8360d9e660",
|
|
74
|
+
"@dxos/config": "0.8.4-main.8360d9e660",
|
|
75
|
+
"@dxos/crypto": "0.8.4-main.8360d9e660",
|
|
76
|
+
"@dxos/credentials": "0.8.4-main.8360d9e660",
|
|
77
|
+
"@dxos/context": "0.8.4-main.8360d9e660",
|
|
78
|
+
"@dxos/debug": "0.8.4-main.8360d9e660",
|
|
79
|
+
"@dxos/echo": "0.8.4-main.8360d9e660",
|
|
80
|
+
"@dxos/echo-db": "0.8.4-main.8360d9e660",
|
|
81
|
+
"@dxos/echo-pipeline": "0.8.4-main.8360d9e660",
|
|
82
|
+
"@dxos/echo-protocol": "0.8.4-main.8360d9e660",
|
|
83
|
+
"@dxos/edge-client": "0.8.4-main.8360d9e660",
|
|
84
|
+
"@dxos/effect": "0.8.4-main.8360d9e660",
|
|
85
|
+
"@dxos/feed": "0.8.4-main.8360d9e660",
|
|
86
|
+
"@dxos/feed-store": "0.8.4-main.8360d9e660",
|
|
87
|
+
"@dxos/keyring": "0.8.4-main.8360d9e660",
|
|
88
|
+
"@dxos/invariant": "0.8.4-main.8360d9e660",
|
|
89
|
+
"@dxos/lock-file": "0.8.4-main.8360d9e660",
|
|
90
|
+
"@dxos/kv-store": "0.8.4-main.8360d9e660",
|
|
91
|
+
"@dxos/messaging": "0.8.4-main.8360d9e660",
|
|
92
|
+
"@dxos/log": "0.8.4-main.8360d9e660",
|
|
93
|
+
"@dxos/node-std": "0.8.4-main.8360d9e660",
|
|
94
|
+
"@dxos/network-manager": "0.8.4-main.8360d9e660",
|
|
95
|
+
"@dxos/protocols": "0.8.4-main.8360d9e660",
|
|
96
|
+
"@dxos/random-access-storage": "0.8.4-main.8360d9e660",
|
|
97
|
+
"@dxos/keys": "0.8.4-main.8360d9e660",
|
|
98
|
+
"@dxos/sql-sqlite": "0.8.4-main.8360d9e660",
|
|
99
|
+
"@dxos/rpc": "0.8.4-main.8360d9e660",
|
|
100
|
+
"@dxos/teleport": "0.8.4-main.8360d9e660",
|
|
101
|
+
"@dxos/timeframe": "0.8.4-main.8360d9e660",
|
|
102
|
+
"@dxos/teleport-extension-gossip": "0.8.4-main.8360d9e660",
|
|
103
|
+
"@dxos/teleport-extension-object-sync": "0.8.4-main.8360d9e660",
|
|
104
|
+
"@dxos/tracing": "0.8.4-main.8360d9e660",
|
|
105
|
+
"@dxos/util": "0.8.4-main.8360d9e660",
|
|
106
|
+
"@dxos/websocket-rpc": "0.8.4-main.8360d9e660"
|
|
85
107
|
},
|
|
86
108
|
"devDependencies": {
|
|
87
109
|
"@types/platform": "^1.3.4",
|
|
88
110
|
"@types/readable-stream": "^2.3.9",
|
|
89
111
|
"get-port-please": "^3.1.1",
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/
|
|
112
|
+
"@dxos/test-utils": "0.8.4-main.8360d9e660",
|
|
113
|
+
"@dxos/signal": "0.8.4-main.8360d9e660"
|
|
92
114
|
},
|
|
93
115
|
"publishConfig": {
|
|
94
116
|
"access": "public"
|
|
@@ -53,7 +53,7 @@ export class DevtoolsHostEvents {
|
|
|
53
53
|
readonly ready = new AsyncEvent();
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
export type
|
|
56
|
+
export type DevtoolsServiceProps = {
|
|
57
57
|
events: DevtoolsHostEvents;
|
|
58
58
|
config: Config;
|
|
59
59
|
context: ServiceContext;
|
|
@@ -63,7 +63,7 @@ export type DevtoolsServiceParams = {
|
|
|
63
63
|
* @deprecated
|
|
64
64
|
*/
|
|
65
65
|
export class DevtoolsServiceImpl implements DevtoolsHost {
|
|
66
|
-
constructor(private readonly params:
|
|
66
|
+
constructor(private readonly params: DevtoolsServiceProps) {}
|
|
67
67
|
|
|
68
68
|
events(_request: void): Stream<Event> {
|
|
69
69
|
return new Stream<Event>(({ next }) => {
|
|
@@ -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();
|
|
@@ -7,7 +7,7 @@ import { type PublicKey, SpaceId } from '@dxos/keys';
|
|
|
7
7
|
import { log } from '@dxos/log';
|
|
8
8
|
import { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
9
9
|
|
|
10
|
-
type
|
|
10
|
+
type DefaultSpaceStateMachineProps = {
|
|
11
11
|
identityKey: PublicKey;
|
|
12
12
|
onUpdate?: () => void;
|
|
13
13
|
};
|
|
@@ -18,7 +18,7 @@ type DefaultSpaceStateMachineParams = {
|
|
|
18
18
|
export class DefaultSpaceStateMachine implements CredentialProcessor {
|
|
19
19
|
private _spaceId: SpaceId | undefined;
|
|
20
20
|
|
|
21
|
-
constructor(private readonly _params:
|
|
21
|
+
constructor(private readonly _params: DefaultSpaceStateMachineProps) {}
|
|
22
22
|
|
|
23
23
|
public get spaceId(): SpaceId | undefined {
|
|
24
24
|
return this._spaceId;
|
|
@@ -36,14 +36,14 @@ import { Identity } from './identity';
|
|
|
36
36
|
const DEVICE_PRESENCE_ANNOUNCE_INTERVAL = 10_000;
|
|
37
37
|
const DEVICE_PRESENCE_OFFLINE_TIMEOUT = 20_000;
|
|
38
38
|
|
|
39
|
-
interface
|
|
39
|
+
interface ConstructSpaceProps {
|
|
40
40
|
spaceRecord: SpaceMetadata;
|
|
41
41
|
swarmIdentity: SwarmIdentity;
|
|
42
42
|
identityKey: PublicKey;
|
|
43
43
|
gossip: Gossip;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export type
|
|
46
|
+
export type JoinIdentityProps = {
|
|
47
47
|
identityKey: PublicKey;
|
|
48
48
|
deviceKey: PublicKey;
|
|
49
49
|
haloSpaceKey: PublicKey;
|
|
@@ -67,7 +67,7 @@ export type CreateIdentityOptions = {
|
|
|
67
67
|
deviceProfile?: DeviceProfileDocument;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
export type
|
|
70
|
+
export type IdentityManagerProps = {
|
|
71
71
|
metadataStore: MetadataStore;
|
|
72
72
|
keyring: Keyring;
|
|
73
73
|
feedStore: FeedStore<FeedMessage>;
|
|
@@ -95,7 +95,7 @@ export class IdentityManager {
|
|
|
95
95
|
private _identity?: Identity;
|
|
96
96
|
|
|
97
97
|
// TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
|
|
98
|
-
constructor(params:
|
|
98
|
+
constructor(params: IdentityManagerProps) {
|
|
99
99
|
this._metadataStore = params.metadataStore;
|
|
100
100
|
this._keyring = params.keyring;
|
|
101
101
|
this._feedStore = params.feedStore;
|
|
@@ -240,7 +240,7 @@ export class IdentityManager {
|
|
|
240
240
|
/**
|
|
241
241
|
* Prepare an identity object as the first step of acceptIdentity flow.
|
|
242
242
|
*/
|
|
243
|
-
async prepareIdentity(params:
|
|
243
|
+
async prepareIdentity(params: JoinIdentityProps) {
|
|
244
244
|
log('accepting identity', { params });
|
|
245
245
|
invariant(!this._identity, 'Identity already exists.');
|
|
246
246
|
|
|
@@ -395,7 +395,7 @@ export class IdentityManager {
|
|
|
395
395
|
return identity;
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
-
private async _constructSpace({ spaceRecord, swarmIdentity, identityKey, gossip }:
|
|
398
|
+
private async _constructSpace({ spaceRecord, swarmIdentity, identityKey, gossip }: ConstructSpaceProps) {
|
|
399
399
|
return this._spaceManager.constructSpace({
|
|
400
400
|
metadata: {
|
|
401
401
|
key: spaceRecord.key,
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
import { Timeframe } from '@dxos/timeframe';
|
|
23
23
|
|
|
24
24
|
import { type Identity } from './identity';
|
|
25
|
-
import { type
|
|
25
|
+
import { type JoinIdentityProps } from './identity-manager';
|
|
26
26
|
|
|
27
27
|
export class EdgeIdentityRecoveryManager {
|
|
28
28
|
constructor(
|
|
29
29
|
private readonly _keyring: Keyring,
|
|
30
30
|
private readonly _edgeClient: EdgeHttpClient | undefined,
|
|
31
31
|
private readonly _identityProvider: () => Identity | undefined,
|
|
32
|
-
private readonly _acceptRecoveredIdentity: (params:
|
|
32
|
+
private readonly _acceptRecoveredIdentity: (params: JoinIdentityProps) => Promise<Identity>,
|
|
33
33
|
) {}
|
|
34
34
|
|
|
35
35
|
public async createRecoveryCredential({
|
|
@@ -38,7 +38,7 @@ import { EdgeFeedReplicator } from '../spaces';
|
|
|
38
38
|
import { TrustedKeySetAuthVerifier } from './authenticator';
|
|
39
39
|
import { DefaultSpaceStateMachine } from './default-space-state-machine';
|
|
40
40
|
|
|
41
|
-
export type
|
|
41
|
+
export type IdentityProps = {
|
|
42
42
|
did: IdentityDid;
|
|
43
43
|
identityKey: PublicKey;
|
|
44
44
|
deviceKey: PublicKey;
|
|
@@ -71,7 +71,7 @@ export class Identity {
|
|
|
71
71
|
|
|
72
72
|
public readonly stateUpdate = new Event();
|
|
73
73
|
|
|
74
|
-
constructor(params:
|
|
74
|
+
constructor(params: IdentityProps) {
|
|
75
75
|
this.space = params.space;
|
|
76
76
|
this._signer = params.signer;
|
|
77
77
|
this._presence = params.presence;
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
type IntroductionRequest,
|
|
16
16
|
} from '@dxos/protocols/proto/dxos/halo/invitations';
|
|
17
17
|
|
|
18
|
-
import { type Identity, type
|
|
18
|
+
import { type Identity, type JoinIdentityProps } from '../identity';
|
|
19
19
|
|
|
20
20
|
import { type InvitationProtocol } from './invitation-protocol';
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ export class DeviceInvitationProtocol implements InvitationProtocol {
|
|
|
23
23
|
constructor(
|
|
24
24
|
private readonly _keyring: Keyring,
|
|
25
25
|
private readonly _getIdentity: () => Identity,
|
|
26
|
-
private readonly _acceptIdentity: (identity:
|
|
26
|
+
private readonly _acceptIdentity: (identity: JoinIdentityProps) => Promise<Identity>,
|
|
27
27
|
) {}
|
|
28
28
|
|
|
29
29
|
toJSON(): object {
|
|
@@ -16,7 +16,7 @@ import { type AdmissionKeypair, Invitation } from '@dxos/protocols/proto/dxos/cl
|
|
|
16
16
|
import { type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
17
17
|
import { AuthenticationResponse, type IntroductionResponse } from '@dxos/protocols/proto/dxos/halo/invitations';
|
|
18
18
|
import { InvitationOptions } from '@dxos/protocols/proto/dxos/halo/invitations';
|
|
19
|
-
import { type ExtensionContext, type TeleportExtension, type
|
|
19
|
+
import { type ExtensionContext, type TeleportExtension, type TeleportProps } from '@dxos/teleport';
|
|
20
20
|
import { trace as _trace } from '@dxos/tracing';
|
|
21
21
|
import { ComplexSet } from '@dxos/util';
|
|
22
22
|
|
|
@@ -31,8 +31,8 @@ const metrics = _trace.metrics;
|
|
|
31
31
|
|
|
32
32
|
const MAX_DELEGATED_INVITATION_HOST_TRIES = 3;
|
|
33
33
|
|
|
34
|
-
export type
|
|
35
|
-
teleport: Partial<
|
|
34
|
+
export type InvitationConnectionProps = {
|
|
35
|
+
teleport: Partial<TeleportProps>;
|
|
36
36
|
edgeInvitations?: EdgeInvitationConfig;
|
|
37
37
|
};
|
|
38
38
|
|
|
@@ -71,7 +71,7 @@ export class InvitationsHandler {
|
|
|
71
71
|
constructor(
|
|
72
72
|
private readonly _networkManager: SwarmNetworkManager,
|
|
73
73
|
private readonly _edgeClient?: EdgeHttpClient,
|
|
74
|
-
private readonly
|
|
74
|
+
private readonly _connectionProps?: InvitationConnectionProps,
|
|
75
75
|
) {}
|
|
76
76
|
|
|
77
77
|
handleInvitationFlow(
|
|
@@ -388,7 +388,7 @@ export class InvitationsHandler {
|
|
|
388
388
|
return extension;
|
|
389
389
|
};
|
|
390
390
|
|
|
391
|
-
const edgeInvitationHandler = new EdgeInvitationHandler(this.
|
|
391
|
+
const edgeInvitationHandler = new EdgeInvitationHandler(this._connectionProps?.edgeInvitations, this._edgeClient, {
|
|
392
392
|
onInvitationSuccess: async (admissionResponse, admissionRequest) => {
|
|
393
393
|
const result = await protocol.accept(admissionResponse, admissionRequest);
|
|
394
394
|
log.info('admitted by edge', { ...protocol.toJSON() });
|
|
@@ -440,7 +440,7 @@ export class InvitationsHandler {
|
|
|
440
440
|
topic: invitation.swarmKey,
|
|
441
441
|
protocolProvider: createTeleportProtocolFactory(async (teleport) => {
|
|
442
442
|
teleport.addExtension('dxos.halo.invitations', extensionFactory());
|
|
443
|
-
}, this.
|
|
443
|
+
}, this._connectionProps?.teleport),
|
|
444
444
|
topology: new InvitationTopology(role),
|
|
445
445
|
label,
|
|
446
446
|
});
|
|
@@ -26,6 +26,10 @@ import { getDebugName, jsonify, numericalValues, tracer } from '@dxos/util';
|
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Logging service used to spy on logs of the host.
|
|
29
|
+
*
|
|
30
|
+
* @deprecated This was created so that logs from the shared worker (WorkerClientServices) could be
|
|
31
|
+
* seen in the main window console without opening the shared worker DevTools. Shared worker client
|
|
32
|
+
* services is deprecated; dedicated worker logs already show in the main window console.
|
|
29
33
|
*/
|
|
30
34
|
export class LoggingServiceImpl implements LoggingService {
|
|
31
35
|
private readonly _logs = new Event<NaturalLogEntry>();
|
|
@@ -11,7 +11,7 @@ import { type MaybePromise } from '@dxos/util';
|
|
|
11
11
|
|
|
12
12
|
import { type ServiceRegistry } from './service-registry';
|
|
13
13
|
|
|
14
|
-
export type
|
|
14
|
+
export type ClientRpcServerProps = {
|
|
15
15
|
serviceRegistry: ServiceRegistry<ClientServices>;
|
|
16
16
|
handleCall?: (
|
|
17
17
|
method: string,
|
|
@@ -30,8 +30,8 @@ export class ClientRpcServer {
|
|
|
30
30
|
private readonly _serviceRegistry: ServiceRegistry<ClientServices>;
|
|
31
31
|
private readonly _rpcPeer: RpcPeer;
|
|
32
32
|
private readonly _handlerCache = new Map<string, ServiceHandler<any>>();
|
|
33
|
-
private readonly _handleCall:
|
|
34
|
-
private readonly _handleStream:
|
|
33
|
+
private readonly _handleCall: ClientRpcServerProps['handleCall'];
|
|
34
|
+
private readonly _handleStream: ClientRpcServerProps['handleStream'];
|
|
35
35
|
|
|
36
36
|
@trace.metricsCounter()
|
|
37
37
|
private readonly _callMetrics = new MapCounter();
|
|
@@ -41,7 +41,7 @@ export class ClientRpcServer {
|
|
|
41
41
|
return Object.keys(this._serviceRegistry.services);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
constructor(params:
|
|
44
|
+
constructor(params: ClientRpcServerProps) {
|
|
45
45
|
const { serviceRegistry, handleCall, handleStream, ...rpcOptions } = params;
|
|
46
46
|
this._handleCall = handleCall;
|
|
47
47
|
this._handleStream = handleStream;
|