@genobank/biofs 3.17.3 → 3.18.0

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 (59) hide show
  1. package/dist/commands/benchmark.d.ts.map +1 -1
  2. package/dist/commands/benchmark.js +2 -1
  3. package/dist/commands/benchmark.js.map +1 -1
  4. package/dist/commands/consent.d.ts +10 -0
  5. package/dist/commands/consent.d.ts.map +1 -0
  6. package/dist/commands/consent.js +114 -0
  7. package/dist/commands/consent.js.map +1 -0
  8. package/dist/commands/duet.d.ts.map +1 -1
  9. package/dist/commands/duet.js +2 -1
  10. package/dist/commands/duet.js.map +1 -1
  11. package/dist/commands/fuse.d.ts.map +1 -1
  12. package/dist/commands/fuse.js +29 -7
  13. package/dist/commands/fuse.js.map +1 -1
  14. package/dist/commands/htsget.d.ts +6 -0
  15. package/dist/commands/htsget.d.ts.map +1 -1
  16. package/dist/commands/htsget.js +31 -6
  17. package/dist/commands/htsget.js.map +1 -1
  18. package/dist/commands/pipe.d.ts +4 -2
  19. package/dist/commands/pipe.d.ts.map +1 -1
  20. package/dist/commands/pipe.js +55 -50
  21. package/dist/commands/pipe.js.map +1 -1
  22. package/dist/commands/profile.d.ts +8 -0
  23. package/dist/commands/profile.d.ts.map +1 -0
  24. package/dist/commands/profile.js +193 -0
  25. package/dist/commands/profile.js.map +1 -0
  26. package/dist/commands/researcher/passport.d.ts +15 -0
  27. package/dist/commands/researcher/passport.d.ts.map +1 -0
  28. package/dist/commands/researcher/passport.js +98 -0
  29. package/dist/commands/researcher/passport.js.map +1 -0
  30. package/dist/commands/researcher/register.d.ts.map +1 -1
  31. package/dist/commands/researcher/register.js +4 -2
  32. package/dist/commands/researcher/register.js.map +1 -1
  33. package/dist/commands/room.d.ts +31 -0
  34. package/dist/commands/room.d.ts.map +1 -0
  35. package/dist/commands/room.js +486 -0
  36. package/dist/commands/room.js.map +1 -0
  37. package/dist/commands/stream.d.ts +7 -0
  38. package/dist/commands/stream.d.ts.map +1 -1
  39. package/dist/commands/stream.js +26 -41
  40. package/dist/commands/stream.js.map +1 -1
  41. package/dist/commands/tele.d.ts +42 -0
  42. package/dist/commands/tele.d.ts.map +1 -0
  43. package/dist/commands/tele.js +559 -0
  44. package/dist/commands/tele.js.map +1 -0
  45. package/dist/index.js +537 -7
  46. package/dist/index.js.map +1 -1
  47. package/dist/lib/config/paths.d.ts +6 -6
  48. package/dist/lib/config/paths.d.ts.map +1 -1
  49. package/dist/lib/config/paths.js +56 -17
  50. package/dist/lib/config/paths.js.map +1 -1
  51. package/dist/lib/htsget/client.d.ts +28 -5
  52. package/dist/lib/htsget/client.d.ts.map +1 -1
  53. package/dist/lib/htsget/client.js +96 -18
  54. package/dist/lib/htsget/client.js.map +1 -1
  55. package/dist/lib/tele/core.d.ts +71 -0
  56. package/dist/lib/tele/core.d.ts.map +1 -0
  57. package/dist/lib/tele/core.js +387 -0
  58. package/dist/lib/tele/core.js.map +1 -0
  59. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7,7 +7,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const commander_1 = require("commander");
8
8
  // FLUENCY_LINEAGE_VERBS_20260730
9
9
  const fluency_1 = require("./commands/fluency");
10
+ // CONSENT_VERBS_20260730
11
+ const consent_1 = require("./commands/consent");
10
12
  const lineage_1 = require("./commands/lineage");
13
+ // BIODATA_ROOM_20260801: dual profiles + researcher biodata room
14
+ const profile_1 = require("./commands/profile");
15
+ const room_1 = require("./commands/room");
11
16
  const version_1 = require("./version");
12
17
  const chalk_1 = __importDefault(require("chalk"));
13
18
  const login_1 = require("./commands/login");
@@ -48,10 +53,12 @@ const results_1 = require("./commands/job/results");
48
53
  const list_3 = require("./commands/job/list");
49
54
  const pipelines_1 = require("./commands/job/pipelines");
50
55
  // v2.7.0: htsget + smart streaming + aliases
56
+ // v3.18.0: TeleBioinformatics (`biofs tele`) + region stream
51
57
  const stream_1 = require("./commands/stream");
52
58
  const pipe_1 = require("./commands/pipe");
53
59
  const alias_1 = require("./commands/alias");
54
60
  const htsget_1 = require("./commands/htsget");
61
+ const tele_1 = require("./commands/tele");
55
62
  const submit_clara_1 = require("./commands/job/submit-clara");
56
63
  const recall_1 = require("./commands/job/recall");
57
64
  const create_2 = require("./commands/context/create");
@@ -170,6 +177,7 @@ const claim_1 = require("./commands/claim");
170
177
  const fingerprint_1 = require("./commands/fingerprint");
171
178
  const register_2 = require("./commands/researcher/register");
172
179
  const status_9 = require("./commands/researcher/status");
180
+ const passport_1 = require("./commands/researcher/passport");
173
181
  const errorReporter_1 = require("./utils/errorReporter");
174
182
  const logger_1 = require("./lib/utils/logger");
175
183
  const errorReporter_2 = require("./utils/errorReporter");
@@ -481,10 +489,15 @@ program
481
489
  // stream - htsget stream to stdout (pipes into any bioinformatics tool)
482
490
  program
483
491
  .command('stream <id>')
484
- .description('Stream a BioNFT-gated VCF/BAM to stdout via htsget (pipe into bcftools/samtools/pysam)')
492
+ .description('Stream a BioNFT-gated VCF/BAM/CRAM/FASTQ to stdout via htsget (pipe into bcftools/samtools/pysam/seqkit)')
485
493
  .option('--kind <variants|reads>', 'force datatype (default: auto-detect from filename)')
486
494
  .option('--htsget-url <url>', 'override htsget endpoint (default: https://htsget.genobank.app)')
487
495
  .option('--annotated', 'stream the OpenCRAVAT-annotated VCF sibling (Phase D) instead of raw')
496
+ .option('--region <chr:start-end>', 'genomic region (forwarded to htsget; client tools may also filter)')
497
+ .option('--referenceName <chr>', 'htsget referenceName (alias of region chrom)')
498
+ .option('--start <n>', 'htsget start (0-based if set with --referenceName)')
499
+ .option('--end <n>', 'htsget end')
500
+ .option('--raw', 'treat as raw byte stream (still via htsget inventory)')
488
501
  .option('-q, --quiet', 'suppress info messages')
489
502
  .action(async (id, options) => {
490
503
  try {
@@ -495,18 +508,20 @@ program
495
508
  process.exit(6);
496
509
  }
497
510
  });
498
- // pipe - auto-pipe htsget stream into bcftools/samtools view
511
+ // pipe - auto-pipe htsget stream into bcftools/samtools/seqkit
499
512
  // (distinct from the existing `view` command, which prints file content)
500
513
  program
501
514
  .command('pipe <id>')
502
- .description('Pipe a BioIP stream into bcftools view (VCF) or samtools view (BAM) automatically')
503
- .option('--tool <bcftools|samtools>', 'force tool (default: auto-detect from filename)')
515
+ .description('Pipe a BioIP stream into bcftools view (VCF), samtools view (BAM), or seqkit stats (FASTQ)')
516
+ .option('--tool <bcftools|samtools|seqkit>', 'force tool (default: auto-detect from filename)')
504
517
  .option('--htsget-url <url>', 'override htsget endpoint')
518
+ .option('--region <chr:start-end>', 'genomic region forwarded to htsget')
519
+ .option('--annotated', 'prefer OpenCRAVAT-annotated VCF sibling')
505
520
  .option('-q, --quiet', 'suppress info messages')
506
521
  .allowUnknownOption(true)
507
522
  .action(async (id, options, cmd) => {
508
523
  try {
509
- // Everything after `--` is passed through to bcftools/samtools view
524
+ // Everything after `--` is passed through to the tool
510
525
  const extra = cmd.args.slice(cmd.args.indexOf(id) + 1);
511
526
  await (0, pipe_1.pipeCommand)(id, { ...options, extra });
512
527
  }
@@ -515,6 +530,253 @@ program
515
530
  process.exit(6);
516
531
  }
517
532
  });
533
+ // ========================================================================
534
+ // v3.18.0 — TeleBioinformatics (`biofs tele`)
535
+ // Consent-gated htsget → local tools (Tier A) + IGV/Jupyter (Tier B).
536
+ // Heavy calling/annotation remains Tier C (annotate / job / skills).
537
+ // ========================================================================
538
+ const teleCmd = program
539
+ .command('tele')
540
+ .description('TeleBioinformatics: consent-gated streams into local tools (stats, IGV, jupyter, …)');
541
+ function teleCommon(cmd) {
542
+ return cmd
543
+ .option('--kind <variants|reads>', 'force htsget datatype')
544
+ .option('--htsget-url <url>', 'override htsget endpoint')
545
+ .option('--region <chr:start-end>', 'genomic region')
546
+ .option('--annotated', 'OpenCRAVAT-annotated VCF sibling when available')
547
+ .option('-q, --quiet', 'suppress progress on stderr')
548
+ .option('--json', 'JSON output where supported');
549
+ }
550
+ teleCommon(teleCmd
551
+ .command('tools')
552
+ .description('Catalog of TeleBioinformatics tools and tiers (A stream / B fuse / C server)')).action(async (options) => {
553
+ try {
554
+ await (0, tele_1.teleToolsCommand)(options);
555
+ }
556
+ catch (e) {
557
+ logger_1.Logger.error(e?.message || e);
558
+ process.exit(6);
559
+ }
560
+ });
561
+ teleCommon(teleCmd
562
+ .command('stats <id>')
563
+ .description('bcftools stats | samtools stats | seqkit stats (auto by filetype)')).action(async (id, options) => {
564
+ try {
565
+ await (0, tele_1.teleStatsCommand)(id, options);
566
+ }
567
+ catch (e) {
568
+ logger_1.Logger.error(e?.message || e);
569
+ process.exit(6);
570
+ }
571
+ });
572
+ teleCommon(teleCmd
573
+ .command('header <id>')
574
+ .description('VCF/BAM header only (bcftools view -h | samtools view -H)')).action(async (id, options) => {
575
+ try {
576
+ await (0, tele_1.teleHeaderCommand)(id, options);
577
+ }
578
+ catch (e) {
579
+ logger_1.Logger.error(e?.message || e);
580
+ process.exit(6);
581
+ }
582
+ });
583
+ teleCommon(teleCmd
584
+ .command('flagstat <id>')
585
+ .description('samtools flagstat on a streamed BAM/CRAM')).action(async (id, options) => {
586
+ try {
587
+ await (0, tele_1.teleFlagstatCommand)(id, options);
588
+ }
589
+ catch (e) {
590
+ logger_1.Logger.error(e?.message || e);
591
+ process.exit(6);
592
+ }
593
+ });
594
+ teleCommon(teleCmd
595
+ .command('count <id>')
596
+ .description('Count variants (bcftools) or reads (samtools view -c)')).action(async (id, options) => {
597
+ try {
598
+ await (0, tele_1.teleCountCommand)(id, options);
599
+ }
600
+ catch (e) {
601
+ logger_1.Logger.error(e?.message || e);
602
+ process.exit(6);
603
+ }
604
+ });
605
+ teleCommon(teleCmd
606
+ .command('region <id> <region>')
607
+ .description('Stream a genomic region (chr:start-end) via htsget + tool filter')).action(async (id, region, options) => {
608
+ try {
609
+ await (0, tele_1.teleRegionCommand)(id, region, options);
610
+ }
611
+ catch (e) {
612
+ logger_1.Logger.error(e?.message || e);
613
+ process.exit(6);
614
+ }
615
+ });
616
+ teleCommon(teleCmd
617
+ .command('query <id>')
618
+ .description('bcftools query (pass -f after --)')
619
+ .option('--format <fmt>', 'bcftools -f format string')
620
+ .allowUnknownOption(true)).action(async (id, options, cmd) => {
621
+ try {
622
+ const extra = cmd.args.slice(cmd.args.indexOf(id) + 1);
623
+ await (0, tele_1.teleQueryCommand)(id, extra, options);
624
+ }
625
+ catch (e) {
626
+ logger_1.Logger.error(e?.message || e);
627
+ process.exit(6);
628
+ }
629
+ });
630
+ teleCommon(teleCmd
631
+ .command('filter <id>')
632
+ .description('bcftools view with -i/-e filters')
633
+ .option('--include <expr>', 'bcftools -i expression')
634
+ .option('--exclude <expr>', 'bcftools -e expression')
635
+ .allowUnknownOption(true)).action(async (id, options, cmd) => {
636
+ try {
637
+ const extra = cmd.args.slice(cmd.args.indexOf(id) + 1);
638
+ await (0, tele_1.teleFilterCommand)(id, extra, options);
639
+ }
640
+ catch (e) {
641
+ logger_1.Logger.error(e?.message || e);
642
+ process.exit(6);
643
+ }
644
+ });
645
+ teleCommon(teleCmd
646
+ .command('view <id>')
647
+ .description('Generic bcftools/samtools view (args after --)')
648
+ .allowUnknownOption(true)).action(async (id, options, cmd) => {
649
+ try {
650
+ const extra = cmd.args.slice(cmd.args.indexOf(id) + 1);
651
+ await (0, tele_1.teleViewCommand)(id, extra, options);
652
+ }
653
+ catch (e) {
654
+ logger_1.Logger.error(e?.message || e);
655
+ process.exit(6);
656
+ }
657
+ });
658
+ teleCommon(teleCmd
659
+ .command('seqkit <id>')
660
+ .description('seqkit stats on streamed FASTQ/FASTA')).action(async (id, options) => {
661
+ try {
662
+ await (0, tele_1.teleSeqkitCommand)(id, options);
663
+ }
664
+ catch (e) {
665
+ logger_1.Logger.error(e?.message || e);
666
+ process.exit(6);
667
+ }
668
+ });
669
+ teleCommon(teleCmd
670
+ .command('seqtk <id>')
671
+ .description('seqtk on streamed FASTQ (args after --)')
672
+ .allowUnknownOption(true)).action(async (id, options, cmd) => {
673
+ try {
674
+ const extra = cmd.args.slice(cmd.args.indexOf(id) + 1);
675
+ await (0, tele_1.teleSeqtkCommand)(id, extra, options);
676
+ }
677
+ catch (e) {
678
+ logger_1.Logger.error(e?.message || e);
679
+ process.exit(6);
680
+ }
681
+ });
682
+ teleCommon(teleCmd
683
+ .command('bedtools <id>')
684
+ .description('bedtools on stream (e.g. -- intersect -b genes.bed)')
685
+ .allowUnknownOption(true)).action(async (id, options, cmd) => {
686
+ try {
687
+ const extra = cmd.args.slice(cmd.args.indexOf(id) + 1);
688
+ await (0, tele_1.teleBedtoolsCommand)(id, extra, options);
689
+ }
690
+ catch (e) {
691
+ logger_1.Logger.error(e?.message || e);
692
+ process.exit(6);
693
+ }
694
+ });
695
+ teleCommon(teleCmd
696
+ .command('vt <id>')
697
+ .description('vt on VCF stream (e.g. -- normalize -r ref.fa)')
698
+ .allowUnknownOption(true)).action(async (id, options, cmd) => {
699
+ try {
700
+ const extra = cmd.args.slice(cmd.args.indexOf(id) + 1);
701
+ await (0, tele_1.teleVtCommand)(id, extra, options);
702
+ }
703
+ catch (e) {
704
+ logger_1.Logger.error(e?.message || e);
705
+ process.exit(6);
706
+ }
707
+ });
708
+ teleCommon(teleCmd
709
+ .command('mosdepth <id>')
710
+ .description('mosdepth coverage (materializes temp BAM; prefer fuse for large WGS)')
711
+ .option('--out <prefix>', 'output prefix')).action(async (id, options) => {
712
+ try {
713
+ await (0, tele_1.teleMosdepthCommand)(id, options);
714
+ }
715
+ catch (e) {
716
+ logger_1.Logger.error(e?.message || e);
717
+ process.exit(6);
718
+ }
719
+ });
720
+ teleCommon(teleCmd
721
+ .command('igv <id>')
722
+ .description('Write IGV desktop batch + IGV.js HTML session for the stream URL')
723
+ .option('--web', 'also open IGV.js HTML')
724
+ .option('--open', 'open the HTML session in the default browser')
725
+ .option('--out <path>', 'output HTML path')).action(async (id, options) => {
726
+ try {
727
+ await (0, tele_1.teleIgvCommand)(id, options);
728
+ }
729
+ catch (e) {
730
+ logger_1.Logger.error(e?.message || e);
731
+ process.exit(6);
732
+ }
733
+ });
734
+ teleCommon(teleCmd
735
+ .command('jupyter <id>')
736
+ .description('Emit a Jupyter/Python cell that streams via biofs into pysam or line parser')
737
+ .option('--out <file>', 'write cell to file')).action(async (id, options) => {
738
+ try {
739
+ await (0, tele_1.teleJupyterCommand)(id, options);
740
+ }
741
+ catch (e) {
742
+ logger_1.Logger.error(e?.message || e);
743
+ process.exit(6);
744
+ }
745
+ });
746
+ teleCommon(teleCmd
747
+ .command('pysam <id>')
748
+ .description('Alias of tele jupyter (pysam-oriented snippet)')
749
+ .option('--out <file>', 'write snippet to file')).action(async (id, options) => {
750
+ try {
751
+ await (0, tele_1.telePysamCommand)(id, options);
752
+ }
753
+ catch (e) {
754
+ logger_1.Logger.error(e?.message || e);
755
+ process.exit(6);
756
+ }
757
+ });
758
+ teleCommon(teleCmd
759
+ .command('stream <id>')
760
+ .description('Same as biofs stream (raw htsget bytes to stdout)')).action(async (id, options) => {
761
+ try {
762
+ await (0, tele_1.teleStreamCommand)(id, options);
763
+ }
764
+ catch (e) {
765
+ logger_1.Logger.error(e?.message || e);
766
+ process.exit(6);
767
+ }
768
+ });
769
+ teleCommon(teleCmd
770
+ .command('ticket <id>')
771
+ .description('Show htsget ticket JSON for an id (TeleBioinformatics debug)')).action(async (id, options) => {
772
+ try {
773
+ await (0, tele_1.teleTicketCommand)(id, options);
774
+ }
775
+ catch (e) {
776
+ logger_1.Logger.error(e?.message || e);
777
+ process.exit(6);
778
+ }
779
+ });
518
780
  // alias - manage local shortcuts for ip_ids / BioCIDs
519
781
  program
520
782
  .command('alias [name] [target]')
@@ -551,13 +813,19 @@ htsgetCmd
551
813
  htsgetCmd
552
814
  .command('ticket <kind> <id>')
553
815
  .description('Fetch a raw htsget ticket for debugging (kind = variants | reads)')
554
- .action(async (kind, id) => {
816
+ .option('--region <chr:start-end>', 'genomic region (htsget referenceName/start/end)')
817
+ .option('--referenceName <chr>', 'htsget referenceName')
818
+ .option('--start <n>', 'htsget start')
819
+ .option('--end <n>', 'htsget end')
820
+ .option('--annotated', 'request annotated VCF sibling')
821
+ .option('--htsget-url <url>', 'override htsget endpoint')
822
+ .action(async (kind, id, options) => {
555
823
  try {
556
824
  if (kind !== 'variants' && kind !== 'reads') {
557
825
  logger_1.Logger.error(`kind must be 'variants' or 'reads' (got '${kind}')`);
558
826
  process.exit(2);
559
827
  }
560
- await (0, htsget_1.htsgetTicketCommand)(kind, id);
828
+ await (0, htsget_1.htsgetTicketCommand)(kind, id, options);
561
829
  }
562
830
  catch (error) {
563
831
  logger_1.Logger.error(`ticket failed: ${error?.message || error}`);
@@ -2630,6 +2898,35 @@ researcherCmd
2630
2898
  process.exit(1);
2631
2899
  }
2632
2900
  });
2901
+ researcherCmd
2902
+ .command('passport')
2903
+ .description('Publish or show known-identity passport (shown on Biodata Room admit / Telegram)')
2904
+ .option('--publish', 'Publish/update passport on biofs-node (default if no --show)')
2905
+ .option('--show', 'Show passport for a wallet')
2906
+ .option('--name <name>', 'Display name')
2907
+ .option('--provider <provider>', 'orcid|linkedin|twitter|google|metamask|…')
2908
+ .option('--orcid <id>', 'ORCID iD')
2909
+ .option('--linkedin <url>', 'LinkedIn profile URL')
2910
+ .option('--twitter <handle>', 'X / Twitter handle')
2911
+ .option('--institution <name>', 'Institution')
2912
+ .option('--ga4gh <level>', 'NONE|BASIC|LITE|FULL', 'BASIC')
2913
+ .option('--wallet <addr>', 'Wallet for --show')
2914
+ .option('--json', 'JSON output')
2915
+ .option('--quiet', 'Quiet')
2916
+ .action(async (options) => {
2917
+ try {
2918
+ if (options.show || options.wallet) {
2919
+ await (0, passport_1.researcherPassportShowCommand)(options);
2920
+ }
2921
+ else {
2922
+ await (0, passport_1.researcherPassportPublishCommand)(options);
2923
+ }
2924
+ }
2925
+ catch (error) {
2926
+ logger_1.Logger.error(`Passport failed: ${error}`);
2927
+ process.exit(1);
2928
+ }
2929
+ });
2633
2930
  // Lab Registry - List approved research labs
2634
2931
  program
2635
2932
  .command('labnfts')
@@ -3500,6 +3797,237 @@ program
3500
3797
  program.outputHelp();
3501
3798
  }
3502
3799
  });
3800
+ // BIODATA_ROOM_20260801: dual-role profiles (patient vault vs known researcher)
3801
+ const profileCmd = program
3802
+ .command('profile')
3803
+ .description('Manage dual BioFS profiles (patient vs researcher credential roots)');
3804
+ profileCmd
3805
+ .command('list')
3806
+ .description('List local profiles under ~/.biofs/profiles/*')
3807
+ .option('--json', 'JSON output')
3808
+ .action(async (o) => {
3809
+ try {
3810
+ await (0, profile_1.profileListCommand)(o);
3811
+ }
3812
+ catch (e) {
3813
+ logger_1.Logger.error(String(e));
3814
+ process.exit(1);
3815
+ }
3816
+ });
3817
+ profileCmd
3818
+ .command('use <name>')
3819
+ .description('Prepare a named profile; print export BIOFS_PROFILE=... (--print for shell eval)')
3820
+ .option('--print', 'Print shell exports only (for eval "$(biofs profile use researcher --print)")')
3821
+ .option('--json', 'JSON output')
3822
+ .action(async (name, o) => {
3823
+ try {
3824
+ await (0, profile_1.profileUseCommand)(name, o);
3825
+ }
3826
+ catch (e) {
3827
+ logger_1.Logger.error(String(e));
3828
+ process.exit(1);
3829
+ }
3830
+ });
3831
+ profileCmd
3832
+ .command('status')
3833
+ .description('Show active profile, config dir, and wallet')
3834
+ .option('--json', 'JSON output')
3835
+ .action(async (o) => {
3836
+ try {
3837
+ await (0, profile_1.profileStatusCommand)(o);
3838
+ }
3839
+ catch (e) {
3840
+ logger_1.Logger.error(String(e));
3841
+ process.exit(1);
3842
+ }
3843
+ });
3844
+ // BIODATA_ROOM_20260801: investor-style biodata room for researcher deep dives
3845
+ const roomCmd = program
3846
+ .command('room')
3847
+ .description('Researcher Biodata Room: create, request, admit, enter, scoped files (via biofs-node)');
3848
+ roomCmd
3849
+ .command('create')
3850
+ .description('Owner: create a room over one or more biocid:// assets')
3851
+ .requiredOption('--biocids <list>', 'Comma/space-separated biocid:// list')
3852
+ .option('--purpose <text>', 'Research purpose shown to the owner', 'research deep dive')
3853
+ .option('--skills <list>', 'Allowed verbs (comma-separated)')
3854
+ .option('--days <n>', 'TTL days after admit (1-30)', '7')
3855
+ .option('--researcher <wallet>', 'Optional pre-assign researcher wallet')
3856
+ .option('--json', 'JSON output')
3857
+ .option('--quiet', 'Quiet mode')
3858
+ .action(async (o) => {
3859
+ try {
3860
+ await (0, room_1.roomCreateCommand)(o);
3861
+ }
3862
+ catch (e) {
3863
+ logger_1.Logger.error(String(e));
3864
+ process.exit(1);
3865
+ }
3866
+ });
3867
+ roomCmd
3868
+ .command('request <room_id>')
3869
+ .description('Researcher: request admission to a room')
3870
+ .option('--purpose <text>', 'Purpose of the deep dive')
3871
+ .option('--message <text>', 'Message to the data owner')
3872
+ .option('--skills <list>', 'Requested skills')
3873
+ .option('--json', 'JSON output')
3874
+ .option('--quiet', 'Quiet mode')
3875
+ .action(async (roomId, o) => {
3876
+ try {
3877
+ await (0, room_1.roomRequestCommand)(roomId, o);
3878
+ }
3879
+ catch (e) {
3880
+ logger_1.Logger.error(String(e));
3881
+ process.exit(1);
3882
+ }
3883
+ });
3884
+ roomCmd
3885
+ .command('status <room_id>')
3886
+ .description('Show room status (members see full card)')
3887
+ .option('--json', 'JSON output')
3888
+ .action(async (roomId, o) => {
3889
+ try {
3890
+ await (0, room_1.roomStatusCommand)(roomId, o);
3891
+ }
3892
+ catch (e) {
3893
+ logger_1.Logger.error(String(e));
3894
+ process.exit(1);
3895
+ }
3896
+ });
3897
+ roomCmd
3898
+ .command('admit <room_id>')
3899
+ .description('Owner (patient): admit the researcher and open the room')
3900
+ .option('--json', 'JSON output')
3901
+ .option('--quiet', 'Quiet mode')
3902
+ .action(async (roomId, o) => {
3903
+ try {
3904
+ await (0, room_1.roomAdmitCommand)(roomId, o);
3905
+ }
3906
+ catch (e) {
3907
+ logger_1.Logger.error(String(e));
3908
+ process.exit(1);
3909
+ }
3910
+ });
3911
+ roomCmd
3912
+ .command('revoke <room_id>')
3913
+ .description('Owner or researcher: revoke/leave the room')
3914
+ .option('--json', 'JSON output')
3915
+ .option('--quiet', 'Quiet mode')
3916
+ .action(async (roomId, o) => {
3917
+ try {
3918
+ await (0, room_1.roomRevokeCommand)(roomId, o);
3919
+ }
3920
+ catch (e) {
3921
+ logger_1.Logger.error(String(e));
3922
+ process.exit(1);
3923
+ }
3924
+ });
3925
+ roomCmd
3926
+ .command('list')
3927
+ .description('List rooms for the active profile wallet')
3928
+ .option('--json', 'JSON output')
3929
+ .action(async (o) => {
3930
+ try {
3931
+ await (0, room_1.roomListCommand)(o);
3932
+ }
3933
+ catch (e) {
3934
+ logger_1.Logger.error(String(e));
3935
+ process.exit(1);
3936
+ }
3937
+ });
3938
+ roomCmd
3939
+ .command('enter <room_id>')
3940
+ .description('Enter an OPEN room (sets local active_room.json session)')
3941
+ .option('--json', 'JSON output')
3942
+ .option('--quiet', 'Quiet mode')
3943
+ .action(async (roomId, o) => {
3944
+ try {
3945
+ await (0, room_1.roomEnterCommand)(roomId, o);
3946
+ }
3947
+ catch (e) {
3948
+ logger_1.Logger.error(String(e));
3949
+ process.exit(1);
3950
+ }
3951
+ });
3952
+ roomCmd
3953
+ .command('leave')
3954
+ .description('Clear the local active room session')
3955
+ .option('--json', 'JSON output')
3956
+ .action(async (o) => {
3957
+ try {
3958
+ await (0, room_1.roomLeaveCommand)(o);
3959
+ }
3960
+ catch (e) {
3961
+ logger_1.Logger.error(String(e));
3962
+ process.exit(1);
3963
+ }
3964
+ });
3965
+ roomCmd
3966
+ .command('files [room_id]')
3967
+ .description('List biocids in a room (defaults to active room). No gs:// paths returned.')
3968
+ .option('--json', 'JSON output')
3969
+ .action(async (roomId, o) => {
3970
+ try {
3971
+ await (0, room_1.roomFilesCommand)(roomId, o);
3972
+ }
3973
+ catch (e) {
3974
+ logger_1.Logger.error(String(e));
3975
+ process.exit(1);
3976
+ }
3977
+ });
3978
+ roomCmd
3979
+ .command('signing-url <room_id>')
3980
+ .description('Get patient web + Telegram signing links for a room')
3981
+ .option('--json', 'JSON output')
3982
+ .action(async (roomId, o) => {
3983
+ try {
3984
+ await (0, room_1.roomSigningUrlCommand)(roomId, o);
3985
+ }
3986
+ catch (e) {
3987
+ logger_1.Logger.error(String(e));
3988
+ process.exit(1);
3989
+ }
3990
+ });
3991
+ // CONSENT_VERBS_20260730: subject-signed consent for an AI-agent session. Two steps because the
3992
+ // node cannot sign for the data owner, which is the property that stops consent being
3993
+ // minted ABOUT a person instead of BY them.
3994
+ const consentCmd = program
3995
+ .command('consent')
3996
+ .description('Grant or inspect consent for an AI-agent session (dispatched through biofs-node)');
3997
+ consentCmd
3998
+ .command('payload')
3999
+ .description('Build the consent terms the data owner must sign for one MCP session')
4000
+ .requiredOption('--session <id>', 'MCP session id (Mcp-Session-Id)')
4001
+ .requiredOption('--biocid <biocid>', 'The biocid:// the grant covers')
4002
+ .option('--days <n>', 'Validity in days (1-30)', '1')
4003
+ .option('--json', 'Emit JSON')
4004
+ .option('--quiet', 'Suppress progress')
4005
+ .action(async (o) => {
4006
+ try {
4007
+ await (0, consent_1.consentPayloadCommand)(o.session, o.biocid, o);
4008
+ }
4009
+ catch (e) {
4010
+ logger_1.Logger.error(`consent payload failed: ${e}`);
4011
+ process.exit(1);
4012
+ }
4013
+ });
4014
+ consentCmd
4015
+ .command('submit')
4016
+ .description('Relay a data-owner-signed consent grant on-chain (the node pays the gas)')
4017
+ .requiredOption('--session <id>', 'MCP session id')
4018
+ .requiredOption('--message <json>', 'The signed grant message, inline JSON or a path')
4019
+ .requiredOption('--signature <sig>', 'EIP-712 signature by the data owner')
4020
+ .option('--json', 'Emit JSON')
4021
+ .option('--quiet', 'Suppress progress')
4022
+ .action(async (o) => {
4023
+ try {
4024
+ await (0, consent_1.consentSubmitCommand)(o.session, o.message, o.signature, o);
4025
+ }
4026
+ catch (e) {
4027
+ logger_1.Logger.error(`consent submit failed: ${e}`);
4028
+ process.exit(1);
4029
+ }
4030
+ });
3503
4031
  // FLUENCY_LINEAGE_VERBS_20260730: make a genomics store AI-conversable, and report the metamorphosis.
3504
4032
  // Registered with the other groups, BEFORE the welcome banner and program.parse().
3505
4033
  const fluencyCmd = program
@@ -3562,6 +4090,8 @@ if (process.argv.length === 2) {
3562
4090
  console.log(` ${chalk_1.default.green('biofiles')} - List your BioFiles (all sources)`);
3563
4091
  console.log(` ${chalk_1.default.green('download')} - Download files (GDPR consent)`);
3564
4092
  console.log(` ${chalk_1.default.green('mount')} - Mount all files (GDPR consent)`);
4093
+ console.log(` ${chalk_1.default.green('profile')} - Dual profiles (patient vs researcher credentials)`);
4094
+ console.log(` ${chalk_1.default.green('room')} - Researcher Biodata Room (admit + scoped deep dive)`);
3565
4095
  console.log(` ${chalk_1.default.green('fluency')} - Make a store AI-conversable (coverage + per-gene rollups)`);
3566
4096
  console.log(` ${chalk_1.default.green('lineage')} - Biodata metamorphosis: parents, derivatives, owners`);
3567
4097
  console.log(` ${chalk_1.default.green('mount-remote')} - Mount biosample on agent`);