@verana-labs/vs-agent-sdk 2.0.0-dev.12 → 2.0.0-dev.120

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 (205) hide show
  1. package/README.md +0 -2
  2. package/build/adminApi/AdminApiError.d.ts +28 -0
  3. package/build/adminApi/AdminApiError.js +67 -0
  4. package/build/adminApi/AdminApiError.js.map +1 -0
  5. package/build/adminApi/didcommModules.d.ts +2 -0
  6. package/build/adminApi/didcommModules.js +8 -0
  7. package/build/adminApi/didcommModules.js.map +1 -0
  8. package/build/adminApi/index.d.ts +4 -0
  9. package/build/adminApi/index.js +21 -0
  10. package/build/adminApi/index.js.map +1 -0
  11. package/build/adminApi/moduleEndpoint.d.ts +7 -0
  12. package/build/adminApi/moduleEndpoint.js +21 -0
  13. package/build/adminApi/moduleEndpoint.js.map +1 -0
  14. package/build/adminApi/pagination/PageDto.d.ts +7 -0
  15. package/build/adminApi/pagination/PageDto.js +50 -0
  16. package/build/adminApi/pagination/PageDto.js.map +1 -0
  17. package/build/adminApi/pagination/PaginationQueryDto.d.ts +11 -0
  18. package/build/adminApi/pagination/PaginationQueryDto.js +46 -0
  19. package/build/adminApi/pagination/PaginationQueryDto.js.map +1 -0
  20. package/build/adminApi/pagination/cursor.d.ts +28 -0
  21. package/build/adminApi/pagination/cursor.js +64 -0
  22. package/build/adminApi/pagination/cursor.js.map +1 -0
  23. package/build/adminApi/pagination/index.d.ts +4 -0
  24. package/build/adminApi/pagination/index.js +21 -0
  25. package/build/adminApi/pagination/index.js.map +1 -0
  26. package/build/adminApi/pagination/paginate.d.ts +27 -0
  27. package/build/adminApi/pagination/paginate.js +77 -0
  28. package/build/adminApi/pagination/paginate.js.map +1 -0
  29. package/build/agent/VsAgent.d.ts +32 -36
  30. package/build/agent/VsAgent.js +179 -221
  31. package/build/agent/VsAgent.js.map +1 -1
  32. package/build/agent/createVsAgent.d.ts +9 -6
  33. package/build/agent/createVsAgent.js +5 -5
  34. package/build/agent/createVsAgent.js.map +1 -1
  35. package/build/blockchain/AnonCredsTrustService.d.ts +115 -0
  36. package/build/blockchain/AnonCredsTrustService.js +287 -0
  37. package/build/blockchain/AnonCredsTrustService.js.map +1 -0
  38. package/build/blockchain/AuthorizationService.d.ts +8 -6
  39. package/build/blockchain/AuthorizationService.js +30 -38
  40. package/build/blockchain/AuthorizationService.js.map +1 -1
  41. package/build/blockchain/IndexerWebSocketService.d.ts +5 -1
  42. package/build/blockchain/IndexerWebSocketService.js +42 -21
  43. package/build/blockchain/IndexerWebSocketService.js.map +1 -1
  44. package/build/blockchain/VeranaChainService.d.ts +38 -27
  45. package/build/blockchain/VeranaChainService.js +186 -177
  46. package/build/blockchain/VeranaChainService.js.map +1 -1
  47. package/build/blockchain/VeranaIndexerService.d.ts +14 -1
  48. package/build/blockchain/VeranaIndexerService.js +122 -8
  49. package/build/blockchain/VeranaIndexerService.js.map +1 -1
  50. package/build/blockchain/feePreflight.d.ts +34 -0
  51. package/build/blockchain/feePreflight.js +96 -0
  52. package/build/blockchain/feePreflight.js.map +1 -0
  53. package/build/blockchain/handlers/IndexerHandlerRegistry.d.ts +0 -1
  54. package/build/blockchain/handlers/IndexerHandlerRegistry.js.map +1 -1
  55. package/build/blockchain/handlers/authorizationHandlers.js +2 -2
  56. package/build/blockchain/handlers/authorizationHandlers.js.map +1 -1
  57. package/build/blockchain/handlers/defaultHandlers.js +7 -2
  58. package/build/blockchain/handlers/defaultHandlers.js.map +1 -1
  59. package/build/blockchain/handlers/index.d.ts +1 -0
  60. package/build/blockchain/handlers/index.js +1 -0
  61. package/build/blockchain/handlers/index.js.map +1 -1
  62. package/build/blockchain/handlers/selfIssuanceHandlers.d.ts +13 -0
  63. package/build/blockchain/handlers/selfIssuanceHandlers.js +76 -0
  64. package/build/blockchain/handlers/selfIssuanceHandlers.js.map +1 -0
  65. package/build/blockchain/handlers/stateMutations.d.ts +28 -4
  66. package/build/blockchain/handlers/stateMutations.js +356 -48
  67. package/build/blockchain/handlers/stateMutations.js.map +1 -1
  68. package/build/blockchain/index.d.ts +4 -0
  69. package/build/blockchain/index.js +4 -0
  70. package/build/blockchain/index.js.map +1 -1
  71. package/build/blockchain/indexerMappers.d.ts +3 -0
  72. package/build/blockchain/indexerMappers.js +57 -0
  73. package/build/blockchain/indexerMappers.js.map +1 -0
  74. package/build/blockchain/rpcRetry.d.ts +2 -0
  75. package/build/blockchain/rpcRetry.js +43 -0
  76. package/build/blockchain/rpcRetry.js.map +1 -0
  77. package/build/blockchain/triggerResolver.d.ts +26 -0
  78. package/build/blockchain/triggerResolver.js +110 -0
  79. package/build/blockchain/triggerResolver.js.map +1 -0
  80. package/build/blockchain/types.d.ts +14 -70
  81. package/build/blockchain/types.js +6 -1
  82. package/build/blockchain/types.js.map +1 -1
  83. package/build/bootstrap/EcsBootstrapService.d.ts +13 -4
  84. package/build/bootstrap/EcsBootstrapService.js +176 -124
  85. package/build/bootstrap/EcsBootstrapService.js.map +1 -1
  86. package/build/connections/InvitationRecord.d.ts +50 -0
  87. package/build/connections/InvitationRecord.js +60 -0
  88. package/build/connections/InvitationRecord.js.map +1 -0
  89. package/build/connections/ParentConnectionModule.d.ts +22 -0
  90. package/build/connections/ParentConnectionModule.js +91 -0
  91. package/build/connections/ParentConnectionModule.js.map +1 -0
  92. package/build/credentials/FullTailsFileService.d.ts +0 -1
  93. package/build/credentials/FullTailsFileService.js +0 -49
  94. package/build/credentials/FullTailsFileService.js.map +1 -1
  95. package/build/did/CachedDocumentLoader.d.ts +3 -0
  96. package/build/did/CachedDocumentLoader.js +9 -3
  97. package/build/did/CachedDocumentLoader.js.map +1 -1
  98. package/build/did/CachedWebDidResolver.d.ts +0 -4
  99. package/build/did/CachedWebDidResolver.js +1 -5
  100. package/build/did/CachedWebDidResolver.js.map +1 -1
  101. package/build/did/artifactServices.d.ts +12 -0
  102. package/build/did/artifactServices.js +48 -0
  103. package/build/did/artifactServices.js.map +1 -0
  104. package/build/did/legacyDidWeb.d.ts +6 -4
  105. package/build/did/legacyDidWeb.js +17 -14
  106. package/build/did/legacyDidWeb.js.map +1 -1
  107. package/build/did/publicDid.d.ts +4 -0
  108. package/build/did/publicDid.js +19 -0
  109. package/build/did/publicDid.js.map +1 -0
  110. package/build/did/reusedDidDocument.d.ts +37 -0
  111. package/build/did/reusedDidDocument.js +93 -0
  112. package/build/did/reusedDidDocument.js.map +1 -0
  113. package/build/events/BaseMessageEvents.d.ts +24 -0
  114. package/build/events/BaseMessageEvents.js +368 -14
  115. package/build/events/BaseMessageEvents.js.map +1 -1
  116. package/build/events/ConnectionEvents.js +149 -87
  117. package/build/events/ConnectionEvents.js.map +1 -1
  118. package/build/events/InvitationEvents.d.ts +6 -0
  119. package/build/events/InvitationEvents.js +57 -0
  120. package/build/events/InvitationEvents.js.map +1 -0
  121. package/build/events/VsAgentEvents.d.ts +40 -9
  122. package/build/events/VsAgentEvents.js +10 -1
  123. package/build/events/VsAgentEvents.js.map +1 -1
  124. package/build/events/VtFlowEvents.d.ts +1 -1
  125. package/build/events/VtFlowEvents.js +29 -17
  126. package/build/events/VtFlowEvents.js.map +1 -1
  127. package/build/events/index.d.ts +1 -0
  128. package/build/events/index.js +1 -0
  129. package/build/events/index.js.map +1 -1
  130. package/build/index.d.ts +9 -1
  131. package/build/index.js +20 -2
  132. package/build/index.js.map +1 -1
  133. package/build/plugins/setupBaseDidComm.js +24 -22
  134. package/build/plugins/setupBaseDidComm.js.map +1 -1
  135. package/build/transports/HttpInboundTransport.js +6 -1
  136. package/build/transports/HttpInboundTransport.js.map +1 -1
  137. package/build/transports/VsAgentWsInboundTransport.d.ts +1 -1
  138. package/build/transports/VsAgentWsInboundTransport.js +20 -14
  139. package/build/transports/VsAgentWsInboundTransport.js.map +1 -1
  140. package/build/types.d.ts +14 -13
  141. package/build/types.js +1 -2
  142. package/build/types.js.map +1 -1
  143. package/build/utils/agent.d.ts +42 -4
  144. package/build/utils/agent.js +126 -22
  145. package/build/utils/agent.js.map +1 -1
  146. package/build/utils/boundedFetch.d.ts +13 -0
  147. package/build/utils/boundedFetch.js +47 -0
  148. package/build/utils/boundedFetch.js.map +1 -0
  149. package/build/utils/didReadiness.js +5 -2
  150. package/build/utils/didReadiness.js.map +1 -1
  151. package/build/utils/ecsClaims.d.ts +46 -0
  152. package/build/utils/ecsClaims.js +115 -0
  153. package/build/utils/ecsClaims.js.map +1 -0
  154. package/build/utils/ecsService.d.ts +8 -0
  155. package/build/utils/ecsService.js +23 -0
  156. package/build/utils/ecsService.js.map +1 -0
  157. package/build/utils/index.d.ts +7 -0
  158. package/build/utils/index.js +7 -0
  159. package/build/utils/index.js.map +1 -1
  160. package/build/utils/publishedDidRecord.d.ts +15 -0
  161. package/build/utils/publishedDidRecord.js +83 -0
  162. package/build/utils/publishedDidRecord.js.map +1 -0
  163. package/build/utils/selfIssuedEcsCredential.d.ts +8 -0
  164. package/build/utils/selfIssuedEcsCredential.js +158 -0
  165. package/build/utils/selfIssuedEcsCredential.js.map +1 -0
  166. package/build/utils/setupSelfTr.d.ts +34 -74
  167. package/build/utils/setupSelfTr.js +79 -321
  168. package/build/utils/setupSelfTr.js.map +1 -1
  169. package/build/utils/trustCredentialStore.d.ts +86 -9
  170. package/build/utils/trustCredentialStore.js +342 -137
  171. package/build/utils/trustCredentialStore.js.map +1 -1
  172. package/build/utils/typeMetadata.d.ts +44 -0
  173. package/build/utils/typeMetadata.js +89 -0
  174. package/build/utils/typeMetadata.js.map +1 -0
  175. package/build/utils/util.d.ts +20 -0
  176. package/build/utils/util.js +32 -1
  177. package/build/utils/util.js.map +1 -1
  178. package/build/utils/vcdm2.d.ts +34 -0
  179. package/build/utils/vcdm2.js +60 -0
  180. package/build/utils/vcdm2.js.map +1 -0
  181. package/build/utils/vtjscResolver.d.ts +23 -0
  182. package/build/utils/vtjscResolver.js +53 -0
  183. package/build/utils/vtjscResolver.js.map +1 -0
  184. package/build/vtFlow/VtFlowOrchestrator.d.ts +134 -16
  185. package/build/vtFlow/VtFlowOrchestrator.js +965 -138
  186. package/build/vtFlow/VtFlowOrchestrator.js.map +1 -1
  187. package/build/vtFlow/assertVerifiableService.d.ts +31 -2
  188. package/build/vtFlow/assertVerifiableService.js +68 -10
  189. package/build/vtFlow/assertVerifiableService.js.map +1 -1
  190. package/build/vtFlow/ecsIssuanceExemption.d.ts +12 -0
  191. package/build/vtFlow/ecsIssuanceExemption.js +63 -0
  192. package/build/vtFlow/ecsIssuanceExemption.js.map +1 -0
  193. package/build/vtFlow/index.d.ts +2 -0
  194. package/build/vtFlow/index.js +2 -0
  195. package/build/vtFlow/index.js.map +1 -1
  196. package/build/vtFlow/issuanceRepair.d.ts +4 -0
  197. package/build/vtFlow/issuanceRepair.js +181 -0
  198. package/build/vtFlow/issuanceRepair.js.map +1 -0
  199. package/package.json +27 -19
  200. package/build/did/migrateWebVhLog.d.ts +0 -34
  201. package/build/did/migrateWebVhLog.js +0 -230
  202. package/build/did/migrateWebVhLog.js.map +0 -1
  203. package/build/did/migrateWebVhVersionTime.d.ts +0 -9
  204. package/build/did/migrateWebVhVersionTime.js +0 -191
  205. package/build/did/migrateWebVhVersionTime.js.map +0 -1
@@ -2,157 +2,167 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VsAgent = void 0;
4
4
  const core_1 = require("@credo-ts/core");
5
+ const didcomm_1 = require("@credo-ts/didcomm");
5
6
  const didwebvh_ts_1 = require("didwebvh-ts");
7
+ const AnonCredsTrustService_1 = require("../blockchain/AnonCredsTrustService");
8
+ const triggerResolver_1 = require("../blockchain/triggerResolver");
6
9
  const adminApiService_1 = require("../did/adminApiService");
7
- const migrateWebVhLog_1 = require("../did/migrateWebVhLog");
8
- const migrateWebVhVersionTime_1 = require("../did/migrateWebVhVersionTime");
10
+ const artifactServices_1 = require("../did/artifactServices");
11
+ const legacyDidWeb_1 = require("../did/legacyDidWeb");
12
+ const reusedDidDocument_1 = require("../did/reusedDidDocument");
9
13
  const BaseMessageEvents_1 = require("../events/BaseMessageEvents");
10
14
  const ConnectionEvents_1 = require("../events/ConnectionEvents");
15
+ const InvitationEvents_1 = require("../events/InvitationEvents");
11
16
  const VtFlowEvents_1 = require("../events/VtFlowEvents");
17
+ const issuanceRepair_1 = require("../vtFlow/issuanceRepair");
18
+ const agent_1 = require("../utils/agent");
12
19
  const MANAGED_DIDCOMM_SERVICE_TYPES = [core_1.DidCommV1Service.type, core_1.NewDidCommV2Service.type];
20
+ const KEY_AGREEMENT_FRAGMENT = 'key-agreement-1';
13
21
  class VsAgent extends core_1.Agent {
14
22
  constructor(options) {
23
+ var _a;
24
+ // Credo validates the module map with a type that it does not export, so cast to its constructor options.
15
25
  super(options);
16
26
  this.did = options.did;
17
- this.autoDiscloseUserProfile = options.autoDiscloseUserProfile;
18
27
  this.publicApiBaseUrl = options.publicApiBaseUrl;
19
28
  this.adminApiServiceEndpoint = options.adminApiServiceEndpoint;
20
- this.displayPictureUrl = options.displayPictureUrl;
21
- this.label = options.label;
22
29
  this.veranaChain = options.veranaChain;
30
+ this.indexer = options.indexer;
31
+ this.trustedEcosystemDids = options.trustedEcosystemDids;
32
+ this.ecsClaims = options.ecsClaims;
23
33
  this.authorizationService = options.authorizationService;
24
34
  this.discoveryOptions = options.discoveryOptions;
35
+ this.anonCredsTrust =
36
+ (_a = options.anonCredsTrust) !== null && _a !== void 0 ? _a : new AnonCredsTrustService_1.AnonCredsTrustService(this, { skipOwnAuthorization: options.skipOwnAuthorization });
25
37
  }
26
38
  get hasUserProfile() {
27
39
  return 'userProfile' in this.modules;
28
40
  }
41
+ /**
42
+ * [VSA-VT-LVP-5]: a `TriggerResolver` that the coalescing window still holds is the only signal of
43
+ * the publication change behind it, so the agent sends it before it stops.
44
+ */
45
+ async shutdown() {
46
+ await (0, triggerResolver_1.flushPendingTriggerResolvers)().catch(error => this.config.logger.error(`[TriggerResolver] the pending trigger was not sent: ${error}`));
47
+ await super.shutdown();
48
+ }
29
49
  async initialize() {
30
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
50
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
31
51
  await super.initialize();
32
52
  const logger = this.config.logger;
33
53
  await (0, ConnectionEvents_1.connectionEvents)(this, { discoveryOptions: this.discoveryOptions, logger });
54
+ (0, InvitationEvents_1.invitationEvents)(this, logger);
34
55
  await (0, BaseMessageEvents_1.baseMessageEvents)(this, logger);
35
56
  await (0, VtFlowEvents_1.vtFlowEvents)(this, logger);
36
- if (this.hasUserProfile) {
37
- // Make sure default User Profile corresponds to settings in environment variables
38
- const imageUrl = this.displayPictureUrl;
39
- const displayPicture = imageUrl ? { links: [imageUrl], mimeType: 'image/png' } : undefined;
40
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
- await this.modules.userProfile.updateUserProfileData({
42
- displayName: this.label,
43
- displayPicture,
44
- }); // TODO: Move this logic to the ChatPlugin
45
- }
57
+ (0, issuanceRepair_1.watchIssuanceRepair)(this, logger);
46
58
  const parsedDid = this.did ? (0, core_1.parseDid)(this.did) : null;
47
59
  if (parsedDid) {
48
- // If a public did is specified, check if it's already stored in the wallet. If it's not the case,
49
- // create a new one and generate keys for DIDComm (if there are endpoints configured)
60
+ // The DID is derived from the public API base URL and is always SCID-less: its id is the
61
+ // location (domain[%3Aport][:path...]). Create it if the wallet holds no record yet.
50
62
  // TODO: Make DIDComm version, keys, etc. configurable. Keys can also be imported
51
- const domain = parsedDid.id.includes(':') ? parsedDid.id.split(':')[1] : parsedDid.id;
63
+ const location = parsedDid.id;
64
+ const [domain, ...pathSegments] = location.split(':');
65
+ const path = pathSegments.length ? pathSegments.join('/') : undefined;
52
66
  const existingRecord = await this.findCreatedDid(parsedDid);
67
+ if (!existingRecord) {
68
+ const otherMethod = parsedDid.method === 'webvh' ? 'web' : 'webvh';
69
+ const foreignRecord = await this.findCreatedDid(Object.assign(Object.assign({}, parsedDid), { method: otherMethod }));
70
+ if (foreignRecord) {
71
+ throw new core_1.CredoError(`Persisted public DID '${foreignRecord.did}' was created with method '${otherMethod}', but AGENT_PUBLIC_DID_METHOD is now '${parsedDid.method}'. Refusing to start: creating a second DID would discard the credentials, Participant entries and permissions bound to the persisted one.`);
72
+ }
73
+ }
74
+ if (existingRecord) {
75
+ const persistedLocation = parsedDid.method === 'webvh'
76
+ ? existingRecord.getTag('domain')
77
+ : (0, core_1.parseDid)(existingRecord.did).id;
78
+ if (persistedLocation !== location) {
79
+ throw new core_1.CredoError(`Persisted public DID '${existingRecord.did}' was created for location '${persistedLocation}', but PUBLIC_API_BASE_URL now derives location '${location}'. Refusing to start: restore the previous URL or deliberately reset the wallet.`);
80
+ }
81
+ }
53
82
  // DID has not been created yet. Let's do it
54
83
  if (!existingRecord) {
55
84
  if (parsedDid.method === 'web') {
56
85
  const didDocument = new core_1.DidDocument({ id: parsedDid.did });
57
- const didCommKey = await this.createAndAddDidCommKeysAndServices(didDocument);
58
- // Add Self TR
59
- await this.createAndAddLinkedVpServices(didDocument);
60
- // Add AnonCreds Services
61
- await this.createAndAddAnonCredsServices(didDocument);
86
+ const didCommKeys = await this.createAndAddDidCommKeysAndServices(didDocument);
87
+ this.addLinkedVpContext(didDocument);
88
+ (0, artifactServices_1.applyArtifactServices)(didDocument, { method: 'web', publicApiBaseUrl: this.publicApiBaseUrl });
62
89
  this.applyAdminApiService(didDocument);
63
- await this.dids.create({
90
+ const createResult = await this.dids.create({
64
91
  method: 'web',
65
- domain,
92
+ domain: location,
66
93
  didDocument,
67
- keys: [didCommKey],
94
+ keys: didCommKeys,
68
95
  });
96
+ if (createResult.didState.state !== 'finished') {
97
+ throw new core_1.CredoError(`Failed to create did:web record: ${(_a = createResult.didState.reason) !== null && _a !== void 0 ? _a : 'unknown reason'}`);
98
+ }
69
99
  this.did = parsedDid.did;
70
100
  }
71
101
  else if (parsedDid.method === 'webvh') {
72
- // If there is an existing did:web with the same domain, this could be an
73
- // upgrade. There should be no problem on removing did:web record since we
74
- // can use newer keys for DIDComm bootstrapping, but we should at least warn
75
- // about that
76
- const didRepository = this.dependencyManager.resolve(core_1.DidRepository);
77
- const existingDidWebRecord = await didRepository.findCreatedDid(this.context, `did:web:${domain}`);
78
- if (existingDidWebRecord) {
79
- this.logger.warn('Existing record for legacy did:web found. Removing it');
80
- await didRepository.delete(this.context, existingDidWebRecord);
81
- }
82
- const { didState: { did: publicDid, didDocument }, } = await this.dids.create({ method: 'webvh', domain });
102
+ const createResult = await this.dids.create({ method: 'webvh', domain, path });
103
+ const { did: publicDid, didDocument } = createResult.didState;
83
104
  if (!publicDid || !didDocument) {
84
- this.logger.error('Failed to create did:webvh record');
85
- process.exit(1);
105
+ throw new core_1.CredoError(`Failed to create did:webvh record: ${(_b = createResult.didState.reason) !== null && _b !== void 0 ? _b : 'unknown reason'}`);
86
106
  }
87
107
  // Add DIDComm services and keys
88
- const didCommKey = await this.createAndAddDidCommKeysAndServices(didDocument);
89
- // Add Linked VP services
90
- await this.createAndAddLinkedVpServices(didDocument);
91
- // Add implicit services
92
- await this.createAndAddWebVhImplicitServices(didDocument);
93
- didDocument.alsoKnownAs = [`did:web:${domain}`];
108
+ const didCommKeys = await this.createAndAddDidCommKeysAndServices(didDocument);
109
+ this.addLinkedVpContext(didDocument);
110
+ (0, artifactServices_1.applyArtifactServices)(didDocument, { method: 'webvh', publicApiBaseUrl: this.publicApiBaseUrl });
111
+ const legacyDidWeb = (0, legacyDidWeb_1.getLegacyDidWeb)(publicDid);
112
+ if (legacyDidWeb)
113
+ didDocument.alsoKnownAs = [legacyDidWeb];
94
114
  // The webvh registrar doesn't merge new keys into the DidRecord on update,
95
115
  // so persist the DIDComm key mapping directly on the existing record.
96
- await this.persistDidDocumentKey(publicDid, didCommKey);
116
+ const didRepository = this.agentContext.resolve(core_1.DidRepository);
117
+ const [record] = await didRepository.findByQuery(this.agentContext, { did: publicDid });
118
+ if (record) {
119
+ record.keys = [...((_c = record.keys) !== null && _c !== void 0 ? _c : []), ...didCommKeys];
120
+ if (legacyDidWeb)
121
+ record.setTag('alternativeDids', [legacyDidWeb]);
122
+ await didRepository.update(this.agentContext, record);
123
+ }
97
124
  this.applyAdminApiService(didDocument);
98
125
  const result = await this.dids.update({ did: publicDid, didDocument });
99
126
  if (result.didState.state !== 'finished') {
100
- this.logger.error(`Cannot update DID ${publicDid}`);
101
- process.exit(1);
127
+ throw new core_1.CredoError(`Cannot update DID ${publicDid}: ${(_d = result.didState.reason) !== null && _d !== void 0 ? _d : 'unknown reason'}`);
102
128
  }
103
- (_a = this.logger) === null || _a === void 0 ? void 0 : _a.debug('Public did:webvh record created');
129
+ (_e = this.logger) === null || _e === void 0 ? void 0 : _e.debug('Public did:webvh record created');
104
130
  this.did = publicDid;
105
131
  }
106
132
  else {
107
133
  throw new core_1.CredoError(`Agent DID method not supported: ${parsedDid.method}`);
108
134
  }
135
+ await this.ensureSharedPublicDidInvitation();
109
136
  return;
110
137
  }
111
- // Ensure the stored did:webvh log is resolvable under the current didwebvh-ts version:
112
- // <2.7.4 wrote broken entry hashes (SCID placeholder), and >=2.8.0 rejects the
113
- // same-second versionTimes the old create+update-at-init flow produced. Both migrations
114
- // rebuild the log in-place, preserving entry #1 (and therefore the SCID and public DID).
115
- if (parsedDid.method === 'webvh') {
116
- try {
117
- await (0, migrateWebVhVersionTime_1.migrateWebVhVersionTimeIfBroken)(this.agentContext, existingRecord, this.logger);
118
- await (0, migrateWebVhLog_1.migrateWebVhLogIfBroken)(this.agentContext, existingRecord, this.logger);
119
- }
120
- catch (error) {
121
- this.logger.error(`Failed to migrate webvh DID log for ${existingRecord.did}: ${error instanceof Error ? error.message : String(error)}`);
122
- throw error;
123
- }
124
- }
125
- // Make sure did:webvh record has the did:web form as an alternative, in order to support
126
- // implicit invitations
127
- if (parsedDid.method === 'webvh' &&
128
- !((_b = existingRecord === null || existingRecord === void 0 ? void 0 : existingRecord.getTag('alternativeDids')) === null || _b === void 0 ? void 0 : _b.includes(`did:web:${domain}`))) {
129
- (_c = this.logger) === null || _c === void 0 ? void 0 : _c.debug('Adding did:web form as an alternative DID');
130
- existingRecord.setTag('alternativeDids', [`did:web:${domain}`]);
131
- const didRepository = this.dependencyManager.resolve(core_1.DidRepository);
132
- await didRepository.update(this.agentContext, existingRecord);
133
- }
134
- // Fix a legacy webvh update-key mapping before the self-heal update below relies on it.
135
- if (parsedDid.method === 'webvh')
136
- await this.repairWebvhUpdateKeyMapping(existingRecord);
137
- // DID Already exists: update it in case that agent parameters have been changed. At the moment, we can only update
138
- // DIDComm endpoints, so we'll only replace the service (if different from previous)
138
+ // DID already exists: reconcile the stored document with the current agent parameters,
139
+ // updating it only if one of the checks below finds a difference
139
140
  const didDocument = existingRecord.didDocument;
140
- const hasLegacyMethods = ((_d = didDocument.verificationMethod) !== null && _d !== void 0 ? _d : []).some(vm => ['Ed25519VerificationKey2018', 'X25519KeyAgreementKey2019'].includes(vm.type));
141
+ // A document written by v1 keeps its key relations and Linked VP services, which no resolver accepts
142
+ const signingKeyRelationsChanged = (0, reusedDidDocument_1.alignSigningKeyRelations)(didDocument, (0, reusedDidDocument_1.didWebvhUpdateKeys)(existingRecord.metadata.get('log')));
143
+ const removedLinkedVpServices = (0, reusedDidDocument_1.removeUnservedLinkedVpServices)(didDocument, {
144
+ publicApiBaseUrl: this.publicApiBaseUrl,
145
+ vtc: (_f = existingRecord.metadata.get('_vt/vtc')) !== null && _f !== void 0 ? _f : undefined,
146
+ jsc: (_g = existingRecord.metadata.get('_vt/jsc')) !== null && _g !== void 0 ? _g : undefined,
147
+ });
148
+ const publicationChanged = signingKeyRelationsChanged || removedLinkedVpServices.length > 0;
141
149
  const ed25519VerificationMethodId = this.findEd25519VerificationMethodId(didDocument);
150
+ const keyAgreementKey = await this.replaceDerivedKeyAgreementKey(existingRecord, didDocument);
142
151
  const servicesChanged = !ed25519VerificationMethodId ||
143
- JSON.stringify(didDocument.didCommServices) !==
144
- JSON.stringify(this.getDidCommServices(didDocument.id, ed25519VerificationMethodId));
145
- // One-shot migration for did:webvh records published before authentication-replace
146
- // landed, which still carry the didwebvh-ts update key in authentication.
147
- const authHasUpdateKey = parsedDid.method === 'webvh' &&
148
- !!ed25519VerificationMethodId &&
149
- ((_e = didDocument.authentication) !== null && _e !== void 0 ? _e : []).some(a => {
150
- const id = typeof a === 'string' ? a : a.id;
151
- return id !== ed25519VerificationMethodId;
152
- });
153
- const currentAdminEntry = ((_f = didDocument.service) !== null && _f !== void 0 ? _f : []).find(s => s.type === 'VsAgentAdminAPI');
152
+ JSON.stringify(((_h = didDocument.service) !== null && _h !== void 0 ? _h : []).filter(service => MANAGED_DIDCOMM_SERVICE_TYPES.includes(service.type))) !== JSON.stringify(this.getDidCommServices(didDocument.id, ed25519VerificationMethodId));
153
+ const currentAdminEntry = ((_j = didDocument.service) !== null && _j !== void 0 ? _j : []).find(s => s.type === 'VsAgentAdminAPI');
154
154
  const adminEntryChanged = (currentAdminEntry === null || currentAdminEntry === void 0 ? void 0 : currentAdminEntry.serviceEndpoint) !== this.adminApiServiceEndpoint;
155
- if (hasLegacyMethods || servicesChanged || authHasUpdateKey || adminEntryChanged) {
155
+ // A record from an earlier version may still carry the service of the other method.
156
+ const artifactMethod = parsedDid.method === 'webvh' ? 'webvh' : 'web';
157
+ const artifactServicesChanged = !(0, artifactServices_1.artifactServicesMatch)(didDocument, {
158
+ method: artifactMethod,
159
+ publicApiBaseUrl: this.publicApiBaseUrl,
160
+ });
161
+ if (keyAgreementKey ||
162
+ servicesChanged ||
163
+ adminEntryChanged ||
164
+ artifactServicesChanged ||
165
+ publicationChanged) {
156
166
  if (servicesChanged && ed25519VerificationMethodId) {
157
167
  didDocument.service = [
158
168
  ...(didDocument.service
@@ -161,50 +171,66 @@ class VsAgent extends core_1.Agent {
161
171
  ...this.getDidCommServices(didDocument.id, ed25519VerificationMethodId),
162
172
  ];
163
173
  }
174
+ (0, artifactServices_1.applyArtifactServices)(didDocument, {
175
+ method: artifactMethod,
176
+ publicApiBaseUrl: this.publicApiBaseUrl,
177
+ });
164
178
  this.applyAdminApiService(didDocument);
165
- const newKeys = [];
166
- if (hasLegacyMethods) {
167
- newKeys.push(await this.createAndAddDidCommKeysAndServices(didDocument));
168
- }
169
- if (authHasUpdateKey)
170
- didDocument.authentication = [ed25519VerificationMethodId];
171
- if (newKeys.length && parsedDid.method === 'webvh') {
172
- // webvh registrar doesn't accept keys in update options; persist directly
173
- for (const key of newKeys)
174
- await this.persistDidDocumentKey(didDocument.id, key);
175
- }
176
179
  // The webvh registrar returns state:"failed" WITHOUT throwing, so an unchecked update
177
180
  // silently no-ops. Check the result and surface the reason instead of assuming success.
178
- const updateResult = await this.dids.update(Object.assign({ did: didDocument.id, didDocument }, (newKeys.length && parsedDid.method === 'web' ? { keys: newKeys } : {})));
181
+ const updateResult = await this.dids.update({ did: didDocument.id, didDocument });
179
182
  if (updateResult.didState.state !== 'finished') {
180
- (_g = this.logger) === null || _g === void 0 ? void 0 : _g.error('Public did record update failed to persist', {
181
- did: didDocument.id,
182
- state: updateResult.didState.state,
183
- reason: updateResult.didState.reason,
184
- });
183
+ throw new core_1.CredoError(`Cannot update DID ${didDocument.id}: ${(_k = updateResult.didState.reason) !== null && _k !== void 0 ? _k : 'unknown reason'}`);
185
184
  }
186
- else {
187
- (_h = this.logger) === null || _h === void 0 ? void 0 : _h.debug('Public did record updated');
185
+ // Mapped only once the document publishes the key, so an interrupted update is retried on the next start
186
+ if (keyAgreementKey)
187
+ await this.addDidKey(didDocument.id, keyAgreementKey);
188
+ if (signingKeyRelationsChanged) {
189
+ (_l = this.logger) === null || _l === void 0 ? void 0 : _l.info(`Signing key of ${didDocument.id} is now under authentication and assertionMethod, without the did:webvh update key`);
188
190
  }
191
+ if (removedLinkedVpServices.length) {
192
+ (_m = this.logger) === null || _m === void 0 ? void 0 : _m.info(`Removed the Linked VP services of ${didDocument.id} that the agent does not serve: ${removedLinkedVpServices.join(', ')}`);
193
+ }
194
+ (_o = this.logger) === null || _o === void 0 ? void 0 : _o.debug('Public did record updated');
189
195
  }
190
196
  else {
191
- (_j = this.logger) === null || _j === void 0 ? void 0 : _j.debug('Existing DID record found. No updates');
197
+ (_p = this.logger) === null || _p === void 0 ? void 0 : _p.debug('Existing DID record found. No updates');
192
198
  }
193
199
  this.did = existingRecord.did;
200
+ // [VSA-VT-LVP-5]: resolvers read the reconciled document only once they are told it changed
201
+ if (publicationChanged) {
202
+ (0, triggerResolver_1.scheduleTriggerResolverForOwnDid)(this, 'the reused DID Document was brought to the current layout');
203
+ }
204
+ await this.ensureSharedPublicDidInvitation();
194
205
  }
195
206
  }
207
+ // Credo refuses implicit connections to a public DID that the agent dialed peers from, unless a
208
+ // shared invitation names it. This one keeps the public DID open and is never shown.
209
+ async ensureSharedPublicDidInvitation() {
210
+ const agent = this;
211
+ if (!agent.did || !agent.didcomm.config.didcommVersions.includes('v2'))
212
+ return;
213
+ const [invitation] = await agent.didcomm.oob.findAllByQuery({ role: didcomm_1.DidCommOutOfBandRole.Sender, recipientDid: agent.did, sharedRecipientDid: true }, { limit: 1 });
214
+ if (!invitation)
215
+ await (0, agent_1.createInvitation)({ agent });
216
+ }
196
217
  async findCreatedDid(parsedDid) {
197
218
  const didRepository = this.dependencyManager.resolve(core_1.DidRepository);
198
- // Particular case of webvh: parsedDid might not include the SCID, so we'll need to find it by domain
199
- if (parsedDid.method === 'webvh') {
200
- const domain = parsedDid.id.includes(':') ? parsedDid.id.split(':')[1] : parsedDid.id;
201
- return await didRepository.findSingleByQuery(this.context, { method: 'webvh', domain });
202
- }
203
- return await didRepository.findCreatedDid(this.context, parsedDid.did);
219
+ // Method-scoped on purpose: a location change must surface as a mismatch error in
220
+ // initialize, never as a lookup miss that silently mints a second DID
221
+ return await didRepository.findSingleByQuery(this.context, {
222
+ method: parsedDid.method,
223
+ role: core_1.DidDocumentRole.Created,
224
+ });
204
225
  }
205
- // Prefer Ed25519VerificationKey2020 over Multikey: webvh's update Multikey is not ours to use.
226
+ // The signing key comes first: a v1 did:webvh document types the update key as
227
+ // Ed25519VerificationKey2020 too, and lists it before the key of the agent. Then prefer
228
+ // Ed25519VerificationKey2020 over Multikey: webvh's update Multikey is not ours to use.
206
229
  findEd25519VerificationMethodId(didDocument) {
207
230
  var _a;
231
+ const signingKeyId = (0, reusedDidDocument_1.findSigningVerificationMethodId)(didDocument);
232
+ if (signingKeyId)
233
+ return signingKeyId;
208
234
  const vms = (_a = didDocument.verificationMethod) !== null && _a !== void 0 ? _a : [];
209
235
  const preferred = vms.find(vm => vm.type === 'Ed25519VerificationKey2020');
210
236
  if (preferred)
@@ -243,55 +269,39 @@ class VsAgent extends core_1.Agent {
243
269
  });
244
270
  return services;
245
271
  }
246
- async persistDidDocumentKey(did, key) {
272
+ // DIDs created by earlier versions publish an X25519 key derived from the Ed25519 key, with no KMS key of its own
273
+ async replaceDerivedKeyAgreementKey(didRecord, didDocument) {
274
+ var _a, _b, _c;
275
+ const keyAgreementId = `${didDocument.id}#${KEY_AGREEMENT_FRAGMENT}`;
276
+ const verificationMethod = (_a = didDocument.verificationMethod) === null || _a === void 0 ? void 0 : _a.find(vm => vm.id === keyAgreementId);
277
+ if (!verificationMethod)
278
+ return;
279
+ if ((_b = didRecord.keys) === null || _b === void 0 ? void 0 : _b.some(({ didDocumentRelativeKeyId }) => keyAgreementId.endsWith(didDocumentRelativeKeyId))) {
280
+ return;
281
+ }
282
+ (_c = this.logger) === null || _c === void 0 ? void 0 : _c.info(`Key agreement key of ${didDocument.id} has no KMS key. Replacing it with a new X25519 key`);
283
+ const { key, publicKeyMultibase } = await this.createKeyAgreementKey();
284
+ verificationMethod.publicKeyMultibase = publicKeyMultibase;
285
+ return key;
286
+ }
287
+ async createKeyAgreementKey() {
288
+ const kms = this.agentContext.resolve(core_1.Kms.KeyManagementApi);
289
+ const { keyId, publicJwk } = await kms.createKey({ type: { kty: 'OKP', crv: 'X25519' } });
290
+ return {
291
+ key: { kmsKeyId: keyId, didDocumentRelativeKeyId: `#${KEY_AGREEMENT_FRAGMENT}` },
292
+ publicKeyMultibase: core_1.Kms.PublicJwk.fromPublicJwk(publicJwk).fingerprint,
293
+ };
294
+ }
295
+ async addDidKey(did, key) {
247
296
  var _a;
248
297
  const didRepository = this.agentContext.resolve(core_1.DidRepository);
249
298
  const [record] = await didRepository.findByQuery(this.agentContext, { did });
250
- if (!record)
251
- return;
252
- const existing = (_a = record.keys) !== null && _a !== void 0 ? _a : [];
253
- if (existing.some(k => k.didDocumentRelativeKeyId === key.didDocumentRelativeKeyId))
254
- return;
255
- record.keys = [...existing, key];
299
+ record.keys = [
300
+ ...((_a = record.keys) !== null && _a !== void 0 ? _a : []).filter(({ didDocumentRelativeKeyId }) => didDocumentRelativeKeyId !== key.didDocumentRelativeKeyId),
301
+ key,
302
+ ];
256
303
  await didRepository.update(this.agentContext, record);
257
304
  }
258
- /**
259
- * Fix a webvh update-key mapping whose `didDocumentRelativeKeyId` was stored as the full multibase
260
- * (e.g. `#z6Mk...`) while the DID document verification method uses a short fragment (e.g. `#BVhGnL79`).
261
- * `getKmsKeyIdForVerifiacationMethod` matches by suffix (`vm.id.endsWith(relativeKeyId)`), so the
262
- * mismatch leaves the update key unresolvable and every webvh update fails with
263
- * "The key ID must be present before the log can be edited." The private key is present in the KMS;
264
- * only the mapping label is wrong. Idempotent: a mapping that already correlates to a VM is left alone.
265
- */
266
- async repairWebvhUpdateKeyMapping(record) {
267
- var _a, _b, _c;
268
- if (!record.didDocument || !((_a = record.keys) === null || _a === void 0 ? void 0 : _a.length))
269
- return;
270
- const vms = (_b = record.didDocument.verificationMethod) !== null && _b !== void 0 ? _b : [];
271
- let repaired = false;
272
- for (const key of record.keys) {
273
- const rel = key.didDocumentRelativeKeyId;
274
- if (vms.some(vm => vm.id.endsWith(rel)))
275
- continue; // already correlates
276
- const vm = vms.find(v => `#${v.publicKeyMultibase}` === rel); // was stored as #<multibase>
277
- if (!vm)
278
- continue;
279
- const correct = `#${vm.id.split('#')[1]}`;
280
- if (correct !== rel) {
281
- (_c = this.logger) === null || _c === void 0 ? void 0 : _c.warn('Fixing webvh update-key mapping', {
282
- from: rel,
283
- to: correct,
284
- kmsKeyId: key.kmsKeyId,
285
- });
286
- key.didDocumentRelativeKeyId = correct;
287
- repaired = true;
288
- }
289
- }
290
- if (repaired) {
291
- const didRepository = this.dependencyManager.resolve(core_1.DidRepository);
292
- await didRepository.update(this.agentContext, record);
293
- }
294
- }
295
305
  async createAndAddDidCommKeysAndServices(didDocument) {
296
306
  var _a, _b, _c, _d, _e;
297
307
  const publicDid = didDocument.id;
@@ -300,7 +310,7 @@ class VsAgent extends core_1.Agent {
300
310
  'https://w3id.org/security/suites/ed25519-2020/v1',
301
311
  'https://w3id.org/security/suites/x25519-2019/v1',
302
312
  ];
303
- const keyAgreementId = `${publicDid}#key-agreement-1`;
313
+ const keyAgreementId = `${publicDid}#${KEY_AGREEMENT_FRAGMENT}`;
304
314
  const kms = this.agentContext.resolve(core_1.Kms.KeyManagementApi);
305
315
  // Create didcomm keys
306
316
  const key = await kms.createKey({ type: { kty: 'OKP', crv: 'Ed25519' } });
@@ -311,8 +321,7 @@ class VsAgent extends core_1.Agent {
311
321
  didDocumentRelativeKeyId: `#${publicKeyMultibase}`,
312
322
  };
313
323
  const verificationMethodId = `${publicDid}#${publicKeyMultibase}`;
314
- const publicKeyX25519 = (0, core_1.convertPublicKeyToX25519)(publicKeyBytes);
315
- const x25519Key = core_1.Kms.PublicJwk.fromPublicKey({ kty: 'OKP', crv: 'X25519', publicKey: publicKeyX25519 });
324
+ const keyAgreementKey = await this.createKeyAgreementKey();
316
325
  // Remove legacy if exist
317
326
  const legacyContexts = ['https://w3id.org/security/suites/ed25519-2018/v1'];
318
327
  const legacyAuthId = (_b = ((_a = didDocument.verificationMethod) !== null && _a !== void 0 ? _a : []).find(vm => ['Ed25519VerificationKey2018'].includes(vm.type))) === null || _b === void 0 ? void 0 : _b.id;
@@ -331,7 +340,7 @@ class VsAgent extends core_1.Agent {
331
340
  {
332
341
  controller: publicDid,
333
342
  id: keyAgreementId,
334
- publicKeyMultibase: x25519Key.fingerprint,
343
+ publicKeyMultibase: keyAgreementKey.publicKeyMultibase,
335
344
  type: 'Multikey',
336
345
  },
337
346
  ];
@@ -359,66 +368,15 @@ class VsAgent extends core_1.Agent {
359
368
  : []),
360
369
  ...didcommServices,
361
370
  ];
362
- return didDocumentKey;
371
+ return [didDocumentKey, keyAgreementKey.key];
363
372
  }
364
- async createAndAddLinkedVpServices(didDocument) {
365
- var _a, _b;
366
- const publicDid = didDocument.id;
367
- didDocument.service = [
368
- ...((_a = didDocument.service) !== null && _a !== void 0 ? _a : []),
369
- ...[
370
- new core_1.DidDocumentService({
371
- id: `${publicDid}#vpr-schemas-service-vtc-vp`,
372
- serviceEndpoint: `${this.publicApiBaseUrl}/vt/ecs-service-vtc-vp.json`,
373
- type: 'LinkedVerifiablePresentation',
374
- }),
375
- new core_1.DidDocumentService({
376
- id: `${publicDid}#vpr-schemas-org-vtc-vp`,
377
- serviceEndpoint: `${this.publicApiBaseUrl}/vt/ecs-org-vtc-vp.json`,
378
- type: 'LinkedVerifiablePresentation',
379
- }),
380
- ],
381
- ];
373
+ addLinkedVpContext(didDocument) {
374
+ var _a;
382
375
  didDocument.context = [
383
- ...((_b = didDocument.context) !== null && _b !== void 0 ? _b : []),
376
+ ...((_a = didDocument.context) !== null && _a !== void 0 ? _a : []),
384
377
  'https://identity.foundation/linked-vp/contexts/v1',
385
378
  ];
386
379
  }
387
- /**
388
- * Basic implicit webvh services, for the moment pointing to the service VP
389
- * and public base URL
390
- */
391
- async createAndAddWebVhImplicitServices(didDocument) {
392
- var _a;
393
- const publicDid = didDocument.id;
394
- didDocument.service = [
395
- ...((_a = didDocument.service) !== null && _a !== void 0 ? _a : []),
396
- ...[
397
- new core_1.DidDocumentService({
398
- id: `${publicDid}#whois`,
399
- serviceEndpoint: `${this.publicApiBaseUrl}/vt/ecs-service-vtc-vp.json`,
400
- type: 'LinkedVerifiablePresentation',
401
- }),
402
- new core_1.DidDocumentService({
403
- id: `${publicDid}#files`,
404
- serviceEndpoint: `${this.publicApiBaseUrl}`,
405
- type: 'relativeRef',
406
- }),
407
- ],
408
- ];
409
- }
410
- async createAndAddAnonCredsServices(didDocument) {
411
- var _a;
412
- const publicDid = didDocument.id;
413
- didDocument.service = [
414
- ...((_a = didDocument.service) !== null && _a !== void 0 ? _a : []),
415
- new core_1.DidDocumentService({
416
- id: `${publicDid}#anoncreds`,
417
- serviceEndpoint: `${this.publicApiBaseUrl}/anoncreds/v1`,
418
- type: 'AnonCredsRegistry',
419
- }),
420
- ];
421
- }
422
380
  applyAdminApiService(didDocument) {
423
381
  (0, adminApiService_1.applyAdminApiServiceEntry)(didDocument, this.adminApiServiceEndpoint);
424
382
  }
@@ -1 +1 @@
1
- {"version":3,"file":"VsAgent.js","sourceRoot":"","sources":["../../src/agent/VsAgent.ts"],"names":[],"mappings":";;;AAQA,yCAoBuB;AAYvB,6CAAgE;AAIhE,4DAAkE;AAClE,4DAAgE;AAChE,4EAAgF;AAChF,mEAA+D;AAC/D,iEAA6D;AAC7D,yDAAqD;AAErD,MAAM,6BAA6B,GAAsB,CAAC,uBAAgB,CAAC,IAAI,EAAE,0BAAmB,CAAC,IAAI,CAAC,CAAA;AAoC1G,MAAa,OAA8D,SAAQ,YAAe;IAWhG,YACE,OAUC;QAED,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;QACtB,IAAI,CAAC,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAA;QAC9D,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAA;QAChD,IAAI,CAAC,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAA;QAC9D,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAA;QAClD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;QAC1B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;QACtC,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAA;QACx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