@dxos/credentials 0.8.3 → 0.8.4-main.28f8d3d

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.
Files changed (47) hide show
  1. package/.swc/plugins/v7_linux_x86_64_13.0.0/c614d7475354583212fbd7669acbae95b9832c305bf51bdaabe2e6de05abb6bf +0 -0
  2. package/dist/lib/browser/index.mjs +124 -58
  3. package/dist/lib/browser/index.mjs.map +3 -3
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/node-esm/index.mjs +124 -58
  6. package/dist/lib/node-esm/index.mjs.map +3 -3
  7. package/dist/lib/node-esm/meta.json +1 -1
  8. package/dist/types/src/credentials/assertions.d.ts +1 -1
  9. package/dist/types/src/credentials/assertions.d.ts.map +1 -1
  10. package/dist/types/src/credentials/credential-generator.d.ts.map +1 -1
  11. package/dist/types/src/did.d.ts +1 -1
  12. package/dist/types/src/did.d.ts.map +1 -1
  13. package/dist/types/src/presentations/presentation.d.ts.map +1 -1
  14. package/dist/types/src/presentations/verifier.d.ts.map +1 -1
  15. package/dist/types/src/processor/device-state-machine.d.ts.map +1 -1
  16. package/dist/types/src/processor/index.d.ts +1 -1
  17. package/dist/types/src/processor/index.d.ts.map +1 -1
  18. package/dist/types/src/processor/profile-state-machine.d.ts.map +1 -1
  19. package/dist/types/src/state-machine/member-state-machine.d.ts +1 -1
  20. package/dist/types/src/state-machine/member-state-machine.d.ts.map +1 -1
  21. package/dist/types/src/state-machine/space-state-machine.d.ts +1 -1
  22. package/dist/types/src/state-machine/space-state-machine.d.ts.map +1 -1
  23. package/dist/types/tsconfig.tsbuildinfo +1 -1
  24. package/moon.yml +11 -0
  25. package/package.json +13 -12
  26. package/src/credentials/assertions.ts +1 -1
  27. package/src/credentials/credential-factory.ts +1 -1
  28. package/src/credentials/credential-generator.ts +1 -1
  29. package/src/did.ts +2 -2
  30. package/src/presentations/json-encoding.test.ts +3 -1
  31. package/src/presentations/presentation.ts +2 -1
  32. package/src/presentations/verifier.test.ts +2 -1
  33. package/src/presentations/verifier.ts +2 -1
  34. package/src/processor/device-state-machine.ts +2 -1
  35. package/src/processor/index.ts +1 -1
  36. package/src/processor/profile-state-machine.ts +2 -1
  37. package/src/state-machine/invitation-state-machine.test.ts +3 -2
  38. package/src/state-machine/member-state-machine.test.ts +2 -1
  39. package/src/state-machine/member-state-machine.ts +1 -1
  40. package/src/state-machine/space-state-machine.test.ts +2 -1
  41. package/src/state-machine/space-state-machine.ts +14 -8
  42. package/vitest.config.ts +5 -2
  43. package/.eslintrc.cjs +0 -7
  44. package/dist/lib/node/index.cjs +0 -1894
  45. package/dist/lib/node/index.cjs.map +0 -7
  46. package/dist/lib/node/meta.json +0 -1
  47. package/project.json +0 -27
@@ -1,8 +1,8 @@
1
1
  import "@dxos/node-std/globals";
2
2
 
3
- // packages/core/halo/credentials/src/did.ts
3
+ // src/did.ts
4
4
  import { subtleCrypto } from "@dxos/crypto";
5
- import { PublicKey, IdentityDid } from "@dxos/keys";
5
+ import { IdentityDid, PublicKey } from "@dxos/keys";
6
6
  import { ComplexMap } from "@dxos/util";
7
7
  var IDENTITY_DIDS_CACHE = new ComplexMap(PublicKey.hash);
8
8
  var createDidFromIdentityKey = async (identityKey) => {
@@ -17,15 +17,15 @@ var createDidFromIdentityKey = async (identityKey) => {
17
17
  return identityDid;
18
18
  };
19
19
 
20
- // packages/core/halo/credentials/src/invitations.ts
20
+ // src/invitations.ts
21
21
  var defaultSecretProvider = async () => Buffer.from("0000");
22
22
  var defaultSecretValidator = async (invitation, secret) => true;
23
23
 
24
- // packages/core/halo/credentials/src/seedphrase.ts
24
+ // src/seedphrase.ts
25
25
  import { generateMnemonic, mnemonicToSeedSync } from "bip39";
26
26
  import { createKeyPair } from "@dxos/crypto";
27
27
  import { invariant } from "@dxos/invariant";
28
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/src/seedphrase.ts";
28
+ var __dxlog_file = "/__w/dxos/dxos/packages/core/halo/credentials/src/seedphrase.ts";
29
29
  var generateSeedPhrase = () => generateMnemonic();
30
30
  var keyPairFromSeedPhrase = (seedPhrase) => {
31
31
  invariant(seedPhrase, void 0, {
@@ -41,7 +41,7 @@ var keyPairFromSeedPhrase = (seedPhrase) => {
41
41
  return createKeyPair(seed);
42
42
  };
43
43
 
44
- // packages/core/halo/credentials/src/passcode.ts
44
+ // src/passcode.ts
45
45
  var generatePasscode = (length = 4) => {
46
46
  let passcode = "";
47
47
  for (let i = 0; i < length; i++) {
@@ -50,7 +50,7 @@ var generatePasscode = (length = 4) => {
50
50
  return passcode;
51
51
  };
52
52
 
53
- // packages/core/halo/credentials/src/credentials/signing.ts
53
+ // src/credentials/signing.ts
54
54
  import stableStringify from "json-stable-stringify";
55
55
  import { PublicKey as PublicKey2 } from "@dxos/keys";
56
56
  import { Timeframe } from "@dxos/timeframe";
@@ -114,7 +114,7 @@ var truncateKey = (key) => {
114
114
  return `${str.substring(0, 4)}...${str.substring(str.length - 4)}`;
115
115
  };
116
116
 
117
- // packages/core/halo/credentials/src/presentations/signing.ts
117
+ // src/presentations/signing.ts
118
118
  var getPresentationProofPayload = (credentials, proof) => {
119
119
  const copy = {
120
120
  credentials: credentials.map((credential) => removeEmptyParentCredentialIds(credential)),
@@ -142,7 +142,7 @@ var removeEmptyParentCredentialIds = (credential) => {
142
142
  return copy;
143
143
  };
144
144
 
145
- // packages/core/halo/credentials/src/credentials/assertions.ts
145
+ // src/credentials/assertions.ts
146
146
  var getCredentialAssertion = (credential) => credential.subject.assertion;
147
147
  var isValidAuthorizedDeviceCredential = (credential, identityKey, deviceKey) => {
148
148
  const assertion = getCredentialAssertion(credential);
@@ -151,12 +151,12 @@ var isValidAuthorizedDeviceCredential = (credential, identityKey, deviceKey) =>
151
151
  var checkCredentialType = (credential, type) => credential.subject.assertion["@type"] === type;
152
152
  var credentialTypeFilter = (type) => (credential) => checkCredentialType(credential, type);
153
153
 
154
- // packages/core/halo/credentials/src/credentials/credential-factory.ts
154
+ // src/credentials/credential-factory.ts
155
155
  import { subtleCrypto as subtleCrypto2 } from "@dxos/crypto";
156
156
  import { invariant as invariant2 } from "@dxos/invariant";
157
157
  import { PublicKey as PublicKey3 } from "@dxos/keys";
158
158
 
159
- // packages/core/halo/credentials/src/credentials/verifier.ts
159
+ // src/credentials/verifier.ts
160
160
  import { verifySignature } from "@dxos/crypto";
161
161
  var SIGNATURE_TYPE_ED25519 = "ED25519Signature";
162
162
  var verifyCredential = async (credential) => {
@@ -225,8 +225,8 @@ var verifyChain = async (chain, authority, subject) => {
225
225
  };
226
226
  };
227
227
 
228
- // packages/core/halo/credentials/src/credentials/credential-factory.ts
229
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/src/credentials/credential-factory.ts";
228
+ // src/credentials/credential-factory.ts
229
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/core/halo/credentials/src/credentials/credential-factory.ts";
230
230
  var createCredential = async ({ signer, issuer, subject, assertion, signingKey, chain, nonce, parentCredentialIds }) => {
231
231
  invariant2(assertion["@type"], "Invalid assertion.", {
232
232
  F: __dxlog_file2,
@@ -313,10 +313,13 @@ var createCredentialSignerWithChain = (signer, chain, signingKey) => ({
313
313
  })
314
314
  });
315
315
 
316
- // packages/core/halo/credentials/src/credentials/credential-generator.ts
316
+ // src/credentials/credential-generator.ts
317
317
  import { AdmittedFeed, SpaceMember } from "@dxos/protocols/proto/dxos/halo/credentials";
318
318
  import { Timeframe as Timeframe2 } from "@dxos/timeframe";
319
319
  var CredentialGenerator = class {
320
+ _signer;
321
+ _identityKey;
322
+ _deviceKey;
320
323
  constructor(_signer, _identityKey, _deviceKey) {
321
324
  this._signer = _signer;
322
325
  this._identityKey = _identityKey;
@@ -516,7 +519,7 @@ var createCancelDelegatedSpaceInvitationCredential = async (signer, subject, inv
516
519
  };
517
520
  };
518
521
 
519
- // packages/core/halo/credentials/src/presentations/presentation.ts
522
+ // src/presentations/presentation.ts
520
523
  var signPresentation = async ({ presentation, signer, signerKey, chain, nonce }) => {
521
524
  const proof = {
522
525
  type: SIGNATURE_TYPE_ED25519,
@@ -539,7 +542,7 @@ var signPresentation = async ({ presentation, signer, signerKey, chain, nonce })
539
542
  };
540
543
  };
541
544
 
542
- // packages/core/halo/credentials/src/presentations/verifier.ts
545
+ // src/presentations/verifier.ts
543
546
  import { verifySignature as verifySignature2 } from "@dxos/crypto";
544
547
  var verifyPresentation = async (presentation) => {
545
548
  const errors = [];
@@ -623,7 +626,7 @@ var verifyPresentationSignature = async (presentation, proof) => {
623
626
  };
624
627
  };
625
628
 
626
- // packages/core/halo/credentials/src/state-machine/space-state-machine.ts
629
+ // src/state-machine/space-state-machine.ts
627
630
  import { runInContextAsync, synchronized } from "@dxos/async";
628
631
  import { Context } from "@dxos/context";
629
632
  import { PublicKey as PublicKey8 } from "@dxos/keys";
@@ -631,12 +634,15 @@ import { log as log3 } from "@dxos/log";
631
634
  import { SpaceMember as SpaceMember3 } from "@dxos/protocols/proto/dxos/halo/credentials";
632
635
  import { Callback as Callback4, ComplexMap as ComplexMap6, ComplexSet as ComplexSet3 } from "@dxos/util";
633
636
 
634
- // packages/core/halo/credentials/src/state-machine/feed-state-machine.ts
637
+ // src/state-machine/feed-state-machine.ts
635
638
  import { invariant as invariant3 } from "@dxos/invariant";
636
639
  import { PublicKey as PublicKey4 } from "@dxos/keys";
637
640
  import { Callback, ComplexMap as ComplexMap2 } from "@dxos/util";
638
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/src/state-machine/feed-state-machine.ts";
641
+ var __dxlog_file3 = "/__w/dxos/dxos/packages/core/halo/credentials/src/state-machine/feed-state-machine.ts";
639
642
  var FeedStateMachine = class {
643
+ _spaceKey;
644
+ _feeds;
645
+ onFeedAdmitted;
640
646
  constructor(_spaceKey) {
641
647
  this._spaceKey = _spaceKey;
642
648
  this._feeds = new ComplexMap2(PublicKey4.hash);
@@ -682,17 +688,15 @@ var FeedStateMachine = class {
682
688
  }
683
689
  };
684
690
 
685
- // packages/core/halo/credentials/src/state-machine/invitation-state-machine.ts
691
+ // src/state-machine/invitation-state-machine.ts
686
692
  import { PublicKey as PublicKey5 } from "@dxos/keys";
687
693
  import { Callback as Callback2, ComplexMap as ComplexMap3, ComplexSet } from "@dxos/util";
688
694
  var InvitationStateMachine = class {
689
- constructor() {
690
- this._invitations = new ComplexMap3(PublicKey5.hash);
691
- this._redeemedInvitationCredentialIds = new ComplexSet(PublicKey5.hash);
692
- this._cancelledInvitationCredentialIds = new ComplexSet(PublicKey5.hash);
693
- this.onDelegatedInvitation = new Callback2();
694
- this.onDelegatedInvitationRemoved = new Callback2();
695
- }
695
+ _invitations = new ComplexMap3(PublicKey5.hash);
696
+ _redeemedInvitationCredentialIds = new ComplexSet(PublicKey5.hash);
697
+ _cancelledInvitationCredentialIds = new ComplexSet(PublicKey5.hash);
698
+ onDelegatedInvitation = new Callback2();
699
+ onDelegatedInvitationRemoved = new Callback2();
696
700
  get invitations() {
697
701
  return this._invitations;
698
702
  }
@@ -752,20 +756,44 @@ var InvitationStateMachine = class {
752
756
  }
753
757
  };
754
758
 
755
- // packages/core/halo/credentials/src/state-machine/member-state-machine.ts
759
+ // src/state-machine/member-state-machine.ts
756
760
  import { invariant as invariant5 } from "@dxos/invariant";
757
761
  import { PublicKey as PublicKey7 } from "@dxos/keys";
758
762
  import { log as log2 } from "@dxos/log";
759
763
  import { SpaceMember as SpaceMember2 } from "@dxos/protocols/proto/dxos/halo/credentials";
760
764
  import { ComplexMap as ComplexMap5 } from "@dxos/util";
761
765
 
762
- // packages/core/halo/credentials/src/graph/credential-graph.ts
766
+ // src/graph/credential-graph.ts
763
767
  import { invariant as invariant4 } from "@dxos/invariant";
764
768
  import { PublicKey as PublicKey6 } from "@dxos/keys";
765
769
  import { log } from "@dxos/log";
766
770
  import { Callback as Callback3, ComplexMap as ComplexMap4, ComplexSet as ComplexSet2 } from "@dxos/util";
767
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/src/graph/credential-graph.ts";
771
+ var __dxlog_file4 = "/__w/dxos/dxos/packages/core/halo/credentials/src/graph/credential-graph.ts";
768
772
  var CredentialGraph = class {
773
+ _stateHandler;
774
+ /**
775
+ * Local ids are used during traversals.
776
+ */
777
+ _vertexIdGenerator;
778
+ /**
779
+ * All credentials without parent references are connected to the root.
780
+ */
781
+ _root;
782
+ /**
783
+ * A credential which is not a parent of any other credential has the sentinel as a child.
784
+ * Sentinel is a virtual merge-point of all credentials.
785
+ */
786
+ _sentinel;
787
+ /**
788
+ * Vertex references are used for fast credential inserts into the graph.
789
+ */
790
+ _vertexByCredentialId;
791
+ /**
792
+ * The current state of the graph.
793
+ */
794
+ _subjectToVertex;
795
+ _subjectToState;
796
+ onSubjectStateChanged;
769
797
  constructor(_stateHandler) {
770
798
  this._stateHandler = _stateHandler;
771
799
  this._vertexIdGenerator = 1;
@@ -1314,9 +1342,14 @@ var toChosenPath = (path) => {
1314
1342
  ]));
1315
1343
  };
1316
1344
 
1317
- // packages/core/halo/credentials/src/state-machine/member-state-machine.ts
1318
- var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/src/state-machine/member-state-machine.ts";
1345
+ // src/state-machine/member-state-machine.ts
1346
+ var __dxlog_file5 = "/__w/dxos/dxos/packages/core/halo/credentials/src/state-machine/member-state-machine.ts";
1319
1347
  var MemberStateMachine = class {
1348
+ _spaceKey;
1349
+ _ownerKey;
1350
+ _memberProfiles;
1351
+ _hashgraph;
1352
+ onMemberRoleChanged;
1320
1353
  constructor(_spaceKey) {
1321
1354
  this._spaceKey = _spaceKey;
1322
1355
  this._memberProfiles = new ComplexMap5(PublicKey7.hash);
@@ -1460,29 +1493,43 @@ var MemberStateMachine = class {
1460
1493
  }
1461
1494
  };
1462
1495
 
1463
- // packages/core/halo/credentials/src/state-machine/space-state-machine.ts
1496
+ // src/state-machine/space-state-machine.ts
1464
1497
  function _ts_decorate(decorators, target, key, desc) {
1465
1498
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1466
1499
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1467
1500
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1468
1501
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1469
1502
  }
1470
- var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/src/state-machine/space-state-machine.ts";
1503
+ var __dxlog_file6 = "/__w/dxos/dxos/packages/core/halo/credentials/src/state-machine/space-state-machine.ts";
1471
1504
  var SpaceStateMachine = class {
1505
+ _spaceKey;
1506
+ _members;
1507
+ _feeds;
1508
+ _invitations;
1509
+ _credentials;
1510
+ _credentialsById;
1511
+ _processedCredentials;
1512
+ _genesisCredential;
1513
+ _credentialProcessors;
1514
+ onCredentialProcessed;
1515
+ onMemberRoleChanged;
1516
+ onFeedAdmitted;
1517
+ onDelegatedInvitation;
1518
+ onDelegatedInvitationRemoved;
1472
1519
  constructor(_spaceKey) {
1473
1520
  this._spaceKey = _spaceKey;
1474
- this._members = new MemberStateMachine(this._spaceKey);
1475
- this._feeds = new FeedStateMachine(this._spaceKey);
1476
1521
  this._invitations = new InvitationStateMachine();
1477
1522
  this._credentials = [];
1478
1523
  this._credentialsById = new ComplexMap6(PublicKey8.hash);
1479
1524
  this._processedCredentials = new ComplexSet3(PublicKey8.hash);
1480
1525
  this._credentialProcessors = [];
1481
1526
  this.onCredentialProcessed = new Callback4();
1482
- this.onMemberRoleChanged = this._members.onMemberRoleChanged;
1483
- this.onFeedAdmitted = this._feeds.onFeedAdmitted;
1484
1527
  this.onDelegatedInvitation = this._invitations.onDelegatedInvitation;
1485
1528
  this.onDelegatedInvitationRemoved = this._invitations.onDelegatedInvitationRemoved;
1529
+ this._members = new MemberStateMachine(this._spaceKey);
1530
+ this._feeds = new FeedStateMachine(this._spaceKey);
1531
+ this.onMemberRoleChanged = this._members.onMemberRoleChanged;
1532
+ this.onFeedAdmitted = this._feeds.onFeedAdmitted;
1486
1533
  }
1487
1534
  get creator() {
1488
1535
  return this._members.creator;
@@ -1546,7 +1593,7 @@ var SpaceStateMachine = class {
1546
1593
  if (result.kind !== "pass") {
1547
1594
  log3.warn(`Invalid credential: ${result.errors.join(", ")}`, void 0, {
1548
1595
  F: __dxlog_file6,
1549
- L: 156,
1596
+ L: 162,
1550
1597
  S: this,
1551
1598
  C: (f, a) => f(...a)
1552
1599
  });
@@ -1559,7 +1606,7 @@ var SpaceStateMachine = class {
1559
1606
  if (this._genesisCredential) {
1560
1607
  log3.warn("Space already has a genesis credential.", void 0, {
1561
1608
  F: __dxlog_file6,
1562
- L: 165,
1609
+ L: 171,
1563
1610
  S: this,
1564
1611
  C: (f, a) => f(...a)
1565
1612
  });
@@ -1568,7 +1615,7 @@ var SpaceStateMachine = class {
1568
1615
  if (!credential.issuer.equals(this._spaceKey)) {
1569
1616
  log3.warn("Space genesis credential must be issued by space.", void 0, {
1570
1617
  F: __dxlog_file6,
1571
- L: 169,
1618
+ L: 175,
1572
1619
  S: this,
1573
1620
  C: (f, a) => f(...a)
1574
1621
  });
@@ -1577,7 +1624,7 @@ var SpaceStateMachine = class {
1577
1624
  if (!credential.subject.id.equals(this._spaceKey)) {
1578
1625
  log3.warn("Space genesis credential must be issued to space.", void 0, {
1579
1626
  F: __dxlog_file6,
1580
- L: 173,
1627
+ L: 179,
1581
1628
  S: this,
1582
1629
  C: (f, a) => f(...a)
1583
1630
  });
@@ -1593,7 +1640,7 @@ var SpaceStateMachine = class {
1593
1640
  if (!this._genesisCredential) {
1594
1641
  log3.warn("Space must have a genesis credential before adding members.", void 0, {
1595
1642
  F: __dxlog_file6,
1596
- L: 186,
1643
+ L: 192,
1597
1644
  S: this,
1598
1645
  C: (f, a) => f(...a)
1599
1646
  });
@@ -1602,7 +1649,7 @@ var SpaceStateMachine = class {
1602
1649
  if (!this._canInviteNewMembers(credential.issuer)) {
1603
1650
  log3.warn(`Space member is not authorized to invite new members: ${credential.issuer}`, void 0, {
1604
1651
  F: __dxlog_file6,
1605
- L: 190,
1652
+ L: 196,
1606
1653
  S: this,
1607
1654
  C: (f, a) => f(...a)
1608
1655
  });
@@ -1616,7 +1663,7 @@ var SpaceStateMachine = class {
1616
1663
  if (!this._genesisCredential) {
1617
1664
  log3.warn("Space must have a genesis credential before adding members.", void 0, {
1618
1665
  F: __dxlog_file6,
1619
- L: 201,
1666
+ L: 207,
1620
1667
  S: this,
1621
1668
  C: (f, a) => f(...a)
1622
1669
  });
@@ -1629,7 +1676,7 @@ var SpaceStateMachine = class {
1629
1676
  if (!this._genesisCredential) {
1630
1677
  log3.warn("Space must have a genesis credential before admitting feeds.", void 0, {
1631
1678
  F: __dxlog_file6,
1632
- L: 211,
1679
+ L: 217,
1633
1680
  S: this,
1634
1681
  C: (f, a) => f(...a)
1635
1682
  });
@@ -1643,7 +1690,7 @@ var SpaceStateMachine = class {
1643
1690
  if (!this._canInviteNewMembers(credential.issuer)) {
1644
1691
  log3.warn(`Invalid invitation, space member is not authorized to invite new members: ${credential.issuer}`, void 0, {
1645
1692
  F: __dxlog_file6,
1646
- L: 222,
1693
+ L: 228,
1647
1694
  S: this,
1648
1695
  C: (f, a) => f(...a)
1649
1696
  });
@@ -1684,13 +1731,24 @@ _ts_decorate([
1684
1731
  synchronized
1685
1732
  ], SpaceStateMachine.prototype, "process", null);
1686
1733
  var CredentialConsumer = class {
1734
+ processor;
1735
+ _onOpen;
1736
+ _onClose;
1737
+ _ctx;
1738
+ /**
1739
+ * @internal
1740
+ * Processor is ready to process live credentials.
1741
+ * NOTE: Setting this flag before all existing credentials are processed will cause them to be processed out of order.
1742
+ * Set externally.
1743
+ */
1744
+ _isReadyForLiveCredentials;
1687
1745
  constructor(processor, _onOpen, _onClose) {
1688
1746
  this.processor = processor;
1689
1747
  this._onOpen = _onOpen;
1690
1748
  this._onClose = _onClose;
1691
1749
  this._ctx = new Context(void 0, {
1692
1750
  F: __dxlog_file6,
1693
- L: 267
1751
+ L: 273
1694
1752
  });
1695
1753
  this._isReadyForLiveCredentials = false;
1696
1754
  }
@@ -1714,14 +1772,19 @@ var CredentialConsumer = class {
1714
1772
  }
1715
1773
  };
1716
1774
 
1717
- // packages/core/halo/credentials/src/processor/device-state-machine.ts
1775
+ // src/processor/device-state-machine.ts
1718
1776
  import { Trigger } from "@dxos/async";
1719
1777
  import { invariant as invariant6 } from "@dxos/invariant";
1720
1778
  import { PublicKey as PublicKey9 } from "@dxos/keys";
1721
1779
  import { log as log4 } from "@dxos/log";
1722
1780
  import { ComplexMap as ComplexMap7 } from "@dxos/util";
1723
- var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/src/processor/device-state-machine.ts";
1781
+ var __dxlog_file7 = "/__w/dxos/dxos/packages/core/halo/credentials/src/processor/device-state-machine.ts";
1724
1782
  var DeviceStateMachine = class {
1783
+ _params;
1784
+ // TODO(burdon): Return values via getter.
1785
+ authorizedDeviceKeys;
1786
+ deviceChainReady;
1787
+ deviceCredentialChain;
1725
1788
  constructor(_params) {
1726
1789
  this._params = _params;
1727
1790
  this.authorizedDeviceKeys = new ComplexMap7(PublicKey9.hash);
@@ -1734,7 +1797,7 @@ var DeviceStateMachine = class {
1734
1797
  credential
1735
1798
  }, {
1736
1799
  F: __dxlog_file7,
1737
- L: 35,
1800
+ L: 36,
1738
1801
  S: this,
1739
1802
  C: (f, a) => f(...a)
1740
1803
  });
@@ -1754,7 +1817,7 @@ var DeviceStateMachine = class {
1754
1817
  size: this.authorizedDeviceKeys.size
1755
1818
  }, {
1756
1819
  F: __dxlog_file7,
1757
- L: 55,
1820
+ L: 56,
1758
1821
  S: this,
1759
1822
  C: (f, a) => f(...a)
1760
1823
  });
@@ -1764,7 +1827,7 @@ var DeviceStateMachine = class {
1764
1827
  case "dxos.halo.credentials.DeviceProfile": {
1765
1828
  invariant6(this.authorizedDeviceKeys.has(credential.subject.id), "Device not found.", {
1766
1829
  F: __dxlog_file7,
1767
- L: 65,
1830
+ L: 66,
1768
1831
  S: this,
1769
1832
  A: [
1770
1833
  "this.authorizedDeviceKeys.has(credential.subject.id)",
@@ -1777,7 +1840,7 @@ var DeviceStateMachine = class {
1777
1840
  profile: assertion.profile
1778
1841
  }, {
1779
1842
  F: __dxlog_file7,
1780
- L: 68,
1843
+ L: 69,
1781
1844
  S: this,
1782
1845
  C: (f, a) => f(...a)
1783
1846
  });
@@ -1790,10 +1853,13 @@ var DeviceStateMachine = class {
1790
1853
  }
1791
1854
  };
1792
1855
 
1793
- // packages/core/halo/credentials/src/processor/profile-state-machine.ts
1856
+ // src/processor/profile-state-machine.ts
1794
1857
  import { log as log5 } from "@dxos/log";
1795
- var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/halo/credentials/src/processor/profile-state-machine.ts";
1858
+ var __dxlog_file8 = "/__w/dxos/dxos/packages/core/halo/credentials/src/processor/profile-state-machine.ts";
1796
1859
  var ProfileStateMachine = class {
1860
+ _params;
1861
+ // TODO(burdon): Return values via getter.
1862
+ profile;
1797
1863
  constructor(_params) {
1798
1864
  this._params = _params;
1799
1865
  }
@@ -1807,7 +1873,7 @@ var ProfileStateMachine = class {
1807
1873
  credential
1808
1874
  }, {
1809
1875
  F: __dxlog_file8,
1810
- L: 34,
1876
+ L: 35,
1811
1877
  S: this,
1812
1878
  C: (f, a) => f(...a)
1813
1879
  });
@@ -1819,7 +1885,7 @@ var ProfileStateMachine = class {
1819
1885
  profile: this.profile
1820
1886
  }, {
1821
1887
  F: __dxlog_file8,
1822
- L: 40,
1888
+ L: 41,
1823
1889
  S: this,
1824
1890
  C: (f, a) => f(...a)
1825
1891
  });