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
@@ -405,38 +405,205 @@ export function registerSiemCommand(program) {
405
405
 
406
406
  function _registerSiemExporterV2Commands(parent) {
407
407
  const L = async () => await import("../lib/siem-exporter.js");
408
- parent.command("enums-v2").description("Show V2 enums (target maturity + export lifecycle)")
409
- .action(async () => { const m = await L(); console.log(JSON.stringify({ targetMaturity: m.SIEM_TARGET_MATURITY_V2, exportLifecycle: m.SIEM_EXPORT_LIFECYCLE_V2 }, null, 2)); });
410
- parent.command("config-v2").description("Show V2 config thresholds")
411
- .action(async () => { const m = await L(); console.log(JSON.stringify({ maxActiveSiemTargetsPerOperator: m.getMaxActiveSiemTargetsPerOperatorV2(), maxPendingSiemExportsPerTarget: m.getMaxPendingSiemExportsPerTargetV2(), siemTargetIdleMs: m.getSiemTargetIdleMsV2(), siemExportStuckMs: m.getSiemExportStuckMsV2() }, null, 2)); });
412
- parent.command("set-max-active-targets-v2 <n>").description("Set max active targets per operator")
413
- .action(async (n) => { const m = await L(); m.setMaxActiveSiemTargetsPerOperatorV2(Number(n)); console.log("ok"); });
414
- parent.command("set-max-pending-exports-v2 <n>").description("Set max pending exports per target")
415
- .action(async (n) => { const m = await L(); m.setMaxPendingSiemExportsPerTargetV2(Number(n)); console.log("ok"); });
416
- parent.command("set-target-idle-ms-v2 <n>").description("Set target idle threshold (ms)")
417
- .action(async (n) => { const m = await L(); m.setSiemTargetIdleMsV2(Number(n)); console.log("ok"); });
418
- parent.command("set-export-stuck-ms-v2 <n>").description("Set export stuck threshold (ms)")
419
- .action(async (n) => { const m = await L(); m.setSiemExportStuckMsV2(Number(n)); console.log("ok"); });
420
- parent.command("register-target-v2 <id> <operator>").description("Register V2 SIEM target")
421
- .option("--kind <k>", "Target kind").action(async (id, operator, o) => { const m = await L(); console.log(JSON.stringify(m.registerSiemTargetV2({ id, operator, kind: o.kind }), null, 2)); });
422
- parent.command("activate-target-v2 <id>").description("Activate target").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.activateSiemTargetV2(id), null, 2)); });
423
- parent.command("degrade-target-v2 <id>").description("Degrade target").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.degradeSiemTargetV2(id), null, 2)); });
424
- parent.command("retire-target-v2 <id>").description("Retire target (terminal)").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.retireSiemTargetV2(id), null, 2)); });
425
- parent.command("touch-target-v2 <id>").description("Touch target lastTouchedAt").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.touchSiemTargetV2(id), null, 2)); });
426
- parent.command("get-target-v2 <id>").description("Get V2 target").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.getSiemTargetV2(id), null, 2)); });
427
- parent.command("list-targets-v2").description("List V2 targets").action(async () => { const m = await L(); console.log(JSON.stringify(m.listSiemTargetsV2(), null, 2)); });
428
- parent.command("create-export-v2 <id> <targetId>").description("Create V2 export (queued)")
429
- .option("--format <f>", "Format", "json").action(async (id, targetId, o) => { const m = await L(); console.log(JSON.stringify(m.createSiemExportV2({ id, targetId, format: o.format }), null, 2)); });
430
- parent.command("start-export-v2 <id>").description("Start export").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.startSiemExportV2(id), null, 2)); });
431
- parent.command("deliver-export-v2 <id>").description("Deliver export").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.deliverSiemExportV2(id), null, 2)); });
432
- parent.command("fail-export-v2 <id> [reason]").description("Fail export").action(async (id, reason) => { const m = await L(); console.log(JSON.stringify(m.failSiemExportV2(id, reason), null, 2)); });
433
- parent.command("cancel-export-v2 <id> [reason]").description("Cancel export").action(async (id, reason) => { const m = await L(); console.log(JSON.stringify(m.cancelSiemExportV2(id, reason), null, 2)); });
434
- parent.command("get-export-v2 <id>").description("Get V2 export").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.getSiemExportV2(id), null, 2)); });
435
- parent.command("list-exports-v2").description("List V2 exports").action(async () => { const m = await L(); console.log(JSON.stringify(m.listSiemExportsV2(), null, 2)); });
436
- parent.command("auto-degrade-idle-v2").description("Auto-degrade idle targets")
437
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.autoDegradeIdleSiemTargetsV2(), null, 2)); });
438
- parent.command("auto-fail-stuck-v2").description("Auto-fail stuck sending exports")
439
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.autoFailStuckSiemExportsV2(), null, 2)); });
440
- parent.command("gov-stats-v2").description("V2 governance aggregate stats")
441
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.getSiemExporterGovStatsV2(), null, 2)); });
408
+ parent
409
+ .command("enums-v2")
410
+ .description("Show V2 enums (target maturity + export lifecycle)")
411
+ .action(async () => {
412
+ const m = await L();
413
+ console.log(
414
+ JSON.stringify(
415
+ {
416
+ targetMaturity: m.SIEM_TARGET_MATURITY_V2,
417
+ exportLifecycle: m.SIEM_EXPORT_LIFECYCLE_V2,
418
+ },
419
+ null,
420
+ 2,
421
+ ),
422
+ );
423
+ });
424
+ parent
425
+ .command("config-v2")
426
+ .description("Show V2 config thresholds")
427
+ .action(async () => {
428
+ const m = await L();
429
+ console.log(
430
+ JSON.stringify(
431
+ {
432
+ maxActiveSiemTargetsPerOperator:
433
+ m.getMaxActiveSiemTargetsPerOperatorV2(),
434
+ maxPendingSiemExportsPerTarget:
435
+ m.getMaxPendingSiemExportsPerTargetV2(),
436
+ siemTargetIdleMs: m.getSiemTargetIdleMsV2(),
437
+ siemExportStuckMs: m.getSiemExportStuckMsV2(),
438
+ },
439
+ null,
440
+ 2,
441
+ ),
442
+ );
443
+ });
444
+ parent
445
+ .command("set-max-active-targets-v2 <n>")
446
+ .description("Set max active targets per operator")
447
+ .action(async (n) => {
448
+ const m = await L();
449
+ m.setMaxActiveSiemTargetsPerOperatorV2(Number(n));
450
+ console.log("ok");
451
+ });
452
+ parent
453
+ .command("set-max-pending-exports-v2 <n>")
454
+ .description("Set max pending exports per target")
455
+ .action(async (n) => {
456
+ const m = await L();
457
+ m.setMaxPendingSiemExportsPerTargetV2(Number(n));
458
+ console.log("ok");
459
+ });
460
+ parent
461
+ .command("set-target-idle-ms-v2 <n>")
462
+ .description("Set target idle threshold (ms)")
463
+ .action(async (n) => {
464
+ const m = await L();
465
+ m.setSiemTargetIdleMsV2(Number(n));
466
+ console.log("ok");
467
+ });
468
+ parent
469
+ .command("set-export-stuck-ms-v2 <n>")
470
+ .description("Set export stuck threshold (ms)")
471
+ .action(async (n) => {
472
+ const m = await L();
473
+ m.setSiemExportStuckMsV2(Number(n));
474
+ console.log("ok");
475
+ });
476
+ parent
477
+ .command("register-target-v2 <id> <operator>")
478
+ .description("Register V2 SIEM target")
479
+ .option("--kind <k>", "Target kind")
480
+ .action(async (id, operator, o) => {
481
+ const m = await L();
482
+ console.log(
483
+ JSON.stringify(
484
+ m.registerSiemTargetV2({ id, operator, kind: o.kind }),
485
+ null,
486
+ 2,
487
+ ),
488
+ );
489
+ });
490
+ parent
491
+ .command("activate-target-v2 <id>")
492
+ .description("Activate target")
493
+ .action(async (id) => {
494
+ const m = await L();
495
+ console.log(JSON.stringify(m.activateSiemTargetV2(id), null, 2));
496
+ });
497
+ parent
498
+ .command("degrade-target-v2 <id>")
499
+ .description("Degrade target")
500
+ .action(async (id) => {
501
+ const m = await L();
502
+ console.log(JSON.stringify(m.degradeSiemTargetV2(id), null, 2));
503
+ });
504
+ parent
505
+ .command("retire-target-v2 <id>")
506
+ .description("Retire target (terminal)")
507
+ .action(async (id) => {
508
+ const m = await L();
509
+ console.log(JSON.stringify(m.retireSiemTargetV2(id), null, 2));
510
+ });
511
+ parent
512
+ .command("touch-target-v2 <id>")
513
+ .description("Touch target lastTouchedAt")
514
+ .action(async (id) => {
515
+ const m = await L();
516
+ console.log(JSON.stringify(m.touchSiemTargetV2(id), null, 2));
517
+ });
518
+ parent
519
+ .command("get-target-v2 <id>")
520
+ .description("Get V2 target")
521
+ .action(async (id) => {
522
+ const m = await L();
523
+ console.log(JSON.stringify(m.getSiemTargetV2(id), null, 2));
524
+ });
525
+ parent
526
+ .command("list-targets-v2")
527
+ .description("List V2 targets")
528
+ .action(async () => {
529
+ const m = await L();
530
+ console.log(JSON.stringify(m.listSiemTargetsV2(), null, 2));
531
+ });
532
+ parent
533
+ .command("create-export-v2 <id> <targetId>")
534
+ .description("Create V2 export (queued)")
535
+ .option("--format <f>", "Format", "json")
536
+ .action(async (id, targetId, o) => {
537
+ const m = await L();
538
+ console.log(
539
+ JSON.stringify(
540
+ m.createSiemExportV2({ id, targetId, format: o.format }),
541
+ null,
542
+ 2,
543
+ ),
544
+ );
545
+ });
546
+ parent
547
+ .command("start-export-v2 <id>")
548
+ .description("Start export")
549
+ .action(async (id) => {
550
+ const m = await L();
551
+ console.log(JSON.stringify(m.startSiemExportV2(id), null, 2));
552
+ });
553
+ parent
554
+ .command("deliver-export-v2 <id>")
555
+ .description("Deliver export")
556
+ .action(async (id) => {
557
+ const m = await L();
558
+ console.log(JSON.stringify(m.deliverSiemExportV2(id), null, 2));
559
+ });
560
+ parent
561
+ .command("fail-export-v2 <id> [reason]")
562
+ .description("Fail export")
563
+ .action(async (id, reason) => {
564
+ const m = await L();
565
+ console.log(JSON.stringify(m.failSiemExportV2(id, reason), null, 2));
566
+ });
567
+ parent
568
+ .command("cancel-export-v2 <id> [reason]")
569
+ .description("Cancel export")
570
+ .action(async (id, reason) => {
571
+ const m = await L();
572
+ console.log(JSON.stringify(m.cancelSiemExportV2(id, reason), null, 2));
573
+ });
574
+ parent
575
+ .command("get-export-v2 <id>")
576
+ .description("Get V2 export")
577
+ .action(async (id) => {
578
+ const m = await L();
579
+ console.log(JSON.stringify(m.getSiemExportV2(id), null, 2));
580
+ });
581
+ parent
582
+ .command("list-exports-v2")
583
+ .description("List V2 exports")
584
+ .action(async () => {
585
+ const m = await L();
586
+ console.log(JSON.stringify(m.listSiemExportsV2(), null, 2));
587
+ });
588
+ parent
589
+ .command("auto-degrade-idle-v2")
590
+ .description("Auto-degrade idle targets")
591
+ .action(async () => {
592
+ const m = await L();
593
+ console.log(JSON.stringify(m.autoDegradeIdleSiemTargetsV2(), null, 2));
594
+ });
595
+ parent
596
+ .command("auto-fail-stuck-v2")
597
+ .description("Auto-fail stuck sending exports")
598
+ .action(async () => {
599
+ const m = await L();
600
+ console.log(JSON.stringify(m.autoFailStuckSiemExportsV2(), null, 2));
601
+ });
602
+ parent
603
+ .command("gov-stats-v2")
604
+ .description("V2 governance aggregate stats")
605
+ .action(async () => {
606
+ const m = await L();
607
+ console.log(JSON.stringify(m.getSiemExporterGovStatsV2(), null, 2));
608
+ });
442
609
  }
@@ -609,3 +609,215 @@ export function registerSlaCommand(program) {
609
609
  console.log(JSON.stringify(getSLAStatsV2(), null, 2));
610
610
  });
611
611
  }
612
+
613
+ // === Iter16 V2 governance overlay ===
614
+ export function registerSlagovV2Commands(program) {
615
+ const parent = program.commands.find((c) => c.name() === "sla");
616
+ if (!parent) return;
617
+ const L = async () => await import("../lib/sla-manager.js");
618
+ parent
619
+ .command("slagov-enums-v2")
620
+ .description("Show V2 enums (slagov maturity + measurement lifecycle)")
621
+ .action(async () => {
622
+ const m = await L();
623
+ console.log(
624
+ JSON.stringify(
625
+ {
626
+ profileMaturity: m.SLAGOV_PROFILE_MATURITY_V2,
627
+ measurementLifecycle: m.SLAGOV_MEASUREMENT_LIFECYCLE_V2,
628
+ },
629
+ null,
630
+ 2,
631
+ ),
632
+ );
633
+ });
634
+ parent
635
+ .command("slagov-config-v2")
636
+ .description("Show V2 config thresholds")
637
+ .action(async () => {
638
+ const m = await L();
639
+ console.log(
640
+ JSON.stringify(
641
+ {
642
+ maxActive: m.getMaxActiveSlagovProfilesPerOwnerV2(),
643
+ maxPending: m.getMaxPendingSlagovMeasurementsPerProfileV2(),
644
+ idleMs: m.getSlagovProfileIdleMsV2(),
645
+ stuckMs: m.getSlagovMeasurementStuckMsV2(),
646
+ },
647
+ null,
648
+ 2,
649
+ ),
650
+ );
651
+ });
652
+ parent
653
+ .command("slagov-set-max-active-v2 <n>")
654
+ .description("Set max active profiles per owner")
655
+ .action(async (n) => {
656
+ const m = await L();
657
+ m.setMaxActiveSlagovProfilesPerOwnerV2(Number(n));
658
+ console.log("ok");
659
+ });
660
+ parent
661
+ .command("slagov-set-max-pending-v2 <n>")
662
+ .description("Set max pending measurements per profile")
663
+ .action(async (n) => {
664
+ const m = await L();
665
+ m.setMaxPendingSlagovMeasurementsPerProfileV2(Number(n));
666
+ console.log("ok");
667
+ });
668
+ parent
669
+ .command("slagov-set-idle-ms-v2 <n>")
670
+ .description("Set profile idle threshold (ms)")
671
+ .action(async (n) => {
672
+ const m = await L();
673
+ m.setSlagovProfileIdleMsV2(Number(n));
674
+ console.log("ok");
675
+ });
676
+ parent
677
+ .command("slagov-set-stuck-ms-v2 <n>")
678
+ .description("Set measurement stuck threshold (ms)")
679
+ .action(async (n) => {
680
+ const m = await L();
681
+ m.setSlagovMeasurementStuckMsV2(Number(n));
682
+ console.log("ok");
683
+ });
684
+ parent
685
+ .command("slagov-register-v2 <id> <owner>")
686
+ .description("Register V2 slagov profile")
687
+ .option("--tier <v>", "tier")
688
+ .action(async (id, owner, o) => {
689
+ const m = await L();
690
+ console.log(
691
+ JSON.stringify(
692
+ m.registerSlagovProfileV2({ id, owner, tier: o.tier }),
693
+ null,
694
+ 2,
695
+ ),
696
+ );
697
+ });
698
+ parent
699
+ .command("slagov-activate-v2 <id>")
700
+ .description("Activate profile")
701
+ .action(async (id) => {
702
+ const m = await L();
703
+ console.log(JSON.stringify(m.activateSlagovProfileV2(id), null, 2));
704
+ });
705
+ parent
706
+ .command("slagov-breach-v2 <id>")
707
+ .description("Breach profile")
708
+ .action(async (id) => {
709
+ const m = await L();
710
+ console.log(JSON.stringify(m.breachSlagovProfileV2(id), null, 2));
711
+ });
712
+ parent
713
+ .command("slagov-archive-v2 <id>")
714
+ .description("Archive profile (terminal)")
715
+ .action(async (id) => {
716
+ const m = await L();
717
+ console.log(JSON.stringify(m.archiveSlagovProfileV2(id), null, 2));
718
+ });
719
+ parent
720
+ .command("slagov-touch-v2 <id>")
721
+ .description("Touch profile")
722
+ .action(async (id) => {
723
+ const m = await L();
724
+ console.log(JSON.stringify(m.touchSlagovProfileV2(id), null, 2));
725
+ });
726
+ parent
727
+ .command("slagov-get-v2 <id>")
728
+ .description("Get profile")
729
+ .action(async (id) => {
730
+ const m = await L();
731
+ console.log(JSON.stringify(m.getSlagovProfileV2(id), null, 2));
732
+ });
733
+ parent
734
+ .command("slagov-list-v2")
735
+ .description("List profiles")
736
+ .action(async () => {
737
+ const m = await L();
738
+ console.log(JSON.stringify(m.listSlagovProfilesV2(), null, 2));
739
+ });
740
+ parent
741
+ .command("slagov-create-measurement-v2 <id> <profileId>")
742
+ .description("Create measurement (queued)")
743
+ .option("--metric <v>", "metric")
744
+ .action(async (id, profileId, o) => {
745
+ const m = await L();
746
+ console.log(
747
+ JSON.stringify(
748
+ m.createSlagovMeasurementV2({ id, profileId, metric: o.metric }),
749
+ null,
750
+ 2,
751
+ ),
752
+ );
753
+ });
754
+ parent
755
+ .command("slagov-measuring-measurement-v2 <id>")
756
+ .description("Mark measurement as measuring")
757
+ .action(async (id) => {
758
+ const m = await L();
759
+ console.log(JSON.stringify(m.measuringSlagovMeasurementV2(id), null, 2));
760
+ });
761
+ parent
762
+ .command("slagov-complete-measurement-v2 <id>")
763
+ .description("Complete measurement")
764
+ .action(async (id) => {
765
+ const m = await L();
766
+ console.log(JSON.stringify(m.completeMeasurementSlagovV2(id), null, 2));
767
+ });
768
+ parent
769
+ .command("slagov-fail-measurement-v2 <id> [reason]")
770
+ .description("Fail measurement")
771
+ .action(async (id, reason) => {
772
+ const m = await L();
773
+ console.log(
774
+ JSON.stringify(m.failSlagovMeasurementV2(id, reason), null, 2),
775
+ );
776
+ });
777
+ parent
778
+ .command("slagov-cancel-measurement-v2 <id> [reason]")
779
+ .description("Cancel measurement")
780
+ .action(async (id, reason) => {
781
+ const m = await L();
782
+ console.log(
783
+ JSON.stringify(m.cancelSlagovMeasurementV2(id, reason), null, 2),
784
+ );
785
+ });
786
+ parent
787
+ .command("slagov-get-measurement-v2 <id>")
788
+ .description("Get measurement")
789
+ .action(async (id) => {
790
+ const m = await L();
791
+ console.log(JSON.stringify(m.getSlagovMeasurementV2(id), null, 2));
792
+ });
793
+ parent
794
+ .command("slagov-list-measurements-v2")
795
+ .description("List measurements")
796
+ .action(async () => {
797
+ const m = await L();
798
+ console.log(JSON.stringify(m.listSlagovMeasurementsV2(), null, 2));
799
+ });
800
+ parent
801
+ .command("slagov-auto-breach-idle-v2")
802
+ .description("Auto-breach idle profiles")
803
+ .action(async () => {
804
+ const m = await L();
805
+ console.log(JSON.stringify(m.autoBreachIdleSlagovProfilesV2(), null, 2));
806
+ });
807
+ parent
808
+ .command("slagov-auto-fail-stuck-v2")
809
+ .description("Auto-fail stuck measurements")
810
+ .action(async () => {
811
+ const m = await L();
812
+ console.log(
813
+ JSON.stringify(m.autoFailStuckSlagovMeasurementsV2(), null, 2),
814
+ );
815
+ });
816
+ parent
817
+ .command("slagov-gov-stats-v2")
818
+ .description("V2 gov aggregate stats")
819
+ .action(async () => {
820
+ const m = await L();
821
+ console.log(JSON.stringify(m.getSlaManagerGovStatsV2(), null, 2));
822
+ });
823
+ }
@@ -2,40 +2,153 @@
2
2
  * `cc slotfill` — Slot Filler V2 governance overlay (in-memory, atop lib/slot-filler.js).
3
3
  */
4
4
  import {
5
- SLOTF_PROFILE_MATURITY_V2, SLOTF_FILL_LIFECYCLE_V2,
6
- setMaxActiveSlotfTemplatesPerOwnerV2, getMaxActiveSlotfTemplatesPerOwnerV2,
7
- setMaxPendingSlotfFillsPerTemplateV2, getMaxPendingSlotfFillsPerTemplateV2,
8
- setSlotfTemplateIdleMsV2, getSlotfTemplateIdleMsV2,
9
- setSlotfFillStuckMsV2, getSlotfFillStuckMsV2,
10
- registerSlotfTemplateV2, activateSlotfTemplateV2, staleSlotfTemplateV2, archiveSlotfTemplateV2, touchSlotfTemplateV2, getSlotfTemplateV2, listSlotfTemplatesV2,
11
- createSlotfFillV2, fillingSlotfFillV2, fillSlotfFillV2, failSlotfFillV2, cancelSlotfFillV2, getSlotfFillV2, listSlotfFillsV2,
12
- autoStaleIdleSlotfTemplatesV2, autoFailStuckSlotfFillsV2, getSlotFillerGovStatsV2, _resetStateSlotFillerV2,
5
+ SLOTF_PROFILE_MATURITY_V2,
6
+ SLOTF_FILL_LIFECYCLE_V2,
7
+ setMaxActiveSlotfTemplatesPerOwnerV2,
8
+ getMaxActiveSlotfTemplatesPerOwnerV2,
9
+ setMaxPendingSlotfFillsPerTemplateV2,
10
+ getMaxPendingSlotfFillsPerTemplateV2,
11
+ setSlotfTemplateIdleMsV2,
12
+ getSlotfTemplateIdleMsV2,
13
+ setSlotfFillStuckMsV2,
14
+ getSlotfFillStuckMsV2,
15
+ registerSlotfTemplateV2,
16
+ activateSlotfTemplateV2,
17
+ staleSlotfTemplateV2,
18
+ archiveSlotfTemplateV2,
19
+ touchSlotfTemplateV2,
20
+ getSlotfTemplateV2,
21
+ listSlotfTemplatesV2,
22
+ createSlotfFillV2,
23
+ fillingSlotfFillV2,
24
+ fillSlotfFillV2,
25
+ failSlotfFillV2,
26
+ cancelSlotfFillV2,
27
+ getSlotfFillV2,
28
+ listSlotfFillsV2,
29
+ autoStaleIdleSlotfTemplatesV2,
30
+ autoFailStuckSlotfFillsV2,
31
+ getSlotFillerGovStatsV2,
32
+ _resetStateSlotFillerV2,
13
33
  } from "../lib/slot-filler.js";
14
34
 
15
35
  export function registerSlotfillCommand(program) {
16
- const sf = program.command("slotfill").description("Slot Filler V2 governance");
17
- sf.command("enums-v2").action(() => console.log(JSON.stringify({ profileMaturity: SLOTF_PROFILE_MATURITY_V2, fillLifecycle: SLOTF_FILL_LIFECYCLE_V2 }, null, 2)));
18
- sf.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveSlotfTemplatesPerOwner: getMaxActiveSlotfTemplatesPerOwnerV2(), maxPendingSlotfFillsPerTemplate: getMaxPendingSlotfFillsPerTemplateV2(), slotfTemplateIdleMs: getSlotfTemplateIdleMsV2(), slotfFillStuckMs: getSlotfFillStuckMsV2() }, null, 2)));
19
- sf.command("set-max-active-v2 <n>").action((n) => { setMaxActiveSlotfTemplatesPerOwnerV2(Number(n)); console.log("ok"); });
20
- sf.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingSlotfFillsPerTemplateV2(Number(n)); console.log("ok"); });
21
- sf.command("set-idle-ms-v2 <n>").action((n) => { setSlotfTemplateIdleMsV2(Number(n)); console.log("ok"); });
22
- sf.command("set-stuck-ms-v2 <n>").action((n) => { setSlotfFillStuckMsV2(Number(n)); console.log("ok"); });
23
- sf.command("register-template-v2 <id> <owner>").option("--schema <s>", "schema").action((id, owner, o) => console.log(JSON.stringify(registerSlotfTemplateV2({ id, owner, schema: o.schema }), null, 2)));
24
- sf.command("activate-template-v2 <id>").action((id) => console.log(JSON.stringify(activateSlotfTemplateV2(id), null, 2)));
25
- sf.command("stale-template-v2 <id>").action((id) => console.log(JSON.stringify(staleSlotfTemplateV2(id), null, 2)));
26
- sf.command("archive-template-v2 <id>").action((id) => console.log(JSON.stringify(archiveSlotfTemplateV2(id), null, 2)));
27
- sf.command("touch-template-v2 <id>").action((id) => console.log(JSON.stringify(touchSlotfTemplateV2(id), null, 2)));
28
- sf.command("get-template-v2 <id>").action((id) => console.log(JSON.stringify(getSlotfTemplateV2(id), null, 2)));
29
- sf.command("list-templates-v2").action(() => console.log(JSON.stringify(listSlotfTemplatesV2(), null, 2)));
30
- sf.command("create-fill-v2 <id> <templateId>").option("--input <s>", "input").action((id, templateId, o) => console.log(JSON.stringify(createSlotfFillV2({ id, templateId, input: o.input }), null, 2)));
31
- sf.command("filling-fill-v2 <id>").action((id) => console.log(JSON.stringify(fillingSlotfFillV2(id), null, 2)));
32
- sf.command("fill-fill-v2 <id>").action((id) => console.log(JSON.stringify(fillSlotfFillV2(id), null, 2)));
33
- sf.command("fail-fill-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failSlotfFillV2(id, reason), null, 2)));
34
- sf.command("cancel-fill-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelSlotfFillV2(id, reason), null, 2)));
35
- sf.command("get-fill-v2 <id>").action((id) => console.log(JSON.stringify(getSlotfFillV2(id), null, 2)));
36
- sf.command("list-fills-v2").action(() => console.log(JSON.stringify(listSlotfFillsV2(), null, 2)));
37
- sf.command("auto-stale-idle-v2").action(() => console.log(JSON.stringify(autoStaleIdleSlotfTemplatesV2(), null, 2)));
38
- sf.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckSlotfFillsV2(), null, 2)));
39
- sf.command("gov-stats-v2").action(() => console.log(JSON.stringify(getSlotFillerGovStatsV2(), null, 2)));
40
- sf.command("reset-state-v2").action(() => { _resetStateSlotFillerV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
36
+ const sf = program
37
+ .command("slotfill")
38
+ .description("Slot Filler V2 governance");
39
+ sf.command("enums-v2").action(() =>
40
+ console.log(
41
+ JSON.stringify(
42
+ {
43
+ profileMaturity: SLOTF_PROFILE_MATURITY_V2,
44
+ fillLifecycle: SLOTF_FILL_LIFECYCLE_V2,
45
+ },
46
+ null,
47
+ 2,
48
+ ),
49
+ ),
50
+ );
51
+ sf.command("config-v2").action(() =>
52
+ console.log(
53
+ JSON.stringify(
54
+ {
55
+ maxActiveSlotfTemplatesPerOwner:
56
+ getMaxActiveSlotfTemplatesPerOwnerV2(),
57
+ maxPendingSlotfFillsPerTemplate:
58
+ getMaxPendingSlotfFillsPerTemplateV2(),
59
+ slotfTemplateIdleMs: getSlotfTemplateIdleMsV2(),
60
+ slotfFillStuckMs: getSlotfFillStuckMsV2(),
61
+ },
62
+ null,
63
+ 2,
64
+ ),
65
+ ),
66
+ );
67
+ sf.command("set-max-active-v2 <n>").action((n) => {
68
+ setMaxActiveSlotfTemplatesPerOwnerV2(Number(n));
69
+ console.log("ok");
70
+ });
71
+ sf.command("set-max-pending-v2 <n>").action((n) => {
72
+ setMaxPendingSlotfFillsPerTemplateV2(Number(n));
73
+ console.log("ok");
74
+ });
75
+ sf.command("set-idle-ms-v2 <n>").action((n) => {
76
+ setSlotfTemplateIdleMsV2(Number(n));
77
+ console.log("ok");
78
+ });
79
+ sf.command("set-stuck-ms-v2 <n>").action((n) => {
80
+ setSlotfFillStuckMsV2(Number(n));
81
+ console.log("ok");
82
+ });
83
+ sf.command("register-template-v2 <id> <owner>")
84
+ .option("--schema <s>", "schema")
85
+ .action((id, owner, o) =>
86
+ console.log(
87
+ JSON.stringify(
88
+ registerSlotfTemplateV2({ id, owner, schema: o.schema }),
89
+ null,
90
+ 2,
91
+ ),
92
+ ),
93
+ );
94
+ sf.command("activate-template-v2 <id>").action((id) =>
95
+ console.log(JSON.stringify(activateSlotfTemplateV2(id), null, 2)),
96
+ );
97
+ sf.command("stale-template-v2 <id>").action((id) =>
98
+ console.log(JSON.stringify(staleSlotfTemplateV2(id), null, 2)),
99
+ );
100
+ sf.command("archive-template-v2 <id>").action((id) =>
101
+ console.log(JSON.stringify(archiveSlotfTemplateV2(id), null, 2)),
102
+ );
103
+ sf.command("touch-template-v2 <id>").action((id) =>
104
+ console.log(JSON.stringify(touchSlotfTemplateV2(id), null, 2)),
105
+ );
106
+ sf.command("get-template-v2 <id>").action((id) =>
107
+ console.log(JSON.stringify(getSlotfTemplateV2(id), null, 2)),
108
+ );
109
+ sf.command("list-templates-v2").action(() =>
110
+ console.log(JSON.stringify(listSlotfTemplatesV2(), null, 2)),
111
+ );
112
+ sf.command("create-fill-v2 <id> <templateId>")
113
+ .option("--input <s>", "input")
114
+ .action((id, templateId, o) =>
115
+ console.log(
116
+ JSON.stringify(
117
+ createSlotfFillV2({ id, templateId, input: o.input }),
118
+ null,
119
+ 2,
120
+ ),
121
+ ),
122
+ );
123
+ sf.command("filling-fill-v2 <id>").action((id) =>
124
+ console.log(JSON.stringify(fillingSlotfFillV2(id), null, 2)),
125
+ );
126
+ sf.command("fill-fill-v2 <id>").action((id) =>
127
+ console.log(JSON.stringify(fillSlotfFillV2(id), null, 2)),
128
+ );
129
+ sf.command("fail-fill-v2 <id> [reason]").action((id, reason) =>
130
+ console.log(JSON.stringify(failSlotfFillV2(id, reason), null, 2)),
131
+ );
132
+ sf.command("cancel-fill-v2 <id> [reason]").action((id, reason) =>
133
+ console.log(JSON.stringify(cancelSlotfFillV2(id, reason), null, 2)),
134
+ );
135
+ sf.command("get-fill-v2 <id>").action((id) =>
136
+ console.log(JSON.stringify(getSlotfFillV2(id), null, 2)),
137
+ );
138
+ sf.command("list-fills-v2").action(() =>
139
+ console.log(JSON.stringify(listSlotfFillsV2(), null, 2)),
140
+ );
141
+ sf.command("auto-stale-idle-v2").action(() =>
142
+ console.log(JSON.stringify(autoStaleIdleSlotfTemplatesV2(), null, 2)),
143
+ );
144
+ sf.command("auto-fail-stuck-v2").action(() =>
145
+ console.log(JSON.stringify(autoFailStuckSlotfFillsV2(), null, 2)),
146
+ );
147
+ sf.command("gov-stats-v2").action(() =>
148
+ console.log(JSON.stringify(getSlotFillerGovStatsV2(), null, 2)),
149
+ );
150
+ sf.command("reset-state-v2").action(() => {
151
+ _resetStateSlotFillerV2();
152
+ console.log(JSON.stringify({ ok: true }, null, 2));
153
+ });
41
154
  }