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
@@ -445,61 +445,216 @@ export function registerPipelineCommand(program) {
445
445
  _json(getStats(db));
446
446
  });
447
447
 
448
-
449
448
  _registerPipelineV2Commands(pipeline);
450
- program.addCommand(pipeline);
449
+ program.addCommand(pipeline);
451
450
  }
452
451
  function _registerPipelineV2Commands(parent) {
453
452
  const L = async () => await import("../lib/pipeline-orchestrator.js");
454
453
 
455
- parent.command("enums-v2").description("Show V2 enums (pipeline maturity + run lifecycle)")
456
- .action(async () => { const m = await L(); console.log(JSON.stringify({ pipelineMaturity: m.PIPELINE_MATURITY_V2, runLifecycle: m.PIPELINE_RUN_LIFECYCLE_V2 }, null, 2)); });
457
- parent.command("config-v2").description("Show V2 config thresholds")
458
- .action(async () => { const m = await L(); console.log(JSON.stringify({ maxActivePipelinesPerOwner: m.getMaxActivePipelinesPerOwnerV2(), maxPendingPipelineRunsPerPipeline: m.getMaxPendingPipelineRunsPerPipelineV2(), pipelineIdleMs: m.getPipelineIdleMsV2(), pipelineRunStuckMs: m.getPipelineRunStuckMsV2() }, null, 2)); });
459
- parent.command("set-max-active-pipelines-v2 <n>").description("Set max active pipelines per owner")
460
- .action(async (n) => { const m = await L(); m.setMaxActivePipelinesPerOwnerV2(Number(n)); console.log("ok"); });
461
- parent.command("set-max-pending-runs-v2 <n>").description("Set max pending runs per pipeline")
462
- .action(async (n) => { const m = await L(); m.setMaxPendingPipelineRunsPerPipelineV2(Number(n)); console.log("ok"); });
463
- parent.command("set-pipeline-idle-ms-v2 <n>").description("Set pipeline idle threshold (ms)")
464
- .action(async (n) => { const m = await L(); m.setPipelineIdleMsV2(Number(n)); console.log("ok"); });
465
- parent.command("set-run-stuck-ms-v2 <n>").description("Set run stuck threshold (ms)")
466
- .action(async (n) => { const m = await L(); m.setPipelineRunStuckMsV2(Number(n)); console.log("ok"); });
467
-
468
- parent.command("register-pipeline-v2 <id> <owner>").description("Register V2 pipeline")
469
- .option("--name <n>", "Pipeline name").action(async (id, owner, o) => { const m = await L(); console.log(JSON.stringify(m.registerPipelineV2({ id, owner, name: o.name }), null, 2)); });
470
- parent.command("activate-pipeline-v2 <id>").description("Activate pipeline")
471
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.activatePipelineV2(id), null, 2)); });
472
- parent.command("pause-pipeline-v2 <id>").description("Pause pipeline")
473
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.pausePipelineV2(id), null, 2)); });
474
- parent.command("archive-pipeline-v2 <id>").description("Archive pipeline (terminal)")
475
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.archivePipelineV2(id), null, 2)); });
476
- parent.command("touch-pipeline-v2 <id>").description("Touch pipeline lastTouchedAt")
477
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.touchPipelineV2(id), null, 2)); });
478
- parent.command("get-pipeline-v2 <id>").description("Get V2 pipeline")
479
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.getPipelineV2(id), null, 2)); });
480
- parent.command("list-pipelines-v2").description("List all V2 pipelines")
481
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.listPipelinesV2(), null, 2)); });
482
-
483
- parent.command("create-run-v2 <id> <pipelineId>").description("Create V2 pipeline run (queued)")
484
- .option("--trigger <t>", "Trigger", "manual").action(async (id, pipelineId, o) => { const m = await L(); console.log(JSON.stringify(m.createPipelineRunV2({ id, pipelineId, trigger: o.trigger }), null, 2)); });
485
- parent.command("start-run-v2 <id>").description("Start run (queued→running)")
486
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.startPipelineRunV2(id), null, 2)); });
487
- parent.command("complete-run-v2 <id>").description("Complete run (running→completed)")
488
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.completePipelineRunV2(id), null, 2)); });
489
- parent.command("fail-run-v2 <id> [reason]").description("Fail run")
490
- .action(async (id, reason) => { const m = await L(); console.log(JSON.stringify(m.failPipelineRunV2(id, reason), null, 2)); });
491
- parent.command("cancel-run-v2 <id> [reason]").description("Cancel run")
492
- .action(async (id, reason) => { const m = await L(); console.log(JSON.stringify(m.cancelPipelineRunV2(id, reason), null, 2)); });
493
- parent.command("get-run-v2 <id>").description("Get V2 run")
494
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.getPipelineRunV2(id), null, 2)); });
495
- parent.command("list-runs-v2").description("List all V2 runs")
496
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.listPipelineRunsV2(), null, 2)); });
497
-
498
- parent.command("auto-pause-idle-v2").description("Auto-pause idle active pipelines")
499
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.autoPauseIdlePipelinesV2(), null, 2)); });
500
- parent.command("auto-fail-stuck-v2").description("Auto-fail stuck running runs")
501
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.autoFailStuckPipelineRunsV2(), null, 2)); });
502
-
503
- parent.command("gov-stats-v2").description("V2 governance aggregate stats")
504
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.getPipelineOrchestratorGovStatsV2(), null, 2)); });
454
+ parent
455
+ .command("enums-v2")
456
+ .description("Show V2 enums (pipeline maturity + run lifecycle)")
457
+ .action(async () => {
458
+ const m = await L();
459
+ console.log(
460
+ JSON.stringify(
461
+ {
462
+ pipelineMaturity: m.PIPELINE_MATURITY_V2,
463
+ runLifecycle: m.PIPELINE_RUN_LIFECYCLE_V2,
464
+ },
465
+ null,
466
+ 2,
467
+ ),
468
+ );
469
+ });
470
+ parent
471
+ .command("config-v2")
472
+ .description("Show V2 config thresholds")
473
+ .action(async () => {
474
+ const m = await L();
475
+ console.log(
476
+ JSON.stringify(
477
+ {
478
+ maxActivePipelinesPerOwner: m.getMaxActivePipelinesPerOwnerV2(),
479
+ maxPendingPipelineRunsPerPipeline:
480
+ m.getMaxPendingPipelineRunsPerPipelineV2(),
481
+ pipelineIdleMs: m.getPipelineIdleMsV2(),
482
+ pipelineRunStuckMs: m.getPipelineRunStuckMsV2(),
483
+ },
484
+ null,
485
+ 2,
486
+ ),
487
+ );
488
+ });
489
+ parent
490
+ .command("set-max-active-pipelines-v2 <n>")
491
+ .description("Set max active pipelines per owner")
492
+ .action(async (n) => {
493
+ const m = await L();
494
+ m.setMaxActivePipelinesPerOwnerV2(Number(n));
495
+ console.log("ok");
496
+ });
497
+ parent
498
+ .command("set-max-pending-runs-v2 <n>")
499
+ .description("Set max pending runs per pipeline")
500
+ .action(async (n) => {
501
+ const m = await L();
502
+ m.setMaxPendingPipelineRunsPerPipelineV2(Number(n));
503
+ console.log("ok");
504
+ });
505
+ parent
506
+ .command("set-pipeline-idle-ms-v2 <n>")
507
+ .description("Set pipeline idle threshold (ms)")
508
+ .action(async (n) => {
509
+ const m = await L();
510
+ m.setPipelineIdleMsV2(Number(n));
511
+ console.log("ok");
512
+ });
513
+ parent
514
+ .command("set-run-stuck-ms-v2 <n>")
515
+ .description("Set run stuck threshold (ms)")
516
+ .action(async (n) => {
517
+ const m = await L();
518
+ m.setPipelineRunStuckMsV2(Number(n));
519
+ console.log("ok");
520
+ });
521
+
522
+ parent
523
+ .command("register-pipeline-v2 <id> <owner>")
524
+ .description("Register V2 pipeline")
525
+ .option("--name <n>", "Pipeline name")
526
+ .action(async (id, owner, o) => {
527
+ const m = await L();
528
+ console.log(
529
+ JSON.stringify(
530
+ m.registerPipelineV2({ id, owner, name: o.name }),
531
+ null,
532
+ 2,
533
+ ),
534
+ );
535
+ });
536
+ parent
537
+ .command("activate-pipeline-v2 <id>")
538
+ .description("Activate pipeline")
539
+ .action(async (id) => {
540
+ const m = await L();
541
+ console.log(JSON.stringify(m.activatePipelineV2(id), null, 2));
542
+ });
543
+ parent
544
+ .command("pause-pipeline-v2 <id>")
545
+ .description("Pause pipeline")
546
+ .action(async (id) => {
547
+ const m = await L();
548
+ console.log(JSON.stringify(m.pausePipelineV2(id), null, 2));
549
+ });
550
+ parent
551
+ .command("archive-pipeline-v2 <id>")
552
+ .description("Archive pipeline (terminal)")
553
+ .action(async (id) => {
554
+ const m = await L();
555
+ console.log(JSON.stringify(m.archivePipelineV2(id), null, 2));
556
+ });
557
+ parent
558
+ .command("touch-pipeline-v2 <id>")
559
+ .description("Touch pipeline lastTouchedAt")
560
+ .action(async (id) => {
561
+ const m = await L();
562
+ console.log(JSON.stringify(m.touchPipelineV2(id), null, 2));
563
+ });
564
+ parent
565
+ .command("get-pipeline-v2 <id>")
566
+ .description("Get V2 pipeline")
567
+ .action(async (id) => {
568
+ const m = await L();
569
+ console.log(JSON.stringify(m.getPipelineV2(id), null, 2));
570
+ });
571
+ parent
572
+ .command("list-pipelines-v2")
573
+ .description("List all V2 pipelines")
574
+ .action(async () => {
575
+ const m = await L();
576
+ console.log(JSON.stringify(m.listPipelinesV2(), null, 2));
577
+ });
578
+
579
+ parent
580
+ .command("create-run-v2 <id> <pipelineId>")
581
+ .description("Create V2 pipeline run (queued)")
582
+ .option("--trigger <t>", "Trigger", "manual")
583
+ .action(async (id, pipelineId, o) => {
584
+ const m = await L();
585
+ console.log(
586
+ JSON.stringify(
587
+ m.createPipelineRunV2({ id, pipelineId, trigger: o.trigger }),
588
+ null,
589
+ 2,
590
+ ),
591
+ );
592
+ });
593
+ parent
594
+ .command("start-run-v2 <id>")
595
+ .description("Start run (queued→running)")
596
+ .action(async (id) => {
597
+ const m = await L();
598
+ console.log(JSON.stringify(m.startPipelineRunV2(id), null, 2));
599
+ });
600
+ parent
601
+ .command("complete-run-v2 <id>")
602
+ .description("Complete run (running→completed)")
603
+ .action(async (id) => {
604
+ const m = await L();
605
+ console.log(JSON.stringify(m.completePipelineRunV2(id), null, 2));
606
+ });
607
+ parent
608
+ .command("fail-run-v2 <id> [reason]")
609
+ .description("Fail run")
610
+ .action(async (id, reason) => {
611
+ const m = await L();
612
+ console.log(JSON.stringify(m.failPipelineRunV2(id, reason), null, 2));
613
+ });
614
+ parent
615
+ .command("cancel-run-v2 <id> [reason]")
616
+ .description("Cancel run")
617
+ .action(async (id, reason) => {
618
+ const m = await L();
619
+ console.log(JSON.stringify(m.cancelPipelineRunV2(id, reason), null, 2));
620
+ });
621
+ parent
622
+ .command("get-run-v2 <id>")
623
+ .description("Get V2 run")
624
+ .action(async (id) => {
625
+ const m = await L();
626
+ console.log(JSON.stringify(m.getPipelineRunV2(id), null, 2));
627
+ });
628
+ parent
629
+ .command("list-runs-v2")
630
+ .description("List all V2 runs")
631
+ .action(async () => {
632
+ const m = await L();
633
+ console.log(JSON.stringify(m.listPipelineRunsV2(), null, 2));
634
+ });
635
+
636
+ parent
637
+ .command("auto-pause-idle-v2")
638
+ .description("Auto-pause idle active pipelines")
639
+ .action(async () => {
640
+ const m = await L();
641
+ console.log(JSON.stringify(m.autoPauseIdlePipelinesV2(), null, 2));
642
+ });
643
+ parent
644
+ .command("auto-fail-stuck-v2")
645
+ .description("Auto-fail stuck running runs")
646
+ .action(async () => {
647
+ const m = await L();
648
+ console.log(JSON.stringify(m.autoFailStuckPipelineRunsV2(), null, 2));
649
+ });
650
+
651
+ parent
652
+ .command("gov-stats-v2")
653
+ .description("V2 governance aggregate stats")
654
+ .action(async () => {
655
+ const m = await L();
656
+ console.log(
657
+ JSON.stringify(m.getPipelineOrchestratorGovStatsV2(), null, 2),
658
+ );
659
+ });
505
660
  }
@@ -6,40 +6,149 @@
6
6
  */
7
7
 
8
8
  import {
9
- PLAN_PROFILE_MATURITY_V2, PLAN_STEP_LIFECYCLE_V2,
10
- setMaxActivePlanProfilesPerOwnerV2, getMaxActivePlanProfilesPerOwnerV2,
11
- setMaxPendingPlanStepsPerProfileV2, getMaxPendingPlanStepsPerProfileV2,
12
- setPlanProfileIdleMsV2, getPlanProfileIdleMsV2,
13
- setPlanStepStuckMsV2, getPlanStepStuckMsV2,
14
- registerPlanProfileV2, activatePlanProfileV2, pausePlanProfileV2, archivePlanProfileV2, touchPlanProfileV2, getPlanProfileV2, listPlanProfilesV2,
15
- createPlanStepV2, startPlanStepV2, completePlanStepV2, failPlanStepV2, cancelPlanStepV2, getPlanStepV2, listPlanStepsV2,
16
- autoPauseIdlePlanProfilesV2, autoFailStuckPlanStepsV2, getPlanModeGovStatsV2, _resetStatePlanModeV2,
9
+ PLAN_PROFILE_MATURITY_V2,
10
+ PLAN_STEP_LIFECYCLE_V2,
11
+ setMaxActivePlanProfilesPerOwnerV2,
12
+ getMaxActivePlanProfilesPerOwnerV2,
13
+ setMaxPendingPlanStepsPerProfileV2,
14
+ getMaxPendingPlanStepsPerProfileV2,
15
+ setPlanProfileIdleMsV2,
16
+ getPlanProfileIdleMsV2,
17
+ setPlanStepStuckMsV2,
18
+ getPlanStepStuckMsV2,
19
+ registerPlanProfileV2,
20
+ activatePlanProfileV2,
21
+ pausePlanProfileV2,
22
+ archivePlanProfileV2,
23
+ touchPlanProfileV2,
24
+ getPlanProfileV2,
25
+ listPlanProfilesV2,
26
+ createPlanStepV2,
27
+ startPlanStepV2,
28
+ completePlanStepV2,
29
+ failPlanStepV2,
30
+ cancelPlanStepV2,
31
+ getPlanStepV2,
32
+ listPlanStepsV2,
33
+ autoPauseIdlePlanProfilesV2,
34
+ autoFailStuckPlanStepsV2,
35
+ getPlanModeGovStatsV2,
36
+ _resetStatePlanModeV2,
17
37
  } from "../lib/plan-mode.js";
18
38
 
19
39
  export function registerPlanModeCommand(program) {
20
40
  const pm = program.command("planmode").description("Plan Mode V2 governance");
21
- pm.command("enums-v2").action(() => console.log(JSON.stringify({ profileMaturity: PLAN_PROFILE_MATURITY_V2, stepLifecycle: PLAN_STEP_LIFECYCLE_V2 }, null, 2)));
22
- pm.command("config-v2").action(() => console.log(JSON.stringify({ maxActivePlanProfilesPerOwner: getMaxActivePlanProfilesPerOwnerV2(), maxPendingPlanStepsPerProfile: getMaxPendingPlanStepsPerProfileV2(), planProfileIdleMs: getPlanProfileIdleMsV2(), planStepStuckMs: getPlanStepStuckMsV2() }, null, 2)));
23
- pm.command("set-max-active-v2 <n>").action((n) => { setMaxActivePlanProfilesPerOwnerV2(Number(n)); console.log("ok"); });
24
- pm.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingPlanStepsPerProfileV2(Number(n)); console.log("ok"); });
25
- pm.command("set-idle-ms-v2 <n>").action((n) => { setPlanProfileIdleMsV2(Number(n)); console.log("ok"); });
26
- pm.command("set-stuck-ms-v2 <n>").action((n) => { setPlanStepStuckMsV2(Number(n)); console.log("ok"); });
27
- pm.command("register-profile-v2 <id> <owner>").option("--goal <g>", "goal").action((id, owner, o) => console.log(JSON.stringify(registerPlanProfileV2({ id, owner, goal: o.goal }), null, 2)));
28
- pm.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activatePlanProfileV2(id), null, 2)));
29
- pm.command("pause-profile-v2 <id>").action((id) => console.log(JSON.stringify(pausePlanProfileV2(id), null, 2)));
30
- pm.command("archive-profile-v2 <id>").action((id) => console.log(JSON.stringify(archivePlanProfileV2(id), null, 2)));
31
- pm.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchPlanProfileV2(id), null, 2)));
32
- pm.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getPlanProfileV2(id), null, 2)));
33
- pm.command("list-profiles-v2").action(() => console.log(JSON.stringify(listPlanProfilesV2(), null, 2)));
34
- pm.command("create-step-v2 <id> <profileId>").option("--action <a>", "action").action((id, profileId, o) => console.log(JSON.stringify(createPlanStepV2({ id, profileId, action: o.action }), null, 2)));
35
- pm.command("start-step-v2 <id>").action((id) => console.log(JSON.stringify(startPlanStepV2(id), null, 2)));
36
- pm.command("complete-step-v2 <id>").action((id) => console.log(JSON.stringify(completePlanStepV2(id), null, 2)));
37
- pm.command("fail-step-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failPlanStepV2(id, reason), null, 2)));
38
- pm.command("cancel-step-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelPlanStepV2(id, reason), null, 2)));
39
- pm.command("get-step-v2 <id>").action((id) => console.log(JSON.stringify(getPlanStepV2(id), null, 2)));
40
- pm.command("list-steps-v2").action(() => console.log(JSON.stringify(listPlanStepsV2(), null, 2)));
41
- pm.command("auto-pause-idle-v2").action(() => console.log(JSON.stringify(autoPauseIdlePlanProfilesV2(), null, 2)));
42
- pm.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckPlanStepsV2(), null, 2)));
43
- pm.command("gov-stats-v2").action(() => console.log(JSON.stringify(getPlanModeGovStatsV2(), null, 2)));
44
- pm.command("reset-state-v2").action(() => { _resetStatePlanModeV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
41
+ pm.command("enums-v2").action(() =>
42
+ console.log(
43
+ JSON.stringify(
44
+ {
45
+ profileMaturity: PLAN_PROFILE_MATURITY_V2,
46
+ stepLifecycle: PLAN_STEP_LIFECYCLE_V2,
47
+ },
48
+ null,
49
+ 2,
50
+ ),
51
+ ),
52
+ );
53
+ pm.command("config-v2").action(() =>
54
+ console.log(
55
+ JSON.stringify(
56
+ {
57
+ maxActivePlanProfilesPerOwner: getMaxActivePlanProfilesPerOwnerV2(),
58
+ maxPendingPlanStepsPerProfile: getMaxPendingPlanStepsPerProfileV2(),
59
+ planProfileIdleMs: getPlanProfileIdleMsV2(),
60
+ planStepStuckMs: getPlanStepStuckMsV2(),
61
+ },
62
+ null,
63
+ 2,
64
+ ),
65
+ ),
66
+ );
67
+ pm.command("set-max-active-v2 <n>").action((n) => {
68
+ setMaxActivePlanProfilesPerOwnerV2(Number(n));
69
+ console.log("ok");
70
+ });
71
+ pm.command("set-max-pending-v2 <n>").action((n) => {
72
+ setMaxPendingPlanStepsPerProfileV2(Number(n));
73
+ console.log("ok");
74
+ });
75
+ pm.command("set-idle-ms-v2 <n>").action((n) => {
76
+ setPlanProfileIdleMsV2(Number(n));
77
+ console.log("ok");
78
+ });
79
+ pm.command("set-stuck-ms-v2 <n>").action((n) => {
80
+ setPlanStepStuckMsV2(Number(n));
81
+ console.log("ok");
82
+ });
83
+ pm.command("register-profile-v2 <id> <owner>")
84
+ .option("--goal <g>", "goal")
85
+ .action((id, owner, o) =>
86
+ console.log(
87
+ JSON.stringify(
88
+ registerPlanProfileV2({ id, owner, goal: o.goal }),
89
+ null,
90
+ 2,
91
+ ),
92
+ ),
93
+ );
94
+ pm.command("activate-profile-v2 <id>").action((id) =>
95
+ console.log(JSON.stringify(activatePlanProfileV2(id), null, 2)),
96
+ );
97
+ pm.command("pause-profile-v2 <id>").action((id) =>
98
+ console.log(JSON.stringify(pausePlanProfileV2(id), null, 2)),
99
+ );
100
+ pm.command("archive-profile-v2 <id>").action((id) =>
101
+ console.log(JSON.stringify(archivePlanProfileV2(id), null, 2)),
102
+ );
103
+ pm.command("touch-profile-v2 <id>").action((id) =>
104
+ console.log(JSON.stringify(touchPlanProfileV2(id), null, 2)),
105
+ );
106
+ pm.command("get-profile-v2 <id>").action((id) =>
107
+ console.log(JSON.stringify(getPlanProfileV2(id), null, 2)),
108
+ );
109
+ pm.command("list-profiles-v2").action(() =>
110
+ console.log(JSON.stringify(listPlanProfilesV2(), null, 2)),
111
+ );
112
+ pm.command("create-step-v2 <id> <profileId>")
113
+ .option("--action <a>", "action")
114
+ .action((id, profileId, o) =>
115
+ console.log(
116
+ JSON.stringify(
117
+ createPlanStepV2({ id, profileId, action: o.action }),
118
+ null,
119
+ 2,
120
+ ),
121
+ ),
122
+ );
123
+ pm.command("start-step-v2 <id>").action((id) =>
124
+ console.log(JSON.stringify(startPlanStepV2(id), null, 2)),
125
+ );
126
+ pm.command("complete-step-v2 <id>").action((id) =>
127
+ console.log(JSON.stringify(completePlanStepV2(id), null, 2)),
128
+ );
129
+ pm.command("fail-step-v2 <id> [reason]").action((id, reason) =>
130
+ console.log(JSON.stringify(failPlanStepV2(id, reason), null, 2)),
131
+ );
132
+ pm.command("cancel-step-v2 <id> [reason]").action((id, reason) =>
133
+ console.log(JSON.stringify(cancelPlanStepV2(id, reason), null, 2)),
134
+ );
135
+ pm.command("get-step-v2 <id>").action((id) =>
136
+ console.log(JSON.stringify(getPlanStepV2(id), null, 2)),
137
+ );
138
+ pm.command("list-steps-v2").action(() =>
139
+ console.log(JSON.stringify(listPlanStepsV2(), null, 2)),
140
+ );
141
+ pm.command("auto-pause-idle-v2").action(() =>
142
+ console.log(JSON.stringify(autoPauseIdlePlanProfilesV2(), null, 2)),
143
+ );
144
+ pm.command("auto-fail-stuck-v2").action(() =>
145
+ console.log(JSON.stringify(autoFailStuckPlanStepsV2(), null, 2)),
146
+ );
147
+ pm.command("gov-stats-v2").action(() =>
148
+ console.log(JSON.stringify(getPlanModeGovStatsV2(), null, 2)),
149
+ );
150
+ pm.command("reset-state-v2").action(() => {
151
+ _resetStatePlanModeV2();
152
+ console.log(JSON.stringify({ ok: true }, null, 2));
153
+ });
45
154
  }
@@ -664,3 +664,206 @@ export function registerPrivacyCommand(program) {
664
664
 
665
665
  program.addCommand(pc);
666
666
  }
667
+
668
+ // === Iter17 V2 governance overlay ===
669
+ export function registerPcgovV2Commands(program) {
670
+ const parent = program.commands.find((c) => c.name() === "privacy");
671
+ if (!parent) return;
672
+ const L = async () => await import("../lib/privacy-computing.js");
673
+ parent
674
+ .command("pcgov-enums-v2")
675
+ .description("Show V2 enums")
676
+ .action(async () => {
677
+ const m = await L();
678
+ console.log(
679
+ JSON.stringify(
680
+ {
681
+ profileMaturity: m.PCGOV_PROFILE_MATURITY_V2,
682
+ jobLifecycle: m.PCGOV_JOB_LIFECYCLE_V2,
683
+ },
684
+ null,
685
+ 2,
686
+ ),
687
+ );
688
+ });
689
+ parent
690
+ .command("pcgov-config-v2")
691
+ .description("Show V2 config")
692
+ .action(async () => {
693
+ const m = await L();
694
+ console.log(
695
+ JSON.stringify(
696
+ {
697
+ maxActive: m.getMaxActivePcgovProfilesPerOwnerV2(),
698
+ maxPending: m.getMaxPendingPcgovJobsPerProfileV2(),
699
+ idleMs: m.getPcgovProfileIdleMsV2(),
700
+ stuckMs: m.getPcgovJobStuckMsV2(),
701
+ },
702
+ null,
703
+ 2,
704
+ ),
705
+ );
706
+ });
707
+ parent
708
+ .command("pcgov-set-max-active-v2 <n>")
709
+ .description("Set max active")
710
+ .action(async (n) => {
711
+ (await L()).setMaxActivePcgovProfilesPerOwnerV2(Number(n));
712
+ console.log("ok");
713
+ });
714
+ parent
715
+ .command("pcgov-set-max-pending-v2 <n>")
716
+ .description("Set max pending")
717
+ .action(async (n) => {
718
+ (await L()).setMaxPendingPcgovJobsPerProfileV2(Number(n));
719
+ console.log("ok");
720
+ });
721
+ parent
722
+ .command("pcgov-set-idle-ms-v2 <n>")
723
+ .description("Set idle threshold ms")
724
+ .action(async (n) => {
725
+ (await L()).setPcgovProfileIdleMsV2(Number(n));
726
+ console.log("ok");
727
+ });
728
+ parent
729
+ .command("pcgov-set-stuck-ms-v2 <n>")
730
+ .description("Set stuck threshold ms")
731
+ .action(async (n) => {
732
+ (await L()).setPcgovJobStuckMsV2(Number(n));
733
+ console.log("ok");
734
+ });
735
+ parent
736
+ .command("pcgov-register-v2 <id> <owner>")
737
+ .description("Register V2 profile")
738
+ .option("--technique <v>", "technique")
739
+ .action(async (id, owner, o) => {
740
+ const m = await L();
741
+ console.log(
742
+ JSON.stringify(
743
+ m.registerPcgovProfileV2({ id, owner, technique: o.technique }),
744
+ null,
745
+ 2,
746
+ ),
747
+ );
748
+ });
749
+ parent
750
+ .command("pcgov-activate-v2 <id>")
751
+ .description("Activate profile")
752
+ .action(async (id) => {
753
+ console.log(
754
+ JSON.stringify((await L()).activatePcgovProfileV2(id), null, 2),
755
+ );
756
+ });
757
+ parent
758
+ .command("pcgov-suspend-v2 <id>")
759
+ .description("Suspend profile")
760
+ .action(async (id) => {
761
+ console.log(
762
+ JSON.stringify((await L()).suspendPcgovProfileV2(id), null, 2),
763
+ );
764
+ });
765
+ parent
766
+ .command("pcgov-archive-v2 <id>")
767
+ .description("Archive profile")
768
+ .action(async (id) => {
769
+ console.log(
770
+ JSON.stringify((await L()).archivePcgovProfileV2(id), null, 2),
771
+ );
772
+ });
773
+ parent
774
+ .command("pcgov-touch-v2 <id>")
775
+ .description("Touch profile")
776
+ .action(async (id) => {
777
+ console.log(JSON.stringify((await L()).touchPcgovProfileV2(id), null, 2));
778
+ });
779
+ parent
780
+ .command("pcgov-get-v2 <id>")
781
+ .description("Get profile")
782
+ .action(async (id) => {
783
+ console.log(JSON.stringify((await L()).getPcgovProfileV2(id), null, 2));
784
+ });
785
+ parent
786
+ .command("pcgov-list-v2")
787
+ .description("List profiles")
788
+ .action(async () => {
789
+ console.log(JSON.stringify((await L()).listPcgovProfilesV2(), null, 2));
790
+ });
791
+ parent
792
+ .command("pcgov-create-job-v2 <id> <profileId>")
793
+ .description("Create job")
794
+ .option("--dataset <v>", "dataset")
795
+ .action(async (id, profileId, o) => {
796
+ const m = await L();
797
+ console.log(
798
+ JSON.stringify(
799
+ m.createPcgovJobV2({ id, profileId, dataset: o.dataset }),
800
+ null,
801
+ 2,
802
+ ),
803
+ );
804
+ });
805
+ parent
806
+ .command("pcgov-computing-job-v2 <id>")
807
+ .description("Mark job as computing")
808
+ .action(async (id) => {
809
+ console.log(JSON.stringify((await L()).computingPcgovJobV2(id), null, 2));
810
+ });
811
+ parent
812
+ .command("pcgov-complete-job-v2 <id>")
813
+ .description("Complete job")
814
+ .action(async (id) => {
815
+ console.log(JSON.stringify((await L()).completeJobPcgovV2(id), null, 2));
816
+ });
817
+ parent
818
+ .command("pcgov-fail-job-v2 <id> [reason]")
819
+ .description("Fail job")
820
+ .action(async (id, reason) => {
821
+ console.log(
822
+ JSON.stringify((await L()).failPcgovJobV2(id, reason), null, 2),
823
+ );
824
+ });
825
+ parent
826
+ .command("pcgov-cancel-job-v2 <id> [reason]")
827
+ .description("Cancel job")
828
+ .action(async (id, reason) => {
829
+ console.log(
830
+ JSON.stringify((await L()).cancelPcgovJobV2(id, reason), null, 2),
831
+ );
832
+ });
833
+ parent
834
+ .command("pcgov-get-job-v2 <id>")
835
+ .description("Get job")
836
+ .action(async (id) => {
837
+ console.log(JSON.stringify((await L()).getPcgovJobV2(id), null, 2));
838
+ });
839
+ parent
840
+ .command("pcgov-list-jobs-v2")
841
+ .description("List jobs")
842
+ .action(async () => {
843
+ console.log(JSON.stringify((await L()).listPcgovJobsV2(), null, 2));
844
+ });
845
+ parent
846
+ .command("pcgov-auto-suspend-idle-v2")
847
+ .description("Auto-suspend idle")
848
+ .action(async () => {
849
+ console.log(
850
+ JSON.stringify((await L()).autoSuspendIdlePcgovProfilesV2(), null, 2),
851
+ );
852
+ });
853
+ parent
854
+ .command("pcgov-auto-fail-stuck-v2")
855
+ .description("Auto-fail stuck jobs")
856
+ .action(async () => {
857
+ console.log(
858
+ JSON.stringify((await L()).autoFailStuckPcgovJobsV2(), null, 2),
859
+ );
860
+ });
861
+ parent
862
+ .command("pcgov-gov-stats-v2")
863
+ .description("V2 gov stats")
864
+ .action(async () => {
865
+ console.log(
866
+ JSON.stringify((await L()).getPrivacyComputingGovStatsV2(), null, 2),
867
+ );
868
+ });
869
+ }