@dxos/client-services 0.7.5-labs.8a82073 → 0.7.5-labs.a8b535d
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-XCOUT2K5.mjs → chunk-LGIF7IGW.mjs} +39 -25
- package/dist/lib/browser/chunk-LGIF7IGW.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-KBHGJAMG.cjs → chunk-RHAQYBK2.cjs} +41 -27
- package/dist/lib/node/chunk-RHAQYBK2.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-YPF3TFCW.mjs → chunk-UBSDPLI2.mjs} +39 -25
- package/dist/lib/node-esm/chunk-UBSDPLI2.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/diagnostics/diagnostics-collector.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-service.d.ts +2 -2
- 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/version.d.ts +1 -1
- package/package.json +39 -38
- package/src/packlets/agents/edge-agent-manager.ts +6 -0
- package/src/packlets/diagnostics/diagnostics-collector.ts +2 -2
- package/src/packlets/identity/identity-recovery-manager.ts +7 -5
- package/src/packlets/spaces/data-space-manager.ts +2 -2
- package/src/packlets/spaces/data-space.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-XCOUT2K5.mjs.map +0 -7
- package/dist/lib/node/chunk-KBHGJAMG.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-YPF3TFCW.mjs.map +0 -7
|
@@ -32,7 +32,7 @@ __export(testing_exports, {
|
|
|
32
32
|
sanitizeInvitation: () => sanitizeInvitation
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(testing_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_RHAQYBK2 = require("../chunk-RHAQYBK2.cjs");
|
|
36
36
|
var import_credentials = require("@dxos/credentials");
|
|
37
37
|
var import_keys = require("@dxos/keys");
|
|
38
38
|
var import_async = require("@dxos/async");
|
|
@@ -235,7 +235,7 @@ var createInvitation = async (host, options) => {
|
|
|
235
235
|
authMethod: import_services.Invitation.AuthMethod.NONE,
|
|
236
236
|
...options ?? {}
|
|
237
237
|
};
|
|
238
|
-
if (host instanceof
|
|
238
|
+
if (host instanceof import_chunk_RHAQYBK2.ServiceContext) {
|
|
239
239
|
return host.invitationsManager.createInvitation({
|
|
240
240
|
kind: import_services.Invitation.Kind.SPACE,
|
|
241
241
|
...options
|
|
@@ -245,7 +245,7 @@ var createInvitation = async (host, options) => {
|
|
|
245
245
|
};
|
|
246
246
|
var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
247
247
|
invitation = sanitizeInvitation(invitation);
|
|
248
|
-
if (guest instanceof
|
|
248
|
+
if (guest instanceof import_chunk_RHAQYBK2.ServiceContext) {
|
|
249
249
|
return guest.invitationsManager.acceptInvitation({
|
|
250
250
|
invitation,
|
|
251
251
|
deviceProfile: guestDeviceProfile
|
|
@@ -255,7 +255,7 @@ var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
|
255
255
|
};
|
|
256
256
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/testing/test-builder.ts";
|
|
257
257
|
var createServiceHost = (config, signalManagerContext) => {
|
|
258
|
-
return new
|
|
258
|
+
return new import_chunk_RHAQYBK2.ClientServicesHost({
|
|
259
259
|
config,
|
|
260
260
|
signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
|
|
261
261
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
@@ -274,7 +274,7 @@ var createServiceContext = async ({ signalManagerFactory = async () => {
|
|
|
274
274
|
});
|
|
275
275
|
const level = (0, import_testing.createTestLevel)();
|
|
276
276
|
await level.open();
|
|
277
|
-
return new
|
|
277
|
+
return new import_chunk_RHAQYBK2.ServiceContext(storage, level, networkManager, signalManager, void 0, void 0, {
|
|
278
278
|
invitationConnectionDefaultParams: {
|
|
279
279
|
teleport: {
|
|
280
280
|
controlHeartbeatInterval: 200
|
|
@@ -385,7 +385,7 @@ var TestPeer = class {
|
|
|
385
385
|
return this._props.meshEchoReplicator ??= new import_echo_pipeline.MeshEchoReplicator();
|
|
386
386
|
}
|
|
387
387
|
get dataSpaceManager() {
|
|
388
|
-
return this._props.dataSpaceManager ??= new
|
|
388
|
+
return this._props.dataSpaceManager ??= new import_chunk_RHAQYBK2.DataSpaceManager({
|
|
389
389
|
spaceManager: this.spaceManager,
|
|
390
390
|
metadataStore: this.metadataStore,
|
|
391
391
|
keyring: this.keyring,
|
|
@@ -400,9 +400,9 @@ var TestPeer = class {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
get invitationsManager() {
|
|
403
|
-
return this._props.invitationsManager ??= new
|
|
403
|
+
return this._props.invitationsManager ??= new import_chunk_RHAQYBK2.InvitationsManager(new import_chunk_RHAQYBK2.InvitationsHandler(this.networkManager), (invitation) => {
|
|
404
404
|
if (invitation.kind === import_services2.Invitation.Kind.SPACE) {
|
|
405
|
-
return new
|
|
405
|
+
return new import_chunk_RHAQYBK2.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
|
|
406
406
|
} else {
|
|
407
407
|
throw new Error("not implemented");
|
|
408
408
|
}
|
|
@@ -397,7 +397,7 @@ 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-labs.
|
|
400
|
+
var DXOS_VERSION = "0.7.5-labs.a8b535d";
|
|
401
401
|
|
|
402
402
|
// packages/sdk/client-services/src/packlets/services/platform.ts
|
|
403
403
|
import { Platform } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -571,7 +571,7 @@ import { ClientServicesProviderResource } from "@dxos/client-protocol";
|
|
|
571
571
|
import { ConfigResource } from "@dxos/config";
|
|
572
572
|
import { GetDiagnosticsRequest } from "@dxos/protocols/proto/dxos/client/services";
|
|
573
573
|
import { TRACE_PROCESSOR as TRACE_PROCESSOR2 } from "@dxos/tracing";
|
|
574
|
-
import { jsonKeyReplacer,
|
|
574
|
+
import { jsonKeyReplacer, isNonNullable } from "@dxos/util";
|
|
575
575
|
var GET_DIAGNOSTICS_RPC_TIMEOUT = 1e4;
|
|
576
576
|
var DiagnosticsCollector = class {
|
|
577
577
|
static {
|
|
@@ -604,7 +604,7 @@ var findSystemServiceProvider = () => {
|
|
|
604
604
|
};
|
|
605
605
|
var findConfigs = () => {
|
|
606
606
|
const configs = TRACE_PROCESSOR2.findResourcesByAnnotation(ConfigResource);
|
|
607
|
-
return configs.map((r) => r.instance.deref()).filter(
|
|
607
|
+
return configs.map((r) => r.instance.deref()).filter(isNonNullable);
|
|
608
608
|
};
|
|
609
609
|
|
|
610
610
|
// packages/sdk/client-services/src/packlets/identity/authenticator.ts
|
|
@@ -2452,7 +2452,7 @@ var DataSpaceManager = class extends Resource4 {
|
|
|
2452
2452
|
});
|
|
2453
2453
|
dataSpace.postOpen.append(async () => {
|
|
2454
2454
|
const setting = dataSpace.getEdgeReplicationSetting();
|
|
2455
|
-
if (setting === EdgeReplicationSetting.ENABLED) {
|
|
2455
|
+
if (!setting || setting === EdgeReplicationSetting.ENABLED) {
|
|
2456
2456
|
await this._echoEdgeReplicator?.connectToSpace(dataSpace.id);
|
|
2457
2457
|
} else if (this._echoEdgeReplicator) {
|
|
2458
2458
|
log6("not connecting EchoEdgeReplicator because of EdgeReplicationSetting", {
|
|
@@ -2467,7 +2467,7 @@ var DataSpaceManager = class extends Resource4 {
|
|
|
2467
2467
|
});
|
|
2468
2468
|
dataSpace.preClose.append(async () => {
|
|
2469
2469
|
const setting = dataSpace.getEdgeReplicationSetting();
|
|
2470
|
-
if (setting === EdgeReplicationSetting.ENABLED) {
|
|
2470
|
+
if (!setting || setting === EdgeReplicationSetting.ENABLED) {
|
|
2471
2471
|
await this._echoEdgeReplicator?.disconnectFromSpace(dataSpace.id);
|
|
2472
2472
|
}
|
|
2473
2473
|
});
|
|
@@ -7016,6 +7016,18 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7016
7016
|
haloSpaceKey: this._identity.haloSpaceKey.toHex()
|
|
7017
7017
|
});
|
|
7018
7018
|
const deviceKey = PublicKey13.fromHex(response.deviceKey);
|
|
7019
|
+
if (await this._identity.authorizedDeviceKeys.has(deviceKey)) {
|
|
7020
|
+
log21.info("agent was already added to HALO, ignoring response", {
|
|
7021
|
+
response
|
|
7022
|
+
}, {
|
|
7023
|
+
F: __dxlog_file25,
|
|
7024
|
+
L: 67,
|
|
7025
|
+
S: this,
|
|
7026
|
+
C: (f, a) => f(...a)
|
|
7027
|
+
});
|
|
7028
|
+
this._updateStatus(EdgeAgentStatus.ACTIVE, deviceKey);
|
|
7029
|
+
return;
|
|
7030
|
+
}
|
|
7019
7031
|
await this._identity.admitDevice({
|
|
7020
7032
|
deviceKey,
|
|
7021
7033
|
controlFeedKey: PublicKey13.fromHex(response.feedKey),
|
|
@@ -7024,7 +7036,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7024
7036
|
});
|
|
7025
7037
|
log21("agent created", response, {
|
|
7026
7038
|
F: __dxlog_file25,
|
|
7027
|
-
L:
|
|
7039
|
+
L: 79,
|
|
7028
7040
|
S: this,
|
|
7029
7041
|
C: (f, a) => f(...a)
|
|
7030
7042
|
});
|
|
@@ -7036,7 +7048,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7036
7048
|
isEnabled
|
|
7037
7049
|
}, {
|
|
7038
7050
|
F: __dxlog_file25,
|
|
7039
|
-
L:
|
|
7051
|
+
L: 87,
|
|
7040
7052
|
S: this,
|
|
7041
7053
|
C: (f, a) => f(...a)
|
|
7042
7054
|
});
|
|
@@ -7069,7 +7081,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7069
7081
|
async _fetchAgentStatus() {
|
|
7070
7082
|
invariant19(this._edgeHttpClient, void 0, {
|
|
7071
7083
|
F: __dxlog_file25,
|
|
7072
|
-
L:
|
|
7084
|
+
L: 121,
|
|
7073
7085
|
S: this,
|
|
7074
7086
|
A: [
|
|
7075
7087
|
"this._edgeHttpClient",
|
|
@@ -7079,7 +7091,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7079
7091
|
try {
|
|
7080
7092
|
log21("fetching agent status", void 0, {
|
|
7081
7093
|
F: __dxlog_file25,
|
|
7082
|
-
L:
|
|
7094
|
+
L: 123,
|
|
7083
7095
|
S: this,
|
|
7084
7096
|
C: (f, a) => f(...a)
|
|
7085
7097
|
});
|
|
@@ -7098,7 +7110,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7098
7110
|
err
|
|
7099
7111
|
}, {
|
|
7100
7112
|
F: __dxlog_file25,
|
|
7101
|
-
L:
|
|
7113
|
+
L: 133,
|
|
7102
7114
|
S: this,
|
|
7103
7115
|
C: (f, a) => f(...a)
|
|
7104
7116
|
});
|
|
@@ -7111,7 +7123,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7111
7123
|
retryAfterMs
|
|
7112
7124
|
}, {
|
|
7113
7125
|
F: __dxlog_file25,
|
|
7114
|
-
L:
|
|
7126
|
+
L: 138,
|
|
7115
7127
|
S: this,
|
|
7116
7128
|
C: (f, a) => f(...a)
|
|
7117
7129
|
});
|
|
@@ -7147,7 +7159,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7147
7159
|
spaceId: space.id
|
|
7148
7160
|
}, {
|
|
7149
7161
|
F: __dxlog_file25,
|
|
7150
|
-
L:
|
|
7162
|
+
L: 165,
|
|
7151
7163
|
S: this,
|
|
7152
7164
|
C: (f, a) => f(...a)
|
|
7153
7165
|
});
|
|
@@ -7167,7 +7179,7 @@ var EdgeAgentManager = class extends Resource6 {
|
|
|
7167
7179
|
status
|
|
7168
7180
|
}, {
|
|
7169
7181
|
F: __dxlog_file25,
|
|
7170
|
-
L:
|
|
7182
|
+
L: 181,
|
|
7171
7183
|
S: this,
|
|
7172
7184
|
C: (f, a) => f(...a)
|
|
7173
7185
|
});
|
|
@@ -7273,7 +7285,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7273
7285
|
this._identityProvider = _identityProvider;
|
|
7274
7286
|
this._acceptRecoveredIdentity = _acceptRecoveredIdentity;
|
|
7275
7287
|
}
|
|
7276
|
-
async createRecoveryCredential({ recoveryKey, algorithm }) {
|
|
7288
|
+
async createRecoveryCredential({ recoveryKey, lookupKey, algorithm }) {
|
|
7277
7289
|
const identity = this._identityProvider();
|
|
7278
7290
|
invariant20(identity, void 0, {
|
|
7279
7291
|
F: __dxlog_file26,
|
|
@@ -7285,15 +7297,16 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7285
7297
|
]
|
|
7286
7298
|
});
|
|
7287
7299
|
let recoveryCode;
|
|
7288
|
-
if (!recoveryKey) {
|
|
7300
|
+
if (!recoveryKey || !lookupKey) {
|
|
7289
7301
|
recoveryCode = generateSeedPhrase();
|
|
7290
7302
|
const keypair = keyPairFromSeedPhrase(recoveryCode);
|
|
7291
7303
|
recoveryKey = PublicKey14.from(keypair.publicKey);
|
|
7304
|
+
lookupKey = PublicKey14.random();
|
|
7292
7305
|
algorithm = "ED25519";
|
|
7293
7306
|
}
|
|
7294
7307
|
invariant20(algorithm, "Algorithm is required.", {
|
|
7295
7308
|
F: __dxlog_file26,
|
|
7296
|
-
L:
|
|
7309
|
+
L: 48,
|
|
7297
7310
|
S: this,
|
|
7298
7311
|
A: [
|
|
7299
7312
|
"algorithm",
|
|
@@ -7307,7 +7320,8 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7307
7320
|
"@type": "dxos.halo.credentials.IdentityRecovery",
|
|
7308
7321
|
recoveryKey,
|
|
7309
7322
|
identityKey,
|
|
7310
|
-
algorithm
|
|
7323
|
+
algorithm,
|
|
7324
|
+
lookupKey
|
|
7311
7325
|
}
|
|
7312
7326
|
});
|
|
7313
7327
|
const receipt = await identity.controlPipeline.writer.write({
|
|
@@ -7328,7 +7342,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7328
7342
|
async requestRecoveryChallenge() {
|
|
7329
7343
|
invariant20(this._edgeClient, "Not connected to EDGE.", {
|
|
7330
7344
|
F: __dxlog_file26,
|
|
7331
|
-
L:
|
|
7345
|
+
L: 68,
|
|
7332
7346
|
S: this,
|
|
7333
7347
|
A: [
|
|
7334
7348
|
"this._edgeClient",
|
|
@@ -7355,10 +7369,10 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7355
7369
|
};
|
|
7356
7370
|
}
|
|
7357
7371
|
}
|
|
7358
|
-
async recoverIdentityWithExternalSignature({
|
|
7372
|
+
async recoverIdentityWithExternalSignature({ lookupKey, deviceKey, controlFeedKey, signature, clientDataJson, authenticatorData }) {
|
|
7359
7373
|
invariant20(this._edgeClient, "Not connected to EDGE.", {
|
|
7360
7374
|
F: __dxlog_file26,
|
|
7361
|
-
L:
|
|
7375
|
+
L: 100,
|
|
7362
7376
|
S: this,
|
|
7363
7377
|
A: [
|
|
7364
7378
|
"this._edgeClient",
|
|
@@ -7366,7 +7380,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7366
7380
|
]
|
|
7367
7381
|
});
|
|
7368
7382
|
const request = {
|
|
7369
|
-
|
|
7383
|
+
lookupKey: lookupKey.toHex(),
|
|
7370
7384
|
deviceKey: deviceKey.toHex(),
|
|
7371
7385
|
controlFeedKey: controlFeedKey.toHex(),
|
|
7372
7386
|
signature: clientDataJson && authenticatorData ? {
|
|
@@ -7389,7 +7403,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7389
7403
|
async recoverIdentity({ recoveryCode }) {
|
|
7390
7404
|
invariant20(this._edgeClient, "Not connected to EDGE.", {
|
|
7391
7405
|
F: __dxlog_file26,
|
|
7392
|
-
L:
|
|
7406
|
+
L: 130,
|
|
7393
7407
|
S: this,
|
|
7394
7408
|
A: [
|
|
7395
7409
|
"this._edgeClient",
|
|
@@ -7401,7 +7415,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7401
7415
|
const deviceKey = await this._keyring.createKey();
|
|
7402
7416
|
const controlFeedKey = await this._keyring.createKey();
|
|
7403
7417
|
const request = {
|
|
7404
|
-
|
|
7418
|
+
lookupKey: recoveryKey.toHex(),
|
|
7405
7419
|
deviceKey: deviceKey.toHex(),
|
|
7406
7420
|
controlFeedKey: controlFeedKey.toHex()
|
|
7407
7421
|
};
|
|
@@ -7420,7 +7434,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7420
7434
|
}
|
|
7421
7435
|
log22.info("recovering identity", response, {
|
|
7422
7436
|
F: __dxlog_file26,
|
|
7423
|
-
L:
|
|
7437
|
+
L: 156,
|
|
7424
7438
|
S: this,
|
|
7425
7439
|
C: (f, a) => f(...a)
|
|
7426
7440
|
});
|
|
@@ -9022,4 +9036,4 @@ export {
|
|
|
9022
9036
|
importProfileData,
|
|
9023
9037
|
ClientServicesHost
|
|
9024
9038
|
};
|
|
9025
|
-
//# sourceMappingURL=chunk-
|
|
9039
|
+
//# sourceMappingURL=chunk-UBSDPLI2.mjs.map
|