@genobank/biofs 2.5.0 → 2.5.2

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 (100) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE +37 -0
  3. package/README.md +2 -1
  4. package/bin/biofs.js +2 -1
  5. package/contracts/ClaraJobNFT.sol +2 -0
  6. package/dist/commands/link-clara.d.ts.map +1 -1
  7. package/dist/commands/link-clara.js +9 -3
  8. package/dist/commands/link-clara.js.map +1 -1
  9. package/dist/commands/tokenize-biosample.d.ts.map +1 -1
  10. package/dist/commands/tokenize-biosample.js +9 -3
  11. package/dist/commands/tokenize-biosample.js.map +1 -1
  12. package/dist/index.js +1 -1
  13. package/docs/AI_AGENT_MCP_MANUAL.md +2 -0
  14. package/docs/USER_MANUAL.md +2 -0
  15. package/docs/technical-details.html +555 -0
  16. package/lib/bionfs-client.js +2 -0
  17. package/lib/consent-manager.js +2 -0
  18. package/lib/consent-prompt.js +2 -0
  19. package/package.json +3 -3
  20. package/presentation/biofs-x402-kite-presentation.html +2 -0
  21. package/scripts/build_annotator_dictionary.py +1 -0
  22. package/scripts/deploy-clara-nft.js +2 -0
  23. package/ADMIN_REGISTER_LAB.md +0 -252
  24. package/ANNOTATOR_RECOMMENDATIONS_API.md +0 -490
  25. package/BIOFS_QUICK_START.md +0 -200
  26. package/BIOFS_TOKENIZE_COMPLETE.md +0 -541
  27. package/BIOFS_V1.2.7_PUBLISHED.md +0 -317
  28. package/BIOFS_V1.2.9_FIXES.md +0 -306
  29. package/BIOFS_V1.3.0_DIRECT_GRANT.md +0 -381
  30. package/BIOFS_V1.3.1_GRANTED_FILES.md +0 -328
  31. package/BIONFS_DEPLOYMENT_GUIDE.md +0 -408
  32. package/BIONFS_MOUNT_INTEGRATION_PLAN.md +0 -415
  33. package/BIONFS_PROTOCOL_SPECIFICATION.md +0 -688
  34. package/BIONFS_SEQUENTIAS_INTEGRATION.md +0 -457
  35. package/BIONFT_NFS_PROTOCOL_ARCHITECTURE.md +0 -583
  36. package/BIOOS_CLI_IMPLEMENTATION_COMPLETE.md +0 -422
  37. package/BIOOS_JOB_MANAGEMENT.md +0 -681
  38. package/BUGFIX_V2.1.3.md +0 -72
  39. package/CHANGELOG_V2.1.0.md +0 -386
  40. package/CHANGELOG_V2.2.0.md +0 -284
  41. package/ENHANCEMENT_DOCUMENTATION.md +0 -218
  42. package/GDPR_BIONFS_CONSENT_ARCHITECTURE.md +0 -798
  43. package/GDPR_BIONFS_IMPLEMENTATION_STATUS.md +0 -462
  44. package/INSTALL_V1.2.7_ON_MAC.md +0 -306
  45. package/LABNFT_BIOFS_INTEGRATION.md +0 -396
  46. package/OPENCRAVAT_ANNOTATORS_REFERENCE.md +0 -340
  47. package/OPENCRAVAT_ANNOTATOR_INTELLIGENCE_COMPLETE.md +0 -479
  48. package/QUICK_START_V2.1.0.md +0 -116
  49. package/RELEASE_SUMMARY_V1.2.7.md +0 -479
  50. package/RELEASE_SUMMARY_V1.3.0.md +0 -324
  51. package/SEQUENTIAS_PROTOCOL_ARCHITECTURE.md +0 -880
  52. package/SEQUENTIA_MIGRATION_GUIDE.md +0 -337
  53. package/SESSION_SUMMARY_DIRECT_GRANT.md +0 -321
  54. package/ULTRATHINK_BIONFS_COMPLETE.md +0 -458
  55. package/WEB3FUSE_LICENSE_TOKEN_ANALYSIS.md +0 -494
  56. package/WHERE_PERMISSIONS_LIVE.md +0 -165
  57. package/artifacts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json +0 -4
  58. package/artifacts/@openzeppelin/contracts/access/Ownable.sol/Ownable.json +0 -63
  59. package/artifacts/@openzeppelin/contracts/interfaces/IERC4906.sol/IERC4906.dbg.json +0 -4
  60. package/artifacts/@openzeppelin/contracts/interfaces/IERC4906.sol/IERC4906.json +0 -328
  61. package/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.dbg.json +0 -4
  62. package/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.json +0 -357
  63. package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.dbg.json +0 -4
  64. package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.json +0 -296
  65. package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol/IERC721Receiver.dbg.json +0 -4
  66. package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol/IERC721Receiver.json +0 -45
  67. package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol/ERC721URIStorage.dbg.json +0 -4
  68. package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol/ERC721URIStorage.json +0 -373
  69. package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol/IERC721Metadata.dbg.json +0 -4
  70. package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol/IERC721Metadata.json +0 -341
  71. package/artifacts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +0 -4
  72. package/artifacts/@openzeppelin/contracts/utils/Address.sol/Address.json +0 -10
  73. package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +0 -4
  74. package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.json +0 -10
  75. package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +0 -4
  76. package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +0 -10
  77. package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +0 -4
  78. package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json +0 -30
  79. package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +0 -4
  80. package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json +0 -30
  81. package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +0 -4
  82. package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.json +0 -10
  83. package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.dbg.json +0 -4
  84. package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.json +0 -10
  85. package/artifacts/build-info/1adfbc50ae3e1821260f858a9c689a37.json +0 -1
  86. package/artifacts/contracts/ClaraJobNFT.sol/ClaraJobNFT.dbg.json +0 -4
  87. package/artifacts/contracts/ClaraJobNFT.sol/ClaraJobNFT.json +0 -667
  88. package/cache/solidity-files-cache.json +0 -628
  89. package/check_clara2.js +0 -70
  90. package/check_clara3.js +0 -65
  91. package/config.json +0 -21
  92. package/hardhat.config.js +0 -25
  93. package/jest.config.js +0 -27
  94. package/mint_and_link_all.js +0 -128
  95. package/opencravat_annotators_dictionary.json +0 -2356
  96. package/package.json.working.v1.9.2.20251105_023952 +0 -48
  97. package/test-complete-flow.sh +0 -60
  98. package/test.vcf +0 -12
  99. package/test_23andme.txt +0 -12
  100. package/test_v2_mint.js +0 -101
package/check_clara3.js DELETED
@@ -1,65 +0,0 @@
1
- const { ethers } = require('ethers');
2
-
3
- const CLARA_JOB_NFT = '0xdCd99012D796A4b250386cD6AcF5386316A8c3f8';
4
- const BIONFT = '0xA2cD489d7c2eB3FF5e51F13f0641351a33cA32cd';
5
- const RPC = 'http://54.226.180.9:8545';
6
- const MINTER_KEY = '0xfaa9148191dfcb99dc713f2652315b09df590a59e07c78a8d59c288d7f4a5013';
7
-
8
- async function main() {
9
- const provider = new ethers.JsonRpcProvider(RPC);
10
- const wallet = new ethers.Wallet(MINTER_KEY, provider);
11
- console.log('Wallet:', wallet.address);
12
-
13
- // Get BioNFT owner for Memo (token #2)
14
- const bionft = new ethers.Contract(BIONFT, [
15
- 'function ownerOf(uint256 tokenId) view returns (address)',
16
- 'function serialToTokenId(string serial) view returns (uint256)'
17
- ], provider);
18
-
19
- const tokenId = await bionft.serialToTokenId('56102007614180');
20
- console.log('Memo BioNFT Token ID:', tokenId.toString());
21
-
22
- const owner = await bionft.ownerOf(tokenId);
23
- console.log('Memo BioWallet (raw):', owner);
24
-
25
- // Checksum address properly
26
- const checksumOwner = ethers.getAddress(owner);
27
- console.log('Memo BioWallet (checksum):', checksumOwner);
28
-
29
- // ClaraJobNFT contract
30
- const claraAbi = [
31
- 'function safeMint(address to, string uri)',
32
- 'function totalSupply() view returns (uint256)'
33
- ];
34
- const clara = new ethers.Contract(CLARA_JOB_NFT, claraAbi, wallet);
35
-
36
- // Try to mint
37
- const metadata = {
38
- name: 'Clara Genomics Job: 56102007614180',
39
- description: 'DeepVariant VCF for Memo biosample'
40
- };
41
- const metadataUri = 'data:application/json;base64,' +
42
- Buffer.from(JSON.stringify(metadata)).toString('base64');
43
-
44
- console.log('\nMinting ClaraJobNFT to:', checksumOwner);
45
-
46
- try {
47
- const tx = await clara.safeMint(checksumOwner, metadataUri, {
48
- gasLimit: 500000n
49
- });
50
- console.log('TX sent:', tx.hash);
51
- const receipt = await tx.wait();
52
- console.log('TX status:', receipt.status === 1 ? 'SUCCESS' : 'FAILED');
53
- console.log('Gas used:', receipt.gasUsed.toString());
54
-
55
- const supply = await clara.totalSupply();
56
- console.log('New total supply:', supply.toString());
57
- } catch (e) {
58
- console.log('Mint error:', e.message);
59
- if (e.transaction) {
60
- console.log('TX data:', e.transaction.data?.slice(0, 100));
61
- }
62
- }
63
- }
64
-
65
- main().catch(console.error);
package/config.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "biofsNode": {
3
- "url": "http://localhost:8081",
4
- "timeout": 30000
5
- },
6
- "wallet": {
7
- "address": "0x5f5a60eaef242c0d51a21c703f520347b96ed19a"
8
- },
9
- "services": {
10
- "clara": {
11
- "enabled": true,
12
- "defaultReference": "hg38",
13
- "defaultCaptureKit": "agilent_v8",
14
- "defaultSequencingType": "WES",
15
- "defaultIntervalFile": "/Samples1/hg38/Agilent_V8_SureSelect_hg38.bed"
16
- }
17
- },
18
- "storage": {
19
- "vault": "s3://vault.genobank.io"
20
- }
21
- }
package/hardhat.config.js DELETED
@@ -1,25 +0,0 @@
1
- require("@nomicfoundation/hardhat-toolbox");
2
-
3
- /** @type import('hardhat/config').HardhatUserConfig */
4
- module.exports = {
5
- solidity: {
6
- version: "0.8.19", // CRITICAL: Max 0.8.19 for Sequentia (no PUSH0)
7
- settings: {
8
- optimizer: {
9
- enabled: true,
10
- runs: 200
11
- }
12
- }
13
- },
14
- networks: {
15
- sequentia: {
16
- url: "http://54.226.180.9:8545",
17
- chainId: 15132025,
18
- accounts: [
19
- "0xfaa9148191dfcb99dc713f2652315b09df590a59e07c78a8d59c288d7f4a5013"
20
- ],
21
- gas: 5000000,
22
- gasPrice: 0
23
- }
24
- }
25
- };
package/jest.config.js DELETED
@@ -1,27 +0,0 @@
1
- /** @type {import('jest').Config} */
2
- module.exports = {
3
- preset: 'ts-jest',
4
- testEnvironment: 'node',
5
- roots: ['<rootDir>/test'],
6
- testMatch: ['**/*.test.ts'],
7
- moduleFileExtensions: ['ts', 'js', 'json'],
8
- collectCoverageFrom: [
9
- 'src/**/*.ts',
10
- '!src/**/*.d.ts',
11
- '!src/**/index.ts'
12
- ],
13
- coverageDirectory: 'coverage',
14
- coverageReporters: ['text', 'lcov'],
15
- transform: {
16
- '^.+\\.ts$': ['ts-jest', {
17
- tsconfig: {
18
- esModuleInterop: true,
19
- strict: false,
20
- types: ['jest', 'node']
21
- }
22
- }]
23
- },
24
- moduleNameMapper: {
25
- '^@/(.*)$': '<rootDir>/src/$1'
26
- }
27
- };
@@ -1,128 +0,0 @@
1
- const { ethers } = require('ethers');
2
-
3
- const CLARA_JOB_NFT_V2 = '0x9B70040299efd49C0BBC607395F92a9492DCcc20';
4
- const BIONFT = '0xA2cD489d7c2eB3FF5e51F13f0641351a33cA32cd';
5
- const RPC = 'http://54.226.180.9:8545';
6
- const MINTER_KEY = '0xfaa9148191dfcb99dc713f2652315b09df590a59e07c78a8d59c288d7f4a5013';
7
-
8
- const FAMILY = [
9
- { serial: '56102007614180', name: 'Memo', role: 'father' },
10
- { serial: '56102007614196', name: 'Julieta', role: 'mother' },
11
- { serial: '56102007614194', name: 'Valeria', role: 'child' }
12
- ];
13
-
14
- async function main() {
15
- const provider = new ethers.JsonRpcProvider(RPC);
16
- const wallet = new ethers.Wallet(MINTER_KEY, provider);
17
- console.log('Wallet:', wallet.address);
18
-
19
- const bionft = new ethers.Contract(BIONFT, [
20
- 'function ownerOf(uint256 tokenId) view returns (address)',
21
- 'function serialToTokenId(string serial) view returns (uint256)',
22
- 'function linkDerivative(uint256 parentTokenId, address derivativeContract, uint256 derivativeTokenId, string derivativeType, string description, bytes32 dataHash)',
23
- 'function derivativeCount(uint256 tokenId) view returns (uint256)'
24
- ], wallet);
25
-
26
- const clara = new ethers.Contract(CLARA_JOB_NFT_V2, [
27
- 'function mintJob(address to, string biosampleSerial, string vcfPath, string pipeline, string referenceGenome, bytes32 vcfHash, string metadataUri) returns (uint256)',
28
- 'function totalSupply() view returns (uint256)',
29
- 'function biosampleToTokenId(string biosample) view returns (uint256)'
30
- ], wallet);
31
-
32
- for (const member of FAMILY) {
33
- console.log(`\n${'='.repeat(60)}`);
34
- console.log(`Processing ${member.name} (${member.serial})`);
35
- console.log('='.repeat(60));
36
-
37
- // Get BioNFT token ID
38
- const bionftTokenId = await bionft.serialToTokenId(member.serial);
39
- console.log(`BioNFT Token ID: ${bionftTokenId}`);
40
-
41
- // Check if already has Clara derivative linked
42
- const derivCount = await bionft.derivativeCount(bionftTokenId);
43
- console.log(`Existing derivatives: ${derivCount}`);
44
-
45
- // Check if Clara NFT already minted for this biosample
46
- const existingClaraTokenId = await clara.biosampleToTokenId(member.serial);
47
- console.log(`Existing ClaraJobNFT for biosample: ${existingClaraTokenId}`);
48
-
49
- let claraTokenId;
50
-
51
- if (existingClaraTokenId > 0n) {
52
- console.log(`ClaraJobNFT #${existingClaraTokenId} already exists, using it`);
53
- claraTokenId = existingClaraTokenId;
54
- } else {
55
- // Mint new ClaraJobNFT
56
- const bionftOwner = await bionft.ownerOf(bionftTokenId);
57
- const checksumOwner = ethers.getAddress(bionftOwner);
58
-
59
- const vcfPath = `s3://deepvariant-fastq-to-vcf-genobank.app/output/${member.serial}/${member.serial}.deepvariant.g.vcf`;
60
- const vcfHash = ethers.keccak256(ethers.toUtf8Bytes(vcfPath));
61
-
62
- const metadata = {
63
- name: `Clara DeepVariant VCF: ${member.serial}`,
64
- description: `DeepVariant variant calling results for ${member.name} (${member.role}) biosample ${member.serial}.`,
65
- image: 'https://genobank.io/images/clara-job-nft.png',
66
- attributes: [
67
- { trait_type: 'Biosample ID', value: member.serial },
68
- { trait_type: 'Name', value: member.name },
69
- { trait_type: 'Role', value: member.role },
70
- { trait_type: 'Pipeline', value: 'deepvariant' },
71
- { trait_type: 'Reference', value: 'hg38' },
72
- { trait_type: 'Parent BioNFT', value: `#${bionftTokenId}` }
73
- ]
74
- };
75
- const metadataUri = 'data:application/json;base64,' +
76
- Buffer.from(JSON.stringify(metadata)).toString('base64');
77
-
78
- console.log(`Minting ClaraJobNFT for ${member.name}...`);
79
- const mintTx = await clara.mintJob(
80
- checksumOwner,
81
- member.serial,
82
- vcfPath,
83
- 'deepvariant',
84
- 'hg38',
85
- vcfHash,
86
- metadataUri,
87
- { gasLimit: 1000000n }
88
- );
89
- const mintReceipt = await mintTx.wait();
90
- console.log(`Mint TX: ${mintReceipt.hash}`);
91
-
92
- const supply = await clara.totalSupply();
93
- claraTokenId = supply;
94
- console.log(`Minted ClaraJobNFT #${claraTokenId}`);
95
- }
96
-
97
- // Check if we need to link
98
- if (derivCount > 0n) {
99
- console.log('Derivative already linked, skipping...');
100
- continue;
101
- }
102
-
103
- // Link as derivative
104
- console.log(`Linking ClaraJobNFT #${claraTokenId} to BioNFT #${bionftTokenId}...`);
105
-
106
- const vcfPath = `s3://deepvariant-fastq-to-vcf-genobank.app/output/${member.serial}/${member.serial}.deepvariant.g.vcf`;
107
- const vcfHash = ethers.keccak256(ethers.toUtf8Bytes(vcfPath));
108
-
109
- const linkTx = await bionft.linkDerivative(
110
- bionftTokenId,
111
- CLARA_JOB_NFT_V2,
112
- claraTokenId,
113
- 'clara_job',
114
- `Clara Parabricks DeepVariant VCF from ${member.name} (${member.role})`,
115
- vcfHash,
116
- { gasLimit: 500000n }
117
- );
118
- const linkReceipt = await linkTx.wait();
119
- console.log(`Link TX: ${linkReceipt.hash}`);
120
- console.log(`✓ ${member.name} complete!`);
121
- }
122
-
123
- console.log('\n' + '='.repeat(60));
124
- console.log('All family members processed!');
125
- console.log('='.repeat(60));
126
- }
127
-
128
- main().catch(console.error);