@dxos/client-services 0.7.5-main.499c70c → 0.7.5-main.6a330ac
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-BXVZXTZM.mjs → chunk-GCPC6HHD.mjs} +364 -248
- package/dist/lib/browser/chunk-GCPC6HHD.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-PHNHOPRY.cjs → chunk-R6SBOJE2.cjs} +389 -273
- package/dist/lib/node/chunk-R6SBOJE2.cjs.map +7 -0
- package/dist/lib/node/index.cjs +47 -47
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +8 -8
- package/dist/lib/node-esm/{chunk-5LEHZOCS.mjs → chunk-G5KWZONX.mjs} +364 -248
- package/dist/lib/node-esm/chunk-G5KWZONX.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -1
- 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 +1 -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 +1 -1
- package/dist/types/src/packlets/devices/devices-service.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/devtools.d.ts +1 -1
- package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/feeds.d.ts +1 -1
- package/dist/types/src/packlets/devtools/feeds.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/keys.d.ts +1 -1
- package/dist/types/src/packlets/devtools/keys.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/metadata.d.ts +1 -1
- package/dist/types/src/packlets/devtools/metadata.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/network.d.ts +1 -1
- package/dist/types/src/packlets/devtools/network.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/spaces.d.ts +1 -1
- package/dist/types/src/packlets/devtools/spaces.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.map +1 -1
- package/dist/types/src/packlets/identity/contacts-service.d.ts +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 +0 -3
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-recovery-manager.d.ts +12 -4
- package/dist/types/src/packlets/identity/identity-recovery-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts +9 -4
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +3 -1
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/utils.d.ts +1 -0
- package/dist/types/src/packlets/invitations/utils.d.ts.map +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/network/network-service.d.ts +9 -2
- package/dist/types/src/packlets/network/network-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts +3 -0
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.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/version.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -38
- package/src/packlets/agents/edge-agent-manager.ts +6 -0
- package/src/packlets/agents/edge-agent-service.ts +1 -1
- package/src/packlets/devices/devices-service.ts +1 -1
- package/src/packlets/devtools/devtools.ts +1 -1
- package/src/packlets/devtools/feeds.ts +1 -1
- package/src/packlets/devtools/keys.ts +1 -1
- package/src/packlets/devtools/metadata.ts +1 -1
- package/src/packlets/devtools/network.ts +1 -1
- package/src/packlets/devtools/spaces.ts +1 -1
- package/src/packlets/diagnostics/diagnostics-collector.ts +2 -2
- package/src/packlets/diagnostics/diagnostics.ts +17 -13
- package/src/packlets/identity/contacts-service.ts +1 -1
- package/src/packlets/identity/identity-manager.ts +3 -29
- package/src/packlets/identity/identity-recovery-manager.ts +86 -9
- package/src/packlets/identity/identity-service.ts +17 -4
- package/src/packlets/identity/identity.test.ts +2 -1
- package/src/packlets/identity/identity.ts +4 -1
- package/src/packlets/invitations/invitations-handler.ts +15 -6
- package/src/packlets/invitations/invitations-manager.ts +1 -1
- package/src/packlets/invitations/invitations-service.ts +1 -1
- package/src/packlets/invitations/space-invitation-protocol.ts +2 -3
- package/src/packlets/invitations/utils.ts +7 -0
- package/src/packlets/logging/logging-service.ts +1 -1
- package/src/packlets/network/network-service.ts +39 -1
- package/src/packlets/services/service-context.ts +1 -0
- package/src/packlets/spaces/data-space-manager.ts +3 -3
- package/src/packlets/spaces/data-space.ts +2 -2
- package/src/packlets/spaces/edge-feed-replicator.ts +8 -8
- package/src/packlets/spaces/notarization-plugin.ts +32 -17
- package/src/packlets/spaces/spaces-service.ts +31 -21
- package/src/packlets/system/system-service.ts +1 -1
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-BXVZXTZM.mjs.map +0 -7
- package/dist/lib/node/chunk-PHNHOPRY.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-5LEHZOCS.mjs.map +0 -7
|
@@ -2,7 +2,7 @@ import "@dxos/node-std/globals";
|
|
|
2
2
|
|
|
3
3
|
// packages/sdk/client-services/src/packlets/devtools/feeds.ts
|
|
4
4
|
import { EventSubscriptions } from "@dxos/async";
|
|
5
|
-
import { Stream } from "@dxos/codec-protobuf";
|
|
5
|
+
import { Stream } from "@dxos/codec-protobuf/stream";
|
|
6
6
|
import { FeedIterator } from "@dxos/feed-store";
|
|
7
7
|
import { PublicKey } from "@dxos/keys";
|
|
8
8
|
import { log } from "@dxos/log";
|
|
@@ -113,7 +113,7 @@ var subscribeToFeedBlocks = ({ feedStore }, { feedKey, maxBlocks = 10 }) => {
|
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
// packages/sdk/client-services/src/packlets/devtools/network.ts
|
|
116
|
-
import { Stream as Stream2 } from "@dxos/codec-protobuf";
|
|
116
|
+
import { Stream as Stream2 } from "@dxos/codec-protobuf/stream";
|
|
117
117
|
import { Context } from "@dxos/context";
|
|
118
118
|
import { PublicKey as PublicKey2 } from "@dxos/keys";
|
|
119
119
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devtools/network.ts";
|
|
@@ -210,7 +210,7 @@ var getNetworkPeers = ({ networkManager }, request) => {
|
|
|
210
210
|
};
|
|
211
211
|
|
|
212
212
|
// packages/sdk/client-services/src/packlets/devtools/spaces.ts
|
|
213
|
-
import { Stream as Stream3 } from "@dxos/codec-protobuf";
|
|
213
|
+
import { Stream as Stream3 } from "@dxos/codec-protobuf/stream";
|
|
214
214
|
var subscribeToSpaces = (context, { spaceKeys = [] }) => {
|
|
215
215
|
return new Stream3(({ next }) => {
|
|
216
216
|
let unsubscribe;
|
|
@@ -247,11 +247,11 @@ var subscribeToSpaces = (context, { spaceKeys = [] }) => {
|
|
|
247
247
|
|
|
248
248
|
// packages/sdk/client-services/src/packlets/devtools/devtools.ts
|
|
249
249
|
import { Event as AsyncEvent } from "@dxos/async";
|
|
250
|
-
import { Stream as Stream6 } from "@dxos/codec-protobuf";
|
|
250
|
+
import { Stream as Stream6 } from "@dxos/codec-protobuf/stream";
|
|
251
251
|
|
|
252
252
|
// packages/sdk/client-services/src/packlets/devtools/keys.ts
|
|
253
253
|
import { scheduleTask } from "@dxos/async";
|
|
254
|
-
import { Stream as Stream4 } from "@dxos/codec-protobuf";
|
|
254
|
+
import { Stream as Stream4 } from "@dxos/codec-protobuf/stream";
|
|
255
255
|
var subscribeToKeyringKeys = ({ keyring }) => new Stream4(({ next, ctx }) => {
|
|
256
256
|
const update = async () => {
|
|
257
257
|
next({
|
|
@@ -263,7 +263,7 @@ var subscribeToKeyringKeys = ({ keyring }) => new Stream4(({ next, ctx }) => {
|
|
|
263
263
|
});
|
|
264
264
|
|
|
265
265
|
// packages/sdk/client-services/src/packlets/devtools/metadata.ts
|
|
266
|
-
import { Stream as Stream5 } from "@dxos/codec-protobuf";
|
|
266
|
+
import { Stream as Stream5 } from "@dxos/codec-protobuf/stream";
|
|
267
267
|
var subscribeToMetadata = ({ context }) => new Stream5(({ next, ctx }) => {
|
|
268
268
|
context.metadataStore.update.on(ctx, (data) => next({
|
|
269
269
|
metadata: data
|
|
@@ -390,14 +390,14 @@ var DevtoolsServiceImpl = class {
|
|
|
390
390
|
// packages/sdk/client-services/src/packlets/diagnostics/diagnostics.ts
|
|
391
391
|
import { asyncTimeout } from "@dxos/async";
|
|
392
392
|
import { getFirstStreamValue } from "@dxos/codec-protobuf";
|
|
393
|
-
import { credentialTypeFilter } from "@dxos/credentials";
|
|
393
|
+
import { createDidFromIdentityKey, credentialTypeFilter } from "@dxos/credentials";
|
|
394
394
|
import { invariant } from "@dxos/invariant";
|
|
395
395
|
import { STORAGE_VERSION } from "@dxos/protocols";
|
|
396
396
|
import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
|
|
397
397
|
import { TRACE_PROCESSOR } from "@dxos/tracing";
|
|
398
398
|
|
|
399
399
|
// packages/sdk/client-services/src/version.ts
|
|
400
|
-
var DXOS_VERSION = "0.7.5-main.
|
|
400
|
+
var DXOS_VERSION = "0.7.5-main.6a330ac";
|
|
401
401
|
|
|
402
402
|
// packages/sdk/client-services/src/packlets/services/platform.ts
|
|
403
403
|
import { Platform } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -466,6 +466,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
|
466
466
|
const identity = serviceContext.identityManager.identity;
|
|
467
467
|
if (identity) {
|
|
468
468
|
diagnostics.identity = {
|
|
469
|
+
did: identity.did,
|
|
469
470
|
identityKey: identity.identityKey,
|
|
470
471
|
spaceKey: identity.space.key,
|
|
471
472
|
profile: identity.profileDocument
|
|
@@ -504,16 +505,17 @@ var getSpaceStats = async (space) => {
|
|
|
504
505
|
...credential.subject.assertion,
|
|
505
506
|
id: credential.id
|
|
506
507
|
})),
|
|
507
|
-
members: Array.from(space.inner.spaceState.members.values()).map((member) => ({
|
|
508
|
+
members: await Promise.all(Array.from(space.inner.spaceState.members.values()).map(async (member) => ({
|
|
508
509
|
role: member.role,
|
|
509
510
|
identity: {
|
|
511
|
+
did: await createDidFromIdentityKey(member.key),
|
|
510
512
|
identityKey: member.key,
|
|
511
513
|
profile: {
|
|
512
514
|
displayName: member.assertion.profile?.displayName
|
|
513
515
|
}
|
|
514
516
|
},
|
|
515
517
|
presence: space.presence.getPeersOnline().filter(({ identityKey }) => identityKey.equals(member.key)).length > 0 ? SpaceMember.PresenceState.ONLINE : SpaceMember.PresenceState.OFFLINE
|
|
516
|
-
})),
|
|
518
|
+
}))),
|
|
517
519
|
pipeline: {
|
|
518
520
|
// TODO(burdon): Pick properties from credentials if needed.
|
|
519
521
|
currentEpoch: space.automergeSpaceState.lastEpoch,
|
|
@@ -647,7 +649,7 @@ import { ClientServicesProviderResource } from "@dxos/client-protocol";
|
|
|
647
649
|
import { ConfigResource } from "@dxos/config";
|
|
648
650
|
import { GetDiagnosticsRequest } from "@dxos/protocols/proto/dxos/client/services";
|
|
649
651
|
import { TRACE_PROCESSOR as TRACE_PROCESSOR2 } from "@dxos/tracing";
|
|
650
|
-
import { jsonKeyReplacer,
|
|
652
|
+
import { jsonKeyReplacer, isNonNullable } from "@dxos/util";
|
|
651
653
|
var GET_DIAGNOSTICS_RPC_TIMEOUT = 1e4;
|
|
652
654
|
var DiagnosticsCollector = class {
|
|
653
655
|
static {
|
|
@@ -680,7 +682,7 @@ var findSystemServiceProvider = () => {
|
|
|
680
682
|
};
|
|
681
683
|
var findConfigs = () => {
|
|
682
684
|
const configs = TRACE_PROCESSOR2.findResourcesByAnnotation(ConfigResource);
|
|
683
|
-
return configs.map((r) => r.instance.deref()).filter(
|
|
685
|
+
return configs.map((r) => r.instance.deref()).filter(isNonNullable);
|
|
684
686
|
};
|
|
685
687
|
|
|
686
688
|
// packages/sdk/client-services/src/packlets/identity/authenticator.ts
|
|
@@ -991,7 +993,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
991
993
|
this._remoteLength.clear();
|
|
992
994
|
}
|
|
993
995
|
async addFeed(feed) {
|
|
994
|
-
log4
|
|
996
|
+
log4("addFeed", {
|
|
995
997
|
key: feed.key,
|
|
996
998
|
connected: this._connected,
|
|
997
999
|
hasConnectionCtx: !!this._connectionCtx
|
|
@@ -1028,7 +1030,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1028
1030
|
}
|
|
1029
1031
|
async _sendMessage(message) {
|
|
1030
1032
|
if (!this._connectionCtx) {
|
|
1031
|
-
log4
|
|
1033
|
+
log4("message dropped because connection was disposed", void 0, {
|
|
1032
1034
|
F: __dxlog_file6,
|
|
1033
1035
|
L: 146,
|
|
1034
1036
|
S: this,
|
|
@@ -1037,7 +1039,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1037
1039
|
return;
|
|
1038
1040
|
}
|
|
1039
1041
|
if (message.type === "data") {
|
|
1040
|
-
log4
|
|
1042
|
+
log4("sending blocks", {
|
|
1041
1043
|
feedKey: message.feedKey,
|
|
1042
1044
|
blocks: message.blocks.map((b) => b.index)
|
|
1043
1045
|
}, {
|
|
@@ -1112,7 +1114,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1112
1114
|
feedKey
|
|
1113
1115
|
};
|
|
1114
1116
|
if (message.length > feed.length) {
|
|
1115
|
-
log4
|
|
1117
|
+
log4("requesting missing blocks", logMeta, {
|
|
1116
1118
|
F: __dxlog_file6,
|
|
1117
1119
|
L: 194,
|
|
1118
1120
|
S: this,
|
|
@@ -1127,7 +1129,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1127
1129
|
}
|
|
1128
1130
|
});
|
|
1129
1131
|
} else if (message.length < feed.length) {
|
|
1130
|
-
log4
|
|
1132
|
+
log4("pushing blocks to remote", logMeta, {
|
|
1131
1133
|
F: __dxlog_file6,
|
|
1132
1134
|
L: 202,
|
|
1133
1135
|
S: this,
|
|
@@ -1143,7 +1145,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1143
1145
|
}
|
|
1144
1146
|
}
|
|
1145
1147
|
case "data": {
|
|
1146
|
-
log4
|
|
1148
|
+
log4("received data", {
|
|
1147
1149
|
feed: message.feedKey,
|
|
1148
1150
|
blocks: message.blocks.map((b) => b.index)
|
|
1149
1151
|
}, {
|
|
@@ -1182,7 +1184,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1182
1184
|
});
|
|
1183
1185
|
}
|
|
1184
1186
|
async _pushBlocks(feed, from, to) {
|
|
1185
|
-
log4
|
|
1187
|
+
log4("pushing blocks", {
|
|
1186
1188
|
feed: feed.key.toHex(),
|
|
1187
1189
|
from,
|
|
1188
1190
|
to
|
|
@@ -1221,7 +1223,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1221
1223
|
this._remoteLength.set(feed.key, to);
|
|
1222
1224
|
}
|
|
1223
1225
|
async _integrateBlocks(feed, blocks) {
|
|
1224
|
-
log4
|
|
1226
|
+
log4("integrating blocks", {
|
|
1225
1227
|
feed: feed.key.toHex(),
|
|
1226
1228
|
blocks: blocks.length
|
|
1227
1229
|
}, {
|
|
@@ -1451,6 +1453,7 @@ var NotarizationPlugin = class extends Resource3 {
|
|
|
1451
1453
|
this._processedCredentials = new ComplexSet(PublicKey4.hash);
|
|
1452
1454
|
this._processCredentialsTriggers = new ComplexMap3(PublicKey4.hash);
|
|
1453
1455
|
this._activeEdgePollingIntervalHandle = void 0;
|
|
1456
|
+
this._activeEdgePollingEnabled = false;
|
|
1454
1457
|
this._spaceId = params.spaceId;
|
|
1455
1458
|
this._activeEdgePollingInterval = params.activeEdgePollingInterval ?? DEFAULT_ACTIVE_EDGE_POLLING_INTERVAL;
|
|
1456
1459
|
if (params.edgeClient && params.edgeFeatures?.feedReplicator) {
|
|
@@ -1458,15 +1461,6 @@ var NotarizationPlugin = class extends Resource3 {
|
|
|
1458
1461
|
}
|
|
1459
1462
|
}
|
|
1460
1463
|
setActiveEdgePollingEnabled(enabled) {
|
|
1461
|
-
invariant4(this.isOpen, void 0, {
|
|
1462
|
-
F: __dxlog_file8,
|
|
1463
|
-
L: 109,
|
|
1464
|
-
S: this,
|
|
1465
|
-
A: [
|
|
1466
|
-
"this.isOpen",
|
|
1467
|
-
""
|
|
1468
|
-
]
|
|
1469
|
-
});
|
|
1470
1464
|
const client = this._edgeClient;
|
|
1471
1465
|
invariant4(client, void 0, {
|
|
1472
1466
|
F: __dxlog_file8,
|
|
@@ -1477,30 +1471,30 @@ var NotarizationPlugin = class extends Resource3 {
|
|
|
1477
1471
|
""
|
|
1478
1472
|
]
|
|
1479
1473
|
});
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
clearInterval(this._activeEdgePollingIntervalHandle);
|
|
1488
|
-
this._activeEdgePollingIntervalHandle = void 0;
|
|
1474
|
+
this._activeEdgePollingEnabled = enabled;
|
|
1475
|
+
if (this.isOpen) {
|
|
1476
|
+
if (enabled && !this._activeEdgePollingIntervalHandle) {
|
|
1477
|
+
this._startPeriodicEdgePolling(client);
|
|
1478
|
+
} else if (!enabled && this._activeEdgePollingIntervalHandle) {
|
|
1479
|
+
this._stopPeriodicEdgePolling();
|
|
1480
|
+
}
|
|
1489
1481
|
}
|
|
1490
1482
|
}
|
|
1491
1483
|
get hasWriter() {
|
|
1492
1484
|
return !!this._writer;
|
|
1493
1485
|
}
|
|
1494
1486
|
async _open() {
|
|
1495
|
-
if (this._edgeClient
|
|
1496
|
-
|
|
1487
|
+
if (this._edgeClient) {
|
|
1488
|
+
if (this._activeEdgePollingEnabled) {
|
|
1489
|
+
this._startPeriodicEdgePolling(this._edgeClient);
|
|
1490
|
+
}
|
|
1491
|
+
if (this._writer) {
|
|
1492
|
+
this._notarizePendingEdgeCredentials(this._edgeClient, this._writer);
|
|
1493
|
+
}
|
|
1497
1494
|
}
|
|
1498
1495
|
}
|
|
1499
1496
|
async _close() {
|
|
1500
|
-
|
|
1501
|
-
clearInterval(this._activeEdgePollingIntervalHandle);
|
|
1502
|
-
this._activeEdgePollingIntervalHandle = void 0;
|
|
1503
|
-
}
|
|
1497
|
+
this._stopPeriodicEdgePolling();
|
|
1504
1498
|
await this._ctx.dispose();
|
|
1505
1499
|
}
|
|
1506
1500
|
/**
|
|
@@ -1678,10 +1672,23 @@ var NotarizationPlugin = class extends Resource3 {
|
|
|
1678
1672
|
]
|
|
1679
1673
|
});
|
|
1680
1674
|
this._writer = writer;
|
|
1681
|
-
if (this._edgeClient) {
|
|
1675
|
+
if (this._edgeClient && this.isOpen) {
|
|
1682
1676
|
this._notarizePendingEdgeCredentials(this._edgeClient, writer);
|
|
1683
1677
|
}
|
|
1684
1678
|
}
|
|
1679
|
+
_startPeriodicEdgePolling(client) {
|
|
1680
|
+
this._activeEdgePollingIntervalHandle = setInterval(() => {
|
|
1681
|
+
if (this._writer) {
|
|
1682
|
+
this._notarizePendingEdgeCredentials(client, this._writer);
|
|
1683
|
+
}
|
|
1684
|
+
}, this._activeEdgePollingInterval);
|
|
1685
|
+
}
|
|
1686
|
+
_stopPeriodicEdgePolling() {
|
|
1687
|
+
if (this._activeEdgePollingIntervalHandle) {
|
|
1688
|
+
clearInterval(this._activeEdgePollingIntervalHandle);
|
|
1689
|
+
this._activeEdgePollingIntervalHandle = void 0;
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1685
1692
|
/**
|
|
1686
1693
|
* The method is used only for adding agent feeds to spaces.
|
|
1687
1694
|
* When an agent is created we can admit them into all the existing spaces. In case the operation fails
|
|
@@ -1700,7 +1707,7 @@ var NotarizationPlugin = class extends Resource3 {
|
|
|
1700
1707
|
if (!credentials.length) {
|
|
1701
1708
|
log5("edge did not return credentials for notarization", void 0, {
|
|
1702
1709
|
F: __dxlog_file8,
|
|
1703
|
-
L:
|
|
1710
|
+
L: 311,
|
|
1704
1711
|
S: this,
|
|
1705
1712
|
C: (f, a) => f(...a)
|
|
1706
1713
|
});
|
|
@@ -1710,7 +1717,7 @@ var NotarizationPlugin = class extends Resource3 {
|
|
|
1710
1717
|
count: credentials.length
|
|
1711
1718
|
}, {
|
|
1712
1719
|
F: __dxlog_file8,
|
|
1713
|
-
L:
|
|
1720
|
+
L: 315,
|
|
1714
1721
|
S: this,
|
|
1715
1722
|
C: (f, a) => f(...a)
|
|
1716
1723
|
});
|
|
@@ -1723,7 +1730,7 @@ var NotarizationPlugin = class extends Resource3 {
|
|
|
1723
1730
|
count: decodedCredentials.length
|
|
1724
1731
|
}, {
|
|
1725
1732
|
F: __dxlog_file8,
|
|
1726
|
-
L:
|
|
1733
|
+
L: 324,
|
|
1727
1734
|
S: this,
|
|
1728
1735
|
C: (f, a) => f(...a)
|
|
1729
1736
|
});
|
|
@@ -1751,7 +1758,7 @@ var NotarizationPlugin = class extends Resource3 {
|
|
|
1751
1758
|
for (const credential of credentials) {
|
|
1752
1759
|
invariant4(credential.id, "Credential must have an id", {
|
|
1753
1760
|
F: __dxlog_file8,
|
|
1754
|
-
L:
|
|
1761
|
+
L: 350,
|
|
1755
1762
|
S: this,
|
|
1756
1763
|
A: [
|
|
1757
1764
|
"credential.id",
|
|
@@ -1775,7 +1782,7 @@ var NotarizationPlugin = class extends Resource3 {
|
|
|
1775
1782
|
peer: extension.localPeerId
|
|
1776
1783
|
}, {
|
|
1777
1784
|
F: __dxlog_file8,
|
|
1778
|
-
L:
|
|
1785
|
+
L: 365,
|
|
1779
1786
|
S: this,
|
|
1780
1787
|
C: (f, a) => f(...a)
|
|
1781
1788
|
});
|
|
@@ -1787,7 +1794,7 @@ var NotarizationPlugin = class extends Resource3 {
|
|
|
1787
1794
|
peer: extension.localPeerId
|
|
1788
1795
|
}, {
|
|
1789
1796
|
F: __dxlog_file8,
|
|
1790
|
-
L:
|
|
1797
|
+
L: 370,
|
|
1791
1798
|
S: this,
|
|
1792
1799
|
C: (f, a) => f(...a)
|
|
1793
1800
|
});
|
|
@@ -1804,7 +1811,7 @@ var NotarizationPlugin = class extends Resource3 {
|
|
|
1804
1811
|
peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
|
|
1805
1812
|
}, {
|
|
1806
1813
|
F: __dxlog_file8,
|
|
1807
|
-
L:
|
|
1814
|
+
L: 382,
|
|
1808
1815
|
S: this,
|
|
1809
1816
|
C: (f, a) => f(...a)
|
|
1810
1817
|
});
|
|
@@ -1820,7 +1827,7 @@ var handleEdgeError = (error) => {
|
|
|
1820
1827
|
if (!(error instanceof EdgeCallFailedError) || error.errorData) {
|
|
1821
1828
|
log5.catch(error, void 0, {
|
|
1822
1829
|
F: __dxlog_file8,
|
|
1823
|
-
L:
|
|
1830
|
+
L: 396,
|
|
1824
1831
|
S: void 0,
|
|
1825
1832
|
C: (f, a) => f(...a)
|
|
1826
1833
|
});
|
|
@@ -1829,7 +1836,7 @@ var handleEdgeError = (error) => {
|
|
|
1829
1836
|
reason: error.reason
|
|
1830
1837
|
}, {
|
|
1831
1838
|
F: __dxlog_file8,
|
|
1832
|
-
L:
|
|
1839
|
+
L: 398,
|
|
1833
1840
|
S: void 0,
|
|
1834
1841
|
C: (f, a) => f(...a)
|
|
1835
1842
|
});
|
|
@@ -2523,7 +2530,7 @@ var DataSpaceManager = class extends Resource4 {
|
|
|
2523
2530
|
});
|
|
2524
2531
|
dataSpace.postOpen.append(async () => {
|
|
2525
2532
|
const setting = dataSpace.getEdgeReplicationSetting();
|
|
2526
|
-
if (setting === EdgeReplicationSetting.ENABLED) {
|
|
2533
|
+
if (!setting || setting === EdgeReplicationSetting.ENABLED) {
|
|
2527
2534
|
await this._echoEdgeReplicator?.connectToSpace(dataSpace.id);
|
|
2528
2535
|
} else if (this._echoEdgeReplicator) {
|
|
2529
2536
|
log7("not connecting EchoEdgeReplicator because of EdgeReplicationSetting", {
|
|
@@ -2538,7 +2545,7 @@ var DataSpaceManager = class extends Resource4 {
|
|
|
2538
2545
|
});
|
|
2539
2546
|
dataSpace.preClose.append(async () => {
|
|
2540
2547
|
const setting = dataSpace.getEdgeReplicationSetting();
|
|
2541
|
-
if (setting === EdgeReplicationSetting.ENABLED) {
|
|
2548
|
+
if (!setting || setting === EdgeReplicationSetting.ENABLED) {
|
|
2542
2549
|
await this._echoEdgeReplicator?.disconnectFromSpace(dataSpace.id);
|
|
2543
2550
|
}
|
|
2544
2551
|
});
|
|
@@ -2643,7 +2650,7 @@ var DataSpaceManager = class extends Resource4 {
|
|
|
2643
2650
|
guestKeypair: invitation.guestKey ? {
|
|
2644
2651
|
publicKey: invitation.guestKey
|
|
2645
2652
|
} : void 0,
|
|
2646
|
-
lifetime: invitation.expiresOn ? invitation.expiresOn.getTime() - Date.now() : void 0,
|
|
2653
|
+
lifetime: invitation.expiresOn ? (invitation.expiresOn.getTime() - Date.now()) / 1e3 : void 0,
|
|
2647
2654
|
multiUse: invitation.multiUse,
|
|
2648
2655
|
delegationCredentialId: credentialId,
|
|
2649
2656
|
persistent: false
|
|
@@ -2670,8 +2677,8 @@ DataSpaceManager = _ts_decorate3([
|
|
|
2670
2677
|
|
|
2671
2678
|
// packages/sdk/client-services/src/packlets/spaces/spaces-service.ts
|
|
2672
2679
|
import { EventSubscriptions as EventSubscriptions2, UpdateScheduler, scheduleTask as scheduleTask3 } from "@dxos/async";
|
|
2673
|
-
import { Stream as Stream7 } from "@dxos/codec-protobuf";
|
|
2674
|
-
import { createAdmissionCredentials as createAdmissionCredentials2, getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credentials";
|
|
2680
|
+
import { Stream as Stream7 } from "@dxos/codec-protobuf/stream";
|
|
2681
|
+
import { createAdmissionCredentials as createAdmissionCredentials2, createDidFromIdentityKey as createDidFromIdentityKey2, getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credentials";
|
|
2675
2682
|
import { raise } from "@dxos/debug";
|
|
2676
2683
|
import { writeMessages as writeMessages2 } from "@dxos/feed-store";
|
|
2677
2684
|
import { invariant as invariant6 } from "@dxos/invariant";
|
|
@@ -2727,7 +2734,7 @@ var SpacesServiceImpl = class {
|
|
|
2727
2734
|
const credentials = await createAdmissionCredentials2(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
|
|
2728
2735
|
invariant6(credentials[0].credential, void 0, {
|
|
2729
2736
|
F: __dxlog_file11,
|
|
2730
|
-
L:
|
|
2737
|
+
L: 111,
|
|
2731
2738
|
S: this,
|
|
2732
2739
|
A: [
|
|
2733
2740
|
"credentials[0].credential",
|
|
@@ -2737,7 +2744,7 @@ var SpacesServiceImpl = class {
|
|
|
2737
2744
|
const spaceMemberCredential = credentials[0].credential.credential;
|
|
2738
2745
|
invariant6(getCredentialAssertion3(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
2739
2746
|
F: __dxlog_file11,
|
|
2740
|
-
L:
|
|
2747
|
+
L: 113,
|
|
2741
2748
|
S: this,
|
|
2742
2749
|
A: [
|
|
2743
2750
|
"getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -2750,12 +2757,12 @@ var SpacesServiceImpl = class {
|
|
|
2750
2757
|
return new Stream7(({ next, ctx }) => {
|
|
2751
2758
|
const scheduler = new UpdateScheduler(ctx, async () => {
|
|
2752
2759
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
2753
|
-
const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space));
|
|
2760
|
+
const spaces = await Promise.all(Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space)));
|
|
2754
2761
|
log8("update", () => ({
|
|
2755
2762
|
ids: spaces.map((space) => space.id)
|
|
2756
2763
|
}), {
|
|
2757
2764
|
F: __dxlog_file11,
|
|
2758
|
-
L:
|
|
2765
|
+
L: 126,
|
|
2759
2766
|
S: this,
|
|
2760
2767
|
C: (f, a) => f(...a)
|
|
2761
2768
|
});
|
|
@@ -2847,7 +2854,7 @@ var SpacesServiceImpl = class {
|
|
|
2847
2854
|
} else {
|
|
2848
2855
|
invariant6(!credential.id, "Id on unsigned credentials is not allowed", {
|
|
2849
2856
|
F: __dxlog_file11,
|
|
2850
|
-
L:
|
|
2857
|
+
L: 224,
|
|
2851
2858
|
S: this,
|
|
2852
2859
|
A: [
|
|
2853
2860
|
"!credential.id",
|
|
@@ -2856,7 +2863,7 @@ var SpacesServiceImpl = class {
|
|
|
2856
2863
|
});
|
|
2857
2864
|
invariant6(this._identityManager.identity, "Identity is not available", {
|
|
2858
2865
|
F: __dxlog_file11,
|
|
2859
|
-
L:
|
|
2866
|
+
L: 225,
|
|
2860
2867
|
S: this,
|
|
2861
2868
|
A: [
|
|
2862
2869
|
"this._identityManager.identity",
|
|
@@ -2866,7 +2873,7 @@ var SpacesServiceImpl = class {
|
|
|
2866
2873
|
const signer = this._identityManager.identity.getIdentityCredentialSigner();
|
|
2867
2874
|
invariant6(credential.issuer.equals(signer.getIssuer()), void 0, {
|
|
2868
2875
|
F: __dxlog_file11,
|
|
2869
|
-
L:
|
|
2876
|
+
L: 227,
|
|
2870
2877
|
S: this,
|
|
2871
2878
|
A: [
|
|
2872
2879
|
"credential.issuer.equals(signer.getIssuer())",
|
|
@@ -2916,7 +2923,7 @@ var SpacesServiceImpl = class {
|
|
|
2916
2923
|
const assertion = getCredentialAssertion3(credential);
|
|
2917
2924
|
invariant6(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
|
|
2918
2925
|
F: __dxlog_file11,
|
|
2919
|
-
L:
|
|
2926
|
+
L: 261,
|
|
2920
2927
|
S: this,
|
|
2921
2928
|
A: [
|
|
2922
2929
|
"assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -2926,7 +2933,7 @@ var SpacesServiceImpl = class {
|
|
|
2926
2933
|
const myIdentity = this._identityManager.identity;
|
|
2927
2934
|
invariant6(myIdentity && credential.subject.id.equals(myIdentity.identityKey), void 0, {
|
|
2928
2935
|
F: __dxlog_file11,
|
|
2929
|
-
L:
|
|
2936
|
+
L: 263,
|
|
2930
2937
|
S: this,
|
|
2931
2938
|
A: [
|
|
2932
2939
|
"myIdentity && credential.subject.id.equals(myIdentity.identityKey)",
|
|
@@ -2947,10 +2954,10 @@ var SpacesServiceImpl = class {
|
|
|
2947
2954
|
});
|
|
2948
2955
|
}
|
|
2949
2956
|
return {
|
|
2950
|
-
space: this._serializeSpace(dataSpace)
|
|
2957
|
+
space: await this._serializeSpace(dataSpace)
|
|
2951
2958
|
};
|
|
2952
2959
|
}
|
|
2953
|
-
_serializeSpace(space) {
|
|
2960
|
+
async _serializeSpace(space) {
|
|
2954
2961
|
return {
|
|
2955
2962
|
id: space.id,
|
|
2956
2963
|
spaceKey: space.key,
|
|
@@ -2970,7 +2977,7 @@ var SpacesServiceImpl = class {
|
|
|
2970
2977
|
totalDataTimeframe: void 0,
|
|
2971
2978
|
spaceRootUrl: space.databaseRoot?.url
|
|
2972
2979
|
},
|
|
2973
|
-
members: Array.from(space.inner.spaceState.members.values()).map((member) => {
|
|
2980
|
+
members: await Promise.all(Array.from(space.inner.spaceState.members.values()).map(async (member) => {
|
|
2974
2981
|
const peers = space.presence.getPeersOnline().filter(({ identityKey }) => identityKey.equals(member.key));
|
|
2975
2982
|
const isMe = this._identityManager.identity?.identityKey.equals(member.key);
|
|
2976
2983
|
if (isMe) {
|
|
@@ -2978,6 +2985,7 @@ var SpacesServiceImpl = class {
|
|
|
2978
2985
|
}
|
|
2979
2986
|
return {
|
|
2980
2987
|
identity: {
|
|
2988
|
+
did: await createDidFromIdentityKey2(member.key),
|
|
2981
2989
|
identityKey: member.key,
|
|
2982
2990
|
profile: member.profile ?? {}
|
|
2983
2991
|
},
|
|
@@ -2985,7 +2993,7 @@ var SpacesServiceImpl = class {
|
|
|
2985
2993
|
presence: peers.length > 0 ? SpaceMember4.PresenceState.ONLINE : SpaceMember4.PresenceState.OFFLINE,
|
|
2986
2994
|
peerStates: peers
|
|
2987
2995
|
};
|
|
2988
|
-
}),
|
|
2996
|
+
})),
|
|
2989
2997
|
creator: space.inner.spaceState.creator?.key,
|
|
2990
2998
|
cache: space.cache,
|
|
2991
2999
|
metrics: space.metrics,
|
|
@@ -3030,13 +3038,14 @@ var Identity = class {
|
|
|
3030
3038
|
this.space = params.space;
|
|
3031
3039
|
this._signer = params.signer;
|
|
3032
3040
|
this._presence = params.presence;
|
|
3041
|
+
this.did = params.did;
|
|
3033
3042
|
this.identityKey = params.identityKey;
|
|
3034
3043
|
this.deviceKey = params.deviceKey;
|
|
3035
3044
|
log9.trace("dxos.halo.device", {
|
|
3036
3045
|
deviceKey: params.deviceKey
|
|
3037
3046
|
}, {
|
|
3038
3047
|
F: __dxlog_file12,
|
|
3039
|
-
L:
|
|
3048
|
+
L: 82,
|
|
3040
3049
|
S: this,
|
|
3041
3050
|
C: (f, a) => f(...a)
|
|
3042
3051
|
});
|
|
@@ -3138,7 +3147,7 @@ var Identity = class {
|
|
|
3138
3147
|
getIdentityCredentialSigner() {
|
|
3139
3148
|
invariant7(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.", {
|
|
3140
3149
|
F: __dxlog_file12,
|
|
3141
|
-
L:
|
|
3150
|
+
L: 198,
|
|
3142
3151
|
S: this,
|
|
3143
3152
|
A: [
|
|
3144
3153
|
"this._deviceStateMachine.deviceCredentialChain",
|
|
@@ -3182,7 +3191,7 @@ var Identity = class {
|
|
|
3182
3191
|
dataFeedKey
|
|
3183
3192
|
}, {
|
|
3184
3193
|
F: __dxlog_file12,
|
|
3185
|
-
L:
|
|
3194
|
+
L: 223,
|
|
3186
3195
|
S: this,
|
|
3187
3196
|
C: (f, a) => f(...a)
|
|
3188
3197
|
});
|
|
@@ -3239,7 +3248,7 @@ Identity = _ts_decorate4([
|
|
|
3239
3248
|
import platform from "platform";
|
|
3240
3249
|
import { Event as Event6 } from "@dxos/async";
|
|
3241
3250
|
import { Context as Context4 } from "@dxos/context";
|
|
3242
|
-
import { createCredentialSignerWithKey as createCredentialSignerWithKey2,
|
|
3251
|
+
import { createCredentialSignerWithKey as createCredentialSignerWithKey2, createDidFromIdentityKey as createDidFromIdentityKey3, CredentialGenerator } from "@dxos/credentials";
|
|
3243
3252
|
import { invariant as invariant8 } from "@dxos/invariant";
|
|
3244
3253
|
import { PublicKey as PublicKey7 } from "@dxos/keys";
|
|
3245
3254
|
import { log as log10 } from "@dxos/log";
|
|
@@ -3281,7 +3290,7 @@ var IdentityManager = class {
|
|
|
3281
3290
|
id: traceId
|
|
3282
3291
|
}), {
|
|
3283
3292
|
F: __dxlog_file13,
|
|
3284
|
-
L:
|
|
3293
|
+
L: 116,
|
|
3285
3294
|
S: this,
|
|
3286
3295
|
C: (f, a) => f(...a)
|
|
3287
3296
|
});
|
|
@@ -3290,7 +3299,7 @@ var IdentityManager = class {
|
|
|
3290
3299
|
identityRecord
|
|
3291
3300
|
}, {
|
|
3292
3301
|
F: __dxlog_file13,
|
|
3293
|
-
L:
|
|
3302
|
+
L: 119,
|
|
3294
3303
|
S: this,
|
|
3295
3304
|
C: (f, a) => f(...a)
|
|
3296
3305
|
});
|
|
@@ -3303,7 +3312,7 @@ var IdentityManager = class {
|
|
|
3303
3312
|
displayName: this._identity.profileDocument?.displayName
|
|
3304
3313
|
}, {
|
|
3305
3314
|
F: __dxlog_file13,
|
|
3306
|
-
L:
|
|
3315
|
+
L: 124,
|
|
3307
3316
|
S: this,
|
|
3308
3317
|
C: (f, a) => f(...a)
|
|
3309
3318
|
});
|
|
@@ -3313,7 +3322,7 @@ var IdentityManager = class {
|
|
|
3313
3322
|
id: traceId
|
|
3314
3323
|
}), {
|
|
3315
3324
|
F: __dxlog_file13,
|
|
3316
|
-
L:
|
|
3325
|
+
L: 131,
|
|
3317
3326
|
S: this,
|
|
3318
3327
|
C: (f, a) => f(...a)
|
|
3319
3328
|
});
|
|
@@ -3321,13 +3330,13 @@ var IdentityManager = class {
|
|
|
3321
3330
|
async close() {
|
|
3322
3331
|
await this._identity?.close(new Context4(void 0, {
|
|
3323
3332
|
F: __dxlog_file13,
|
|
3324
|
-
L:
|
|
3333
|
+
L: 135
|
|
3325
3334
|
}));
|
|
3326
3335
|
}
|
|
3327
3336
|
async createIdentity({ displayName, deviceProfile } = {}) {
|
|
3328
3337
|
invariant8(!this._identity, "Identity already exists.", {
|
|
3329
3338
|
F: __dxlog_file13,
|
|
3330
|
-
L:
|
|
3339
|
+
L: 140,
|
|
3331
3340
|
S: this,
|
|
3332
3341
|
A: [
|
|
3333
3342
|
"!this._identity",
|
|
@@ -3336,7 +3345,7 @@ var IdentityManager = class {
|
|
|
3336
3345
|
});
|
|
3337
3346
|
log10("creating identity...", void 0, {
|
|
3338
3347
|
F: __dxlog_file13,
|
|
3339
|
-
L:
|
|
3348
|
+
L: 141,
|
|
3340
3349
|
S: this,
|
|
3341
3350
|
C: (f, a) => f(...a)
|
|
3342
3351
|
});
|
|
@@ -3354,13 +3363,13 @@ var IdentityManager = class {
|
|
|
3354
3363
|
const identity = await this._constructIdentity(identityRecord);
|
|
3355
3364
|
await identity.open(new Context4(void 0, {
|
|
3356
3365
|
F: __dxlog_file13,
|
|
3357
|
-
L:
|
|
3366
|
+
L: 156
|
|
3358
3367
|
}));
|
|
3359
3368
|
{
|
|
3360
3369
|
const generator = new CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
|
|
3361
3370
|
invariant8(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required.", {
|
|
3362
3371
|
F: __dxlog_file13,
|
|
3363
|
-
L:
|
|
3372
|
+
L: 160,
|
|
3364
3373
|
S: this,
|
|
3365
3374
|
A: [
|
|
3366
3375
|
"identityRecord.haloSpace.genesisFeedKey",
|
|
@@ -3369,7 +3378,7 @@ var IdentityManager = class {
|
|
|
3369
3378
|
});
|
|
3370
3379
|
invariant8(identityRecord.haloSpace.dataFeedKey, "Data feed key is required.", {
|
|
3371
3380
|
F: __dxlog_file13,
|
|
3372
|
-
L:
|
|
3381
|
+
L: 161,
|
|
3373
3382
|
S: this,
|
|
3374
3383
|
A: [
|
|
3375
3384
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -3408,7 +3417,7 @@ var IdentityManager = class {
|
|
|
3408
3417
|
displayName: this._identity.profileDocument?.displayName
|
|
3409
3418
|
}, {
|
|
3410
3419
|
F: __dxlog_file13,
|
|
3411
|
-
L:
|
|
3420
|
+
L: 199,
|
|
3412
3421
|
S: this,
|
|
3413
3422
|
C: (f, a) => f(...a)
|
|
3414
3423
|
});
|
|
@@ -3419,7 +3428,7 @@ var IdentityManager = class {
|
|
|
3419
3428
|
profile: identity.profileDocument
|
|
3420
3429
|
}, {
|
|
3421
3430
|
F: __dxlog_file13,
|
|
3422
|
-
L:
|
|
3431
|
+
L: 205,
|
|
3423
3432
|
S: this,
|
|
3424
3433
|
C: (f, a) => f(...a)
|
|
3425
3434
|
});
|
|
@@ -3456,13 +3465,13 @@ var IdentityManager = class {
|
|
|
3456
3465
|
params
|
|
3457
3466
|
}, {
|
|
3458
3467
|
F: __dxlog_file13,
|
|
3459
|
-
L:
|
|
3468
|
+
L: 244,
|
|
3460
3469
|
S: this,
|
|
3461
3470
|
C: (f, a) => f(...a)
|
|
3462
3471
|
});
|
|
3463
3472
|
invariant8(!this._identity, "Identity already exists.", {
|
|
3464
3473
|
F: __dxlog_file13,
|
|
3465
|
-
L:
|
|
3474
|
+
L: 245,
|
|
3466
3475
|
S: this,
|
|
3467
3476
|
A: [
|
|
3468
3477
|
"!this._identity",
|
|
@@ -3483,7 +3492,7 @@ var IdentityManager = class {
|
|
|
3483
3492
|
const identity = await this._constructIdentity(identityRecord);
|
|
3484
3493
|
await identity.open(new Context4(void 0, {
|
|
3485
3494
|
F: __dxlog_file13,
|
|
3486
|
-
L:
|
|
3495
|
+
L: 259
|
|
3487
3496
|
}));
|
|
3488
3497
|
return {
|
|
3489
3498
|
identity,
|
|
@@ -3502,7 +3511,7 @@ var IdentityManager = class {
|
|
|
3502
3511
|
displayName: this._identity.profileDocument?.displayName
|
|
3503
3512
|
}, {
|
|
3504
3513
|
F: __dxlog_file13,
|
|
3505
|
-
L:
|
|
3514
|
+
L: 273,
|
|
3506
3515
|
S: this,
|
|
3507
3516
|
C: (f, a) => f(...a)
|
|
3508
3517
|
});
|
|
@@ -3516,7 +3525,7 @@ var IdentityManager = class {
|
|
|
3516
3525
|
deviceKey: identity.deviceKey
|
|
3517
3526
|
}, {
|
|
3518
3527
|
F: __dxlog_file13,
|
|
3519
|
-
L:
|
|
3528
|
+
L: 284,
|
|
3520
3529
|
S: this,
|
|
3521
3530
|
C: (f, a) => f(...a)
|
|
3522
3531
|
});
|
|
@@ -3527,7 +3536,7 @@ var IdentityManager = class {
|
|
|
3527
3536
|
async updateProfile(profile) {
|
|
3528
3537
|
invariant8(this._identity, "Identity not initialized.", {
|
|
3529
3538
|
F: __dxlog_file13,
|
|
3530
|
-
L:
|
|
3539
|
+
L: 291,
|
|
3531
3540
|
S: this,
|
|
3532
3541
|
A: [
|
|
3533
3542
|
"this._identity",
|
|
@@ -3558,7 +3567,7 @@ var IdentityManager = class {
|
|
|
3558
3567
|
async updateDeviceProfile(profile) {
|
|
3559
3568
|
invariant8(this._identity, "Identity not initialized.", {
|
|
3560
3569
|
F: __dxlog_file13,
|
|
3561
|
-
L:
|
|
3570
|
+
L: 308,
|
|
3562
3571
|
S: this,
|
|
3563
3572
|
A: [
|
|
3564
3573
|
"this._identity",
|
|
@@ -3591,48 +3600,10 @@ var IdentityManager = class {
|
|
|
3591
3600
|
profile
|
|
3592
3601
|
};
|
|
3593
3602
|
}
|
|
3594
|
-
async createRecoveryPhrase() {
|
|
3595
|
-
const identity = this._identity;
|
|
3596
|
-
invariant8(identity, void 0, {
|
|
3597
|
-
F: __dxlog_file13,
|
|
3598
|
-
L: 340,
|
|
3599
|
-
S: this,
|
|
3600
|
-
A: [
|
|
3601
|
-
"identity",
|
|
3602
|
-
""
|
|
3603
|
-
]
|
|
3604
|
-
});
|
|
3605
|
-
const seedphrase = generateSeedPhrase();
|
|
3606
|
-
const keypair = keyPairFromSeedPhrase(seedphrase);
|
|
3607
|
-
const recoveryKey = PublicKey7.from(keypair.publicKey);
|
|
3608
|
-
const identityKey = identity.identityKey;
|
|
3609
|
-
const credential = await identity.getIdentityCredentialSigner().createCredential({
|
|
3610
|
-
subject: identityKey,
|
|
3611
|
-
assertion: {
|
|
3612
|
-
"@type": "dxos.halo.credentials.IdentityRecovery",
|
|
3613
|
-
recoveryKey,
|
|
3614
|
-
identityKey
|
|
3615
|
-
}
|
|
3616
|
-
});
|
|
3617
|
-
const receipt = await identity.controlPipeline.writer.write({
|
|
3618
|
-
credential: {
|
|
3619
|
-
credential
|
|
3620
|
-
}
|
|
3621
|
-
});
|
|
3622
|
-
await identity.controlPipeline.state.waitUntilTimeframe(new Timeframe3([
|
|
3623
|
-
[
|
|
3624
|
-
receipt.feedKey,
|
|
3625
|
-
receipt.seq
|
|
3626
|
-
]
|
|
3627
|
-
]));
|
|
3628
|
-
return {
|
|
3629
|
-
seedphrase
|
|
3630
|
-
};
|
|
3631
|
-
}
|
|
3632
3603
|
async _constructIdentity(identityRecord) {
|
|
3633
3604
|
invariant8(!this._identity, void 0, {
|
|
3634
3605
|
F: __dxlog_file13,
|
|
3635
|
-
L:
|
|
3606
|
+
L: 334,
|
|
3636
3607
|
S: this,
|
|
3637
3608
|
A: [
|
|
3638
3609
|
"!this._identity",
|
|
@@ -3643,7 +3614,7 @@ var IdentityManager = class {
|
|
|
3643
3614
|
identityRecord
|
|
3644
3615
|
}, {
|
|
3645
3616
|
F: __dxlog_file13,
|
|
3646
|
-
L:
|
|
3617
|
+
L: 335,
|
|
3647
3618
|
S: this,
|
|
3648
3619
|
C: (f, a) => f(...a)
|
|
3649
3620
|
});
|
|
@@ -3658,7 +3629,7 @@ var IdentityManager = class {
|
|
|
3658
3629
|
});
|
|
3659
3630
|
invariant8(identityRecord.haloSpace.controlFeedKey, void 0, {
|
|
3660
3631
|
F: __dxlog_file13,
|
|
3661
|
-
L:
|
|
3632
|
+
L: 348,
|
|
3662
3633
|
S: this,
|
|
3663
3634
|
A: [
|
|
3664
3635
|
"identityRecord.haloSpace.controlFeedKey",
|
|
@@ -3670,7 +3641,7 @@ var IdentityManager = class {
|
|
|
3670
3641
|
});
|
|
3671
3642
|
invariant8(identityRecord.haloSpace.dataFeedKey, void 0, {
|
|
3672
3643
|
F: __dxlog_file13,
|
|
3673
|
-
L:
|
|
3644
|
+
L: 352,
|
|
3674
3645
|
S: this,
|
|
3675
3646
|
A: [
|
|
3676
3647
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -3694,10 +3665,12 @@ var IdentityManager = class {
|
|
|
3694
3665
|
});
|
|
3695
3666
|
await space.setControlFeed(controlFeed);
|
|
3696
3667
|
await space.setDataFeed(dataFeed);
|
|
3668
|
+
const did = await createDidFromIdentityKey3(identityRecord.identityKey);
|
|
3697
3669
|
const identity = new Identity({
|
|
3698
3670
|
space,
|
|
3699
3671
|
presence,
|
|
3700
3672
|
signer: this._keyring,
|
|
3673
|
+
did,
|
|
3701
3674
|
identityKey: identityRecord.identityKey,
|
|
3702
3675
|
deviceKey: identityRecord.deviceKey,
|
|
3703
3676
|
edgeConnection: this._edgeConnection,
|
|
@@ -3707,7 +3680,7 @@ var IdentityManager = class {
|
|
|
3707
3680
|
identityKey: identityRecord.identityKey
|
|
3708
3681
|
}, {
|
|
3709
3682
|
F: __dxlog_file13,
|
|
3710
|
-
L:
|
|
3683
|
+
L: 383,
|
|
3711
3684
|
S: this,
|
|
3712
3685
|
C: (f, a) => f(...a)
|
|
3713
3686
|
});
|
|
@@ -3732,7 +3705,7 @@ var IdentityManager = class {
|
|
|
3732
3705
|
onAuthFailure: () => {
|
|
3733
3706
|
log10.warn("auth failure", void 0, {
|
|
3734
3707
|
F: __dxlog_file13,
|
|
3735
|
-
L:
|
|
3708
|
+
L: 408,
|
|
3736
3709
|
S: this,
|
|
3737
3710
|
C: (f, a) => f(...a)
|
|
3738
3711
|
});
|
|
@@ -3756,7 +3729,7 @@ IdentityManager = _ts_decorate5([
|
|
|
3756
3729
|
|
|
3757
3730
|
// packages/sdk/client-services/src/packlets/identity/identity-service.ts
|
|
3758
3731
|
import { Trigger as Trigger4, sleep as sleep2 } from "@dxos/async";
|
|
3759
|
-
import { Stream as Stream8 } from "@dxos/codec-protobuf";
|
|
3732
|
+
import { Stream as Stream8 } from "@dxos/codec-protobuf/stream";
|
|
3760
3733
|
import { Resource as Resource5 } from "@dxos/context";
|
|
3761
3734
|
import { createCredential as createCredential2, signPresentation } from "@dxos/credentials";
|
|
3762
3735
|
import { invariant as invariant9 } from "@dxos/invariant";
|
|
@@ -3795,7 +3768,7 @@ var IdentityServiceImpl = class extends Resource5 {
|
|
|
3795
3768
|
const identity = this._identityManager.identity;
|
|
3796
3769
|
invariant9(identity, void 0, {
|
|
3797
3770
|
F: __dxlog_file14,
|
|
3798
|
-
L:
|
|
3771
|
+
L: 61,
|
|
3799
3772
|
S: this,
|
|
3800
3773
|
A: [
|
|
3801
3774
|
"identity",
|
|
@@ -3818,6 +3791,7 @@ var IdentityServiceImpl = class extends Resource5 {
|
|
|
3818
3791
|
return void 0;
|
|
3819
3792
|
}
|
|
3820
3793
|
return {
|
|
3794
|
+
did: this._identityManager.identity.did,
|
|
3821
3795
|
identityKey: this._identityManager.identity.identityKey,
|
|
3822
3796
|
spaceKey: this._identityManager.identity.space.key,
|
|
3823
3797
|
profile: this._identityManager.identity.profileDocument
|
|
@@ -3826,7 +3800,7 @@ var IdentityServiceImpl = class extends Resource5 {
|
|
|
3826
3800
|
async updateProfile(profile) {
|
|
3827
3801
|
invariant9(this._identityManager.identity, "Identity not initialized.", {
|
|
3828
3802
|
F: __dxlog_file14,
|
|
3829
|
-
L:
|
|
3803
|
+
L: 88,
|
|
3830
3804
|
S: this,
|
|
3831
3805
|
A: [
|
|
3832
3806
|
"this._identityManager.identity",
|
|
@@ -3837,18 +3811,29 @@ var IdentityServiceImpl = class extends Resource5 {
|
|
|
3837
3811
|
await this._onProfileUpdate?.(this._identityManager.identity.profileDocument);
|
|
3838
3812
|
return this._getIdentity();
|
|
3839
3813
|
}
|
|
3840
|
-
async
|
|
3841
|
-
return this._recoveryManager.
|
|
3814
|
+
async createRecoveryCredential(request) {
|
|
3815
|
+
return this._recoveryManager.createRecoveryCredential(request);
|
|
3816
|
+
}
|
|
3817
|
+
async requestRecoveryChallenge() {
|
|
3818
|
+
return this._recoveryManager.requestRecoveryChallenge();
|
|
3842
3819
|
}
|
|
3843
3820
|
async recoverIdentity(request) {
|
|
3844
|
-
|
|
3821
|
+
if (request.recoveryCode) {
|
|
3822
|
+
await this._recoveryManager.recoverIdentity({
|
|
3823
|
+
recoveryCode: request.recoveryCode
|
|
3824
|
+
});
|
|
3825
|
+
} else if (request.external) {
|
|
3826
|
+
await this._recoveryManager.recoverIdentityWithExternalSignature(request.external);
|
|
3827
|
+
} else {
|
|
3828
|
+
throw new Error("Invalid request.");
|
|
3829
|
+
}
|
|
3845
3830
|
return this._getIdentity();
|
|
3846
3831
|
}
|
|
3847
3832
|
// TODO(burdon): Rename createPresentation?
|
|
3848
3833
|
async signPresentation({ presentation, nonce }) {
|
|
3849
3834
|
invariant9(this._identityManager.identity, "Identity not initialized.", {
|
|
3850
3835
|
F: __dxlog_file14,
|
|
3851
|
-
L:
|
|
3836
|
+
L: 116,
|
|
3852
3837
|
S: this,
|
|
3853
3838
|
A: [
|
|
3854
3839
|
"this._identityManager.identity",
|
|
@@ -3867,7 +3852,7 @@ var IdentityServiceImpl = class extends Resource5 {
|
|
|
3867
3852
|
const identity = this._identityManager.identity;
|
|
3868
3853
|
invariant9(identity, "Identity not initialized.", {
|
|
3869
3854
|
F: __dxlog_file14,
|
|
3870
|
-
L:
|
|
3855
|
+
L: 130,
|
|
3871
3856
|
S: this,
|
|
3872
3857
|
A: [
|
|
3873
3858
|
"identity",
|
|
@@ -3905,7 +3890,7 @@ var IdentityServiceImpl = class extends Resource5 {
|
|
|
3905
3890
|
duplicate: space.id
|
|
3906
3891
|
}, {
|
|
3907
3892
|
F: __dxlog_file14,
|
|
3908
|
-
L:
|
|
3893
|
+
L: 164,
|
|
3909
3894
|
S: this,
|
|
3910
3895
|
C: (f, a) => f(...a)
|
|
3911
3896
|
});
|
|
@@ -3919,7 +3904,7 @@ var IdentityServiceImpl = class extends Resource5 {
|
|
|
3919
3904
|
}, (err) => {
|
|
3920
3905
|
log11.catch(err, void 0, {
|
|
3921
3906
|
F: __dxlog_file14,
|
|
3922
|
-
L:
|
|
3907
|
+
L: 175,
|
|
3923
3908
|
S: this,
|
|
3924
3909
|
C: (f, a) => f(...a)
|
|
3925
3910
|
});
|
|
@@ -4700,14 +4685,14 @@ var DeviceInvitationProtocol = class {
|
|
|
4700
4685
|
|
|
4701
4686
|
// packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
|
|
4702
4687
|
import { scheduleTask as scheduleTask7, TimeoutError as TimeoutError2 } from "@dxos/async";
|
|
4703
|
-
import { INVITATION_TIMEOUT } from "@dxos/client-protocol";
|
|
4688
|
+
import { INVITATION_TIMEOUT, getExpirationTime } from "@dxos/client-protocol";
|
|
4704
4689
|
import { ContextDisposedError as ContextDisposedError3 } from "@dxos/context";
|
|
4705
4690
|
import { createKeyPair, sign as sign2 } from "@dxos/crypto";
|
|
4706
4691
|
import { invariant as invariant15 } from "@dxos/invariant";
|
|
4707
4692
|
import { PublicKey as PublicKey11 } from "@dxos/keys";
|
|
4708
4693
|
import { log as log18 } from "@dxos/log";
|
|
4709
4694
|
import { createTeleportProtocolFactory } from "@dxos/network-manager";
|
|
4710
|
-
import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError3, trace as trace7 } from "@dxos/protocols";
|
|
4695
|
+
import { InvalidInvitationError, InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError3, trace as trace7 } from "@dxos/protocols";
|
|
4711
4696
|
import { Invitation as Invitation7 } from "@dxos/protocols/proto/dxos/client/services";
|
|
4712
4697
|
import { AuthenticationResponse as AuthenticationResponse2 } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
4713
4698
|
import { InvitationOptions as InvitationOptions4 } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
@@ -4730,6 +4715,12 @@ import { Invitation as Invitation3 } from "@dxos/protocols/proto/dxos/client/ser
|
|
|
4730
4715
|
var stateToString = (state) => {
|
|
4731
4716
|
return Object.entries(Invitation3.State).find(([key, val]) => val === state)?.[0] ?? "unknown";
|
|
4732
4717
|
};
|
|
4718
|
+
var computeExpirationTime = (invitation) => {
|
|
4719
|
+
if (!invitation.lifetime) {
|
|
4720
|
+
return;
|
|
4721
|
+
}
|
|
4722
|
+
return new Date((invitation.created?.getTime() ?? Date.now()) + invitation.lifetime * 1e3);
|
|
4723
|
+
};
|
|
4733
4724
|
var tryAcquireBeforeContextDisposed = async (ctx, mutex) => {
|
|
4734
4725
|
let guard;
|
|
4735
4726
|
return cancelWithContext3(ctx, (async () => {
|
|
@@ -5745,18 +5736,19 @@ var InvitationsHandler = class {
|
|
|
5745
5736
|
});
|
|
5746
5737
|
return extension;
|
|
5747
5738
|
};
|
|
5748
|
-
|
|
5749
|
-
|
|
5739
|
+
const expiresOn = getExpirationTime(invitation);
|
|
5740
|
+
if (expiresOn) {
|
|
5741
|
+
if (expiresOn.getTime() < Date.now()) {
|
|
5750
5742
|
log18.warn("invitation has already expired", void 0, {
|
|
5751
5743
|
F: __dxlog_file22,
|
|
5752
|
-
L:
|
|
5744
|
+
L: 194,
|
|
5753
5745
|
S: this,
|
|
5754
5746
|
C: (f, a) => f(...a)
|
|
5755
5747
|
});
|
|
5756
5748
|
guardedState.set(null, Invitation7.State.EXPIRED);
|
|
5757
5749
|
void ctx.dispose().catch((err) => log18.catch(err, void 0, {
|
|
5758
5750
|
F: __dxlog_file22,
|
|
5759
|
-
L:
|
|
5751
|
+
L: 196,
|
|
5760
5752
|
S: this,
|
|
5761
5753
|
C: (f, a) => f(...a)
|
|
5762
5754
|
}));
|
|
@@ -5767,7 +5759,7 @@ var InvitationsHandler = class {
|
|
|
5767
5759
|
guardedState.set(null, Invitation7.State.EXPIRED);
|
|
5768
5760
|
metrics.increment("dxos.invitation.expired");
|
|
5769
5761
|
await ctx.dispose();
|
|
5770
|
-
},
|
|
5762
|
+
}, expiresOn.getTime() - Date.now());
|
|
5771
5763
|
}
|
|
5772
5764
|
let swarmConnection;
|
|
5773
5765
|
scheduleTask7(ctx, async () => {
|
|
@@ -5783,7 +5775,7 @@ var InvitationsHandler = class {
|
|
|
5783
5775
|
type: invitation.type
|
|
5784
5776
|
}, {
|
|
5785
5777
|
F: __dxlog_file22,
|
|
5786
|
-
L:
|
|
5778
|
+
L: 227,
|
|
5787
5779
|
S: this,
|
|
5788
5780
|
C: (f, a) => f(...a)
|
|
5789
5781
|
});
|
|
@@ -5791,7 +5783,7 @@ var InvitationsHandler = class {
|
|
|
5791
5783
|
if (deviceProfile) {
|
|
5792
5784
|
invariant15(invitation.kind === Invitation7.Kind.DEVICE, "deviceProfile provided for non-device invitation", {
|
|
5793
5785
|
F: __dxlog_file22,
|
|
5794
|
-
L:
|
|
5786
|
+
L: 236,
|
|
5795
5787
|
S: this,
|
|
5796
5788
|
A: [
|
|
5797
5789
|
"invitation.kind === Invitation.Kind.DEVICE",
|
|
@@ -5809,7 +5801,7 @@ var InvitationsHandler = class {
|
|
|
5809
5801
|
triedPeers: triedPeersIds.size
|
|
5810
5802
|
}, {
|
|
5811
5803
|
F: __dxlog_file22,
|
|
5812
|
-
L:
|
|
5804
|
+
L: 244,
|
|
5813
5805
|
S: this,
|
|
5814
5806
|
C: (f, a) => f(...a)
|
|
5815
5807
|
});
|
|
@@ -5836,7 +5828,7 @@ var InvitationsHandler = class {
|
|
|
5836
5828
|
currentState: guardedState.current.state
|
|
5837
5829
|
}, {
|
|
5838
5830
|
F: __dxlog_file22,
|
|
5839
|
-
L:
|
|
5831
|
+
L: 272,
|
|
5840
5832
|
S: this,
|
|
5841
5833
|
C: (f, a) => f(...a)
|
|
5842
5834
|
});
|
|
@@ -5854,7 +5846,7 @@ var InvitationsHandler = class {
|
|
|
5854
5846
|
id: traceId
|
|
5855
5847
|
}), {
|
|
5856
5848
|
F: __dxlog_file22,
|
|
5857
|
-
L:
|
|
5849
|
+
L: 284,
|
|
5858
5850
|
S: this,
|
|
5859
5851
|
C: (f, a) => f(...a)
|
|
5860
5852
|
});
|
|
@@ -5866,7 +5858,7 @@ var InvitationsHandler = class {
|
|
|
5866
5858
|
...protocol.toJSON()
|
|
5867
5859
|
}, {
|
|
5868
5860
|
F: __dxlog_file22,
|
|
5869
|
-
L:
|
|
5861
|
+
L: 295,
|
|
5870
5862
|
S: this,
|
|
5871
5863
|
C: (f, a) => f(...a)
|
|
5872
5864
|
});
|
|
@@ -5876,7 +5868,7 @@ var InvitationsHandler = class {
|
|
|
5876
5868
|
...protocol.toJSON()
|
|
5877
5869
|
}, {
|
|
5878
5870
|
F: __dxlog_file22,
|
|
5879
|
-
L:
|
|
5871
|
+
L: 299,
|
|
5880
5872
|
S: this,
|
|
5881
5873
|
C: (f, a) => f(...a)
|
|
5882
5874
|
});
|
|
@@ -5890,7 +5882,7 @@ var InvitationsHandler = class {
|
|
|
5890
5882
|
authMethod: introductionResponse.authMethod
|
|
5891
5883
|
}, {
|
|
5892
5884
|
F: __dxlog_file22,
|
|
5893
|
-
L:
|
|
5885
|
+
L: 307,
|
|
5894
5886
|
S: this,
|
|
5895
5887
|
C: (f, a) => f(...a)
|
|
5896
5888
|
});
|
|
@@ -5912,7 +5904,7 @@ var InvitationsHandler = class {
|
|
|
5912
5904
|
...protocol.toJSON()
|
|
5913
5905
|
}, {
|
|
5914
5906
|
F: __dxlog_file22,
|
|
5915
|
-
L:
|
|
5907
|
+
L: 337,
|
|
5916
5908
|
S: this,
|
|
5917
5909
|
C: (f, a) => f(...a)
|
|
5918
5910
|
});
|
|
@@ -5925,7 +5917,7 @@ var InvitationsHandler = class {
|
|
|
5925
5917
|
...protocol.toJSON()
|
|
5926
5918
|
}, {
|
|
5927
5919
|
F: __dxlog_file22,
|
|
5928
|
-
L:
|
|
5920
|
+
L: 351,
|
|
5929
5921
|
S: this,
|
|
5930
5922
|
C: (f, a) => f(...a)
|
|
5931
5923
|
});
|
|
@@ -5938,7 +5930,7 @@ var InvitationsHandler = class {
|
|
|
5938
5930
|
id: traceId
|
|
5939
5931
|
}), {
|
|
5940
5932
|
F: __dxlog_file22,
|
|
5941
|
-
L:
|
|
5933
|
+
L: 360,
|
|
5942
5934
|
S: this,
|
|
5943
5935
|
C: (f, a) => f(...a)
|
|
5944
5936
|
});
|
|
@@ -5948,7 +5940,7 @@ var InvitationsHandler = class {
|
|
|
5948
5940
|
...protocol.toJSON()
|
|
5949
5941
|
}, {
|
|
5950
5942
|
F: __dxlog_file22,
|
|
5951
|
-
L:
|
|
5943
|
+
L: 363,
|
|
5952
5944
|
S: this,
|
|
5953
5945
|
C: (f, a) => f(...a)
|
|
5954
5946
|
});
|
|
@@ -5956,7 +5948,7 @@ var InvitationsHandler = class {
|
|
|
5956
5948
|
} else {
|
|
5957
5949
|
log18.verbose("auth failed", err, {
|
|
5958
5950
|
F: __dxlog_file22,
|
|
5959
|
-
L:
|
|
5951
|
+
L: 366,
|
|
5960
5952
|
S: this,
|
|
5961
5953
|
C: (f, a) => f(...a)
|
|
5962
5954
|
});
|
|
@@ -5968,7 +5960,7 @@ var InvitationsHandler = class {
|
|
|
5968
5960
|
error: err
|
|
5969
5961
|
}), {
|
|
5970
5962
|
F: __dxlog_file22,
|
|
5971
|
-
L:
|
|
5963
|
+
L: 370,
|
|
5972
5964
|
S: this,
|
|
5973
5965
|
C: (f, a) => f(...a)
|
|
5974
5966
|
});
|
|
@@ -5984,7 +5976,7 @@ var InvitationsHandler = class {
|
|
|
5984
5976
|
...protocol.toJSON()
|
|
5985
5977
|
}, {
|
|
5986
5978
|
F: __dxlog_file22,
|
|
5987
|
-
L:
|
|
5979
|
+
L: 379,
|
|
5988
5980
|
S: this,
|
|
5989
5981
|
C: (f, a) => f(...a)
|
|
5990
5982
|
});
|
|
@@ -5992,7 +5984,7 @@ var InvitationsHandler = class {
|
|
|
5992
5984
|
} else {
|
|
5993
5985
|
log18.verbose("auth failed", err, {
|
|
5994
5986
|
F: __dxlog_file22,
|
|
5995
|
-
L:
|
|
5987
|
+
L: 382,
|
|
5996
5988
|
S: this,
|
|
5997
5989
|
C: (f, a) => f(...a)
|
|
5998
5990
|
});
|
|
@@ -6009,7 +6001,7 @@ var InvitationsHandler = class {
|
|
|
6009
6001
|
...protocol.toJSON()
|
|
6010
6002
|
}, {
|
|
6011
6003
|
F: __dxlog_file22,
|
|
6012
|
-
L:
|
|
6004
|
+
L: 394,
|
|
6013
6005
|
S: this,
|
|
6014
6006
|
C: (f, a) => f(...a)
|
|
6015
6007
|
});
|
|
@@ -6022,14 +6014,14 @@ var InvitationsHandler = class {
|
|
|
6022
6014
|
});
|
|
6023
6015
|
edgeInvitationHandler.handle(ctx, guardedState, protocol, deviceProfile);
|
|
6024
6016
|
scheduleTask7(ctx, async () => {
|
|
6025
|
-
const error =
|
|
6017
|
+
const error = checkInvitation(protocol, invitation);
|
|
6026
6018
|
if (error) {
|
|
6027
6019
|
stream.error(error);
|
|
6028
6020
|
await ctx.dispose();
|
|
6029
6021
|
} else {
|
|
6030
6022
|
invariant15(invitation.swarmKey, void 0, {
|
|
6031
6023
|
F: __dxlog_file22,
|
|
6032
|
-
L:
|
|
6024
|
+
L: 406,
|
|
6033
6025
|
S: this,
|
|
6034
6026
|
A: [
|
|
6035
6027
|
"invitation.swarmKey",
|
|
@@ -6073,7 +6065,7 @@ var InvitationsHandler = class {
|
|
|
6073
6065
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
6074
6066
|
log18("guest waiting for authentication code...", void 0, {
|
|
6075
6067
|
F: __dxlog_file22,
|
|
6076
|
-
L:
|
|
6068
|
+
L: 458,
|
|
6077
6069
|
S: this,
|
|
6078
6070
|
C: (f, a) => f(...a)
|
|
6079
6071
|
});
|
|
@@ -6081,7 +6073,7 @@ var InvitationsHandler = class {
|
|
|
6081
6073
|
const authCode = await authenticated.wait(options);
|
|
6082
6074
|
log18("sending authentication request", void 0, {
|
|
6083
6075
|
F: __dxlog_file22,
|
|
6084
|
-
L:
|
|
6076
|
+
L: 462,
|
|
6085
6077
|
S: this,
|
|
6086
6078
|
C: (f, a) => f(...a)
|
|
6087
6079
|
});
|
|
@@ -6100,7 +6092,7 @@ var InvitationsHandler = class {
|
|
|
6100
6092
|
attempt
|
|
6101
6093
|
}, {
|
|
6102
6094
|
F: __dxlog_file22,
|
|
6103
|
-
L:
|
|
6095
|
+
L: 473,
|
|
6104
6096
|
S: this,
|
|
6105
6097
|
C: (f, a) => f(...a)
|
|
6106
6098
|
});
|
|
@@ -6118,7 +6110,7 @@ var InvitationsHandler = class {
|
|
|
6118
6110
|
}
|
|
6119
6111
|
log18("sending authentication request", void 0, {
|
|
6120
6112
|
F: __dxlog_file22,
|
|
6121
|
-
L:
|
|
6113
|
+
L: 492,
|
|
6122
6114
|
S: this,
|
|
6123
6115
|
C: (f, a) => f(...a)
|
|
6124
6116
|
});
|
|
@@ -6131,6 +6123,13 @@ var InvitationsHandler = class {
|
|
|
6131
6123
|
}
|
|
6132
6124
|
}
|
|
6133
6125
|
};
|
|
6126
|
+
var checkInvitation = (protocol, invitation) => {
|
|
6127
|
+
const expiresOn = getExpirationTime(invitation);
|
|
6128
|
+
if (expiresOn && expiresOn.getTime() < Date.now()) {
|
|
6129
|
+
return new InvalidInvitationError("Invitation already expired.");
|
|
6130
|
+
}
|
|
6131
|
+
return protocol.checkInvitation(invitation);
|
|
6132
|
+
};
|
|
6134
6133
|
var createAdmissionKeypair = () => {
|
|
6135
6134
|
const keypair = createKeyPair();
|
|
6136
6135
|
return {
|
|
@@ -6140,7 +6139,7 @@ var createAdmissionKeypair = () => {
|
|
|
6140
6139
|
};
|
|
6141
6140
|
|
|
6142
6141
|
// packages/sdk/client-services/src/packlets/invitations/invitations-service.ts
|
|
6143
|
-
import { Stream as Stream9 } from "@dxos/codec-protobuf";
|
|
6142
|
+
import { Stream as Stream9 } from "@dxos/codec-protobuf/stream";
|
|
6144
6143
|
import { QueryInvitationsResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
6145
6144
|
import { trace as trace8 } from "@dxos/tracing";
|
|
6146
6145
|
var InvitationsServiceImpl = class {
|
|
@@ -6245,7 +6244,7 @@ import { createCancelDelegatedSpaceInvitationCredential, createDelegatedSpaceInv
|
|
|
6245
6244
|
import { writeMessages as writeMessages4 } from "@dxos/feed-store";
|
|
6246
6245
|
import { invariant as invariant16 } from "@dxos/invariant";
|
|
6247
6246
|
import { log as log19 } from "@dxos/log";
|
|
6248
|
-
import { AlreadyJoinedError as AlreadyJoinedError3, AuthorizationError as AuthorizationError2, InvalidInvitationError, SpaceNotFoundError as SpaceNotFoundError2 } from "@dxos/protocols";
|
|
6247
|
+
import { AlreadyJoinedError as AlreadyJoinedError3, AuthorizationError as AuthorizationError2, InvalidInvitationError as InvalidInvitationError2, SpaceNotFoundError as SpaceNotFoundError2 } from "@dxos/protocols";
|
|
6249
6248
|
import { Invitation as Invitation8 } from "@dxos/protocols/proto/dxos/client/services";
|
|
6250
6249
|
import { SpaceMember as SpaceMember6 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
6251
6250
|
var __dxlog_file23 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
|
|
@@ -6265,7 +6264,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6265
6264
|
}
|
|
6266
6265
|
checkCanInviteNewMembers() {
|
|
6267
6266
|
if (this._spaceKey == null) {
|
|
6268
|
-
return new
|
|
6267
|
+
return new InvalidInvitationError2("No spaceKey was provided for a space invitation.");
|
|
6269
6268
|
}
|
|
6270
6269
|
const space = this._spaceManager.spaces.get(this._spaceKey);
|
|
6271
6270
|
if (space == null) {
|
|
@@ -6279,7 +6278,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6279
6278
|
getInvitationContext() {
|
|
6280
6279
|
invariant16(this._spaceKey, void 0, {
|
|
6281
6280
|
F: __dxlog_file23,
|
|
6282
|
-
L:
|
|
6281
|
+
L: 65,
|
|
6283
6282
|
S: this,
|
|
6284
6283
|
A: [
|
|
6285
6284
|
"this._spaceKey",
|
|
@@ -6289,7 +6288,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6289
6288
|
const space = this._spaceManager.spaces.get(this._spaceKey);
|
|
6290
6289
|
invariant16(space, void 0, {
|
|
6291
6290
|
F: __dxlog_file23,
|
|
6292
|
-
L:
|
|
6291
|
+
L: 67,
|
|
6293
6292
|
S: this,
|
|
6294
6293
|
A: [
|
|
6295
6294
|
"space",
|
|
@@ -6305,7 +6304,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6305
6304
|
async admit(invitation, request, guestProfile) {
|
|
6306
6305
|
invariant16(this._spaceKey && request.space, void 0, {
|
|
6307
6306
|
F: __dxlog_file23,
|
|
6308
|
-
L:
|
|
6307
|
+
L: 80,
|
|
6309
6308
|
S: this,
|
|
6310
6309
|
A: [
|
|
6311
6310
|
"this._spaceKey && request.space",
|
|
@@ -6317,7 +6316,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6317
6316
|
guest: request.space.deviceKey
|
|
6318
6317
|
}, {
|
|
6319
6318
|
F: __dxlog_file23,
|
|
6320
|
-
L:
|
|
6319
|
+
L: 81,
|
|
6321
6320
|
S: this,
|
|
6322
6321
|
C: (f, a) => f(...a)
|
|
6323
6322
|
});
|
|
@@ -6339,7 +6338,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6339
6338
|
async delegate(invitation) {
|
|
6340
6339
|
invariant16(this._spaceKey, void 0, {
|
|
6341
6340
|
F: __dxlog_file23,
|
|
6342
|
-
L:
|
|
6341
|
+
L: 101,
|
|
6343
6342
|
S: this,
|
|
6344
6343
|
A: [
|
|
6345
6344
|
"this._spaceKey",
|
|
@@ -6349,7 +6348,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6349
6348
|
const space = this._spaceManager.spaces.get(this._spaceKey);
|
|
6350
6349
|
invariant16(space, void 0, {
|
|
6351
6350
|
F: __dxlog_file23,
|
|
6352
|
-
L:
|
|
6351
|
+
L: 103,
|
|
6353
6352
|
S: this,
|
|
6354
6353
|
A: [
|
|
6355
6354
|
"space",
|
|
@@ -6359,7 +6358,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6359
6358
|
if (invitation.authMethod === Invitation8.AuthMethod.KNOWN_PUBLIC_KEY) {
|
|
6360
6359
|
invariant16(invitation.guestKeypair?.publicKey, void 0, {
|
|
6361
6360
|
F: __dxlog_file23,
|
|
6362
|
-
L:
|
|
6361
|
+
L: 105,
|
|
6363
6362
|
S: this,
|
|
6364
6363
|
A: [
|
|
6365
6364
|
"invitation.guestKeypair?.publicKey",
|
|
@@ -6372,7 +6371,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6372
6371
|
id: invitation.invitationId
|
|
6373
6372
|
}, {
|
|
6374
6373
|
F: __dxlog_file23,
|
|
6375
|
-
L:
|
|
6374
|
+
L: 108,
|
|
6376
6375
|
S: this,
|
|
6377
6376
|
C: (f, a) => f(...a)
|
|
6378
6377
|
});
|
|
@@ -6381,13 +6380,13 @@ var SpaceInvitationProtocol = class {
|
|
|
6381
6380
|
authMethod: invitation.authMethod,
|
|
6382
6381
|
swarmKey: invitation.swarmKey,
|
|
6383
6382
|
role: invitation.role ?? SpaceMember6.Role.ADMIN,
|
|
6384
|
-
expiresOn:
|
|
6383
|
+
expiresOn: computeExpirationTime(invitation),
|
|
6385
6384
|
multiUse: invitation.multiUse ?? false,
|
|
6386
6385
|
guestKey: invitation.authMethod === Invitation8.AuthMethod.KNOWN_PUBLIC_KEY ? invitation.guestKeypair.publicKey : void 0
|
|
6387
6386
|
});
|
|
6388
6387
|
invariant16(credential.credential, void 0, {
|
|
6389
6388
|
F: __dxlog_file23,
|
|
6390
|
-
L:
|
|
6389
|
+
L: 126,
|
|
6391
6390
|
S: this,
|
|
6392
6391
|
A: [
|
|
6393
6392
|
"credential.credential",
|
|
@@ -6402,7 +6401,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6402
6401
|
async cancelDelegation(invitation) {
|
|
6403
6402
|
invariant16(this._spaceKey, void 0, {
|
|
6404
6403
|
F: __dxlog_file23,
|
|
6405
|
-
L:
|
|
6404
|
+
L: 132,
|
|
6406
6405
|
S: this,
|
|
6407
6406
|
A: [
|
|
6408
6407
|
"this._spaceKey",
|
|
@@ -6411,7 +6410,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6411
6410
|
});
|
|
6412
6411
|
invariant16(invitation.type === Invitation8.Type.DELEGATED && invitation.delegationCredentialId, void 0, {
|
|
6413
6412
|
F: __dxlog_file23,
|
|
6414
|
-
L:
|
|
6413
|
+
L: 133,
|
|
6415
6414
|
S: this,
|
|
6416
6415
|
A: [
|
|
6417
6416
|
"invitation.type === Invitation.Type.DELEGATED && invitation.delegationCredentialId",
|
|
@@ -6421,7 +6420,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6421
6420
|
const space = this._spaceManager.spaces.get(this._spaceKey);
|
|
6422
6421
|
invariant16(space, void 0, {
|
|
6423
6422
|
F: __dxlog_file23,
|
|
6424
|
-
L:
|
|
6423
|
+
L: 135,
|
|
6425
6424
|
S: this,
|
|
6426
6425
|
A: [
|
|
6427
6426
|
"space",
|
|
@@ -6433,14 +6432,14 @@ var SpaceInvitationProtocol = class {
|
|
|
6433
6432
|
id: invitation.invitationId
|
|
6434
6433
|
}, {
|
|
6435
6434
|
F: __dxlog_file23,
|
|
6436
|
-
L:
|
|
6435
|
+
L: 137,
|
|
6437
6436
|
S: this,
|
|
6438
6437
|
C: (f, a) => f(...a)
|
|
6439
6438
|
});
|
|
6440
6439
|
const credential = await createCancelDelegatedSpaceInvitationCredential(this._signingContext.credentialSigner, space.key, invitation.delegationCredentialId);
|
|
6441
6440
|
invariant16(credential.credential, void 0, {
|
|
6442
6441
|
F: __dxlog_file23,
|
|
6443
|
-
L:
|
|
6442
|
+
L: 144,
|
|
6444
6443
|
S: this,
|
|
6445
6444
|
A: [
|
|
6446
6445
|
"credential.credential",
|
|
@@ -6453,7 +6452,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6453
6452
|
}
|
|
6454
6453
|
checkInvitation(invitation) {
|
|
6455
6454
|
if (invitation.spaceKey == null) {
|
|
6456
|
-
return new
|
|
6455
|
+
return new InvalidInvitationError2("No spaceKey was provided for a space invitation.");
|
|
6457
6456
|
}
|
|
6458
6457
|
if (this._spaceManager.spaces.has(invitation.spaceKey)) {
|
|
6459
6458
|
return new AlreadyJoinedError3("Already joined space.");
|
|
@@ -6479,7 +6478,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6479
6478
|
async accept(response) {
|
|
6480
6479
|
invariant16(response.space, void 0, {
|
|
6481
6480
|
F: __dxlog_file23,
|
|
6482
|
-
L:
|
|
6481
|
+
L: 179,
|
|
6483
6482
|
S: this,
|
|
6484
6483
|
A: [
|
|
6485
6484
|
"response.space",
|
|
@@ -6490,7 +6489,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6490
6489
|
const assertion = getCredentialAssertion5(credential);
|
|
6491
6490
|
invariant16(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
|
|
6492
6491
|
F: __dxlog_file23,
|
|
6493
|
-
L:
|
|
6492
|
+
L: 182,
|
|
6494
6493
|
S: this,
|
|
6495
6494
|
A: [
|
|
6496
6495
|
"assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -6499,7 +6498,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6499
6498
|
});
|
|
6500
6499
|
invariant16(credential.subject.id.equals(this._signingContext.identityKey), void 0, {
|
|
6501
6500
|
F: __dxlog_file23,
|
|
6502
|
-
L:
|
|
6501
|
+
L: 183,
|
|
6503
6502
|
S: this,
|
|
6504
6503
|
A: [
|
|
6505
6504
|
"credential.subject.id.equals(this._signingContext.identityKey)",
|
|
@@ -6735,7 +6734,7 @@ var InvitationsManager = class {
|
|
|
6735
6734
|
}
|
|
6736
6735
|
}
|
|
6737
6736
|
_createInvitation(protocol, _options) {
|
|
6738
|
-
const { invitationId = PublicKey12.random().toHex(), type = Invitation9.Type.INTERACTIVE, authMethod = Invitation9.AuthMethod.SHARED_SECRET, state = Invitation9.State.INIT, timeout = INVITATION_TIMEOUT2, swarmKey = PublicKey12.random(), persistent = _options?.authMethod !== Invitation9.AuthMethod.KNOWN_PUBLIC_KEY, created = /* @__PURE__ */ new Date(), guestKeypair = void 0, role = SpaceMember7.Role.ADMIN, lifetime = 86400, multiUse = false, ...options } = _options ?? {};
|
|
6737
|
+
const { invitationId = PublicKey12.random().toHex(), type = Invitation9.Type.INTERACTIVE, authMethod = Invitation9.AuthMethod.SHARED_SECRET, state = Invitation9.State.INIT, timeout = INVITATION_TIMEOUT2, swarmKey = PublicKey12.random(), persistent = _options?.authMethod !== Invitation9.AuthMethod.KNOWN_PUBLIC_KEY, created = /* @__PURE__ */ new Date(), guestKeypair = void 0, role = SpaceMember7.Role.ADMIN, lifetime = 86400 * 7, multiUse = false, ...options } = _options ?? {};
|
|
6739
6738
|
const authCode = options?.authCode ?? (authMethod === Invitation9.AuthMethod.SHARED_SECRET ? generatePasscode(AUTHENTICATION_CODE_LENGTH) : void 0);
|
|
6740
6739
|
return {
|
|
6741
6740
|
invitationId,
|
|
@@ -7160,6 +7159,18 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7160
7159
|
haloSpaceKey: this._identity.haloSpaceKey.toHex()
|
|
7161
7160
|
});
|
|
7162
7161
|
const deviceKey = PublicKey13.fromHex(response.deviceKey);
|
|
7162
|
+
if (await this._identity.authorizedDeviceKeys.has(deviceKey)) {
|
|
7163
|
+
log22.info("agent was already added to HALO, ignoring response", {
|
|
7164
|
+
response
|
|
7165
|
+
}, {
|
|
7166
|
+
F: __dxlog_file26,
|
|
7167
|
+
L: 67,
|
|
7168
|
+
S: this,
|
|
7169
|
+
C: (f, a) => f(...a)
|
|
7170
|
+
});
|
|
7171
|
+
this._updateStatus(EdgeAgentStatus.ACTIVE, deviceKey);
|
|
7172
|
+
return;
|
|
7173
|
+
}
|
|
7163
7174
|
await this._identity.admitDevice({
|
|
7164
7175
|
deviceKey,
|
|
7165
7176
|
controlFeedKey: PublicKey13.fromHex(response.feedKey),
|
|
@@ -7168,7 +7179,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7168
7179
|
});
|
|
7169
7180
|
log22("agent created", response, {
|
|
7170
7181
|
F: __dxlog_file26,
|
|
7171
|
-
L:
|
|
7182
|
+
L: 79,
|
|
7172
7183
|
S: this,
|
|
7173
7184
|
C: (f, a) => f(...a)
|
|
7174
7185
|
});
|
|
@@ -7180,7 +7191,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7180
7191
|
isEnabled
|
|
7181
7192
|
}, {
|
|
7182
7193
|
F: __dxlog_file26,
|
|
7183
|
-
L:
|
|
7194
|
+
L: 87,
|
|
7184
7195
|
S: this,
|
|
7185
7196
|
C: (f, a) => f(...a)
|
|
7186
7197
|
});
|
|
@@ -7213,7 +7224,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7213
7224
|
async _fetchAgentStatus() {
|
|
7214
7225
|
invariant18(this._edgeHttpClient, void 0, {
|
|
7215
7226
|
F: __dxlog_file26,
|
|
7216
|
-
L:
|
|
7227
|
+
L: 121,
|
|
7217
7228
|
S: this,
|
|
7218
7229
|
A: [
|
|
7219
7230
|
"this._edgeHttpClient",
|
|
@@ -7223,7 +7234,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7223
7234
|
try {
|
|
7224
7235
|
log22("fetching agent status", void 0, {
|
|
7225
7236
|
F: __dxlog_file26,
|
|
7226
|
-
L:
|
|
7237
|
+
L: 123,
|
|
7227
7238
|
S: this,
|
|
7228
7239
|
C: (f, a) => f(...a)
|
|
7229
7240
|
});
|
|
@@ -7242,7 +7253,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7242
7253
|
err
|
|
7243
7254
|
}, {
|
|
7244
7255
|
F: __dxlog_file26,
|
|
7245
|
-
L:
|
|
7256
|
+
L: 133,
|
|
7246
7257
|
S: this,
|
|
7247
7258
|
C: (f, a) => f(...a)
|
|
7248
7259
|
});
|
|
@@ -7255,7 +7266,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7255
7266
|
retryAfterMs
|
|
7256
7267
|
}, {
|
|
7257
7268
|
F: __dxlog_file26,
|
|
7258
|
-
L:
|
|
7269
|
+
L: 138,
|
|
7259
7270
|
S: this,
|
|
7260
7271
|
C: (f, a) => f(...a)
|
|
7261
7272
|
});
|
|
@@ -7291,7 +7302,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7291
7302
|
spaceId: space.id
|
|
7292
7303
|
}, {
|
|
7293
7304
|
F: __dxlog_file26,
|
|
7294
|
-
L:
|
|
7305
|
+
L: 165,
|
|
7295
7306
|
S: this,
|
|
7296
7307
|
C: (f, a) => f(...a)
|
|
7297
7308
|
});
|
|
@@ -7311,7 +7322,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7311
7322
|
status
|
|
7312
7323
|
}, {
|
|
7313
7324
|
F: __dxlog_file26,
|
|
7314
|
-
L:
|
|
7325
|
+
L: 181,
|
|
7315
7326
|
S: this,
|
|
7316
7327
|
C: (f, a) => f(...a)
|
|
7317
7328
|
});
|
|
@@ -7322,7 +7333,7 @@ _ts_decorate9([
|
|
|
7322
7333
|
], EdgeAgentManager.prototype, "createAgent", null);
|
|
7323
7334
|
|
|
7324
7335
|
// packages/sdk/client-services/src/packlets/agents/edge-agent-service.ts
|
|
7325
|
-
import { Stream as Stream11 } from "@dxos/codec-protobuf";
|
|
7336
|
+
import { Stream as Stream11 } from "@dxos/codec-protobuf/stream";
|
|
7326
7337
|
import { EdgeAgentStatus as EdgeAgentStatus2 } from "@dxos/protocols";
|
|
7327
7338
|
import { QueryAgentStatusResponse, QueryEdgeStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
7328
7339
|
var EdgeAgentServiceImpl = class {
|
|
@@ -7401,7 +7412,7 @@ import { trace as Trace3 } from "@dxos/tracing";
|
|
|
7401
7412
|
import { safeInstanceof } from "@dxos/util";
|
|
7402
7413
|
|
|
7403
7414
|
// packages/sdk/client-services/src/packlets/identity/identity-recovery-manager.ts
|
|
7404
|
-
import { generateSeedPhrase
|
|
7415
|
+
import { generateSeedPhrase, keyPairFromSeedPhrase } from "@dxos/credentials";
|
|
7405
7416
|
import { sign as sign3 } from "@dxos/crypto";
|
|
7406
7417
|
import { invariant as invariant19 } from "@dxos/invariant";
|
|
7407
7418
|
import { PublicKey as PublicKey14 } from "@dxos/keys";
|
|
@@ -7417,27 +7428,41 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7417
7428
|
this._identityProvider = _identityProvider;
|
|
7418
7429
|
this._acceptRecoveredIdentity = _acceptRecoveredIdentity;
|
|
7419
7430
|
}
|
|
7420
|
-
async
|
|
7431
|
+
async createRecoveryCredential({ recoveryKey, algorithm }) {
|
|
7421
7432
|
const identity = this._identityProvider();
|
|
7422
7433
|
invariant19(identity, void 0, {
|
|
7423
7434
|
F: __dxlog_file27,
|
|
7424
|
-
L:
|
|
7435
|
+
L: 37,
|
|
7425
7436
|
S: this,
|
|
7426
7437
|
A: [
|
|
7427
7438
|
"identity",
|
|
7428
7439
|
""
|
|
7429
7440
|
]
|
|
7430
7441
|
});
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7442
|
+
let recoveryCode;
|
|
7443
|
+
if (!recoveryKey) {
|
|
7444
|
+
recoveryCode = generateSeedPhrase();
|
|
7445
|
+
const keypair = keyPairFromSeedPhrase(recoveryCode);
|
|
7446
|
+
recoveryKey = PublicKey14.from(keypair.publicKey);
|
|
7447
|
+
algorithm = "ED25519";
|
|
7448
|
+
}
|
|
7449
|
+
invariant19(algorithm, "Algorithm is required.", {
|
|
7450
|
+
F: __dxlog_file27,
|
|
7451
|
+
L: 47,
|
|
7452
|
+
S: this,
|
|
7453
|
+
A: [
|
|
7454
|
+
"algorithm",
|
|
7455
|
+
"'Algorithm is required.'"
|
|
7456
|
+
]
|
|
7457
|
+
});
|
|
7434
7458
|
const identityKey = identity.identityKey;
|
|
7435
7459
|
const credential = await identity.getIdentityCredentialSigner().createCredential({
|
|
7436
7460
|
subject: identityKey,
|
|
7437
7461
|
assertion: {
|
|
7438
7462
|
"@type": "dxos.halo.credentials.IdentityRecovery",
|
|
7439
7463
|
recoveryKey,
|
|
7440
|
-
identityKey
|
|
7464
|
+
identityKey,
|
|
7465
|
+
algorithm
|
|
7441
7466
|
}
|
|
7442
7467
|
});
|
|
7443
7468
|
const receipt = await identity.controlPipeline.writer.write({
|
|
@@ -7452,20 +7477,81 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7452
7477
|
]
|
|
7453
7478
|
]));
|
|
7454
7479
|
return {
|
|
7455
|
-
|
|
7480
|
+
recoveryCode
|
|
7481
|
+
};
|
|
7482
|
+
}
|
|
7483
|
+
async requestRecoveryChallenge() {
|
|
7484
|
+
invariant19(this._edgeClient, "Not connected to EDGE.", {
|
|
7485
|
+
F: __dxlog_file27,
|
|
7486
|
+
L: 66,
|
|
7487
|
+
S: this,
|
|
7488
|
+
A: [
|
|
7489
|
+
"this._edgeClient",
|
|
7490
|
+
"'Not connected to EDGE.'"
|
|
7491
|
+
]
|
|
7492
|
+
});
|
|
7493
|
+
const deviceKey = await this._keyring.createKey();
|
|
7494
|
+
const controlFeedKey = await this._keyring.createKey();
|
|
7495
|
+
const request = {
|
|
7496
|
+
deviceKey: deviceKey.toHex(),
|
|
7497
|
+
controlFeedKey: controlFeedKey.toHex()
|
|
7498
|
+
};
|
|
7499
|
+
try {
|
|
7500
|
+
await this._edgeClient.recoverIdentity(request);
|
|
7501
|
+
throw new Error("No challenge received.");
|
|
7502
|
+
} catch (error) {
|
|
7503
|
+
if (!(error instanceof EdgeAuthChallengeError2)) {
|
|
7504
|
+
throw error;
|
|
7505
|
+
}
|
|
7506
|
+
return {
|
|
7507
|
+
deviceKey,
|
|
7508
|
+
controlFeedKey,
|
|
7509
|
+
challenge: error.challenge
|
|
7510
|
+
};
|
|
7511
|
+
}
|
|
7512
|
+
}
|
|
7513
|
+
async recoverIdentityWithExternalSignature({ identityDid, deviceKey, controlFeedKey, signature, clientDataJson, authenticatorData }) {
|
|
7514
|
+
invariant19(this._edgeClient, "Not connected to EDGE.", {
|
|
7515
|
+
F: __dxlog_file27,
|
|
7516
|
+
L: 98,
|
|
7517
|
+
S: this,
|
|
7518
|
+
A: [
|
|
7519
|
+
"this._edgeClient",
|
|
7520
|
+
"'Not connected to EDGE.'"
|
|
7521
|
+
]
|
|
7522
|
+
});
|
|
7523
|
+
const request = {
|
|
7524
|
+
identityDid,
|
|
7525
|
+
deviceKey: deviceKey.toHex(),
|
|
7526
|
+
controlFeedKey: controlFeedKey.toHex(),
|
|
7527
|
+
signature: clientDataJson && authenticatorData ? {
|
|
7528
|
+
signature: Buffer.from(signature).toString("base64"),
|
|
7529
|
+
clientDataJson: Buffer.from(clientDataJson).toString("base64"),
|
|
7530
|
+
authenticatorData: Buffer.from(authenticatorData).toString("base64")
|
|
7531
|
+
} : Buffer.from(signature).toString("base64")
|
|
7456
7532
|
};
|
|
7533
|
+
const response = await this._edgeClient.recoverIdentity(request);
|
|
7534
|
+
await this._acceptRecoveredIdentity({
|
|
7535
|
+
authorizedDeviceCredential: decodeCredential(response.deviceAuthCredential),
|
|
7536
|
+
haloGenesisFeedKey: PublicKey14.fromHex(response.genesisFeedKey),
|
|
7537
|
+
haloSpaceKey: PublicKey14.fromHex(response.haloSpaceKey),
|
|
7538
|
+
identityKey: PublicKey14.fromHex(response.identityKey),
|
|
7539
|
+
deviceKey,
|
|
7540
|
+
controlFeedKey,
|
|
7541
|
+
dataFeedKey: await this._keyring.createKey()
|
|
7542
|
+
});
|
|
7457
7543
|
}
|
|
7458
|
-
async recoverIdentity(
|
|
7544
|
+
async recoverIdentity({ recoveryCode }) {
|
|
7459
7545
|
invariant19(this._edgeClient, "Not connected to EDGE.", {
|
|
7460
7546
|
F: __dxlog_file27,
|
|
7461
|
-
L:
|
|
7547
|
+
L: 128,
|
|
7462
7548
|
S: this,
|
|
7463
7549
|
A: [
|
|
7464
7550
|
"this._edgeClient",
|
|
7465
7551
|
"'Not connected to EDGE.'"
|
|
7466
7552
|
]
|
|
7467
7553
|
});
|
|
7468
|
-
const recoveryKeypair =
|
|
7554
|
+
const recoveryKeypair = keyPairFromSeedPhrase(recoveryCode);
|
|
7469
7555
|
const recoveryKey = PublicKey14.from(recoveryKeypair.publicKey);
|
|
7470
7556
|
const deviceKey = await this._keyring.createKey();
|
|
7471
7557
|
const controlFeedKey = await this._keyring.createKey();
|
|
@@ -7489,7 +7575,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7489
7575
|
}
|
|
7490
7576
|
log23.info("recovering identity", response, {
|
|
7491
7577
|
F: __dxlog_file27,
|
|
7492
|
-
L:
|
|
7578
|
+
L: 154,
|
|
7493
7579
|
S: this,
|
|
7494
7580
|
C: (f, a) => f(...a)
|
|
7495
7581
|
});
|
|
@@ -7630,7 +7716,8 @@ var ServiceContext = class extends Resource7 {
|
|
|
7630
7716
|
this.recoveryManager = new EdgeIdentityRecoveryManager(this.keyring, this._edgeHttpClient, () => this.identityManager.identity, this._acceptIdentity.bind(this));
|
|
7631
7717
|
this.echoHost = new EchoHost({
|
|
7632
7718
|
kv: this.level,
|
|
7633
|
-
peerIdProvider: () => this.identityManager.identity?.deviceKey?.toHex()
|
|
7719
|
+
peerIdProvider: () => this.identityManager.identity?.deviceKey?.toHex(),
|
|
7720
|
+
getSpaceKeyByRootDocumentId: (documentId) => this.spaceManager.findSpaceByRootDocumentId(documentId)?.key
|
|
7634
7721
|
});
|
|
7635
7722
|
this._meshReplicator = new MeshEchoReplicator();
|
|
7636
7723
|
this.invitations = new InvitationsHandler(this.networkManager, this._edgeHttpClient, _runtimeParams?.invitationConnectionDefaultParams);
|
|
@@ -7649,7 +7736,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7649
7736
|
await this._checkStorageVersion();
|
|
7650
7737
|
log24("opening...", void 0, {
|
|
7651
7738
|
F: __dxlog_file28,
|
|
7652
|
-
L:
|
|
7739
|
+
L: 199,
|
|
7653
7740
|
S: this,
|
|
7654
7741
|
C: (f, a) => f(...a)
|
|
7655
7742
|
});
|
|
@@ -7657,7 +7744,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7657
7744
|
id: this._instanceId
|
|
7658
7745
|
}), {
|
|
7659
7746
|
F: __dxlog_file28,
|
|
7660
|
-
L:
|
|
7747
|
+
L: 200,
|
|
7661
7748
|
S: this,
|
|
7662
7749
|
C: (f, a) => f(...a)
|
|
7663
7750
|
});
|
|
@@ -7684,7 +7771,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7684
7771
|
count: loadedInvitations.invitations?.length
|
|
7685
7772
|
}, {
|
|
7686
7773
|
F: __dxlog_file28,
|
|
7687
|
-
L:
|
|
7774
|
+
L: 228,
|
|
7688
7775
|
S: this,
|
|
7689
7776
|
C: (f, a) => f(...a)
|
|
7690
7777
|
});
|
|
@@ -7692,13 +7779,13 @@ var ServiceContext = class extends Resource7 {
|
|
|
7692
7779
|
id: this._instanceId
|
|
7693
7780
|
}), {
|
|
7694
7781
|
F: __dxlog_file28,
|
|
7695
|
-
L:
|
|
7782
|
+
L: 230,
|
|
7696
7783
|
S: this,
|
|
7697
7784
|
C: (f, a) => f(...a)
|
|
7698
7785
|
});
|
|
7699
7786
|
log24("opened", void 0, {
|
|
7700
7787
|
F: __dxlog_file28,
|
|
7701
|
-
L:
|
|
7788
|
+
L: 231,
|
|
7702
7789
|
S: this,
|
|
7703
7790
|
C: (f, a) => f(...a)
|
|
7704
7791
|
});
|
|
@@ -7706,7 +7793,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7706
7793
|
async _close(ctx) {
|
|
7707
7794
|
log24("closing...", void 0, {
|
|
7708
7795
|
F: __dxlog_file28,
|
|
7709
|
-
L:
|
|
7796
|
+
L: 235,
|
|
7710
7797
|
S: this,
|
|
7711
7798
|
C: (f, a) => f(...a)
|
|
7712
7799
|
});
|
|
@@ -7725,7 +7812,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7725
7812
|
await this._edgeConnection?.close();
|
|
7726
7813
|
log24("closed", void 0, {
|
|
7727
7814
|
F: __dxlog_file28,
|
|
7728
|
-
L:
|
|
7815
|
+
L: 251,
|
|
7729
7816
|
S: this,
|
|
7730
7817
|
C: (f, a) => f(...a)
|
|
7731
7818
|
});
|
|
@@ -7736,7 +7823,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7736
7823
|
await identity.joinNetwork();
|
|
7737
7824
|
await this._initialize(new Context9(void 0, {
|
|
7738
7825
|
F: __dxlog_file28,
|
|
7739
|
-
L:
|
|
7826
|
+
L: 258
|
|
7740
7827
|
}));
|
|
7741
7828
|
return identity;
|
|
7742
7829
|
}
|
|
@@ -7747,7 +7834,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7747
7834
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
7748
7835
|
invariant20(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
7749
7836
|
F: __dxlog_file28,
|
|
7750
|
-
L:
|
|
7837
|
+
L: 267,
|
|
7751
7838
|
S: this,
|
|
7752
7839
|
A: [
|
|
7753
7840
|
"factory",
|
|
@@ -7773,7 +7860,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7773
7860
|
await this.identityManager.acceptIdentity(identity, identityRecord, params.deviceProfile);
|
|
7774
7861
|
await this._initialize(new Context9(void 0, {
|
|
7775
7862
|
F: __dxlog_file28,
|
|
7776
|
-
L:
|
|
7863
|
+
L: 286
|
|
7777
7864
|
}));
|
|
7778
7865
|
return identity;
|
|
7779
7866
|
}
|
|
@@ -7787,7 +7874,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7787
7874
|
async _initialize(ctx) {
|
|
7788
7875
|
log24("initializing spaces...", void 0, {
|
|
7789
7876
|
F: __dxlog_file28,
|
|
7790
|
-
L:
|
|
7877
|
+
L: 301,
|
|
7791
7878
|
S: this,
|
|
7792
7879
|
C: (f, a) => f(...a)
|
|
7793
7880
|
});
|
|
@@ -7826,7 +7913,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7826
7913
|
this._handlerFactories.set(Invitation10.Kind.SPACE, (invitation) => {
|
|
7827
7914
|
invariant20(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
7828
7915
|
F: __dxlog_file28,
|
|
7829
|
-
L:
|
|
7916
|
+
L: 339,
|
|
7830
7917
|
S: this,
|
|
7831
7918
|
A: [
|
|
7832
7919
|
"this.dataSpaceManager",
|
|
@@ -7850,7 +7937,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7850
7937
|
details: assertion
|
|
7851
7938
|
}, {
|
|
7852
7939
|
F: __dxlog_file28,
|
|
7853
|
-
L:
|
|
7940
|
+
L: 355,
|
|
7854
7941
|
S: this,
|
|
7855
7942
|
C: (f, a) => f(...a)
|
|
7856
7943
|
});
|
|
@@ -7861,7 +7948,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7861
7948
|
details: assertion
|
|
7862
7949
|
}, {
|
|
7863
7950
|
F: __dxlog_file28,
|
|
7864
|
-
L:
|
|
7951
|
+
L: 359,
|
|
7865
7952
|
S: this,
|
|
7866
7953
|
C: (f, a) => f(...a)
|
|
7867
7954
|
});
|
|
@@ -7872,7 +7959,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7872
7959
|
details: assertion
|
|
7873
7960
|
}, {
|
|
7874
7961
|
F: __dxlog_file28,
|
|
7875
|
-
L:
|
|
7962
|
+
L: 364,
|
|
7876
7963
|
S: this,
|
|
7877
7964
|
C: (f, a) => f(...a)
|
|
7878
7965
|
});
|
|
@@ -7883,7 +7970,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7883
7970
|
} catch (err) {
|
|
7884
7971
|
log24.catch(err, void 0, {
|
|
7885
7972
|
F: __dxlog_file28,
|
|
7886
|
-
L:
|
|
7973
|
+
L: 370,
|
|
7887
7974
|
S: this,
|
|
7888
7975
|
C: (f, a) => f(...a)
|
|
7889
7976
|
});
|
|
@@ -7904,7 +7991,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7904
7991
|
swarms: this.networkManager.topics
|
|
7905
7992
|
}, {
|
|
7906
7993
|
F: __dxlog_file28,
|
|
7907
|
-
L:
|
|
7994
|
+
L: 384,
|
|
7908
7995
|
S: this,
|
|
7909
7996
|
C: (f, a) => f(...a)
|
|
7910
7997
|
});
|
|
@@ -7918,7 +8005,7 @@ var ServiceContext = class extends Resource7 {
|
|
|
7918
8005
|
});
|
|
7919
8006
|
invariant20(identity.deviceCredentialChain, void 0, {
|
|
7920
8007
|
F: __dxlog_file28,
|
|
7921
|
-
L:
|
|
8008
|
+
L: 403,
|
|
7922
8009
|
S: this,
|
|
7923
8010
|
A: [
|
|
7924
8011
|
"identity.deviceCredentialChain",
|
|
@@ -8228,7 +8315,7 @@ import { WebsocketRpcClient } from "@dxos/websocket-rpc";
|
|
|
8228
8315
|
|
|
8229
8316
|
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
8230
8317
|
import { EventSubscriptions as EventSubscriptions3 } from "@dxos/async";
|
|
8231
|
-
import { Stream as Stream12 } from "@dxos/codec-protobuf";
|
|
8318
|
+
import { Stream as Stream12 } from "@dxos/codec-protobuf/stream";
|
|
8232
8319
|
import { invariant as invariant22 } from "@dxos/invariant";
|
|
8233
8320
|
import { Device as Device2, DeviceKind as DeviceKind2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
8234
8321
|
var __dxlog_file30 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
|
|
@@ -8318,7 +8405,7 @@ var DevicesServiceImpl = class {
|
|
|
8318
8405
|
|
|
8319
8406
|
// packages/sdk/client-services/src/packlets/identity/contacts-service.ts
|
|
8320
8407
|
import { EventSubscriptions as EventSubscriptions4, scheduleTask as scheduleTask9, UpdateScheduler as UpdateScheduler2 } from "@dxos/async";
|
|
8321
|
-
import { Stream as Stream13 } from "@dxos/codec-protobuf";
|
|
8408
|
+
import { Stream as Stream13 } from "@dxos/codec-protobuf/stream";
|
|
8322
8409
|
import { PublicKey as PublicKey17 } from "@dxos/keys";
|
|
8323
8410
|
import { ComplexMap as ComplexMap5, ComplexSet as ComplexSet6 } from "@dxos/util";
|
|
8324
8411
|
var ContactsServiceImpl = class {
|
|
@@ -8401,7 +8488,7 @@ var ContactsServiceImpl = class {
|
|
|
8401
8488
|
|
|
8402
8489
|
// packages/sdk/client-services/src/packlets/logging/logging-service.ts
|
|
8403
8490
|
import { Event as Event10 } from "@dxos/async";
|
|
8404
|
-
import { Stream as Stream14 } from "@dxos/codec-protobuf";
|
|
8491
|
+
import { Stream as Stream14 } from "@dxos/codec-protobuf/stream";
|
|
8405
8492
|
import { PublicKey as PublicKey18 } from "@dxos/keys";
|
|
8406
8493
|
import { getContextFromEntry, log as log26 } from "@dxos/log";
|
|
8407
8494
|
import { QueryLogsRequest } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -8524,7 +8611,7 @@ var shouldLog = (entry2, request) => {
|
|
|
8524
8611
|
var LOG_PROCESSING = 0;
|
|
8525
8612
|
|
|
8526
8613
|
// packages/sdk/client-services/src/packlets/network/network-service.ts
|
|
8527
|
-
import { Stream as Stream15 } from "@dxos/codec-protobuf";
|
|
8614
|
+
import { Stream as Stream15 } from "@dxos/codec-protobuf/stream";
|
|
8528
8615
|
var NetworkServiceImpl = class {
|
|
8529
8616
|
constructor(networkManager, signalManager) {
|
|
8530
8617
|
this.networkManager = networkManager;
|
|
@@ -8554,10 +8641,39 @@ var NetworkServiceImpl = class {
|
|
|
8554
8641
|
async updateConfig(request) {
|
|
8555
8642
|
await this.networkManager.setConnectionState(request.swarm);
|
|
8556
8643
|
}
|
|
8644
|
+
async joinSwarm(request) {
|
|
8645
|
+
return this.signalManager.join(request);
|
|
8646
|
+
}
|
|
8647
|
+
async leaveSwarm(request) {
|
|
8648
|
+
return this.signalManager.leave(request);
|
|
8649
|
+
}
|
|
8650
|
+
subscribeSwarmState(request) {
|
|
8651
|
+
return new Stream15(({ next }) => {
|
|
8652
|
+
const unsubscribe = this.signalManager.swarmState?.on((state) => {
|
|
8653
|
+
if (request.topic.equals(state.swarmKey)) {
|
|
8654
|
+
next(state);
|
|
8655
|
+
}
|
|
8656
|
+
});
|
|
8657
|
+
return unsubscribe;
|
|
8658
|
+
});
|
|
8659
|
+
}
|
|
8660
|
+
async sendMessage(message) {
|
|
8661
|
+
return this.signalManager.sendMessage(message);
|
|
8662
|
+
}
|
|
8663
|
+
subscribeMessages(peer) {
|
|
8664
|
+
return new Stream15(({ next }) => {
|
|
8665
|
+
const unsubscribe = this.signalManager.onMessage.on((message) => {
|
|
8666
|
+
if (message.recipient.peerKey === peer.peerKey) {
|
|
8667
|
+
next(message);
|
|
8668
|
+
}
|
|
8669
|
+
});
|
|
8670
|
+
return unsubscribe;
|
|
8671
|
+
});
|
|
8672
|
+
}
|
|
8557
8673
|
};
|
|
8558
8674
|
|
|
8559
8675
|
// packages/sdk/client-services/src/packlets/system/system-service.ts
|
|
8560
|
-
import { Stream as Stream16 } from "@dxos/codec-protobuf";
|
|
8676
|
+
import { Stream as Stream16 } from "@dxos/codec-protobuf/stream";
|
|
8561
8677
|
import { GetDiagnosticsRequest as GetDiagnosticsRequest2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
8562
8678
|
import { jsonKeyReplacer as jsonKeyReplacer2 } from "@dxos/util";
|
|
8563
8679
|
var SystemServiceImpl = class {
|
|
@@ -9061,4 +9177,4 @@ export {
|
|
|
9061
9177
|
importProfileData,
|
|
9062
9178
|
ClientServicesHost
|
|
9063
9179
|
};
|
|
9064
|
-
//# sourceMappingURL=chunk-
|
|
9180
|
+
//# sourceMappingURL=chunk-GCPC6HHD.mjs.map
|