@genobank/biofs 2.6.2 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +76 -0
- package/README.md +556 -201
- package/dist/commands/alias.d.ts +9 -0
- package/dist/commands/alias.d.ts.map +1 -0
- package/dist/commands/alias.js +56 -0
- package/dist/commands/alias.js.map +1 -0
- package/dist/commands/bionft/revoke.d.ts +6 -0
- package/dist/commands/bionft/revoke.d.ts.map +1 -0
- package/dist/commands/bionft/revoke.js +74 -0
- package/dist/commands/bionft/revoke.js.map +1 -0
- package/dist/commands/bionft/status.d.ts +2 -0
- package/dist/commands/bionft/status.d.ts.map +1 -0
- package/dist/commands/bionft/status.js +45 -0
- package/dist/commands/bionft/status.js.map +1 -0
- package/dist/commands/bionft/view.d.ts +5 -0
- package/dist/commands/bionft/view.d.ts.map +1 -0
- package/dist/commands/bionft/view.js +127 -0
- package/dist/commands/bionft/view.js.map +1 -0
- package/dist/commands/cred/issue.d.ts +12 -0
- package/dist/commands/cred/issue.d.ts.map +1 -0
- package/dist/commands/cred/issue.js +95 -0
- package/dist/commands/cred/issue.js.map +1 -0
- package/dist/commands/cred/lib.d.ts +23 -0
- package/dist/commands/cred/lib.d.ts.map +1 -0
- package/dist/commands/cred/lib.js +95 -0
- package/dist/commands/cred/lib.js.map +1 -0
- package/dist/commands/cred/list.d.ts +7 -0
- package/dist/commands/cred/list.d.ts.map +1 -0
- package/dist/commands/cred/list.js +65 -0
- package/dist/commands/cred/list.js.map +1 -0
- package/dist/commands/cred/revoke.d.ts +6 -0
- package/dist/commands/cred/revoke.d.ts.map +1 -0
- package/dist/commands/cred/revoke.js +60 -0
- package/dist/commands/cred/revoke.js.map +1 -0
- package/dist/commands/cred/status.d.ts +5 -0
- package/dist/commands/cred/status.d.ts.map +1 -0
- package/dist/commands/cred/status.js +41 -0
- package/dist/commands/cred/status.js.map +1 -0
- package/dist/commands/htsget.d.ts +8 -0
- package/dist/commands/htsget.d.ts.map +1 -0
- package/dist/commands/htsget.js +43 -0
- package/dist/commands/htsget.js.map +1 -0
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +15 -0
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/pipe.d.ts +8 -0
- package/dist/commands/pipe.d.ts.map +1 -0
- package/dist/commands/pipe.js +76 -0
- package/dist/commands/pipe.js.map +1 -0
- package/dist/commands/stream.d.ts +9 -0
- package/dist/commands/stream.d.ts.map +1 -0
- package/dist/commands/stream.js +58 -0
- package/dist/commands/stream.js.map +1 -0
- package/dist/commands/upload-fastq.d.ts +10 -0
- package/dist/commands/upload-fastq.d.ts.map +1 -0
- package/dist/commands/upload-fastq.js +60 -0
- package/dist/commands/upload-fastq.js.map +1 -0
- package/dist/commands/vault/mount.d.ts +8 -0
- package/dist/commands/vault/mount.d.ts.map +1 -0
- package/dist/commands/vault/mount.js +136 -0
- package/dist/commands/vault/mount.js.map +1 -0
- package/dist/commands/vault/setup.d.ts +6 -0
- package/dist/commands/vault/setup.d.ts.map +1 -0
- package/dist/commands/vault/setup.js +160 -0
- package/dist/commands/vault/setup.js.map +1 -0
- package/dist/commands/vault/status.d.ts +4 -0
- package/dist/commands/vault/status.d.ts.map +1 -0
- package/dist/commands/vault/status.js +97 -0
- package/dist/commands/vault/status.js.map +1 -0
- package/dist/commands/vault/unmount.d.ts +6 -0
- package/dist/commands/vault/unmount.d.ts.map +1 -0
- package/dist/commands/vault/unmount.js +90 -0
- package/dist/commands/vault/unmount.js.map +1 -0
- package/dist/index.js +354 -23
- package/dist/index.js.map +1 -1
- package/dist/lib/aliases/store.d.ts +7 -0
- package/dist/lib/aliases/store.d.ts.map +1 -0
- package/dist/lib/aliases/store.js +83 -0
- package/dist/lib/aliases/store.js.map +1 -0
- package/dist/lib/auth/server.d.ts.map +1 -1
- package/dist/lib/auth/server.js +21 -2
- package/dist/lib/auth/server.js.map +1 -1
- package/dist/lib/bionft/BioAssetVault.abi.json +1104 -0
- package/dist/lib/bionft/BioNFTCredentials.abi.json +1235 -0
- package/dist/lib/bionft/client.d.ts +45 -0
- package/dist/lib/bionft/client.d.ts.map +1 -0
- package/dist/lib/bionft/client.js +219 -0
- package/dist/lib/bionft/client.js.map +1 -0
- package/dist/lib/htsget/client.d.ts +54 -0
- package/dist/lib/htsget/client.d.ts.map +1 -0
- package/dist/lib/htsget/client.js +76 -0
- package/dist/lib/htsget/client.js.map +1 -0
- package/dist/utils/errorReporter.d.ts +6 -0
- package/dist/utils/errorReporter.d.ts.map +1 -1
- package/dist/utils/errorReporter.js +53 -0
- package/dist/utils/errorReporter.js.map +1 -1
- package/package.json +4 -4
- package/dist/commands/access-sequentia.d.ts +0 -35
- package/dist/commands/access-sequentia.d.ts.map +0 -1
- package/dist/commands/access-sequentia.js +0 -256
- package/dist/commands/access-sequentia.js.map +0 -1
- package/dist/commands/biofiles-sequentia.d.ts +0 -21
- package/dist/commands/biofiles-sequentia.d.ts.map +0 -1
- package/dist/commands/biofiles-sequentia.js +0 -238
- package/dist/commands/biofiles-sequentia.js.map +0 -1
- package/dist/commands/download-sequentia.d.ts +0 -19
- package/dist/commands/download-sequentia.d.ts.map +0 -1
- package/dist/commands/download-sequentia.js +0 -159
- package/dist/commands/download-sequentia.js.map +0 -1
- package/dist/commands/researcher/register.d.ts +0 -24
- package/dist/commands/researcher/register.d.ts.map +0 -1
- package/dist/commands/researcher/register.js +0 -192
- package/dist/commands/researcher/register.js.map +0 -1
- package/dist/commands/researcher/status.d.ts +0 -24
- package/dist/commands/researcher/status.d.ts.map +0 -1
- package/dist/commands/researcher/status.js +0 -235
- package/dist/commands/researcher/status.js.map +0 -1
- package/dist/commands/researcher/verify.d.ts +0 -24
- package/dist/commands/researcher/verify.d.ts.map +0 -1
- package/dist/commands/researcher/verify.js +0 -167
- package/dist/commands/researcher/verify.js.map +0 -1
- package/dist/commands/share-sequentia.d.ts +0 -21
- package/dist/commands/share-sequentia.d.ts.map +0 -1
- package/dist/commands/share-sequentia.js +0 -161
- package/dist/commands/share-sequentia.js.map +0 -1
- package/dist/commands/tokenize-sequentia.d.ts +0 -21
- package/dist/commands/tokenize-sequentia.d.ts.map +0 -1
- package/dist/commands/tokenize-sequentia.js +0 -191
- package/dist/commands/tokenize-sequentia.js.map +0 -1
- package/dist/commands/verify-sequentia.d.ts +0 -18
- package/dist/commands/verify-sequentia.d.ts.map +0 -1
- package/dist/commands/verify-sequentia.js +0 -150
- package/dist/commands/verify-sequentia.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -20,50 +20,89 @@ const tokenize_fastqs_1 = require("./commands/tokenize-fastqs");
|
|
|
20
20
|
const tokenize_biosample_1 = require("./commands/tokenize-biosample");
|
|
21
21
|
const link_clara_1 = require("./commands/link-clara");
|
|
22
22
|
const family_status_1 = require("./commands/family-status");
|
|
23
|
+
const issue_1 = require("./commands/cred/issue");
|
|
24
|
+
const view_1 = require("./commands/bionft/view");
|
|
25
|
+
const revoke_1 = require("./commands/bionft/revoke");
|
|
26
|
+
const status_1 = require("./commands/bionft/status");
|
|
27
|
+
const setup_1 = require("./commands/vault/setup");
|
|
28
|
+
const mount_2 = require("./commands/vault/mount");
|
|
29
|
+
const status_2 = require("./commands/vault/status");
|
|
30
|
+
const unmount_1 = require("./commands/vault/unmount");
|
|
31
|
+
const status_3 = require("./commands/cred/status");
|
|
32
|
+
const list_1 = require("./commands/cred/list");
|
|
33
|
+
const revoke_2 = require("./commands/cred/revoke");
|
|
34
|
+
const upload_fastq_1 = require("./commands/upload-fastq");
|
|
23
35
|
const request_1 = require("./commands/access/request");
|
|
24
36
|
const grant_1 = require("./commands/access/grant");
|
|
25
|
-
const
|
|
26
|
-
const
|
|
37
|
+
const revoke_3 = require("./commands/access/revoke");
|
|
38
|
+
const list_2 = require("./commands/access/list");
|
|
27
39
|
const check_1 = require("./commands/access/check");
|
|
28
40
|
const revoke_consent_1 = require("./commands/access/revoke-consent");
|
|
29
41
|
const create_1 = require("./commands/job/create");
|
|
30
|
-
const
|
|
42
|
+
const status_4 = require("./commands/job/status");
|
|
31
43
|
const results_1 = require("./commands/job/results");
|
|
32
|
-
const
|
|
44
|
+
const list_3 = require("./commands/job/list");
|
|
33
45
|
const pipelines_1 = require("./commands/job/pipelines");
|
|
46
|
+
// v2.7.0: htsget + smart streaming + aliases
|
|
47
|
+
const stream_1 = require("./commands/stream");
|
|
48
|
+
const pipe_1 = require("./commands/pipe");
|
|
49
|
+
const alias_1 = require("./commands/alias");
|
|
50
|
+
const htsget_1 = require("./commands/htsget");
|
|
34
51
|
const submit_clara_1 = require("./commands/job/submit-clara");
|
|
35
52
|
const create_2 = require("./commands/context/create");
|
|
36
53
|
const publish_1 = require("./commands/context/publish");
|
|
37
54
|
const verify_1 = require("./commands/context/verify");
|
|
38
|
-
const
|
|
55
|
+
const revoke_4 = require("./commands/context/revoke");
|
|
39
56
|
const health_1 = require("./commands/agent/health");
|
|
40
57
|
const register_1 = require("./commands/agent/register");
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
58
|
+
const list_4 = require("./commands/agent/list");
|
|
59
|
+
const status_5 = require("./commands/agent/status");
|
|
60
|
+
const list_5 = require("./commands/labs/list");
|
|
44
61
|
const share_1 = require("./commands/share");
|
|
45
62
|
const shares_1 = require("./commands/shares");
|
|
46
63
|
const verify_2 = require("./commands/verify");
|
|
47
64
|
const dissect_1 = require("./commands/dissect");
|
|
48
65
|
const dissect_sequentia_1 = require("./commands/dissect-sequentia");
|
|
49
|
-
const
|
|
66
|
+
const view_2 = require("./commands/view");
|
|
50
67
|
const report_1 = require("./commands/report");
|
|
51
68
|
const admin_1 = require("./commands/admin");
|
|
52
69
|
const fuse_1 = require("./commands/fuse");
|
|
53
70
|
const submit_1 = require("./commands/annotate/submit");
|
|
54
|
-
const
|
|
71
|
+
const status_6 = require("./commands/annotate/status");
|
|
55
72
|
const balance_1 = require("./commands/payment/balance");
|
|
56
73
|
const pricing_1 = require("./commands/payment/pricing");
|
|
57
|
-
const
|
|
74
|
+
const setup_2 = require("./commands/payment/setup");
|
|
58
75
|
const faucet_1 = require("./commands/payment/faucet");
|
|
59
76
|
const history_1 = require("./commands/payment/history");
|
|
60
77
|
const logger_1 = require("./lib/utils/logger");
|
|
78
|
+
const errorReporter_1 = require("./utils/errorReporter");
|
|
79
|
+
const credentials_1 = require("./lib/auth/credentials");
|
|
61
80
|
const program = new commander_1.Command();
|
|
81
|
+
// Global catch-all so uncaught errors in ANY command still reach telemetry.
|
|
82
|
+
// Individual commands continue to call ErrorReporter.report directly (e.g.
|
|
83
|
+
// mount/umount) for richer context — this is the safety net for the rest.
|
|
84
|
+
async function reportAndExit(command, err, code) {
|
|
85
|
+
try {
|
|
86
|
+
const creds = await credentials_1.CredentialsManager.getInstance().loadCredentials().catch(() => null);
|
|
87
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
88
|
+
await errorReporter_1.ErrorReporter.report(command, error, creds?.wallet_address, { argv: process.argv.slice(2) });
|
|
89
|
+
}
|
|
90
|
+
catch { /* telemetry failure must never block exit */ }
|
|
91
|
+
process.exit(code);
|
|
92
|
+
}
|
|
93
|
+
process.on('uncaughtException', (err) => {
|
|
94
|
+
logger_1.Logger.error(`Uncaught: ${err?.message || err}`);
|
|
95
|
+
reportAndExit(process.argv.slice(2).join(' ') || 'unknown', err, 1);
|
|
96
|
+
});
|
|
97
|
+
process.on('unhandledRejection', (reason) => {
|
|
98
|
+
logger_1.Logger.error(`UnhandledRejection: ${reason?.message || reason}`);
|
|
99
|
+
reportAndExit(process.argv.slice(2).join(' ') || 'unknown', reason, 1);
|
|
100
|
+
});
|
|
62
101
|
// Set up the CLI
|
|
63
102
|
program
|
|
64
103
|
.name('biofs')
|
|
65
104
|
.description('BioFS by GenoBank.io - BioNFT-Gated S3 CLI for genomic data')
|
|
66
|
-
.version('
|
|
105
|
+
.version('3.0.1')
|
|
67
106
|
.option('--debug', 'Enable debug output')
|
|
68
107
|
.hook('preAction', (thisCommand) => {
|
|
69
108
|
// Set global debug flag if --debug is passed
|
|
@@ -319,6 +358,101 @@ program
|
|
|
319
358
|
process.exit(1);
|
|
320
359
|
}
|
|
321
360
|
});
|
|
361
|
+
// ========================================================================
|
|
362
|
+
// v2.7.0 — htsget + smart streaming + aliases (Sprint 6)
|
|
363
|
+
// ========================================================================
|
|
364
|
+
// Mac researchers stream BioNFT-gated VCFs/BAMs through the tools they
|
|
365
|
+
// already use (bcftools, samtools, pysam, IGV) with zero FUSE, zero kext.
|
|
366
|
+
// `stream` / `view` are the day-to-day commands; `htsget` is for debugging.
|
|
367
|
+
// stream - htsget stream to stdout (pipes into any bioinformatics tool)
|
|
368
|
+
program
|
|
369
|
+
.command('stream <id>')
|
|
370
|
+
.description('Stream a BioNFT-gated VCF/BAM to stdout via htsget (pipe into bcftools/samtools/pysam)')
|
|
371
|
+
.option('--kind <variants|reads>', 'force datatype (default: auto-detect from filename)')
|
|
372
|
+
.option('--htsget-url <url>', 'override htsget endpoint (default: https://htsget.genobank.app)')
|
|
373
|
+
.option('--annotated', 'stream the OpenCRAVAT-annotated VCF sibling (Phase D) instead of raw')
|
|
374
|
+
.option('-q, --quiet', 'suppress info messages')
|
|
375
|
+
.action(async (id, options) => {
|
|
376
|
+
try {
|
|
377
|
+
await (0, stream_1.streamCommand)(id, options);
|
|
378
|
+
}
|
|
379
|
+
catch (error) {
|
|
380
|
+
logger_1.Logger.error(`stream failed: ${error?.message || error}`);
|
|
381
|
+
process.exit(6);
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
// pipe - auto-pipe htsget stream into bcftools/samtools view
|
|
385
|
+
// (distinct from the existing `view` command, which prints file content)
|
|
386
|
+
program
|
|
387
|
+
.command('pipe <id>')
|
|
388
|
+
.description('Pipe a BioIP stream into bcftools view (VCF) or samtools view (BAM) automatically')
|
|
389
|
+
.option('--tool <bcftools|samtools>', 'force tool (default: auto-detect from filename)')
|
|
390
|
+
.option('--htsget-url <url>', 'override htsget endpoint')
|
|
391
|
+
.option('-q, --quiet', 'suppress info messages')
|
|
392
|
+
.allowUnknownOption(true)
|
|
393
|
+
.action(async (id, options, cmd) => {
|
|
394
|
+
try {
|
|
395
|
+
// Everything after `--` is passed through to bcftools/samtools view
|
|
396
|
+
const extra = cmd.args.slice(cmd.args.indexOf(id) + 1);
|
|
397
|
+
await (0, pipe_1.pipeCommand)(id, { ...options, extra });
|
|
398
|
+
}
|
|
399
|
+
catch (error) {
|
|
400
|
+
logger_1.Logger.error(`pipe failed: ${error?.message || error}`);
|
|
401
|
+
process.exit(6);
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
// alias - manage local shortcuts for ip_ids / BioCIDs
|
|
405
|
+
program
|
|
406
|
+
.command('alias [name] [target]')
|
|
407
|
+
.description('Manage local aliases for ip_ids (e.g. `biofs alias my-wes 0xCCe14315…`)')
|
|
408
|
+
.option('--list', 'list all aliases (default when no args)')
|
|
409
|
+
.option('--remove <name>', 'remove alias by name')
|
|
410
|
+
.option('--json', 'emit JSON')
|
|
411
|
+
.action(async (name, target, options) => {
|
|
412
|
+
try {
|
|
413
|
+
await (0, alias_1.aliasCommand)({ ...options, name, target });
|
|
414
|
+
}
|
|
415
|
+
catch (error) {
|
|
416
|
+
logger_1.Logger.error(`alias failed: ${error?.message || error}`);
|
|
417
|
+
process.exit(1);
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
// htsget - low-level GA4GH htsget operations (service-info, ticket)
|
|
421
|
+
const htsgetCmd = program
|
|
422
|
+
.command('htsget')
|
|
423
|
+
.description('Low-level GA4GH htsget operations (see `biofs stream`/`view` for day-to-day use)');
|
|
424
|
+
htsgetCmd
|
|
425
|
+
.command('service-info')
|
|
426
|
+
.description('Show htsget endpoint metadata (GA4GH service-info)')
|
|
427
|
+
.option('--json', 'emit JSON')
|
|
428
|
+
.action(async (options) => {
|
|
429
|
+
try {
|
|
430
|
+
await (0, htsget_1.htsgetServiceInfoCommand)(options);
|
|
431
|
+
}
|
|
432
|
+
catch (error) {
|
|
433
|
+
logger_1.Logger.error(`service-info failed: ${error?.message || error}`);
|
|
434
|
+
process.exit(6);
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
htsgetCmd
|
|
438
|
+
.command('ticket <kind> <id>')
|
|
439
|
+
.description('Fetch a raw htsget ticket for debugging (kind = variants | reads)')
|
|
440
|
+
.action(async (kind, id) => {
|
|
441
|
+
try {
|
|
442
|
+
if (kind !== 'variants' && kind !== 'reads') {
|
|
443
|
+
logger_1.Logger.error(`kind must be 'variants' or 'reads' (got '${kind}')`);
|
|
444
|
+
process.exit(2);
|
|
445
|
+
}
|
|
446
|
+
await (0, htsget_1.htsgetTicketCommand)(kind, id);
|
|
447
|
+
}
|
|
448
|
+
catch (error) {
|
|
449
|
+
logger_1.Logger.error(`ticket failed: ${error?.message || error}`);
|
|
450
|
+
process.exit(6);
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
// ========================================================================
|
|
454
|
+
// (end v2.7.0 block)
|
|
455
|
+
// ========================================================================
|
|
322
456
|
// Tokenize command group - BioNFT minting on Sequentia
|
|
323
457
|
const tokenizeCmd = program
|
|
324
458
|
.command('tokenize')
|
|
@@ -449,7 +583,7 @@ annotateCmd
|
|
|
449
583
|
.option('--json', 'Output as JSON')
|
|
450
584
|
.action(async (jobId, options) => {
|
|
451
585
|
try {
|
|
452
|
-
await (0,
|
|
586
|
+
await (0, status_6.annotateStatusCommand)(jobId, options);
|
|
453
587
|
}
|
|
454
588
|
catch (error) {
|
|
455
589
|
logger_1.Logger.error(`Status check failed: ${error}`);
|
|
@@ -501,7 +635,7 @@ paymentCmd
|
|
|
501
635
|
.option('--json', 'Output as JSON')
|
|
502
636
|
.action(async (options) => {
|
|
503
637
|
try {
|
|
504
|
-
await (0,
|
|
638
|
+
await (0, setup_2.paymentSetupCommand)(options);
|
|
505
639
|
}
|
|
506
640
|
catch (error) {
|
|
507
641
|
logger_1.Logger.error(`Setup failed: ${error}`);
|
|
@@ -576,7 +710,7 @@ agentCmd
|
|
|
576
710
|
.option('--json', 'Output as JSON')
|
|
577
711
|
.action(async (options) => {
|
|
578
712
|
try {
|
|
579
|
-
await (0,
|
|
713
|
+
await (0, list_4.agentListCommand)(options);
|
|
580
714
|
}
|
|
581
715
|
catch (error) {
|
|
582
716
|
logger_1.Logger.error(`Agent list failed: ${error}`);
|
|
@@ -593,7 +727,7 @@ agentCmd
|
|
|
593
727
|
.option('--json', 'Output as JSON')
|
|
594
728
|
.action(async (options) => {
|
|
595
729
|
try {
|
|
596
|
-
await (0,
|
|
730
|
+
await (0, status_5.agentStatusCommand)(options);
|
|
597
731
|
}
|
|
598
732
|
catch (error) {
|
|
599
733
|
logger_1.Logger.error(`Agent status check failed: ${error}`);
|
|
@@ -639,7 +773,7 @@ accessCmd
|
|
|
639
773
|
.option('--yes', 'Skip confirmation prompt')
|
|
640
774
|
.action(async (biocidOrIpId, walletAddress, options) => {
|
|
641
775
|
try {
|
|
642
|
-
await (0,
|
|
776
|
+
await (0, revoke_3.accessRevokeCommand)(biocidOrIpId, walletAddress, options);
|
|
643
777
|
}
|
|
644
778
|
catch (error) {
|
|
645
779
|
logger_1.Logger.error(`Access revocation failed: ${error}`);
|
|
@@ -655,7 +789,7 @@ accessCmd
|
|
|
655
789
|
.option('--json', 'Output as JSON')
|
|
656
790
|
.action(async (biocidOrIpId, options) => {
|
|
657
791
|
try {
|
|
658
|
-
await (0,
|
|
792
|
+
await (0, list_2.accessListCommand)(biocidOrIpId, options);
|
|
659
793
|
}
|
|
660
794
|
catch (error) {
|
|
661
795
|
logger_1.Logger.error(`List failed: ${error}`);
|
|
@@ -690,6 +824,203 @@ accessCmd
|
|
|
690
824
|
process.exit(1);
|
|
691
825
|
}
|
|
692
826
|
});
|
|
827
|
+
// ~/genobank/vault commands (v2.9.0 · biovault Phase B)
|
|
828
|
+
// Portable vault: scaffolds ~/genobank/vault/ with a per-BioNFT subdirectory
|
|
829
|
+
// per owned token, then `biofs vault mount` downloads the annotated VCFs via
|
|
830
|
+
// htsget. Works on macOS + Linux without macFUSE kernel signing.
|
|
831
|
+
const vaultCmd = program
|
|
832
|
+
.command('vault')
|
|
833
|
+
.description('Local ~/genobank/vault — your owned BioNFTs as a real directory tree');
|
|
834
|
+
vaultCmd
|
|
835
|
+
.command('setup')
|
|
836
|
+
.description('Scan Sequentia for BioNFTs owned by your wallet and scaffold ~/genobank/vault/')
|
|
837
|
+
.option('--path <dir>', 'override vault path (default: ~/genobank/vault)')
|
|
838
|
+
.option('--force', 're-scaffold even if directory already exists')
|
|
839
|
+
.action(async (options) => {
|
|
840
|
+
try {
|
|
841
|
+
await (0, setup_1.vaultSetupCommand)(options);
|
|
842
|
+
}
|
|
843
|
+
catch (error) {
|
|
844
|
+
logger_1.Logger.error(`vault setup failed: ${error}`);
|
|
845
|
+
process.exit(1);
|
|
846
|
+
}
|
|
847
|
+
});
|
|
848
|
+
vaultCmd
|
|
849
|
+
.command('mount')
|
|
850
|
+
.description('Download BioNFT-gated data (raw + annotated VCFs) into the vault')
|
|
851
|
+
.option('--path <dir>', 'override vault path (default: ~/genobank/vault)')
|
|
852
|
+
.option('--refresh', 'force re-download of existing files')
|
|
853
|
+
.option('--skip-annotated', 'download only raw VCFs, skip OpenCRAVAT annotations')
|
|
854
|
+
.option('--categories <csv>', 'comma-separated BioNFT categories to mount', 'DATA_FILE_CHILD')
|
|
855
|
+
.action(async (options) => {
|
|
856
|
+
try {
|
|
857
|
+
await (0, mount_2.vaultMountCommand)(options);
|
|
858
|
+
}
|
|
859
|
+
catch (error) {
|
|
860
|
+
logger_1.Logger.error(`vault mount failed: ${error}`);
|
|
861
|
+
process.exit(1);
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
vaultCmd
|
|
865
|
+
.command('status')
|
|
866
|
+
.description('Show vault state: wallet, BioNFT inventory, per-token file sizes')
|
|
867
|
+
.option('--path <dir>', 'override vault path')
|
|
868
|
+
.action(async (options) => {
|
|
869
|
+
try {
|
|
870
|
+
await (0, status_2.vaultStatusCommand)(options);
|
|
871
|
+
}
|
|
872
|
+
catch (error) {
|
|
873
|
+
logger_1.Logger.error(`vault status failed: ${error}`);
|
|
874
|
+
process.exit(1);
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
vaultCmd
|
|
878
|
+
.command('unmount')
|
|
879
|
+
.description('Remove local cache. Manifest preserved unless --purge.')
|
|
880
|
+
.option('--path <dir>', 'override vault path')
|
|
881
|
+
.option('--purge', 'delete the whole vault dir (manifest + all files)')
|
|
882
|
+
.option('--force', 'skip confirmation prompt')
|
|
883
|
+
.action(async (options) => {
|
|
884
|
+
try {
|
|
885
|
+
await (0, unmount_1.vaultUnmountCommand)(options);
|
|
886
|
+
}
|
|
887
|
+
catch (error) {
|
|
888
|
+
logger_1.Logger.error(`vault unmount failed: ${error}`);
|
|
889
|
+
process.exit(1);
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
// BioNFT on-chain commands (v2.9.0 · biovault Phase F)
|
|
893
|
+
// Read/revoke any BioNFT (BIOSAMPLE_PARENT, DATA_FILE_CHILD, RENT_AGREEMENT,
|
|
894
|
+
// INGEST_TICKET) directly from Sequentia. No REST hop — ethers talks to the
|
|
895
|
+
// deployed contracts. This replaces `biofs cred revoke` for on-chain credentials
|
|
896
|
+
// and fixes the CherryPy DELETE-body bug we hit in Phase A.7.
|
|
897
|
+
const bionftCmd = program
|
|
898
|
+
.command('bionft')
|
|
899
|
+
.description('View and revoke BioNFTs directly on Sequentia (biovault Phase F)');
|
|
900
|
+
bionftCmd
|
|
901
|
+
.command('view <tokenId>')
|
|
902
|
+
.description('Show on-chain state + metadata for any BioNFT tokenId')
|
|
903
|
+
.option('--json', 'Output as JSON')
|
|
904
|
+
.action(async (tokenId, options) => {
|
|
905
|
+
try {
|
|
906
|
+
await (0, view_1.bionftViewCommand)(tokenId, options);
|
|
907
|
+
}
|
|
908
|
+
catch (error) {
|
|
909
|
+
logger_1.Logger.error(`bionft view failed: ${error}`);
|
|
910
|
+
process.exit(1);
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
bionftCmd
|
|
914
|
+
.command('status <tokenId>')
|
|
915
|
+
.description('One-line on-chain status of a BioNFT')
|
|
916
|
+
.action(async (tokenId) => {
|
|
917
|
+
try {
|
|
918
|
+
await (0, status_1.bionftStatusCommand)(tokenId);
|
|
919
|
+
}
|
|
920
|
+
catch (error) {
|
|
921
|
+
logger_1.Logger.error(`bionft status failed: ${error}`);
|
|
922
|
+
process.exit(1);
|
|
923
|
+
}
|
|
924
|
+
});
|
|
925
|
+
bionftCmd
|
|
926
|
+
.command('revoke <tokenId>')
|
|
927
|
+
.description('Patient-signed on-chain revoke. RENT_AGREEMENT or INGEST_TICKET only. Requires GENOBANK_OWNER_PRIVATE_KEY.')
|
|
928
|
+
.option('--reason <text>', 'Why you are revoking', 'user_cli')
|
|
929
|
+
.option('--force', 'Skip confirmation prompt')
|
|
930
|
+
.action(async (tokenId, options) => {
|
|
931
|
+
try {
|
|
932
|
+
await (0, revoke_1.bionftRevokeCommand)(tokenId, options);
|
|
933
|
+
}
|
|
934
|
+
catch (error) {
|
|
935
|
+
logger_1.Logger.error(`bionft revoke failed: ${error}`);
|
|
936
|
+
process.exit(1);
|
|
937
|
+
}
|
|
938
|
+
});
|
|
939
|
+
// Scoped write-only credential commands (v2.8.0 · biovault Phase A)
|
|
940
|
+
const credCmd = program
|
|
941
|
+
.command('cred')
|
|
942
|
+
.description('Scoped write-only FASTQ/BAM/VCF upload credentials (biovault)');
|
|
943
|
+
credCmd
|
|
944
|
+
.command('issue')
|
|
945
|
+
.description('Issue a single-use write credential for a biosample (requires BIOFS_LAB_PRIVATE_KEY)')
|
|
946
|
+
.requiredOption('--biosample <serial>', 'Biosample serial (e.g. 55052008714049)')
|
|
947
|
+
.requiredOption('--kind <kind>', 'FASTQ | FASTQ_R1 | FASTQ_R2 | BAM | VCF | GVCF', 'FASTQ_R1')
|
|
948
|
+
.option('--lab-id <id>', 'Laboratory ID (or $GENOBANK_LABORATORY_ID)', (v) => parseInt(v, 10))
|
|
949
|
+
.option('--source-file <path>', 'Compute size + sha256 from this file (required unless --size/--sha256 given)')
|
|
950
|
+
.option('--size <bytes>', 'Estimated upload size in bytes', (v) => parseInt(v, 10))
|
|
951
|
+
.option('--sha256 <hex>', 'Claimed SHA256 hash (64 hex chars)')
|
|
952
|
+
.option('--filename <name>', 'Logical filename to record server-side')
|
|
953
|
+
.option('--json', 'Output as JSON')
|
|
954
|
+
.action(async (options) => {
|
|
955
|
+
try {
|
|
956
|
+
await (0, issue_1.credIssueCommand)(options);
|
|
957
|
+
}
|
|
958
|
+
catch (error) {
|
|
959
|
+
logger_1.Logger.error(`cred issue failed: ${error}`);
|
|
960
|
+
process.exit(1);
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
credCmd
|
|
964
|
+
.command('status <cred_id>')
|
|
965
|
+
.description('Show the current state of a credential')
|
|
966
|
+
.option('--json', 'Output as JSON')
|
|
967
|
+
.action(async (credId, options) => {
|
|
968
|
+
try {
|
|
969
|
+
await (0, status_3.credStatusCommand)(credId, options);
|
|
970
|
+
}
|
|
971
|
+
catch (error) {
|
|
972
|
+
logger_1.Logger.error(`cred status failed: ${error}`);
|
|
973
|
+
process.exit(1);
|
|
974
|
+
}
|
|
975
|
+
});
|
|
976
|
+
credCmd
|
|
977
|
+
.command('list')
|
|
978
|
+
.description('List credentials for a biosample')
|
|
979
|
+
.option('--biosample <serial>', 'Biosample serial')
|
|
980
|
+
.option('--status <status>', 'Filter by status (issued|consumed|quarantined|burned)')
|
|
981
|
+
.option('--json', 'Output as JSON')
|
|
982
|
+
.action(async (options) => {
|
|
983
|
+
try {
|
|
984
|
+
await (0, list_1.credListCommand)(options);
|
|
985
|
+
}
|
|
986
|
+
catch (error) {
|
|
987
|
+
logger_1.Logger.error(`cred list failed: ${error}`);
|
|
988
|
+
process.exit(1);
|
|
989
|
+
}
|
|
990
|
+
});
|
|
991
|
+
credCmd
|
|
992
|
+
.command('revoke <cred_id>')
|
|
993
|
+
.description('Owner-signed burn of an unused credential (requires GENOBANK_OWNER_PRIVATE_KEY)')
|
|
994
|
+
.option('--reason <text>', 'Why you are burning this credential', 'user_cli')
|
|
995
|
+
.option('--force', 'Skip confirmation prompt')
|
|
996
|
+
.action(async (credId, options) => {
|
|
997
|
+
try {
|
|
998
|
+
await (0, revoke_2.credRevokeCommand)(credId, options);
|
|
999
|
+
}
|
|
1000
|
+
catch (error) {
|
|
1001
|
+
logger_1.Logger.error(`cred revoke failed: ${error}`);
|
|
1002
|
+
process.exit(1);
|
|
1003
|
+
}
|
|
1004
|
+
});
|
|
1005
|
+
// upload-fastq: thin wrapper around the Python genobank-upload CLI (resumable + resume buffer)
|
|
1006
|
+
program
|
|
1007
|
+
.command('upload-fastq <file>')
|
|
1008
|
+
.description('Upload a FASTQ/BAM/VCF via scoped credential + GCS resumable (wraps genobank-upload)')
|
|
1009
|
+
.requiredOption('--biosample <serial>', 'Biosample serial')
|
|
1010
|
+
.option('--kind <kind>', 'FASTQ | FASTQ_R1 | FASTQ_R2 | BAM | VCF | GVCF', 'FASTQ_R1')
|
|
1011
|
+
.option('--lab-id <id>', 'Laboratory ID (or $GENOBANK_LABORATORY_ID)', (v) => parseInt(v, 10))
|
|
1012
|
+
.option('--api-base <url>', 'Override API base URL')
|
|
1013
|
+
.option('--quiet', 'Suppress progress output')
|
|
1014
|
+
.option('--json', 'Output as JSON on completion')
|
|
1015
|
+
.action(async (file, options) => {
|
|
1016
|
+
try {
|
|
1017
|
+
await (0, upload_fastq_1.uploadFastqCommand)(file, options);
|
|
1018
|
+
}
|
|
1019
|
+
catch (error) {
|
|
1020
|
+
logger_1.Logger.error(`upload-fastq failed: ${error}`);
|
|
1021
|
+
process.exit(1);
|
|
1022
|
+
}
|
|
1023
|
+
});
|
|
693
1024
|
// BioContext manifest commands (v2.6.0)
|
|
694
1025
|
const contextCmd = program
|
|
695
1026
|
.command('context')
|
|
@@ -751,7 +1082,7 @@ contextCmd
|
|
|
751
1082
|
.option('--reason <string>', 'Revocation reason')
|
|
752
1083
|
.action(async (key, options) => {
|
|
753
1084
|
try {
|
|
754
|
-
await (0,
|
|
1085
|
+
await (0, revoke_4.contextRevokeCommand)(key, options);
|
|
755
1086
|
}
|
|
756
1087
|
catch (error) {
|
|
757
1088
|
logger_1.Logger.error(`context revoke failed: ${error}`);
|
|
@@ -785,7 +1116,7 @@ jobCmd
|
|
|
785
1116
|
.option('--watch', 'Watch mode (refresh every 5 seconds)')
|
|
786
1117
|
.action(async (jobId, options) => {
|
|
787
1118
|
try {
|
|
788
|
-
await (0,
|
|
1119
|
+
await (0, status_4.jobStatusCommand)(jobId, options);
|
|
789
1120
|
}
|
|
790
1121
|
catch (error) {
|
|
791
1122
|
logger_1.Logger.error(`Status check failed: ${error}`);
|
|
@@ -816,7 +1147,7 @@ jobCmd
|
|
|
816
1147
|
.option('--limit <number>', 'Limit number of results', parseInt)
|
|
817
1148
|
.action(async (options) => {
|
|
818
1149
|
try {
|
|
819
|
-
await (0,
|
|
1150
|
+
await (0, list_3.jobListCommand)(options);
|
|
820
1151
|
}
|
|
821
1152
|
catch (error) {
|
|
822
1153
|
logger_1.Logger.error(`Failed to list jobs: ${error}`);
|
|
@@ -884,7 +1215,7 @@ program
|
|
|
884
1215
|
.option('--verbose', 'Show detailed lab information')
|
|
885
1216
|
.action(async (options) => {
|
|
886
1217
|
try {
|
|
887
|
-
await (0,
|
|
1218
|
+
await (0, list_5.labNFTsCommand)(options);
|
|
888
1219
|
}
|
|
889
1220
|
catch (error) {
|
|
890
1221
|
logger_1.Logger.error(`Failed to fetch labs: ${error}`);
|
|
@@ -979,7 +1310,7 @@ program
|
|
|
979
1310
|
.option('--debug', 'Show debug information')
|
|
980
1311
|
.action(async (biocidOrFilename, options) => {
|
|
981
1312
|
try {
|
|
982
|
-
await (0,
|
|
1313
|
+
await (0, view_2.viewCommand)(biocidOrFilename, options);
|
|
983
1314
|
}
|
|
984
1315
|
catch (error) {
|
|
985
1316
|
logger_1.Logger.error(`View failed: ${error}`);
|