@verana-labs/vs-agent-sdk 1.12.0-dev.2 → 1.12.0-dev.21

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 (78) hide show
  1. package/README.md +35 -46
  2. package/build/agent/VsAgent.d.ts +6 -0
  3. package/build/agent/VsAgent.js +25 -13
  4. package/build/agent/VsAgent.js.map +1 -1
  5. package/build/agent/createVsAgent.d.ts +1 -0
  6. package/build/agent/createVsAgent.js +1 -0
  7. package/build/agent/createVsAgent.js.map +1 -1
  8. package/build/blockchain/IndexerWebSocketService.d.ts +15 -13
  9. package/build/blockchain/IndexerWebSocketService.js +207 -103
  10. package/build/blockchain/IndexerWebSocketService.js.map +1 -1
  11. package/build/blockchain/VeranaChainService.d.ts +33 -11
  12. package/build/blockchain/VeranaChainService.js +246 -55
  13. package/build/blockchain/VeranaChainService.js.map +1 -1
  14. package/build/blockchain/VeranaHelpers.js +3 -2
  15. package/build/blockchain/VeranaHelpers.js.map +1 -1
  16. package/build/blockchain/VeranaIndexerService.d.ts +9 -5
  17. package/build/blockchain/VeranaIndexerService.js +41 -23
  18. package/build/blockchain/VeranaIndexerService.js.map +1 -1
  19. package/build/blockchain/handlers/IndexerHandlerRegistry.d.ts +5 -3
  20. package/build/blockchain/handlers/IndexerHandlerRegistry.js +6 -0
  21. package/build/blockchain/handlers/IndexerHandlerRegistry.js.map +1 -1
  22. package/build/blockchain/handlers/defaultHandlers.d.ts +4 -1
  23. package/build/blockchain/handlers/defaultHandlers.js +76 -44
  24. package/build/blockchain/handlers/defaultHandlers.js.map +1 -1
  25. package/build/blockchain/handlers/stateMutations.d.ts +17 -4
  26. package/build/blockchain/handlers/stateMutations.js +229 -31
  27. package/build/blockchain/handlers/stateMutations.js.map +1 -1
  28. package/build/blockchain/indexerSync.d.ts +10 -0
  29. package/build/blockchain/indexerSync.js +34 -0
  30. package/build/blockchain/indexerSync.js.map +1 -0
  31. package/build/blockchain/types.d.ts +291 -49
  32. package/build/blockchain/types.js +27 -1
  33. package/build/blockchain/types.js.map +1 -1
  34. package/build/credentials/FullTailsFileService.d.ts +4 -4
  35. package/build/credentials/FullTailsFileService.js +78 -71
  36. package/build/credentials/FullTailsFileService.js.map +1 -1
  37. package/build/did/adminApiService.d.ts +2 -0
  38. package/build/did/adminApiService.js +17 -0
  39. package/build/did/adminApiService.js.map +1 -0
  40. package/build/did/migrateWebVhVersionTime.d.ts +9 -0
  41. package/build/did/migrateWebVhVersionTime.js +191 -0
  42. package/build/did/migrateWebVhVersionTime.js.map +1 -0
  43. package/build/events/VsAgentEvents.d.ts +16 -2
  44. package/build/events/VsAgentEvents.js +2 -0
  45. package/build/events/VsAgentEvents.js.map +1 -1
  46. package/build/events/VtFlowEvents.d.ts +3 -0
  47. package/build/events/VtFlowEvents.js +35 -0
  48. package/build/events/VtFlowEvents.js.map +1 -0
  49. package/build/events/index.d.ts +1 -0
  50. package/build/events/index.js +1 -0
  51. package/build/events/index.js.map +1 -1
  52. package/build/index.d.ts +4 -4
  53. package/build/index.js +9 -6
  54. package/build/index.js.map +1 -1
  55. package/build/plugins/setupBaseDidComm.d.ts +3 -1
  56. package/build/plugins/setupBaseDidComm.js +3 -1
  57. package/build/plugins/setupBaseDidComm.js.map +1 -1
  58. package/build/types.d.ts +2 -0
  59. package/build/types.js +3 -1
  60. package/build/types.js.map +1 -1
  61. package/build/utils/trustCredentialStore.js +2 -0
  62. package/build/utils/trustCredentialStore.js.map +1 -1
  63. package/build/utils/util.d.ts +5 -1
  64. package/build/utils/util.js +17 -5
  65. package/build/utils/util.js.map +1 -1
  66. package/build/vtFlow/VtFlowOrchestrator.d.ts +41 -0
  67. package/build/vtFlow/VtFlowOrchestrator.js +285 -0
  68. package/build/vtFlow/VtFlowOrchestrator.js.map +1 -0
  69. package/build/vtFlow/assertVerifiableService.d.ts +8 -0
  70. package/build/vtFlow/assertVerifiableService.js +28 -0
  71. package/build/vtFlow/assertVerifiableService.js.map +1 -0
  72. package/build/vtFlow/credentialDigest.d.ts +3 -0
  73. package/build/vtFlow/credentialDigest.js +23 -0
  74. package/build/vtFlow/credentialDigest.js.map +1 -0
  75. package/build/vtFlow/index.d.ts +2 -0
  76. package/build/vtFlow/index.js +19 -0
  77. package/build/vtFlow/index.js.map +1 -0
  78. package/package.json +16 -12
@@ -3,90 +3,97 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.tailsIndex = exports.baseFilePath = exports.FullTailsFileService = void 0;
7
- exports.deleteTailsEntry = deleteTailsEntry;
6
+ exports.FullTailsFileService = void 0;
7
+ exports.isValidTailsFileName = isValidTailsFileName;
8
+ exports.getTailsDirectoryPath = getTailsDirectoryPath;
9
+ exports.migrateLegacyTailsFiles = migrateLegacyTailsFiles;
10
+ exports.deleteTailsFile = deleteTailsFile;
8
11
  const anoncreds_1 = require("@credo-ts/anoncreds");
9
12
  const core_1 = require("@credo-ts/core");
10
13
  const crypto_1 = require("crypto");
11
14
  const fs_1 = __importDefault(require("fs"));
12
- class FullTailsFileService extends anoncreds_1.BasicTailsFileService {
13
- constructor(options) {
14
- super(options);
15
- this.tailsServerBaseUrl = options.tailsServerBaseUrl;
16
- }
17
- async uploadTailsFile(agentContext, options) {
18
- const revocationRegistryDefinition = options.revocationRegistryDefinition;
19
- const localTailsFilePath = revocationRegistryDefinition.value.tailsLocation;
20
- const tailsFileId = core_1.utils.uuid();
21
- try {
22
- await saveTailsFile(localTailsFilePath, tailsFileId, agentContext.config.logger);
23
- agentContext.config.logger.info('Tails file processed successfully!');
24
- }
25
- catch (error) {
26
- agentContext.config.logger.error(`Failed to process tails file: ${error.message}`);
27
- }
28
- return { tailsFileUrl: `${this.tailsServerBaseUrl}/${encodeURIComponent(tailsFileId)}` };
29
- }
15
+ const os_1 = __importDefault(require("os"));
16
+ const path_1 = __importDefault(require("path"));
17
+ const tailsFileNamePattern = /^[A-Za-z0-9-]+$/;
18
+ function isValidTailsFileName(name) {
19
+ return tailsFileNamePattern.test(name);
30
20
  }
31
- exports.FullTailsFileService = FullTailsFileService;
32
- exports.baseFilePath = './tails';
33
- const indexFilePath = `./${exports.baseFilePath}/index.json`;
34
- if (!fs_1.default.existsSync(exports.baseFilePath)) {
35
- fs_1.default.mkdirSync(exports.baseFilePath, { recursive: true });
21
+ function getTailsDirectoryPath(agentContext) {
22
+ if (process.env.TAILS_DIRECTORY_PATH)
23
+ return process.env.TAILS_DIRECTORY_PATH;
24
+ const fileSystem = agentContext.dependencyManager.resolve(core_1.InjectionSymbols.FileSystem);
25
+ return path_1.default.join(fileSystem.dataPath, 'tails');
36
26
  }
37
- exports.tailsIndex = (fs_1.default.existsSync(indexFilePath) ? JSON.parse(fs_1.default.readFileSync(indexFilePath, { encoding: 'utf-8' })) : {});
38
- function fileHash(filePath, algorithm = 'sha256') {
39
- return new Promise((resolve, reject) => {
40
- const shasum = (0, crypto_1.createHash)(algorithm);
27
+ // Copy uuid tails files from earlier locations (TAILS_DIRECTORY_PATH, ~/.afj/tails, the old cwd ./tails) into the current dir so URLs published before the hash-based change still resolve.
28
+ // TODO (last legacy version: v1.12.0-dev.8): Remove this once the last release using the legacy configuration is no longer supported.
29
+ function migrateLegacyTailsFiles(agentContext) {
30
+ const directory = getTailsDirectoryPath(agentContext);
31
+ const legacyDirectories = [
32
+ process.env.TAILS_DIRECTORY_PATH,
33
+ path_1.default.join(os_1.default.homedir(), '.afj', 'tails'),
34
+ path_1.default.resolve('tails'),
35
+ ];
36
+ for (const legacyDirectory of new Set(legacyDirectories.filter((d) => Boolean(d)))) {
41
37
  try {
42
- const s = fs_1.default.createReadStream(filePath);
43
- s.on('data', function (data) {
44
- shasum.update(data);
45
- });
46
- // making digest
47
- s.on('end', function () {
48
- const hash = shasum.digest('hex');
49
- return resolve(hash);
50
- });
38
+ const legacyIndexPath = path_1.default.join(legacyDirectory, 'index.json');
39
+ if (!fs_1.default.existsSync(legacyIndexPath))
40
+ continue;
41
+ const legacyIndex = JSON.parse(fs_1.default.readFileSync(legacyIndexPath, 'utf-8'));
42
+ fs_1.default.mkdirSync(directory, { recursive: true });
43
+ let migrated = 0;
44
+ for (const [tailsFileId, hash] of Object.entries(legacyIndex)) {
45
+ if (!isValidTailsFileName(tailsFileId) || !isValidTailsFileName(hash))
46
+ continue;
47
+ const source = path_1.default.join(legacyDirectory, hash);
48
+ const destination = path_1.default.join(directory, tailsFileId);
49
+ if (!fs_1.default.existsSync(source) || fs_1.default.existsSync(destination))
50
+ continue;
51
+ const tempPath = path_1.default.join(directory, `.${tailsFileId}.${process.pid}.${(0, crypto_1.randomBytes)(8).toString('hex')}.tmp`);
52
+ try {
53
+ fs_1.default.copyFileSync(source, tempPath);
54
+ fs_1.default.renameSync(tempPath, destination);
55
+ migrated++;
56
+ }
57
+ catch (fileError) {
58
+ try {
59
+ fs_1.default.unlinkSync(tempPath);
60
+ }
61
+ catch (_a) { }
62
+ agentContext.config.logger.warn(`Legacy tails file ${tailsFileId} skipped: ${fileError.message}`);
63
+ }
64
+ }
65
+ if (migrated > 0)
66
+ agentContext.config.logger.info(`Migrated ${migrated} legacy tails file(s) from ${legacyDirectory}`);
51
67
  }
52
68
  catch (error) {
53
- return reject('error in calculation');
69
+ agentContext.config.logger.warn(`Legacy tails migration skipped for ${legacyDirectory}: ${error.message}`);
54
70
  }
55
- });
56
- }
57
- function deleteTailsEntry(tailsFileUrl) {
58
- var _a;
59
- const tailsFileId = decodeURIComponent((_a = tailsFileUrl.split('/').pop()) !== null && _a !== void 0 ? _a : '');
60
- if (!tailsFileId || !exports.tailsIndex[tailsFileId])
61
- return;
62
- const hash = exports.tailsIndex[tailsFileId];
63
- delete exports.tailsIndex[tailsFileId];
64
- fs_1.default.writeFileSync(indexFilePath, JSON.stringify(exports.tailsIndex));
65
- const stillReferenced = Object.values(exports.tailsIndex).includes(hash);
66
- if (!stillReferenced) {
67
- const filePath = `${exports.baseFilePath}/${hash}`;
68
- if (fs_1.default.existsSync(filePath))
69
- fs_1.default.unlinkSync(filePath);
70
71
  }
71
72
  }
72
- async function saveTailsFile(localFilePath, tailsFileId, logger) {
73
- logger.info(`Processing tails file: ${tailsFileId}`);
74
- if (!localFilePath)
75
- throw new Error('No file path was provided.');
76
- if (!tailsFileId)
77
- throw new Error('Missing tailsFileId');
78
- if (exports.tailsIndex[tailsFileId])
79
- throw new Error(`There is already an entry for: ${tailsFileId}`);
80
- const hash = await fileHash(localFilePath);
81
- const destinationPath = `${exports.baseFilePath}/${hash}`;
82
- if (fs_1.default.existsSync(destinationPath)) {
83
- logger.warn('Tails file already exists');
73
+ class FullTailsFileService extends anoncreds_1.BasicTailsFileService {
74
+ constructor(options) {
75
+ super();
76
+ this.tailsServerBaseUrl = options.tailsServerBaseUrl;
84
77
  }
85
- else {
86
- fs_1.default.copyFileSync(localFilePath, destinationPath);
78
+ async uploadTailsFile(agentContext, options) {
79
+ const { tailsLocation, tailsHash } = options.revocationRegistryDefinition.value;
80
+ const directory = getTailsDirectoryPath(agentContext);
81
+ await fs_1.default.promises.mkdir(directory, { recursive: true });
82
+ const destination = path_1.default.join(directory, tailsHash);
83
+ if (!fs_1.default.existsSync(destination))
84
+ await fs_1.default.promises.copyFile(tailsLocation, destination);
85
+ agentContext.config.logger.info(`Stored tails file ${tailsHash}`);
86
+ return { tailsFileUrl: `${this.tailsServerBaseUrl}/${encodeURIComponent(tailsHash)}` };
87
87
  }
88
- exports.tailsIndex[tailsFileId] = hash;
89
- fs_1.default.writeFileSync(indexFilePath, JSON.stringify(exports.tailsIndex));
90
- logger.info(`Successfully processed tails file ${tailsFileId}`);
88
+ }
89
+ exports.FullTailsFileService = FullTailsFileService;
90
+ function deleteTailsFile(agentContext, tailsFileUrl) {
91
+ var _a;
92
+ const tailsHash = decodeURIComponent((_a = tailsFileUrl.split('/').pop()) !== null && _a !== void 0 ? _a : '');
93
+ if (!isValidTailsFileName(tailsHash))
94
+ return;
95
+ const filePath = path_1.default.join(getTailsDirectoryPath(agentContext), tailsHash);
96
+ if (fs_1.default.existsSync(filePath))
97
+ fs_1.default.unlinkSync(filePath);
91
98
  }
92
99
  //# sourceMappingURL=FullTailsFileService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FullTailsFileService.js","sourceRoot":"","sources":["../../src/credentials/FullTailsFileService.ts"],"names":[],"mappings":";;;;;;AAgEA,4CAaC;AA1ED,mDAA2D;AAC3D,yCAAsC;AACtC,mCAAmC;AACnC,4CAAmB;AAEnB,MAAa,oBAAqB,SAAQ,iCAAqB;IAE7D,YAAmB,OAAoE;QACrF,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAA;IACtD,CAAC;IAEM,KAAK,CAAC,eAAe,CAC1B,YAA0B,EAC1B,OAEC;QAED,MAAM,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,CAAA;QACzE,MAAM,kBAAkB,GAAG,4BAA4B,CAAC,KAAK,CAAC,aAAa,CAAA;QAE3E,MAAM,WAAW,GAAG,YAAK,CAAC,IAAI,EAAE,CAAA;QAChC,IAAI,CAAC;YACH,MAAM,aAAa,CAAC,kBAAkB,EAAE,WAAW,EAAE,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;YAChF,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAA;QACvE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;QACpF,CAAC;QACD,OAAO,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,kBAAkB,IAAI,kBAAkB,CAAC,WAAW,CAAC,EAAE,EAAE,CAAA;IAC1F,CAAC;CACF;AAzBD,oDAyBC;AAEY,QAAA,YAAY,GAAG,SAAS,CAAA;AACrC,MAAM,aAAa,G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AC,CAAA;QACrD,MAAM,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QAEvD,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QACnD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,WAAW,CAAC;YAAE,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;QAEvF,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,SAAS,EAAE,CAAC,CAAA;QACjE,OAAO,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,kBAAkB,IAAI,kBAAkB,CAAC,SAAS,CAAC,EAAE,EAAE,CAAA;IACxF,CAAC;CACF;AAvBD,oDAuBC;AAED,SAAgB,eAAe,CAAC,YAA0B,EAAE,YAAoB;;IAC9E,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAA,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,mCAAI,EAAE,CAAC,CAAA;IACzE,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC;QAAE,OAAM;IAE5C,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,EAAE,SAAS,CAAC,CAAA;IAC1E,IAAI,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;AACtD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { DidDocument } from '@credo-ts/core';
2
+ export declare function applyAdminApiServiceEntry(didDocument: DidDocument, adminApiServiceEndpoint?: string): void;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyAdminApiServiceEntry = applyAdminApiServiceEntry;
4
+ const core_1 = require("@credo-ts/core");
5
+ const ADMIN_API_SERVICE_TYPE = 'VsAgentAdminAPI';
6
+ function applyAdminApiServiceEntry(didDocument, adminApiServiceEndpoint) {
7
+ var _a;
8
+ didDocument.service = ((_a = didDocument.service) !== null && _a !== void 0 ? _a : []).filter(service => service.type !== ADMIN_API_SERVICE_TYPE);
9
+ if (adminApiServiceEndpoint) {
10
+ didDocument.service.push(new core_1.DidDocumentService({
11
+ id: `${didDocument.id}#admin-api`,
12
+ type: ADMIN_API_SERVICE_TYPE,
13
+ serviceEndpoint: adminApiServiceEndpoint,
14
+ }));
15
+ }
16
+ }
17
+ //# sourceMappingURL=adminApiService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adminApiService.js","sourceRoot":"","sources":["../../src/did/adminApiService.ts"],"names":[],"mappings":";;AAIA,8DAWC;AAfD,yCAAgE;AAEhE,MAAM,sBAAsB,GAAG,iBAAiB,CAAA;AAEhD,SAAgB,yBAAyB,CAAC,WAAwB,EAAE,uBAAgC;;IAClG,WAAW,CAAC,OAAO,GAAG,CAAC,MAAA,WAAW,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,sBAAsB,CAAC,CAAA;IAC5G,IAAI,uBAAuB,EAAE,CAAC;QAC5B,WAAW,CAAC,OAAO,CAAC,IAAI,CACtB,IAAI,yBAAkB,CAAC;YACrB,EAAE,EAAE,GAAG,WAAW,CAAC,EAAE,YAAY;YACjC,IAAI,EAAE,sBAAsB;YAC5B,eAAe,EAAE,uBAAuB;SACzC,CAAC,CACH,CAAA;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { AgentContext, DidRecord, Logger } from '@credo-ts/core';
2
+ import { DIDLog, Signer, Verifier } from 'didwebvh-ts';
3
+ export interface RebuildWebVhVersionTimesOptions {
4
+ signer: Signer;
5
+ verifier: Verifier;
6
+ domain?: string;
7
+ }
8
+ export declare function rebuildWebVhVersionTimes(log: DIDLog, { signer, verifier, domain }: RebuildWebVhVersionTimesOptions): Promise<DIDLog | null>;
9
+ export declare function migrateWebVhVersionTimeIfBroken(agentContext: AgentContext, didRecord: DidRecord, logger: Logger): Promise<boolean>;
@@ -0,0 +1,191 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rebuildWebVhVersionTimes = rebuildWebVhVersionTimes;
4
+ exports.migrateWebVhVersionTimeIfBroken = migrateWebVhVersionTimeIfBroken;
5
+ const askar_1 = require("@credo-ts/askar");
6
+ const core_1 = require("@credo-ts/core");
7
+ const askar_shared_1 = require("@openwallet-foundation/askar-shared");
8
+ const didwebvh_ts_1 = require("didwebvh-ts");
9
+ // didwebvh-ts >=2.8.0 enforces the spec rule that each entry's versionTime is strictly greater
10
+ // than the previous one; logs written by the old create+update-at-init flow share a second.
11
+ // Hash-chain errors are accepted too: a hash break can mask a same-second pair behind it,
12
+ // and the rebuild recomputes hashes anyway.
13
+ const REBUILDABLE_ERROR = /must be greater than previous entry time|hash chain broken/i;
14
+ class KmsVerifier {
15
+ constructor(agentContext) {
16
+ this.agentContext = agentContext;
17
+ }
18
+ async verify(signature, message, publicKey) {
19
+ try {
20
+ const kms = this.agentContext.dependencyManager.resolve(core_1.Kms.KeyManagementApi);
21
+ const publicJwk = core_1.Kms.PublicJwk.fromPublicKey({ kty: 'OKP', crv: 'Ed25519', publicKey });
22
+ const { verified } = await kms.verify({
23
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
+ key: { publicJwk: publicJwk.toJson() },
25
+ algorithm: 'EdDSA',
26
+ signature,
27
+ data: message,
28
+ });
29
+ return verified;
30
+ }
31
+ catch (_a) {
32
+ return false;
33
+ }
34
+ }
35
+ }
36
+ class KmsSigner {
37
+ constructor(agentContext, kmsKeyId, publicKeyMultibase) {
38
+ this.agentContext = agentContext;
39
+ this.kmsKeyId = kmsKeyId;
40
+ this.publicKeyMultibase = publicKeyMultibase;
41
+ }
42
+ getVerificationMethodId() {
43
+ return `did:key:${this.publicKeyMultibase}`;
44
+ }
45
+ async sign(input) {
46
+ const kms = this.agentContext.dependencyManager.resolve(core_1.Kms.KeyManagementApi);
47
+ const data = await (0, didwebvh_ts_1.prepareDataForSigning)(input.document, input.proof);
48
+ const { signature } = await kms.sign({
49
+ keyId: this.kmsKeyId,
50
+ algorithm: 'EdDSA',
51
+ data,
52
+ });
53
+ return { proofValue: (0, didwebvh_ts_1.multibaseEncode)(signature, didwebvh_ts_1.MultibaseEncoding.BASE58_BTC) };
54
+ }
55
+ }
56
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
+ const normalizeMethodArray = (arr) =>
58
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
+ arr === null || arr === void 0 ? void 0 : arr.map((item) => (typeof item === 'string' ? item : item.id));
60
+ // Compare at second precision because the output is second-truncated.
61
+ function nextVersionTime(previous, desired) {
62
+ const parseSeconds = (value) => Math.floor(Date.parse(value) / 1000) * 1000;
63
+ const previousMs = parseSeconds(previous);
64
+ const desiredMs = parseSeconds(desired);
65
+ const chosen = Number.isNaN(desiredMs) || desiredMs <= previousMs ? previousMs + 1000 : desiredMs;
66
+ return new Date(chosen).toISOString().replace(/\.\d+Z$/, 'Z');
67
+ }
68
+ async function tryResolveLog(log, verifier) {
69
+ try {
70
+ await (0, didwebvh_ts_1.resolveDIDFromLog)(log, { verifier });
71
+ return { ok: true };
72
+ }
73
+ catch (error) {
74
+ return { ok: false, reason: error instanceof Error ? error.message : String(error) };
75
+ }
76
+ }
77
+ async function rebuildWebVhVersionTimes(log, { signer, verifier, domain }) {
78
+ var _a, _b, _c;
79
+ if (!log || log.length < 2)
80
+ return null;
81
+ const initial = await tryResolveLog(log, verifier);
82
+ if (initial.ok)
83
+ return null;
84
+ if (!REBUILDABLE_ERROR.test(initial.reason))
85
+ return null;
86
+ const originalScid = log[0].parameters.scid;
87
+ let newLog = [log[0]];
88
+ for (let i = 1; i < log.length; i++) {
89
+ const oldEntry = log[i];
90
+ const oldState = oldEntry.state;
91
+ const oldParams = oldEntry.parameters;
92
+ const lastParams = newLog[newLog.length - 1].parameters;
93
+ const activeUpdateKeys = (_a = lastParams.updateKeys) !== null && _a !== void 0 ? _a : [];
94
+ if (activeUpdateKeys.length === 0) {
95
+ throw new Error(`Cannot rebuild webvh log: no active updateKeys at entry ${i + 1}`);
96
+ }
97
+ const controllerValue = Array.isArray(oldState.controller) ? oldState.controller[0] : oldState.controller;
98
+ const { log: rebuilt } = await (0, didwebvh_ts_1.updateDID)({
99
+ log: newLog,
100
+ signer,
101
+ verifier,
102
+ domain,
103
+ updateKeys: (_b = oldParams.updateKeys) !== null && _b !== void 0 ? _b : activeUpdateKeys,
104
+ verificationMethods: oldState.verificationMethod,
105
+ services: oldState.service,
106
+ controller: controllerValue,
107
+ authentication: normalizeMethodArray(oldState.authentication),
108
+ assertionMethod: normalizeMethodArray(oldState.assertionMethod),
109
+ keyAgreement: normalizeMethodArray(oldState.keyAgreement),
110
+ alsoKnownAs: oldState.alsoKnownAs,
111
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
112
+ context: oldState['@context'],
113
+ portable: oldParams.portable,
114
+ nextKeyHashes: oldParams.nextKeyHashes,
115
+ witness: oldParams.witness && (((_c = oldParams.witness.witnesses) === null || _c === void 0 ? void 0 : _c.length) || oldParams.witness.threshold)
116
+ ? oldParams.witness
117
+ : undefined,
118
+ watchers: oldParams.watchers,
119
+ updated: nextVersionTime(newLog[newLog.length - 1].versionTime, oldEntry.versionTime),
120
+ });
121
+ newLog = rebuilt;
122
+ }
123
+ const verify = await tryResolveLog(newLog, verifier);
124
+ if (!verify.ok) {
125
+ throw new Error(`Rebuilt webvh log is still invalid: ${verify.reason}`);
126
+ }
127
+ if (newLog[0].parameters.scid !== originalScid) {
128
+ throw new Error(`Rebuilt webvh log produced a different SCID; aborting migration`);
129
+ }
130
+ return newLog;
131
+ }
132
+ async function findKmsKeyIdForFingerprint(agentContext, fingerprint) {
133
+ try {
134
+ const storeManager = agentContext.dependencyManager.resolve(askar_1.AskarStoreManager);
135
+ return await storeManager.withSession(agentContext, async (session) => {
136
+ const entries = await session.fetchAllKeys({ algorithm: askar_shared_1.KeyAlgorithm.Ed25519 });
137
+ for (const entry of entries) {
138
+ const pubBytes = entry.key.publicBytes;
139
+ const computed = (0, didwebvh_ts_1.multibaseEncode)(new Uint8Array([237, 1, ...pubBytes]), didwebvh_ts_1.MultibaseEncoding.BASE58_BTC);
140
+ entry.key.handle.free();
141
+ if (computed === fingerprint)
142
+ return entry.name;
143
+ }
144
+ return undefined;
145
+ });
146
+ }
147
+ catch (_a) {
148
+ agentContext.config.logger.warn(`Failed to scan Askar keys, cannot recover controller key for webvh versionTime migration`);
149
+ return undefined;
150
+ }
151
+ }
152
+ async function migrateWebVhVersionTimeIfBroken(agentContext, didRecord, logger) {
153
+ var _a, _b, _c, _d, _e, _f, _g;
154
+ const log = didRecord.metadata.get('log');
155
+ if (!log || log.length < 2)
156
+ return false;
157
+ const verifier = new KmsVerifier(agentContext);
158
+ const preCheck = await tryResolveLog(log, verifier);
159
+ if (preCheck.ok)
160
+ return false;
161
+ if (!REBUILDABLE_ERROR.test(preCheck.reason))
162
+ return false;
163
+ const domain = didRecord.getTag('domain');
164
+ const activeUpdateKey = (_b = (_a = log[log.length - 1].parameters.updateKeys) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : (_c = log[0].parameters.updateKeys) === null || _c === void 0 ? void 0 : _c[0];
165
+ if (!activeUpdateKey) {
166
+ throw new Error(`Cannot migrate webvh log for ${didRecord.did}: no updateKeys present`);
167
+ }
168
+ let kmsKeyId = (_e = (_d = didRecord.keys) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.kmsKeyId;
169
+ if (!kmsKeyId) {
170
+ kmsKeyId = await findKmsKeyIdForFingerprint(agentContext, activeUpdateKey);
171
+ if (!kmsKeyId) {
172
+ throw new Error(`Cannot migrate webvh log for ${didRecord.did}: no controller key on DID record`);
173
+ }
174
+ logger.warn(`webvh DID ${didRecord.did}: controller key recovered from Askar scan`);
175
+ const vm = (_g = (_f = didRecord.didDocument) === null || _f === void 0 ? void 0 : _f.verificationMethod) === null || _g === void 0 ? void 0 : _g.find(v => v.publicKeyMultibase === activeUpdateKey);
176
+ const relativeKeyId = (vm === null || vm === void 0 ? void 0 : vm.id) ? `#${vm.id.split('#')[1]}` : '#key-1';
177
+ didRecord.keys = [{ kmsKeyId, didDocumentRelativeKeyId: relativeKeyId }];
178
+ }
179
+ logger.warn(`webvh DID log for ${didRecord.did} has non-monotonic versionTimes. ` +
180
+ `Rebuilding entries 2..${log.length} while preserving SCID.`);
181
+ const signer = new KmsSigner(agentContext, kmsKeyId, activeUpdateKey);
182
+ const newLog = await rebuildWebVhVersionTimes(log, { signer, verifier, domain });
183
+ if (!newLog)
184
+ return false;
185
+ didRecord.metadata.set('log', newLog);
186
+ const didRepository = agentContext.dependencyManager.resolve(core_1.DidRepository);
187
+ await didRepository.update(agentContext, didRecord);
188
+ logger.info(`webvh DID log for ${didRecord.did} versionTimes migrated; ${newLog.length} entries; SCID preserved (${log[0].parameters.scid}).`);
189
+ return true;
190
+ }
191
+ //# sourceMappingURL=migrateWebVhVersionTime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrateWebVhVersionTime.js","sourceRoot":"","sources":["../../src/did/migrateWebVhVersionTime.ts"],"names":[],"mappings":";;AAmGA,4DA8DC;AA0BD,0EAmDC;AA9OD,2CAAmD;AACnD,yCAAoF;AACpF,sEAAkE;AAClE,6CAYoB;AAEpB,+FAA+F;AAC/F,4FAA4F;AAC5F,0FAA0F;AAC1F,4CAA4C;AAC5C,MAAM,iBAAiB,GAAG,6DAA6D,CAAA;AAEvF,MAAM,WAAW;IACf,YAAoC,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAE3D,KAAK,CAAC,MAAM,CAAC,SAAqB,EAAE,OAAmB,EAAE,S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Aa,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,oBAAa,CAAC,CAAA;IAC3E,MAAM,aAAa,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;IAEnD,MAAM,CAAC,IAAI,CACT,qBAAqB,SAAS,CAAC,GAAG,2BAA2B,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,IAAI,CAClI,CAAA;IAED,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -1,11 +1,13 @@
1
1
  import type { VsAgent } from '../agent/VsAgent';
2
2
  import type { BaseEvent } from '@credo-ts/core';
3
- import { BaseMessage, ConnectionStateUpdated, Event, MessageReceived, MessageStateUpdated, PresentationStateUpdated } from '@verana-labs/vs-agent-model';
3
+ import { BaseMessage, ConnectionStateUpdated, Event, IndexerNotification, MessageReceived, MessageStateUpdated, PresentationStateUpdated, VtFlowStateUpdated } from '@verana-labs/vs-agent-model';
4
4
  export declare enum VsAgentEventTypes {
5
5
  ConnectionStateUpdated = "vs-agent-connection-state-updated",
6
6
  MessageReceived = "vs-agent-message-received",
7
7
  MessageStateUpdated = "vs-agent-message-state-updated",
8
- PresentationStateUpdated = "vs-agent-presentation-state-updated"
8
+ PresentationStateUpdated = "vs-agent-presentation-state-updated",
9
+ VtFlowStateUpdated = "vs-agent-vt-flow-state-updated",
10
+ IndexerNotification = "vs-agent-indexer-notification"
9
11
  }
10
12
  export interface VsAgentConnectionStateEvent extends BaseEvent {
11
13
  type: typeof VsAgentEventTypes.ConnectionStateUpdated;
@@ -31,5 +33,17 @@ export interface VsAgentPresentationStateUpdatedEvent extends BaseEvent {
31
33
  event: PresentationStateUpdated;
32
34
  };
33
35
  }
36
+ export interface VsAgentVtFlowStateUpdatedEvent extends BaseEvent {
37
+ type: typeof VsAgentEventTypes.VtFlowStateUpdated;
38
+ payload: {
39
+ event: VtFlowStateUpdated;
40
+ };
41
+ }
42
+ export interface VsAgentIndexerNotificationEvent extends BaseEvent {
43
+ type: typeof VsAgentEventTypes.IndexerNotification;
44
+ payload: {
45
+ event: IndexerNotification;
46
+ };
47
+ }
34
48
  export declare function msgToEvent(message: BaseMessage): MessageReceived;
35
49
  export declare function emitVsAgentEvent(agent: VsAgent, type: VsAgentEventTypes, event: Event): void;
@@ -10,6 +10,8 @@ var VsAgentEventTypes;
10
10
  VsAgentEventTypes["MessageReceived"] = "vs-agent-message-received";
11
11
  VsAgentEventTypes["MessageStateUpdated"] = "vs-agent-message-state-updated";
12
12
  VsAgentEventTypes["PresentationStateUpdated"] = "vs-agent-presentation-state-updated";
13
+ VsAgentEventTypes["VtFlowStateUpdated"] = "vs-agent-vt-flow-state-updated";
14
+ VsAgentEventTypes["IndexerNotification"] = "vs-agent-indexer-notification";
13
15
  })(VsAgentEventTypes || (exports.VsAgentEventTypes = VsAgentEventTypes = {}));
14
16
  function msgToEvent(message) {
15
17
  return new vs_agent_model_1.MessageReceived({
@@ -1 +1 @@
1
- {"version":3,"file":"VsAgentEvents.js","sourceRoot":"","sources":["../../src/events/VsAgentEvents.ts"],"names":[],"mappings":";;;AA4CA,gCAKC;AAED,4CAEC;AAlDD,gEAOoC;AAEpC,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,iFAA4D,CAAA;IAC5D,kEAA6C,CAAA;IAC7C,2EAAsD,CAAA;IACtD,qFAAgE,CAAA;AAClE,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B;AA2BD,SAAgB,UAAU,CAAC,OAAoB;IAC7C,OAAO,IAAI,gCAAe,CAAC;QACzB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,OAAO;KACR,CAAC,CAAA;AACJ,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAc,EAAE,IAAuB,EAAE,KAAY;IACpF,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAA;AAChE,CAAC"}
1
+ {"version":3,"file":"VsAgentEvents.js","sourceRoot":"","sources":["../../src/events/VsAgentEvents.ts"],"names":[],"mappings":";;;AA4DA,gCAKC;AAED,4CAEC;AAlED,gEASoC;AAEpC,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,iFAA4D,CAAA;IAC5D,kEAA6C,CAAA;IAC7C,2EAAsD,CAAA;IACtD,qFAAgE,CAAA;IAChE,0EAAqD,CAAA;IACrD,0EAAqD,CAAA;AACvD,CAAC,EAPW,iBAAiB,iCAAjB,iBAAiB,QAO5B;AAuCD,SAAgB,UAAU,CAAC,OAAoB;IAC7C,OAAO,IAAI,gCAAe,CAAC;QACzB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,OAAO;KACR,CAAC,CAAA;AACJ,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAc,EAAE,IAAuB,EAAE,KAAY;IACpF,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAA;AAChE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { VsAgent } from '../agent/VsAgent';
2
+ import { BaseLogger } from '@credo-ts/core';
3
+ export declare const vtFlowEvents: (agent: VsAgent, logger: BaseLogger) => Promise<void>;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vtFlowEvents = void 0;
4
+ const credo_ts_didcomm_vt_flow_1 = require("@verana-labs/credo-ts-didcomm-vt-flow");
5
+ const vs_agent_model_1 = require("@verana-labs/vs-agent-model");
6
+ const VsAgentEvents_1 = require("./VsAgentEvents");
7
+ const vtFlowEvents = async (agent, logger) => {
8
+ agent.events.on(credo_ts_didcomm_vt_flow_1.VtFlowEventTypes.VtFlowStateChanged, async ({ payload }) => {
9
+ logger.debug(`Incoming vtFlow state change: ${payload.vtFlowRecordId}`);
10
+ const record = await agent.modules.vtFlow.findById(payload.vtFlowRecordId);
11
+ if (!record)
12
+ return;
13
+ (0, VsAgentEvents_1.emitVsAgentEvent)(agent, VsAgentEvents_1.VsAgentEventTypes.VtFlowStateUpdated, new vs_agent_model_1.VtFlowStateUpdated({
14
+ vtFlowRecordId: payload.vtFlowRecordId,
15
+ threadId: payload.threadId,
16
+ participantSessionId: payload.participantSessionId,
17
+ connectionId: record.connectionId,
18
+ role: record.role,
19
+ variant: record.variant,
20
+ state: payload.state,
21
+ previousState: payload.previousState,
22
+ participantId: record.participantId,
23
+ schemaId: record.schemaId,
24
+ claims: record.claims,
25
+ credentialExchangeRecordId: record.credentialExchangeRecordId,
26
+ errorMessage: record.errorMessage,
27
+ subprotocolThid: record.subprotocolThid,
28
+ agentParticipantId: record.agentParticipantId,
29
+ walletAgentParticipantId: record.walletAgentParticipantId,
30
+ timestamp: record.updatedAt,
31
+ }));
32
+ });
33
+ };
34
+ exports.vtFlowEvents = vtFlowEvents;
35
+ //# sourceMappingURL=VtFlowEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VtFlowEvents.js","sourceRoot":"","sources":["../../src/events/VtFlowEvents.ts"],"names":[],"mappings":";;;AAGA,oFAAsG;AACtG,gEAAgE;AAEhE,mDAAqE;AAE9D,MAAM,YAAY,GAAG,KAAK,EAAE,KAAc,EAAE,MAAkB,EAAE,EAAE;IACvE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,2CAAgB,CAAC,kBAAkB,EAAE,KAAK,EAAE,EAAE,OAAO,EAA2B,EAAE,EAAE;QAClG,MAAM,CAAC,KAAK,CAAC,iCAAiC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAA;QACvE,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;QAC1E,IAAI,CAAC,MAAM;YAAE,OAAM;QACnB,IAAA,gCAAgB,EACd,KAAK,EACL,iCAAiB,CAAC,kBAAkB,EACpC,IAAI,mCAAkB,CAAC;YACrB,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;YAClD,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,0BAA0B,EAAE,MAAM,CAAC,0BAA0B;YAC7D,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;YAC7C,wBAAwB,EAAE,MAAM,CAAC,wBAAwB;YACzD,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B,CAAC,CACH,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AA7BY,QAAA,YAAY,gBA6BxB"}
@@ -1,3 +1,4 @@
1
1
  export * from './VsAgentEvents';
2
2
  export * from './ConnectionEvents';
3
3
  export * from './BaseMessageEvents';
4
+ export * from './VtFlowEvents';
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./VsAgentEvents"), exports);
18
18
  __exportStar(require("./ConnectionEvents"), exports);
19
19
  __exportStar(require("./BaseMessageEvents"), exports);
20
+ __exportStar(require("./VtFlowEvents"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,qDAAkC;AAClC,sDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,qDAAkC;AAClC,sDAAmC;AACnC,iDAA8B"}
package/build/index.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  export * from './agent';
2
- export type { Plugin } from './types';
2
+ export * from './types';
3
3
  export * from './events';
4
4
  export { setupBaseDidComm } from './plugins/setupBaseDidComm';
5
5
  export type { BaseDidCommPlugin, BaseDidCommPluginOptions } from './plugins/setupBaseDidComm';
6
- export type { VsAgentNestPlugin, MessageHandler } from './types';
7
- export { MESSAGE_HANDLERS } from './types';
8
6
  export { CachedWebDidResolver } from './did/CachedWebDidResolver';
9
7
  export { WebDidRegistrar } from './did/WebDidRegistrar';
10
8
  export { getLegacyDidDocument } from './did/legacyDidWeb';
9
+ export { applyAdminApiServiceEntry } from './did/adminApiService';
11
10
  export { HttpInboundTransport, HttpTransportSession } from './transports/HttpInboundTransport';
12
11
  export { VsAgentWsInboundTransport, WebSocketTransportSession } from './transports/VsAgentWsInboundTransport';
13
12
  export { VsAgentWsOutboundTransport } from './transports/VsAgentWsOutboundTransport';
14
- export { FullTailsFileService, tailsIndex, baseFilePath, deleteTailsEntry, } from './credentials/FullTailsFileService';
13
+ export { FullTailsFileService, getTailsDirectoryPath, deleteTailsFile, isValidTailsFileName, migrateLegacyTailsFiles, } from './credentials/FullTailsFileService';
15
14
  export * from './utils';
16
15
  export * from './blockchain';
16
+ export * from './vtFlow';