chainlesschain 0.143.0 → 0.145.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 (133) hide show
  1. package/package.json +1 -1
  2. package/src/commands/a2a.js +196 -28
  3. package/src/commands/activitypub.js +157 -27
  4. package/src/commands/agent.js +587 -103
  5. package/src/commands/audit.js +206 -0
  6. package/src/commands/bi.js +152 -27
  7. package/src/commands/bm25.js +111 -27
  8. package/src/commands/browse.js +190 -29
  9. package/src/commands/ccron.js +128 -28
  10. package/src/commands/chat.js +207 -0
  11. package/src/commands/compliance.js +414 -34
  12. package/src/commands/compt.js +127 -29
  13. package/src/commands/consol.js +8 -2
  14. package/src/commands/cowork.js +580 -34
  15. package/src/commands/crosschain.js +182 -28
  16. package/src/commands/dao.js +182 -28
  17. package/src/commands/dlp.js +172 -27
  18. package/src/commands/economy.js +205 -50
  19. package/src/commands/evolution.js +203 -50
  20. package/src/commands/evomap.js +182 -27
  21. package/src/commands/fflag.js +74 -22
  22. package/src/commands/git.js +177 -37
  23. package/src/commands/hardening.js +209 -0
  24. package/src/commands/hmemory.js +204 -50
  25. package/src/commands/incentive.js +209 -0
  26. package/src/commands/inference.js +170 -34
  27. package/src/commands/itbudget.js +149 -33
  28. package/src/commands/kg.js +206 -0
  29. package/src/commands/lowcode.js +195 -38
  30. package/src/commands/marketplace.js +206 -0
  31. package/src/commands/matrix.js +179 -27
  32. package/src/commands/mcpscaf.js +145 -33
  33. package/src/commands/meminj.js +145 -33
  34. package/src/commands/nostr.js +178 -27
  35. package/src/commands/orchestrate.js +217 -0
  36. package/src/commands/orchgov.js +144 -33
  37. package/src/commands/pdfp.js +109 -27
  38. package/src/commands/perf.js +169 -32
  39. package/src/commands/perm.js +144 -33
  40. package/src/commands/pipeline.js +207 -52
  41. package/src/commands/planmode.js +141 -32
  42. package/src/commands/privacy.js +203 -0
  43. package/src/commands/promcomp.js +111 -27
  44. package/src/commands/recommend.js +177 -34
  45. package/src/commands/reputation.js +208 -0
  46. package/src/commands/sandbox.js +206 -0
  47. package/src/commands/seshhook.js +145 -33
  48. package/src/commands/seshsearch.js +141 -33
  49. package/src/commands/seshtail.js +144 -33
  50. package/src/commands/seshu.js +152 -33
  51. package/src/commands/sganal.js +123 -29
  52. package/src/commands/siem.js +201 -34
  53. package/src/commands/sla.js +212 -0
  54. package/src/commands/slotfill.js +146 -33
  55. package/src/commands/social.js +157 -32
  56. package/src/commands/stress.js +206 -0
  57. package/src/commands/svccont.js +145 -33
  58. package/src/commands/terraform.js +206 -0
  59. package/src/commands/tms.js +171 -33
  60. package/src/commands/topiccls.js +146 -33
  61. package/src/commands/uprof.js +141 -32
  62. package/src/commands/vcheck.js +122 -28
  63. package/src/commands/webfetch.js +141 -32
  64. package/src/commands/zkp.js +184 -28
  65. package/src/index.js +40 -0
  66. package/src/lib/a2a-protocol.js +319 -51
  67. package/src/lib/activitypub-bridge.js +288 -50
  68. package/src/lib/agent-economy.js +304 -51
  69. package/src/lib/app-builder.js +279 -46
  70. package/src/lib/audit-logger.js +321 -0
  71. package/src/lib/autonomous-agent.js +284 -48
  72. package/src/lib/bi-engine.js +283 -49
  73. package/src/lib/bm25-search.js +301 -49
  74. package/src/lib/browser-automation.js +296 -49
  75. package/src/lib/chat-core.js +336 -0
  76. package/src/lib/claude-code-bridge.js +341 -0
  77. package/src/lib/compliance-framework-reporter.js +305 -51
  78. package/src/lib/compliance-manager.js +330 -0
  79. package/src/lib/compression-telemetry.js +301 -49
  80. package/src/lib/content-recommender.js +317 -52
  81. package/src/lib/cowork-cron.js +298 -49
  82. package/src/lib/cowork-learning.js +333 -0
  83. package/src/lib/cowork-task-runner.js +308 -51
  84. package/src/lib/cowork-workflow.js +327 -0
  85. package/src/lib/cross-chain.js +311 -51
  86. package/src/lib/dao-governance.js +280 -46
  87. package/src/lib/dlp-engine.js +287 -49
  88. package/src/lib/evolution-system.js +278 -47
  89. package/src/lib/evomap-manager.js +280 -46
  90. package/src/lib/execution-backend.js +294 -48
  91. package/src/lib/feature-flags.js +294 -49
  92. package/src/lib/git-integration.js +285 -47
  93. package/src/lib/hardening-manager.js +341 -0
  94. package/src/lib/hierarchical-memory.js +284 -48
  95. package/src/lib/inference-network.js +308 -51
  96. package/src/lib/iteration-budget.js +302 -50
  97. package/src/lib/knowledge-graph.js +333 -0
  98. package/src/lib/matrix-bridge.js +281 -47
  99. package/src/lib/mcp-scaffold.js +318 -54
  100. package/src/lib/memory-injection.js +288 -49
  101. package/src/lib/nostr-bridge.js +286 -49
  102. package/src/lib/orchestrator.js +293 -48
  103. package/src/lib/pdf-parser.js +298 -49
  104. package/src/lib/perf-tuning.js +309 -50
  105. package/src/lib/permission-engine.js +287 -49
  106. package/src/lib/pipeline-orchestrator.js +289 -49
  107. package/src/lib/plan-mode.js +298 -51
  108. package/src/lib/privacy-computing.js +335 -0
  109. package/src/lib/reputation-optimizer.js +340 -0
  110. package/src/lib/sandbox-v2.js +327 -0
  111. package/src/lib/service-container.js +313 -52
  112. package/src/lib/session-consolidator.js +296 -49
  113. package/src/lib/session-hooks.js +312 -53
  114. package/src/lib/session-search.js +304 -51
  115. package/src/lib/session-tail.js +288 -49
  116. package/src/lib/session-usage.js +298 -52
  117. package/src/lib/siem-exporter.js +298 -51
  118. package/src/lib/skill-marketplace.js +345 -0
  119. package/src/lib/sla-manager.js +341 -0
  120. package/src/lib/slot-filler.js +303 -51
  121. package/src/lib/social-graph-analytics.js +295 -49
  122. package/src/lib/social-graph.js +272 -49
  123. package/src/lib/stress-tester.js +342 -0
  124. package/src/lib/sub-agent-registry.js +302 -53
  125. package/src/lib/task-model-selector.js +302 -50
  126. package/src/lib/terraform-manager.js +333 -0
  127. package/src/lib/todo-manager.js +281 -47
  128. package/src/lib/token-incentive.js +341 -0
  129. package/src/lib/topic-classifier.js +297 -49
  130. package/src/lib/user-profile.js +294 -50
  131. package/src/lib/version-checker.js +304 -50
  132. package/src/lib/web-fetch.js +292 -51
  133. package/src/lib/zkp-engine.js +286 -49
@@ -586,3 +586,209 @@ export function registerAuditCommand(program) {
586
586
  logger.log(JSON.stringify(getAuditStatsV2(), null, 2));
587
587
  });
588
588
  }
589
+
590
+ // === Iter16 V2 governance overlay ===
591
+ export function registerAuditGovV2Commands(program) {
592
+ const parent = program.commands.find((c) => c.name() === "audit");
593
+ if (!parent) return;
594
+ const L = async () => await import("../lib/audit-logger.js");
595
+ parent
596
+ .command("aud-gov-enums-v2")
597
+ .description("Show V2 enums (aud maturity + write lifecycle)")
598
+ .action(async () => {
599
+ const m = await L();
600
+ console.log(
601
+ JSON.stringify(
602
+ {
603
+ profileMaturity: m.AUD_PROFILE_MATURITY_V2,
604
+ writeLifecycle: m.AUD_WRITE_LIFECYCLE_V2,
605
+ },
606
+ null,
607
+ 2,
608
+ ),
609
+ );
610
+ });
611
+ parent
612
+ .command("aud-gov-config-v2")
613
+ .description("Show V2 config thresholds")
614
+ .action(async () => {
615
+ const m = await L();
616
+ console.log(
617
+ JSON.stringify(
618
+ {
619
+ maxActive: m.getMaxActiveAudProfilesPerOwnerV2(),
620
+ maxPending: m.getMaxPendingAudWritesPerProfileV2(),
621
+ idleMs: m.getAudProfileIdleMsV2(),
622
+ stuckMs: m.getAudWriteStuckMsV2(),
623
+ },
624
+ null,
625
+ 2,
626
+ ),
627
+ );
628
+ });
629
+ parent
630
+ .command("aud-gov-set-max-active-v2 <n>")
631
+ .description("Set max active profiles per owner")
632
+ .action(async (n) => {
633
+ const m = await L();
634
+ m.setMaxActiveAudProfilesPerOwnerV2(Number(n));
635
+ console.log("ok");
636
+ });
637
+ parent
638
+ .command("aud-gov-set-max-pending-v2 <n>")
639
+ .description("Set max pending writes per profile")
640
+ .action(async (n) => {
641
+ const m = await L();
642
+ m.setMaxPendingAudWritesPerProfileV2(Number(n));
643
+ console.log("ok");
644
+ });
645
+ parent
646
+ .command("aud-gov-set-idle-ms-v2 <n>")
647
+ .description("Set profile idle threshold (ms)")
648
+ .action(async (n) => {
649
+ const m = await L();
650
+ m.setAudProfileIdleMsV2(Number(n));
651
+ console.log("ok");
652
+ });
653
+ parent
654
+ .command("aud-gov-set-stuck-ms-v2 <n>")
655
+ .description("Set write stuck threshold (ms)")
656
+ .action(async (n) => {
657
+ const m = await L();
658
+ m.setAudWriteStuckMsV2(Number(n));
659
+ console.log("ok");
660
+ });
661
+ parent
662
+ .command("aud-gov-register-v2 <id> <owner>")
663
+ .description("Register V2 aud profile")
664
+ .option("--level <v>", "level")
665
+ .action(async (id, owner, o) => {
666
+ const m = await L();
667
+ console.log(
668
+ JSON.stringify(
669
+ m.registerAudProfileV2({ id, owner, level: o.level }),
670
+ null,
671
+ 2,
672
+ ),
673
+ );
674
+ });
675
+ parent
676
+ .command("aud-gov-activate-v2 <id>")
677
+ .description("Activate profile")
678
+ .action(async (id) => {
679
+ const m = await L();
680
+ console.log(JSON.stringify(m.activateAudProfileV2(id), null, 2));
681
+ });
682
+ parent
683
+ .command("aud-gov-suspend-v2 <id>")
684
+ .description("Suspend profile")
685
+ .action(async (id) => {
686
+ const m = await L();
687
+ console.log(JSON.stringify(m.suspendAudProfileV2(id), null, 2));
688
+ });
689
+ parent
690
+ .command("aud-gov-archive-v2 <id>")
691
+ .description("Archive profile (terminal)")
692
+ .action(async (id) => {
693
+ const m = await L();
694
+ console.log(JSON.stringify(m.archiveAudProfileV2(id), null, 2));
695
+ });
696
+ parent
697
+ .command("aud-gov-touch-v2 <id>")
698
+ .description("Touch profile")
699
+ .action(async (id) => {
700
+ const m = await L();
701
+ console.log(JSON.stringify(m.touchAudProfileV2(id), null, 2));
702
+ });
703
+ parent
704
+ .command("aud-gov-get-v2 <id>")
705
+ .description("Get profile")
706
+ .action(async (id) => {
707
+ const m = await L();
708
+ console.log(JSON.stringify(m.getAudProfileV2(id), null, 2));
709
+ });
710
+ parent
711
+ .command("aud-gov-list-v2")
712
+ .description("List profiles")
713
+ .action(async () => {
714
+ const m = await L();
715
+ console.log(JSON.stringify(m.listAudProfilesV2(), null, 2));
716
+ });
717
+ parent
718
+ .command("aud-gov-create-write-v2 <id> <profileId>")
719
+ .description("Create write (queued)")
720
+ .option("--key <v>", "key")
721
+ .action(async (id, profileId, o) => {
722
+ const m = await L();
723
+ console.log(
724
+ JSON.stringify(
725
+ m.createAudWriteV2({ id, profileId, key: o.key }),
726
+ null,
727
+ 2,
728
+ ),
729
+ );
730
+ });
731
+ parent
732
+ .command("aud-gov-writing-write-v2 <id>")
733
+ .description("Mark write as writing")
734
+ .action(async (id) => {
735
+ const m = await L();
736
+ console.log(JSON.stringify(m.writingAudWriteV2(id), null, 2));
737
+ });
738
+ parent
739
+ .command("aud-gov-complete-write-v2 <id>")
740
+ .description("Write OK")
741
+ .action(async (id) => {
742
+ const m = await L();
743
+ console.log(JSON.stringify(m.writeOkAudV2(id), null, 2));
744
+ });
745
+ parent
746
+ .command("aud-gov-fail-write-v2 <id> [reason]")
747
+ .description("Fail write")
748
+ .action(async (id, reason) => {
749
+ const m = await L();
750
+ console.log(JSON.stringify(m.failAudWriteV2(id, reason), null, 2));
751
+ });
752
+ parent
753
+ .command("aud-gov-cancel-write-v2 <id> [reason]")
754
+ .description("Cancel write")
755
+ .action(async (id, reason) => {
756
+ const m = await L();
757
+ console.log(JSON.stringify(m.cancelAudWriteV2(id, reason), null, 2));
758
+ });
759
+ parent
760
+ .command("aud-gov-get-write-v2 <id>")
761
+ .description("Get write")
762
+ .action(async (id) => {
763
+ const m = await L();
764
+ console.log(JSON.stringify(m.getAudWriteV2(id), null, 2));
765
+ });
766
+ parent
767
+ .command("aud-gov-list-writes-v2")
768
+ .description("List writes")
769
+ .action(async () => {
770
+ const m = await L();
771
+ console.log(JSON.stringify(m.listAudWritesV2(), null, 2));
772
+ });
773
+ parent
774
+ .command("aud-gov-auto-suspend-idle-v2")
775
+ .description("Auto-suspend idle profiles")
776
+ .action(async () => {
777
+ const m = await L();
778
+ console.log(JSON.stringify(m.autoSuspendIdleAudProfilesV2(), null, 2));
779
+ });
780
+ parent
781
+ .command("aud-gov-auto-fail-stuck-v2")
782
+ .description("Auto-fail stuck writes")
783
+ .action(async () => {
784
+ const m = await L();
785
+ console.log(JSON.stringify(m.autoFailStuckAudWritesV2(), null, 2));
786
+ });
787
+ parent
788
+ .command("aud-gov-gov-stats-v2")
789
+ .description("V2 gov aggregate stats")
790
+ .action(async () => {
791
+ const m = await L();
792
+ console.log(JSON.stringify(m.getAuditLoggerGovStatsV2(), null, 2));
793
+ });
794
+ }
@@ -588,7 +588,6 @@ export function registerBiCommand(program) {
588
588
  registerBiV2Command(bi);
589
589
  }
590
590
 
591
-
592
591
  import {
593
592
  BI_DATASET_MATURITY_V2,
594
593
  BI_QUERY_LIFECYCLE_V2,
@@ -620,30 +619,156 @@ import {
620
619
  } from "../lib/bi-engine.js";
621
620
 
622
621
  export function registerBiV2Command(bi) {
623
- bi.command("enums-v2").description("Show V2 enums").action(() => { console.log(JSON.stringify({ BI_DATASET_MATURITY_V2, BI_QUERY_LIFECYCLE_V2 }, null, 2)); });
624
- bi.command("register-dataset-v2").description("Register a BI dataset profile (pending)")
625
- .requiredOption("--id <id>").requiredOption("--owner <owner>").option("--source <source>")
626
- .action((o) => { console.log(JSON.stringify(registerBiDatasetV2(o), null, 2)); });
627
- bi.command("activate-dataset-v2 <id>").description("Activate dataset").action((id) => { console.log(JSON.stringify(activateBiDatasetV2(id), null, 2)); });
628
- bi.command("stale-dataset-v2 <id>").description("Mark dataset stale").action((id) => { console.log(JSON.stringify(staleBiDatasetV2(id), null, 2)); });
629
- bi.command("archive-dataset-v2 <id>").description("Archive dataset (terminal)").action((id) => { console.log(JSON.stringify(archiveBiDatasetV2(id), null, 2)); });
630
- bi.command("touch-dataset-v2 <id>").description("Refresh lastTouchedAt").action((id) => { console.log(JSON.stringify(touchBiDatasetV2(id), null, 2)); });
631
- bi.command("get-dataset-v2 <id>").description("Get dataset").action((id) => { console.log(JSON.stringify(getBiDatasetV2(id), null, 2)); });
632
- bi.command("list-datasets-v2").description("List datasets").action(() => { console.log(JSON.stringify(listBiDatasetsV2(), null, 2)); });
633
- bi.command("create-query-v2").description("Create a BI query (queued)")
634
- .requiredOption("--id <id>").requiredOption("--dataset-id <datasetId>").option("--sql <sql>")
635
- .action((o) => { console.log(JSON.stringify(createBiQueryV2({ id: o.id, datasetId: o.datasetId, sql: o.sql }), null, 2)); });
636
- bi.command("start-query-v2 <id>").description("Transition query to running").action((id) => { console.log(JSON.stringify(startBiQueryV2(id), null, 2)); });
637
- bi.command("complete-query-v2 <id>").description("Transition query to completed").action((id) => { console.log(JSON.stringify(completeBiQueryV2(id), null, 2)); });
638
- bi.command("fail-query-v2 <id>").description("Fail query").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(failBiQueryV2(id, o.reason), null, 2)); });
639
- bi.command("cancel-query-v2 <id>").description("Cancel query").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(cancelBiQueryV2(id, o.reason), null, 2)); });
640
- bi.command("get-query-v2 <id>").description("Get query").action((id) => { console.log(JSON.stringify(getBiQueryV2(id), null, 2)); });
641
- bi.command("list-queries-v2").description("List queries").action(() => { console.log(JSON.stringify(listBiQueriesV2(), null, 2)); });
642
- bi.command("set-max-active-datasets-v2 <n>").description("Set per-owner active cap").action((n) => { setMaxActiveBiDatasetsPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveBiDatasetsPerOwner: getMaxActiveBiDatasetsPerOwnerV2() }, null, 2)); });
643
- bi.command("set-max-pending-queries-v2 <n>").description("Set per-dataset pending cap").action((n) => { setMaxPendingBiQueriesPerDatasetV2(Number(n)); console.log(JSON.stringify({ maxPendingBiQueriesPerDataset: getMaxPendingBiQueriesPerDatasetV2() }, null, 2)); });
644
- bi.command("set-dataset-idle-ms-v2 <n>").description("Set idle threshold").action((n) => { setBiDatasetIdleMsV2(Number(n)); console.log(JSON.stringify({ biDatasetIdleMs: getBiDatasetIdleMsV2() }, null, 2)); });
645
- bi.command("set-query-stuck-ms-v2 <n>").description("Set stuck threshold").action((n) => { setBiQueryStuckMsV2(Number(n)); console.log(JSON.stringify({ biQueryStuckMs: getBiQueryStuckMsV2() }, null, 2)); });
646
- bi.command("auto-stale-idle-datasets-v2").description("Auto-stale idle datasets").action(() => { console.log(JSON.stringify(autoStaleIdleBiDatasetsV2(), null, 2)); });
647
- bi.command("auto-fail-stuck-queries-v2").description("Auto-fail stuck running queries").action(() => { console.log(JSON.stringify(autoFailStuckBiQueriesV2(), null, 2)); });
648
- bi.command("gov-stats-v2").description("V2 governance aggregate stats").action(() => { console.log(JSON.stringify(getBiEngineStatsV2(), null, 2)); });
622
+ bi.command("enums-v2")
623
+ .description("Show V2 enums")
624
+ .action(() => {
625
+ console.log(
626
+ JSON.stringify(
627
+ { BI_DATASET_MATURITY_V2, BI_QUERY_LIFECYCLE_V2 },
628
+ null,
629
+ 2,
630
+ ),
631
+ );
632
+ });
633
+ bi.command("register-dataset-v2")
634
+ .description("Register a BI dataset profile (pending)")
635
+ .requiredOption("--id <id>")
636
+ .requiredOption("--owner <owner>")
637
+ .option("--source <source>")
638
+ .action((o) => {
639
+ console.log(JSON.stringify(registerBiDatasetV2(o), null, 2));
640
+ });
641
+ bi.command("activate-dataset-v2 <id>")
642
+ .description("Activate dataset")
643
+ .action((id) => {
644
+ console.log(JSON.stringify(activateBiDatasetV2(id), null, 2));
645
+ });
646
+ bi.command("stale-dataset-v2 <id>")
647
+ .description("Mark dataset stale")
648
+ .action((id) => {
649
+ console.log(JSON.stringify(staleBiDatasetV2(id), null, 2));
650
+ });
651
+ bi.command("archive-dataset-v2 <id>")
652
+ .description("Archive dataset (terminal)")
653
+ .action((id) => {
654
+ console.log(JSON.stringify(archiveBiDatasetV2(id), null, 2));
655
+ });
656
+ bi.command("touch-dataset-v2 <id>")
657
+ .description("Refresh lastTouchedAt")
658
+ .action((id) => {
659
+ console.log(JSON.stringify(touchBiDatasetV2(id), null, 2));
660
+ });
661
+ bi.command("get-dataset-v2 <id>")
662
+ .description("Get dataset")
663
+ .action((id) => {
664
+ console.log(JSON.stringify(getBiDatasetV2(id), null, 2));
665
+ });
666
+ bi.command("list-datasets-v2")
667
+ .description("List datasets")
668
+ .action(() => {
669
+ console.log(JSON.stringify(listBiDatasetsV2(), null, 2));
670
+ });
671
+ bi.command("create-query-v2")
672
+ .description("Create a BI query (queued)")
673
+ .requiredOption("--id <id>")
674
+ .requiredOption("--dataset-id <datasetId>")
675
+ .option("--sql <sql>")
676
+ .action((o) => {
677
+ console.log(
678
+ JSON.stringify(
679
+ createBiQueryV2({ id: o.id, datasetId: o.datasetId, sql: o.sql }),
680
+ null,
681
+ 2,
682
+ ),
683
+ );
684
+ });
685
+ bi.command("start-query-v2 <id>")
686
+ .description("Transition query to running")
687
+ .action((id) => {
688
+ console.log(JSON.stringify(startBiQueryV2(id), null, 2));
689
+ });
690
+ bi.command("complete-query-v2 <id>")
691
+ .description("Transition query to completed")
692
+ .action((id) => {
693
+ console.log(JSON.stringify(completeBiQueryV2(id), null, 2));
694
+ });
695
+ bi.command("fail-query-v2 <id>")
696
+ .description("Fail query")
697
+ .option("--reason <r>")
698
+ .action((id, o) => {
699
+ console.log(JSON.stringify(failBiQueryV2(id, o.reason), null, 2));
700
+ });
701
+ bi.command("cancel-query-v2 <id>")
702
+ .description("Cancel query")
703
+ .option("--reason <r>")
704
+ .action((id, o) => {
705
+ console.log(JSON.stringify(cancelBiQueryV2(id, o.reason), null, 2));
706
+ });
707
+ bi.command("get-query-v2 <id>")
708
+ .description("Get query")
709
+ .action((id) => {
710
+ console.log(JSON.stringify(getBiQueryV2(id), null, 2));
711
+ });
712
+ bi.command("list-queries-v2")
713
+ .description("List queries")
714
+ .action(() => {
715
+ console.log(JSON.stringify(listBiQueriesV2(), null, 2));
716
+ });
717
+ bi.command("set-max-active-datasets-v2 <n>")
718
+ .description("Set per-owner active cap")
719
+ .action((n) => {
720
+ setMaxActiveBiDatasetsPerOwnerV2(Number(n));
721
+ console.log(
722
+ JSON.stringify(
723
+ { maxActiveBiDatasetsPerOwner: getMaxActiveBiDatasetsPerOwnerV2() },
724
+ null,
725
+ 2,
726
+ ),
727
+ );
728
+ });
729
+ bi.command("set-max-pending-queries-v2 <n>")
730
+ .description("Set per-dataset pending cap")
731
+ .action((n) => {
732
+ setMaxPendingBiQueriesPerDatasetV2(Number(n));
733
+ console.log(
734
+ JSON.stringify(
735
+ {
736
+ maxPendingBiQueriesPerDataset: getMaxPendingBiQueriesPerDatasetV2(),
737
+ },
738
+ null,
739
+ 2,
740
+ ),
741
+ );
742
+ });
743
+ bi.command("set-dataset-idle-ms-v2 <n>")
744
+ .description("Set idle threshold")
745
+ .action((n) => {
746
+ setBiDatasetIdleMsV2(Number(n));
747
+ console.log(
748
+ JSON.stringify({ biDatasetIdleMs: getBiDatasetIdleMsV2() }, null, 2),
749
+ );
750
+ });
751
+ bi.command("set-query-stuck-ms-v2 <n>")
752
+ .description("Set stuck threshold")
753
+ .action((n) => {
754
+ setBiQueryStuckMsV2(Number(n));
755
+ console.log(
756
+ JSON.stringify({ biQueryStuckMs: getBiQueryStuckMsV2() }, null, 2),
757
+ );
758
+ });
759
+ bi.command("auto-stale-idle-datasets-v2")
760
+ .description("Auto-stale idle datasets")
761
+ .action(() => {
762
+ console.log(JSON.stringify(autoStaleIdleBiDatasetsV2(), null, 2));
763
+ });
764
+ bi.command("auto-fail-stuck-queries-v2")
765
+ .description("Auto-fail stuck running queries")
766
+ .action(() => {
767
+ console.log(JSON.stringify(autoFailStuckBiQueriesV2(), null, 2));
768
+ });
769
+ bi.command("gov-stats-v2")
770
+ .description("V2 governance aggregate stats")
771
+ .action(() => {
772
+ console.log(JSON.stringify(getBiEngineStatsV2(), null, 2));
773
+ });
649
774
  }
@@ -37,42 +37,126 @@ export function registerBm25Command(program) {
37
37
  .command("bm25")
38
38
  .description("BM25 Search V2 governance (in-memory, CLI v0.143.0)");
39
39
 
40
- b.command("enums-v2").action(() => console.log(JSON.stringify({ BM25_PROFILE_MATURITY_V2, BM25_QUERY_LIFECYCLE_V2 }, null, 2)));
40
+ b.command("enums-v2").action(() =>
41
+ console.log(
42
+ JSON.stringify(
43
+ { BM25_PROFILE_MATURITY_V2, BM25_QUERY_LIFECYCLE_V2 },
44
+ null,
45
+ 2,
46
+ ),
47
+ ),
48
+ );
41
49
  b.command("register-profile-v2")
42
50
  .requiredOption("--id <id>")
43
51
  .requiredOption("--owner <owner>")
44
52
  .option("--field <field>", "indexed field", "content")
45
- .action((o) => console.log(JSON.stringify(registerBm25ProfileV2(o), null, 2)));
46
- b.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activateBm25ProfileV2(id), null, 2)));
47
- b.command("stale-profile-v2 <id>").action((id) => console.log(JSON.stringify(staleBm25ProfileV2(id), null, 2)));
48
- b.command("archive-profile-v2 <id>").action((id) => console.log(JSON.stringify(archiveBm25ProfileV2(id), null, 2)));
49
- b.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchBm25ProfileV2(id), null, 2)));
50
- b.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getBm25ProfileV2(id), null, 2)));
51
- b.command("list-profiles-v2").action(() => console.log(JSON.stringify(listBm25ProfilesV2(), null, 2)));
53
+ .action((o) =>
54
+ console.log(JSON.stringify(registerBm25ProfileV2(o), null, 2)),
55
+ );
56
+ b.command("activate-profile-v2 <id>").action((id) =>
57
+ console.log(JSON.stringify(activateBm25ProfileV2(id), null, 2)),
58
+ );
59
+ b.command("stale-profile-v2 <id>").action((id) =>
60
+ console.log(JSON.stringify(staleBm25ProfileV2(id), null, 2)),
61
+ );
62
+ b.command("archive-profile-v2 <id>").action((id) =>
63
+ console.log(JSON.stringify(archiveBm25ProfileV2(id), null, 2)),
64
+ );
65
+ b.command("touch-profile-v2 <id>").action((id) =>
66
+ console.log(JSON.stringify(touchBm25ProfileV2(id), null, 2)),
67
+ );
68
+ b.command("get-profile-v2 <id>").action((id) =>
69
+ console.log(JSON.stringify(getBm25ProfileV2(id), null, 2)),
70
+ );
71
+ b.command("list-profiles-v2").action(() =>
72
+ console.log(JSON.stringify(listBm25ProfilesV2(), null, 2)),
73
+ );
52
74
 
53
75
  b.command("create-query-v2")
54
76
  .requiredOption("--id <id>")
55
77
  .requiredOption("--profile-id <profileId>")
56
78
  .option("--q <q>", "query text", "")
57
79
  .action((o) => console.log(JSON.stringify(createBm25QueryV2(o), null, 2)));
58
- b.command("searching-query-v2 <id>").action((id) => console.log(JSON.stringify(searchingBm25QueryV2(id), null, 2)));
59
- b.command("complete-query-v2 <id>").action((id) => console.log(JSON.stringify(completeBm25QueryV2(id), null, 2)));
60
- b.command("fail-query-v2 <id>").option("--reason <r>").action((id, o) => console.log(JSON.stringify(failBm25QueryV2(id, o.reason), null, 2)));
61
- b.command("cancel-query-v2 <id>").option("--reason <r>").action((id, o) => console.log(JSON.stringify(cancelBm25QueryV2(id, o.reason), null, 2)));
62
- b.command("get-query-v2 <id>").action((id) => console.log(JSON.stringify(getBm25QueryV2(id), null, 2)));
63
- b.command("list-queries-v2").action(() => console.log(JSON.stringify(listBm25QueriesV2(), null, 2)));
80
+ b.command("searching-query-v2 <id>").action((id) =>
81
+ console.log(JSON.stringify(searchingBm25QueryV2(id), null, 2)),
82
+ );
83
+ b.command("complete-query-v2 <id>").action((id) =>
84
+ console.log(JSON.stringify(completeBm25QueryV2(id), null, 2)),
85
+ );
86
+ b.command("fail-query-v2 <id>")
87
+ .option("--reason <r>")
88
+ .action((id, o) =>
89
+ console.log(JSON.stringify(failBm25QueryV2(id, o.reason), null, 2)),
90
+ );
91
+ b.command("cancel-query-v2 <id>")
92
+ .option("--reason <r>")
93
+ .action((id, o) =>
94
+ console.log(JSON.stringify(cancelBm25QueryV2(id, o.reason), null, 2)),
95
+ );
96
+ b.command("get-query-v2 <id>").action((id) =>
97
+ console.log(JSON.stringify(getBm25QueryV2(id), null, 2)),
98
+ );
99
+ b.command("list-queries-v2").action(() =>
100
+ console.log(JSON.stringify(listBm25QueriesV2(), null, 2)),
101
+ );
64
102
 
65
- b.command("config-v2").action(() => console.log(JSON.stringify({
66
- maxActiveBm25ProfilesPerOwner: getMaxActiveBm25ProfilesPerOwnerV2(),
67
- maxPendingBm25QueriesPerProfile: getMaxPendingBm25QueriesPerProfileV2(),
68
- bm25ProfileIdleMs: getBm25ProfileIdleMsV2(),
69
- bm25QueryStuckMs: getBm25QueryStuckMsV2(),
70
- }, null, 2)));
71
- b.command("set-max-active-profiles-v2 <n>").action((n) => { setMaxActiveBm25ProfilesPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveBm25ProfilesPerOwner: getMaxActiveBm25ProfilesPerOwnerV2() }, null, 2)); });
72
- b.command("set-max-pending-queries-v2 <n>").action((n) => { setMaxPendingBm25QueriesPerProfileV2(Number(n)); console.log(JSON.stringify({ maxPendingBm25QueriesPerProfile: getMaxPendingBm25QueriesPerProfileV2() }, null, 2)); });
73
- b.command("set-profile-idle-ms-v2 <ms>").action((ms) => { setBm25ProfileIdleMsV2(Number(ms)); console.log(JSON.stringify({ bm25ProfileIdleMs: getBm25ProfileIdleMsV2() }, null, 2)); });
74
- b.command("set-query-stuck-ms-v2 <ms>").action((ms) => { setBm25QueryStuckMsV2(Number(ms)); console.log(JSON.stringify({ bm25QueryStuckMs: getBm25QueryStuckMsV2() }, null, 2)); });
75
- b.command("auto-stale-idle-v2").action(() => console.log(JSON.stringify(autoStaleIdleBm25ProfilesV2(), null, 2)));
76
- b.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckBm25QueriesV2(), null, 2)));
77
- b.command("gov-stats-v2").action(() => console.log(JSON.stringify(getBm25SearchGovStatsV2(), null, 2)));
103
+ b.command("config-v2").action(() =>
104
+ console.log(
105
+ JSON.stringify(
106
+ {
107
+ maxActiveBm25ProfilesPerOwner: getMaxActiveBm25ProfilesPerOwnerV2(),
108
+ maxPendingBm25QueriesPerProfile:
109
+ getMaxPendingBm25QueriesPerProfileV2(),
110
+ bm25ProfileIdleMs: getBm25ProfileIdleMsV2(),
111
+ bm25QueryStuckMs: getBm25QueryStuckMsV2(),
112
+ },
113
+ null,
114
+ 2,
115
+ ),
116
+ ),
117
+ );
118
+ b.command("set-max-active-profiles-v2 <n>").action((n) => {
119
+ setMaxActiveBm25ProfilesPerOwnerV2(Number(n));
120
+ console.log(
121
+ JSON.stringify(
122
+ { maxActiveBm25ProfilesPerOwner: getMaxActiveBm25ProfilesPerOwnerV2() },
123
+ null,
124
+ 2,
125
+ ),
126
+ );
127
+ });
128
+ b.command("set-max-pending-queries-v2 <n>").action((n) => {
129
+ setMaxPendingBm25QueriesPerProfileV2(Number(n));
130
+ console.log(
131
+ JSON.stringify(
132
+ {
133
+ maxPendingBm25QueriesPerProfile:
134
+ getMaxPendingBm25QueriesPerProfileV2(),
135
+ },
136
+ null,
137
+ 2,
138
+ ),
139
+ );
140
+ });
141
+ b.command("set-profile-idle-ms-v2 <ms>").action((ms) => {
142
+ setBm25ProfileIdleMsV2(Number(ms));
143
+ console.log(
144
+ JSON.stringify({ bm25ProfileIdleMs: getBm25ProfileIdleMsV2() }, null, 2),
145
+ );
146
+ });
147
+ b.command("set-query-stuck-ms-v2 <ms>").action((ms) => {
148
+ setBm25QueryStuckMsV2(Number(ms));
149
+ console.log(
150
+ JSON.stringify({ bm25QueryStuckMs: getBm25QueryStuckMsV2() }, null, 2),
151
+ );
152
+ });
153
+ b.command("auto-stale-idle-v2").action(() =>
154
+ console.log(JSON.stringify(autoStaleIdleBm25ProfilesV2(), null, 2)),
155
+ );
156
+ b.command("auto-fail-stuck-v2").action(() =>
157
+ console.log(JSON.stringify(autoFailStuckBm25QueriesV2(), null, 2)),
158
+ );
159
+ b.command("gov-stats-v2").action(() =>
160
+ console.log(JSON.stringify(getBm25SearchGovStatsV2(), null, 2)),
161
+ );
78
162
  }