chainlesschain 0.143.0 → 0.152.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 (227) hide show
  1. package/package.json +1 -1
  2. package/src/commands/a2a.js +196 -28
  3. package/src/commands/activitypub.js +364 -27
  4. package/src/commands/agent-network.js +217 -0
  5. package/src/commands/agent.js +587 -103
  6. package/src/commands/audit.js +206 -0
  7. package/src/commands/automation.js +201 -0
  8. package/src/commands/bi.js +355 -27
  9. package/src/commands/bm25.js +111 -27
  10. package/src/commands/browse.js +403 -29
  11. package/src/commands/ccron.js +128 -28
  12. package/src/commands/chat.js +207 -0
  13. package/src/commands/codegen.js +207 -0
  14. package/src/commands/collab.js +211 -0
  15. package/src/commands/compliance.js +824 -34
  16. package/src/commands/compt.js +127 -29
  17. package/src/commands/consol.js +8 -2
  18. package/src/commands/cowork.js +783 -34
  19. package/src/commands/crosschain.js +182 -28
  20. package/src/commands/dao.js +182 -28
  21. package/src/commands/dbevo.js +227 -0
  22. package/src/commands/dev.js +207 -0
  23. package/src/commands/did-v2.js +217 -0
  24. package/src/commands/did.js +221 -0
  25. package/src/commands/dlp.js +385 -27
  26. package/src/commands/economy.js +205 -50
  27. package/src/commands/evolution.js +203 -50
  28. package/src/commands/evomap.js +387 -27
  29. package/src/commands/export.js +213 -0
  30. package/src/commands/federation.js +209 -0
  31. package/src/commands/fflag.js +74 -22
  32. package/src/commands/fusion.js +205 -0
  33. package/src/commands/git.js +177 -37
  34. package/src/commands/governance.js +209 -0
  35. package/src/commands/hardening.js +209 -0
  36. package/src/commands/hmemory.js +204 -50
  37. package/src/commands/hook.js +209 -0
  38. package/src/commands/import.js +209 -0
  39. package/src/commands/incentive.js +209 -0
  40. package/src/commands/inference.js +170 -34
  41. package/src/commands/infra.js +203 -0
  42. package/src/commands/instinct.js +209 -0
  43. package/src/commands/ipfs.js +207 -0
  44. package/src/commands/itbudget.js +149 -33
  45. package/src/commands/kg.js +206 -0
  46. package/src/commands/llm.js +217 -0
  47. package/src/commands/lowcode.js +195 -38
  48. package/src/commands/marketplace.js +206 -0
  49. package/src/commands/matrix.js +386 -27
  50. package/src/commands/mcp.js +217 -0
  51. package/src/commands/mcpscaf.js +145 -33
  52. package/src/commands/meminj.js +145 -33
  53. package/src/commands/memory.js +209 -0
  54. package/src/commands/multimodal.js +203 -0
  55. package/src/commands/nlprog.js +225 -0
  56. package/src/commands/nostr.js +387 -27
  57. package/src/commands/note.js +205 -0
  58. package/src/commands/ops.js +219 -0
  59. package/src/commands/orchestrate.js +217 -0
  60. package/src/commands/orchgov.js +144 -33
  61. package/src/commands/org.js +209 -0
  62. package/src/commands/p2p.js +209 -0
  63. package/src/commands/pdfp.js +109 -27
  64. package/src/commands/perception.js +209 -0
  65. package/src/commands/perf.js +169 -32
  66. package/src/commands/perm.js +144 -33
  67. package/src/commands/permmem.js +203 -0
  68. package/src/commands/pipeline.js +207 -52
  69. package/src/commands/planmode.js +141 -32
  70. package/src/commands/plugin-ecosystem.js +209 -0
  71. package/src/commands/pqc.js +213 -0
  72. package/src/commands/privacy.js +203 -0
  73. package/src/commands/promcomp.js +111 -27
  74. package/src/commands/quantization.js +207 -0
  75. package/src/commands/rcache.js +205 -0
  76. package/src/commands/recommend.js +410 -34
  77. package/src/commands/reputation.js +208 -0
  78. package/src/commands/runtime.js +205 -0
  79. package/src/commands/sandbox.js +206 -0
  80. package/src/commands/scim.js +209 -0
  81. package/src/commands/seshhook.js +145 -33
  82. package/src/commands/seshsearch.js +141 -33
  83. package/src/commands/seshtail.js +144 -33
  84. package/src/commands/seshu.js +152 -33
  85. package/src/commands/session.js +209 -0
  86. package/src/commands/sganal.js +123 -29
  87. package/src/commands/siem.js +201 -34
  88. package/src/commands/skill.js +207 -0
  89. package/src/commands/sla.js +212 -0
  90. package/src/commands/slotfill.js +146 -33
  91. package/src/commands/social.js +358 -32
  92. package/src/commands/sso.js +209 -0
  93. package/src/commands/stress.js +206 -0
  94. package/src/commands/svccont.js +145 -33
  95. package/src/commands/sync.js +209 -0
  96. package/src/commands/tech.js +209 -0
  97. package/src/commands/tenant.js +217 -0
  98. package/src/commands/terraform.js +206 -0
  99. package/src/commands/tms.js +171 -33
  100. package/src/commands/tokens.js +209 -0
  101. package/src/commands/topiccls.js +146 -33
  102. package/src/commands/trust.js +217 -0
  103. package/src/commands/uprof.js +141 -32
  104. package/src/commands/vcheck.js +122 -28
  105. package/src/commands/wallet.js +209 -0
  106. package/src/commands/webfetch.js +141 -32
  107. package/src/commands/workflow.js +203 -0
  108. package/src/commands/zkp.js +184 -28
  109. package/src/index.js +180 -0
  110. package/src/lib/a2a-protocol.js +319 -51
  111. package/src/lib/activitypub-bridge.js +622 -50
  112. package/src/lib/agent-economy.js +304 -51
  113. package/src/lib/agent-network.js +341 -0
  114. package/src/lib/aiops.js +346 -0
  115. package/src/lib/app-builder.js +279 -46
  116. package/src/lib/audit-logger.js +321 -0
  117. package/src/lib/automation-engine.js +335 -0
  118. package/src/lib/autonomous-agent.js +284 -48
  119. package/src/lib/autonomous-developer.js +332 -0
  120. package/src/lib/bi-engine.js +616 -49
  121. package/src/lib/bm25-search.js +301 -49
  122. package/src/lib/browser-automation.js +630 -49
  123. package/src/lib/chat-core.js +336 -0
  124. package/src/lib/claude-code-bridge.js +341 -0
  125. package/src/lib/code-agent.js +339 -0
  126. package/src/lib/collaboration-governance.js +334 -0
  127. package/src/lib/community-governance.js +346 -0
  128. package/src/lib/compliance-framework-reporter.js +305 -51
  129. package/src/lib/compliance-manager.js +330 -0
  130. package/src/lib/compression-telemetry.js +301 -49
  131. package/src/lib/content-recommendation.js +351 -0
  132. package/src/lib/content-recommender.js +317 -52
  133. package/src/lib/cowork-cron.js +298 -49
  134. package/src/lib/cowork-learning.js +333 -0
  135. package/src/lib/cowork-share.js +338 -0
  136. package/src/lib/cowork-task-runner.js +308 -51
  137. package/src/lib/cowork-workflow.js +327 -0
  138. package/src/lib/cross-chain.js +311 -51
  139. package/src/lib/dao-governance.js +280 -46
  140. package/src/lib/dbevo.js +351 -0
  141. package/src/lib/decentral-infra.js +330 -0
  142. package/src/lib/did-manager.js +341 -0
  143. package/src/lib/did-v2-manager.js +341 -0
  144. package/src/lib/dlp-engine.js +626 -49
  145. package/src/lib/evolution-system.js +278 -47
  146. package/src/lib/evomap-governance.js +334 -0
  147. package/src/lib/evomap-manager.js +280 -46
  148. package/src/lib/execution-backend.js +294 -48
  149. package/src/lib/feature-flags.js +294 -49
  150. package/src/lib/federation-hardening.js +340 -0
  151. package/src/lib/git-integration.js +285 -47
  152. package/src/lib/hardening-manager.js +341 -0
  153. package/src/lib/hierarchical-memory.js +284 -48
  154. package/src/lib/hook-manager.js +341 -0
  155. package/src/lib/inference-network.js +308 -51
  156. package/src/lib/instinct-manager.js +346 -0
  157. package/src/lib/ipfs-storage.js +334 -0
  158. package/src/lib/iteration-budget.js +302 -50
  159. package/src/lib/knowledge-exporter.js +341 -0
  160. package/src/lib/knowledge-graph.js +333 -0
  161. package/src/lib/knowledge-importer.js +341 -0
  162. package/src/lib/llm-providers.js +346 -0
  163. package/src/lib/matrix-bridge.js +620 -47
  164. package/src/lib/mcp-registry.js +346 -0
  165. package/src/lib/mcp-scaffold.js +318 -54
  166. package/src/lib/memory-injection.js +288 -49
  167. package/src/lib/memory-manager.js +336 -0
  168. package/src/lib/multimodal.js +330 -0
  169. package/src/lib/nl-programming.js +341 -0
  170. package/src/lib/nostr-bridge.js +622 -49
  171. package/src/lib/note-versioning.js +339 -0
  172. package/src/lib/orchestrator.js +293 -48
  173. package/src/lib/org-manager.js +336 -0
  174. package/src/lib/p2p-manager.js +341 -0
  175. package/src/lib/pdf-parser.js +298 -49
  176. package/src/lib/perception.js +346 -0
  177. package/src/lib/perf-tuning.js +309 -50
  178. package/src/lib/permanent-memory.js +327 -0
  179. package/src/lib/permission-engine.js +287 -49
  180. package/src/lib/pipeline-orchestrator.js +289 -49
  181. package/src/lib/plan-mode.js +298 -51
  182. package/src/lib/plugin-ecosystem.js +346 -0
  183. package/src/lib/pqc-manager.js +346 -0
  184. package/src/lib/privacy-computing.js +335 -0
  185. package/src/lib/protocol-fusion.js +338 -0
  186. package/src/lib/quantization.js +337 -0
  187. package/src/lib/reputation-optimizer.js +340 -0
  188. package/src/lib/response-cache.js +333 -0
  189. package/src/lib/sandbox-v2.js +327 -0
  190. package/src/lib/scim-manager.js +346 -0
  191. package/src/lib/service-container.js +313 -52
  192. package/src/lib/session-consolidator.js +296 -49
  193. package/src/lib/session-hooks.js +312 -53
  194. package/src/lib/session-manager.js +334 -0
  195. package/src/lib/session-search.js +304 -51
  196. package/src/lib/session-tail.js +288 -49
  197. package/src/lib/session-usage.js +298 -52
  198. package/src/lib/siem-exporter.js +298 -51
  199. package/src/lib/skill-loader.js +334 -0
  200. package/src/lib/skill-marketplace.js +345 -0
  201. package/src/lib/sla-manager.js +341 -0
  202. package/src/lib/slot-filler.js +303 -51
  203. package/src/lib/social-graph-analytics.js +295 -49
  204. package/src/lib/social-graph.js +272 -49
  205. package/src/lib/social-manager.js +330 -0
  206. package/src/lib/sso-manager.js +340 -0
  207. package/src/lib/stress-tester.js +342 -0
  208. package/src/lib/sub-agent-registry.js +302 -53
  209. package/src/lib/sync-manager.js +336 -0
  210. package/src/lib/task-model-selector.js +302 -50
  211. package/src/lib/tech-learning-engine.js +341 -0
  212. package/src/lib/tenant-saas.js +341 -0
  213. package/src/lib/terraform-manager.js +333 -0
  214. package/src/lib/threat-intel.js +330 -0
  215. package/src/lib/todo-manager.js +281 -47
  216. package/src/lib/token-incentive.js +341 -0
  217. package/src/lib/token-tracker.js +336 -0
  218. package/src/lib/topic-classifier.js +297 -49
  219. package/src/lib/trust-security.js +343 -0
  220. package/src/lib/ueba.js +340 -0
  221. package/src/lib/universal-runtime.js +330 -0
  222. package/src/lib/user-profile.js +294 -50
  223. package/src/lib/version-checker.js +304 -50
  224. package/src/lib/wallet-manager.js +336 -0
  225. package/src/lib/web-fetch.js +292 -51
  226. package/src/lib/workflow-engine.js +330 -0
  227. package/src/lib/zkp-engine.js +286 -49
@@ -693,3 +693,212 @@ export function registerIncentiveCommand(program) {
693
693
  logger.log(JSON.stringify(getTokenStatsV2(), null, 2));
694
694
  });
695
695
  }
696
+
697
+ // === Iter17 V2 governance overlay ===
698
+ export function registerIncgovV2Commands(program) {
699
+ const parent = program.commands.find((c) => c.name() === "incentive");
700
+ if (!parent) return;
701
+ const L = async () => await import("../lib/token-incentive.js");
702
+ parent
703
+ .command("incgov-enums-v2")
704
+ .description("Show V2 enums")
705
+ .action(async () => {
706
+ const m = await L();
707
+ console.log(
708
+ JSON.stringify(
709
+ {
710
+ profileMaturity: m.INCGOV_PROFILE_MATURITY_V2,
711
+ payoutLifecycle: m.INCGOV_PAYOUT_LIFECYCLE_V2,
712
+ },
713
+ null,
714
+ 2,
715
+ ),
716
+ );
717
+ });
718
+ parent
719
+ .command("incgov-config-v2")
720
+ .description("Show V2 config")
721
+ .action(async () => {
722
+ const m = await L();
723
+ console.log(
724
+ JSON.stringify(
725
+ {
726
+ maxActive: m.getMaxActiveIncgovProfilesPerOwnerV2(),
727
+ maxPending: m.getMaxPendingIncgovPayoutsPerProfileV2(),
728
+ idleMs: m.getIncgovProfileIdleMsV2(),
729
+ stuckMs: m.getIncgovPayoutStuckMsV2(),
730
+ },
731
+ null,
732
+ 2,
733
+ ),
734
+ );
735
+ });
736
+ parent
737
+ .command("incgov-set-max-active-v2 <n>")
738
+ .description("Set max active")
739
+ .action(async (n) => {
740
+ (await L()).setMaxActiveIncgovProfilesPerOwnerV2(Number(n));
741
+ console.log("ok");
742
+ });
743
+ parent
744
+ .command("incgov-set-max-pending-v2 <n>")
745
+ .description("Set max pending")
746
+ .action(async (n) => {
747
+ (await L()).setMaxPendingIncgovPayoutsPerProfileV2(Number(n));
748
+ console.log("ok");
749
+ });
750
+ parent
751
+ .command("incgov-set-idle-ms-v2 <n>")
752
+ .description("Set idle threshold ms")
753
+ .action(async (n) => {
754
+ (await L()).setIncgovProfileIdleMsV2(Number(n));
755
+ console.log("ok");
756
+ });
757
+ parent
758
+ .command("incgov-set-stuck-ms-v2 <n>")
759
+ .description("Set stuck threshold ms")
760
+ .action(async (n) => {
761
+ (await L()).setIncgovPayoutStuckMsV2(Number(n));
762
+ console.log("ok");
763
+ });
764
+ parent
765
+ .command("incgov-register-v2 <id> <owner>")
766
+ .description("Register V2 profile")
767
+ .option("--token <v>", "token")
768
+ .action(async (id, owner, o) => {
769
+ const m = await L();
770
+ console.log(
771
+ JSON.stringify(
772
+ m.registerIncgovProfileV2({ id, owner, token: o.token }),
773
+ null,
774
+ 2,
775
+ ),
776
+ );
777
+ });
778
+ parent
779
+ .command("incgov-activate-v2 <id>")
780
+ .description("Activate profile")
781
+ .action(async (id) => {
782
+ console.log(
783
+ JSON.stringify((await L()).activateIncgovProfileV2(id), null, 2),
784
+ );
785
+ });
786
+ parent
787
+ .command("incgov-pause-v2 <id>")
788
+ .description("Pause profile")
789
+ .action(async (id) => {
790
+ console.log(
791
+ JSON.stringify((await L()).pauseIncgovProfileV2(id), null, 2),
792
+ );
793
+ });
794
+ parent
795
+ .command("incgov-archive-v2 <id>")
796
+ .description("Archive profile")
797
+ .action(async (id) => {
798
+ console.log(
799
+ JSON.stringify((await L()).archiveIncgovProfileV2(id), null, 2),
800
+ );
801
+ });
802
+ parent
803
+ .command("incgov-touch-v2 <id>")
804
+ .description("Touch profile")
805
+ .action(async (id) => {
806
+ console.log(
807
+ JSON.stringify((await L()).touchIncgovProfileV2(id), null, 2),
808
+ );
809
+ });
810
+ parent
811
+ .command("incgov-get-v2 <id>")
812
+ .description("Get profile")
813
+ .action(async (id) => {
814
+ console.log(JSON.stringify((await L()).getIncgovProfileV2(id), null, 2));
815
+ });
816
+ parent
817
+ .command("incgov-list-v2")
818
+ .description("List profiles")
819
+ .action(async () => {
820
+ console.log(JSON.stringify((await L()).listIncgovProfilesV2(), null, 2));
821
+ });
822
+ parent
823
+ .command("incgov-create-payout-v2 <id> <profileId>")
824
+ .description("Create payout")
825
+ .option("--recipient <v>", "recipient")
826
+ .action(async (id, profileId, o) => {
827
+ const m = await L();
828
+ console.log(
829
+ JSON.stringify(
830
+ m.createIncgovPayoutV2({ id, profileId, recipient: o.recipient }),
831
+ null,
832
+ 2,
833
+ ),
834
+ );
835
+ });
836
+ parent
837
+ .command("incgov-processing-payout-v2 <id>")
838
+ .description("Mark payout as processing")
839
+ .action(async (id) => {
840
+ console.log(
841
+ JSON.stringify((await L()).processingIncgovPayoutV2(id), null, 2),
842
+ );
843
+ });
844
+ parent
845
+ .command("incgov-complete-payout-v2 <id>")
846
+ .description("Complete payout")
847
+ .action(async (id) => {
848
+ console.log(
849
+ JSON.stringify((await L()).completePayoutIncgovV2(id), null, 2),
850
+ );
851
+ });
852
+ parent
853
+ .command("incgov-fail-payout-v2 <id> [reason]")
854
+ .description("Fail payout")
855
+ .action(async (id, reason) => {
856
+ console.log(
857
+ JSON.stringify((await L()).failIncgovPayoutV2(id, reason), null, 2),
858
+ );
859
+ });
860
+ parent
861
+ .command("incgov-cancel-payout-v2 <id> [reason]")
862
+ .description("Cancel payout")
863
+ .action(async (id, reason) => {
864
+ console.log(
865
+ JSON.stringify((await L()).cancelIncgovPayoutV2(id, reason), null, 2),
866
+ );
867
+ });
868
+ parent
869
+ .command("incgov-get-payout-v2 <id>")
870
+ .description("Get payout")
871
+ .action(async (id) => {
872
+ console.log(JSON.stringify((await L()).getIncgovPayoutV2(id), null, 2));
873
+ });
874
+ parent
875
+ .command("incgov-list-payouts-v2")
876
+ .description("List payouts")
877
+ .action(async () => {
878
+ console.log(JSON.stringify((await L()).listIncgovPayoutsV2(), null, 2));
879
+ });
880
+ parent
881
+ .command("incgov-auto-pause-idle-v2")
882
+ .description("Auto-pause idle")
883
+ .action(async () => {
884
+ console.log(
885
+ JSON.stringify((await L()).autoPauseIdleIncgovProfilesV2(), null, 2),
886
+ );
887
+ });
888
+ parent
889
+ .command("incgov-auto-fail-stuck-v2")
890
+ .description("Auto-fail stuck payouts")
891
+ .action(async () => {
892
+ console.log(
893
+ JSON.stringify((await L()).autoFailStuckIncgovPayoutsV2(), null, 2),
894
+ );
895
+ });
896
+ parent
897
+ .command("incgov-gov-stats-v2")
898
+ .description("V2 gov stats")
899
+ .action(async () => {
900
+ console.log(
901
+ JSON.stringify((await L()).getTokenIncentiveGovStatsV2(), null, 2),
902
+ );
903
+ });
904
+ }
@@ -623,42 +623,178 @@ export function registerInferenceCommand(program) {
623
623
  _registerInferenceGovV2(inf);
624
624
  }
625
625
 
626
-
627
626
  import {
628
- INFERENCE_NODE_MATURITY_V2, INFERENCE_JOB_LIFECYCLE_V2,
629
- setMaxActiveInferenceNodesPerOperatorV2, setMaxPendingInferenceJobsPerNodeV2, setInferenceNodeIdleMsV2, setInferenceJobStuckMsV2,
630
- registerInferenceNodeV2, activateInferenceNodeV2, degradeInferenceNodeV2, decommissionInferenceNodeV2, touchInferenceNodeV2, getInferenceNodeV2, listInferenceNodesV2,
631
- createInferenceJobV2, startInferenceJobV2, completeInferenceJobV2, failInferenceJobV2, cancelInferenceJobV2, getInferenceJobV2, listInferenceJobsV2,
632
- autoDegradeIdleInferenceNodesV2, autoFailStuckInferenceJobsV2, getInferenceNetworkGovStatsV2,
627
+ INFERENCE_NODE_MATURITY_V2,
628
+ INFERENCE_JOB_LIFECYCLE_V2,
629
+ setMaxActiveInferenceNodesPerOperatorV2,
630
+ setMaxPendingInferenceJobsPerNodeV2,
631
+ setInferenceNodeIdleMsV2,
632
+ setInferenceJobStuckMsV2,
633
+ registerInferenceNodeV2,
634
+ activateInferenceNodeV2,
635
+ degradeInferenceNodeV2,
636
+ decommissionInferenceNodeV2,
637
+ touchInferenceNodeV2,
638
+ getInferenceNodeV2,
639
+ listInferenceNodesV2,
640
+ createInferenceJobV2,
641
+ startInferenceJobV2,
642
+ completeInferenceJobV2,
643
+ failInferenceJobV2,
644
+ cancelInferenceJobV2,
645
+ getInferenceJobV2,
646
+ listInferenceJobsV2,
647
+ autoDegradeIdleInferenceNodesV2,
648
+ autoFailStuckInferenceJobsV2,
649
+ getInferenceNetworkGovStatsV2,
633
650
  } from "../lib/inference-network.js";
634
651
 
635
652
  function _registerInferenceGovV2(parent) {
636
- parent.command("enums-v2").description("List Inference Network V2 enums").option("--json", "JSON").action((opts) => {
637
- const out = { nodeMaturity: INFERENCE_NODE_MATURITY_V2, jobLifecycle: INFERENCE_JOB_LIFECYCLE_V2 };
638
- if (opts.json) console.log(JSON.stringify(out, null, 2)); else console.log(out);
639
- });
640
- parent.command("config-set-v2").description("Set Inference V2 caps/thresholds").option("--max-active <n>", "max active nodes per operator").option("--max-pending <n>", "max pending jobs per node").option("--idle-ms <n>", "node idle ms").option("--stuck-ms <n>", "job stuck ms").action((opts) => {
641
- if (opts.maxActive) setMaxActiveInferenceNodesPerOperatorV2(parseInt(opts.maxActive, 10));
642
- if (opts.maxPending) setMaxPendingInferenceJobsPerNodeV2(parseInt(opts.maxPending, 10));
643
- if (opts.idleMs) setInferenceNodeIdleMsV2(parseInt(opts.idleMs, 10));
644
- if (opts.stuckMs) setInferenceJobStuckMsV2(parseInt(opts.stuckMs, 10));
645
- console.log("ok");
646
- });
647
- parent.command("register-node-v2 <id>").description("Register Inference V2 node").requiredOption("--operator <op>", "operator").option("--model <m>", "model").action((id, opts) => { console.log(registerInferenceNodeV2({ id, operator: opts.operator, model: opts.model })); });
648
- parent.command("activate-node-v2 <id>").description("Activate Inference V2 node").action((id) => { console.log(activateInferenceNodeV2(id)); });
649
- parent.command("degrade-node-v2 <id>").description("Degrade Inference V2 node").action((id) => { console.log(degradeInferenceNodeV2(id)); });
650
- parent.command("decommission-node-v2 <id>").description("Decommission Inference V2 node").action((id) => { console.log(decommissionInferenceNodeV2(id)); });
651
- parent.command("touch-node-v2 <id>").description("Touch Inference V2 node").action((id) => { console.log(touchInferenceNodeV2(id)); });
652
- parent.command("get-node-v2 <id>").description("Get Inference V2 node").action((id) => { console.log(getInferenceNodeV2(id)); });
653
- parent.command("list-nodes-v2").description("List Inference V2 nodes").action(() => { console.log(listInferenceNodesV2()); });
654
- parent.command("create-job-v2 <id>").description("Create Inference V2 job").requiredOption("--node-id <nid>", "node id").option("--prompt <p>", "prompt").action((id, opts) => { console.log(createInferenceJobV2({ id, nodeId: opts.nodeId, prompt: opts.prompt })); });
655
- parent.command("start-job-v2 <id>").description("Start Inference V2 job").action((id) => { console.log(startInferenceJobV2(id)); });
656
- parent.command("complete-job-v2 <id>").description("Complete Inference V2 job").action((id) => { console.log(completeInferenceJobV2(id)); });
657
- parent.command("fail-job-v2 <id>").description("Fail Inference V2 job").option("--reason <r>", "reason").action((id, opts) => { console.log(failInferenceJobV2(id, opts.reason)); });
658
- parent.command("cancel-job-v2 <id>").description("Cancel Inference V2 job").option("--reason <r>", "reason").action((id, opts) => { console.log(cancelInferenceJobV2(id, opts.reason)); });
659
- parent.command("get-job-v2 <id>").description("Get Inference V2 job").action((id) => { console.log(getInferenceJobV2(id)); });
660
- parent.command("list-jobs-v2").description("List Inference V2 jobs").action(() => { console.log(listInferenceJobsV2()); });
661
- parent.command("auto-degrade-nodes-v2").description("Auto-degrade idle Inference V2 nodes").action(() => { console.log(autoDegradeIdleInferenceNodesV2()); });
662
- parent.command("auto-fail-jobs-v2").description("Auto-fail stuck Inference V2 jobs").action(() => { console.log(autoFailStuckInferenceJobsV2()); });
663
- parent.command("gov-stats-v2").description("Inference V2 governance stats").option("--json", "JSON").action((opts) => { const s = getInferenceNetworkGovStatsV2(); if (opts.json) console.log(JSON.stringify(s, null, 2)); else console.log(s); });
653
+ parent
654
+ .command("enums-v2")
655
+ .description("List Inference Network V2 enums")
656
+ .option("--json", "JSON")
657
+ .action((opts) => {
658
+ const out = {
659
+ nodeMaturity: INFERENCE_NODE_MATURITY_V2,
660
+ jobLifecycle: INFERENCE_JOB_LIFECYCLE_V2,
661
+ };
662
+ if (opts.json) console.log(JSON.stringify(out, null, 2));
663
+ else console.log(out);
664
+ });
665
+ parent
666
+ .command("config-set-v2")
667
+ .description("Set Inference V2 caps/thresholds")
668
+ .option("--max-active <n>", "max active nodes per operator")
669
+ .option("--max-pending <n>", "max pending jobs per node")
670
+ .option("--idle-ms <n>", "node idle ms")
671
+ .option("--stuck-ms <n>", "job stuck ms")
672
+ .action((opts) => {
673
+ if (opts.maxActive)
674
+ setMaxActiveInferenceNodesPerOperatorV2(parseInt(opts.maxActive, 10));
675
+ if (opts.maxPending)
676
+ setMaxPendingInferenceJobsPerNodeV2(parseInt(opts.maxPending, 10));
677
+ if (opts.idleMs) setInferenceNodeIdleMsV2(parseInt(opts.idleMs, 10));
678
+ if (opts.stuckMs) setInferenceJobStuckMsV2(parseInt(opts.stuckMs, 10));
679
+ console.log("ok");
680
+ });
681
+ parent
682
+ .command("register-node-v2 <id>")
683
+ .description("Register Inference V2 node")
684
+ .requiredOption("--operator <op>", "operator")
685
+ .option("--model <m>", "model")
686
+ .action((id, opts) => {
687
+ console.log(
688
+ registerInferenceNodeV2({
689
+ id,
690
+ operator: opts.operator,
691
+ model: opts.model,
692
+ }),
693
+ );
694
+ });
695
+ parent
696
+ .command("activate-node-v2 <id>")
697
+ .description("Activate Inference V2 node")
698
+ .action((id) => {
699
+ console.log(activateInferenceNodeV2(id));
700
+ });
701
+ parent
702
+ .command("degrade-node-v2 <id>")
703
+ .description("Degrade Inference V2 node")
704
+ .action((id) => {
705
+ console.log(degradeInferenceNodeV2(id));
706
+ });
707
+ parent
708
+ .command("decommission-node-v2 <id>")
709
+ .description("Decommission Inference V2 node")
710
+ .action((id) => {
711
+ console.log(decommissionInferenceNodeV2(id));
712
+ });
713
+ parent
714
+ .command("touch-node-v2 <id>")
715
+ .description("Touch Inference V2 node")
716
+ .action((id) => {
717
+ console.log(touchInferenceNodeV2(id));
718
+ });
719
+ parent
720
+ .command("get-node-v2 <id>")
721
+ .description("Get Inference V2 node")
722
+ .action((id) => {
723
+ console.log(getInferenceNodeV2(id));
724
+ });
725
+ parent
726
+ .command("list-nodes-v2")
727
+ .description("List Inference V2 nodes")
728
+ .action(() => {
729
+ console.log(listInferenceNodesV2());
730
+ });
731
+ parent
732
+ .command("create-job-v2 <id>")
733
+ .description("Create Inference V2 job")
734
+ .requiredOption("--node-id <nid>", "node id")
735
+ .option("--prompt <p>", "prompt")
736
+ .action((id, opts) => {
737
+ console.log(
738
+ createInferenceJobV2({ id, nodeId: opts.nodeId, prompt: opts.prompt }),
739
+ );
740
+ });
741
+ parent
742
+ .command("start-job-v2 <id>")
743
+ .description("Start Inference V2 job")
744
+ .action((id) => {
745
+ console.log(startInferenceJobV2(id));
746
+ });
747
+ parent
748
+ .command("complete-job-v2 <id>")
749
+ .description("Complete Inference V2 job")
750
+ .action((id) => {
751
+ console.log(completeInferenceJobV2(id));
752
+ });
753
+ parent
754
+ .command("fail-job-v2 <id>")
755
+ .description("Fail Inference V2 job")
756
+ .option("--reason <r>", "reason")
757
+ .action((id, opts) => {
758
+ console.log(failInferenceJobV2(id, opts.reason));
759
+ });
760
+ parent
761
+ .command("cancel-job-v2 <id>")
762
+ .description("Cancel Inference V2 job")
763
+ .option("--reason <r>", "reason")
764
+ .action((id, opts) => {
765
+ console.log(cancelInferenceJobV2(id, opts.reason));
766
+ });
767
+ parent
768
+ .command("get-job-v2 <id>")
769
+ .description("Get Inference V2 job")
770
+ .action((id) => {
771
+ console.log(getInferenceJobV2(id));
772
+ });
773
+ parent
774
+ .command("list-jobs-v2")
775
+ .description("List Inference V2 jobs")
776
+ .action(() => {
777
+ console.log(listInferenceJobsV2());
778
+ });
779
+ parent
780
+ .command("auto-degrade-nodes-v2")
781
+ .description("Auto-degrade idle Inference V2 nodes")
782
+ .action(() => {
783
+ console.log(autoDegradeIdleInferenceNodesV2());
784
+ });
785
+ parent
786
+ .command("auto-fail-jobs-v2")
787
+ .description("Auto-fail stuck Inference V2 jobs")
788
+ .action(() => {
789
+ console.log(autoFailStuckInferenceJobsV2());
790
+ });
791
+ parent
792
+ .command("gov-stats-v2")
793
+ .description("Inference V2 governance stats")
794
+ .option("--json", "JSON")
795
+ .action((opts) => {
796
+ const s = getInferenceNetworkGovStatsV2();
797
+ if (opts.json) console.log(JSON.stringify(s, null, 2));
798
+ else console.log(s);
799
+ });
664
800
  }
@@ -603,3 +603,206 @@ export function registerInfraCommand(program) {
603
603
 
604
604
  program.addCommand(inf);
605
605
  }
606
+
607
+ // === Iter23 V2 governance overlay ===
608
+ export function registerDigovV2Commands(program) {
609
+ const parent = program.commands.find((c) => c.name() === "infra");
610
+ if (!parent) return;
611
+ const L = async () => await import("../lib/decentral-infra.js");
612
+ parent
613
+ .command("digov-enums-v2")
614
+ .description("Show V2 enums")
615
+ .action(async () => {
616
+ const m = await L();
617
+ console.log(
618
+ JSON.stringify(
619
+ {
620
+ profileMaturity: m.DIGOV_PROFILE_MATURITY_V2,
621
+ dealLifecycle: m.DIGOV_DEAL_LIFECYCLE_V2,
622
+ },
623
+ null,
624
+ 2,
625
+ ),
626
+ );
627
+ });
628
+ parent
629
+ .command("digov-config-v2")
630
+ .description("Show V2 config")
631
+ .action(async () => {
632
+ const m = await L();
633
+ console.log(
634
+ JSON.stringify(
635
+ {
636
+ maxActive: m.getMaxActiveDigovProfilesPerOwnerV2(),
637
+ maxPending: m.getMaxPendingDigovDealsPerProfileV2(),
638
+ idleMs: m.getDigovProfileIdleMsV2(),
639
+ stuckMs: m.getDigovDealStuckMsV2(),
640
+ },
641
+ null,
642
+ 2,
643
+ ),
644
+ );
645
+ });
646
+ parent
647
+ .command("digov-set-max-active-v2 <n>")
648
+ .description("Set max active")
649
+ .action(async (n) => {
650
+ (await L()).setMaxActiveDigovProfilesPerOwnerV2(Number(n));
651
+ console.log("ok");
652
+ });
653
+ parent
654
+ .command("digov-set-max-pending-v2 <n>")
655
+ .description("Set max pending")
656
+ .action(async (n) => {
657
+ (await L()).setMaxPendingDigovDealsPerProfileV2(Number(n));
658
+ console.log("ok");
659
+ });
660
+ parent
661
+ .command("digov-set-idle-ms-v2 <n>")
662
+ .description("Set idle threshold ms")
663
+ .action(async (n) => {
664
+ (await L()).setDigovProfileIdleMsV2(Number(n));
665
+ console.log("ok");
666
+ });
667
+ parent
668
+ .command("digov-set-stuck-ms-v2 <n>")
669
+ .description("Set stuck threshold ms")
670
+ .action(async (n) => {
671
+ (await L()).setDigovDealStuckMsV2(Number(n));
672
+ console.log("ok");
673
+ });
674
+ parent
675
+ .command("digov-register-v2 <id> <owner>")
676
+ .description("Register V2 profile")
677
+ .option("--region <v>", "region")
678
+ .action(async (id, owner, o) => {
679
+ const m = await L();
680
+ console.log(
681
+ JSON.stringify(
682
+ m.registerDigovProfileV2({ id, owner, region: o.region }),
683
+ null,
684
+ 2,
685
+ ),
686
+ );
687
+ });
688
+ parent
689
+ .command("digov-activate-v2 <id>")
690
+ .description("Activate profile")
691
+ .action(async (id) => {
692
+ console.log(
693
+ JSON.stringify((await L()).activateDigovProfileV2(id), null, 2),
694
+ );
695
+ });
696
+ parent
697
+ .command("digov-stale-v2 <id>")
698
+ .description("Stale profile")
699
+ .action(async (id) => {
700
+ console.log(JSON.stringify((await L()).staleDigovProfileV2(id), null, 2));
701
+ });
702
+ parent
703
+ .command("digov-archive-v2 <id>")
704
+ .description("Archive profile")
705
+ .action(async (id) => {
706
+ console.log(
707
+ JSON.stringify((await L()).archiveDigovProfileV2(id), null, 2),
708
+ );
709
+ });
710
+ parent
711
+ .command("digov-touch-v2 <id>")
712
+ .description("Touch profile")
713
+ .action(async (id) => {
714
+ console.log(JSON.stringify((await L()).touchDigovProfileV2(id), null, 2));
715
+ });
716
+ parent
717
+ .command("digov-get-v2 <id>")
718
+ .description("Get profile")
719
+ .action(async (id) => {
720
+ console.log(JSON.stringify((await L()).getDigovProfileV2(id), null, 2));
721
+ });
722
+ parent
723
+ .command("digov-list-v2")
724
+ .description("List profiles")
725
+ .action(async () => {
726
+ console.log(JSON.stringify((await L()).listDigovProfilesV2(), null, 2));
727
+ });
728
+ parent
729
+ .command("digov-create-deal-v2 <id> <profileId>")
730
+ .description("Create deal")
731
+ .option("--provider <v>", "provider")
732
+ .action(async (id, profileId, o) => {
733
+ const m = await L();
734
+ console.log(
735
+ JSON.stringify(
736
+ m.createDigovDealV2({ id, profileId, provider: o.provider }),
737
+ null,
738
+ 2,
739
+ ),
740
+ );
741
+ });
742
+ parent
743
+ .command("digov-negotiating-deal-v2 <id>")
744
+ .description("Mark deal as negotiating")
745
+ .action(async (id) => {
746
+ console.log(
747
+ JSON.stringify((await L()).negotiatingDigovDealV2(id), null, 2),
748
+ );
749
+ });
750
+ parent
751
+ .command("digov-complete-deal-v2 <id>")
752
+ .description("Complete deal")
753
+ .action(async (id) => {
754
+ console.log(JSON.stringify((await L()).completeDealDigovV2(id), null, 2));
755
+ });
756
+ parent
757
+ .command("digov-fail-deal-v2 <id> [reason]")
758
+ .description("Fail deal")
759
+ .action(async (id, reason) => {
760
+ console.log(
761
+ JSON.stringify((await L()).failDigovDealV2(id, reason), null, 2),
762
+ );
763
+ });
764
+ parent
765
+ .command("digov-cancel-deal-v2 <id> [reason]")
766
+ .description("Cancel deal")
767
+ .action(async (id, reason) => {
768
+ console.log(
769
+ JSON.stringify((await L()).cancelDigovDealV2(id, reason), null, 2),
770
+ );
771
+ });
772
+ parent
773
+ .command("digov-get-deal-v2 <id>")
774
+ .description("Get deal")
775
+ .action(async (id) => {
776
+ console.log(JSON.stringify((await L()).getDigovDealV2(id), null, 2));
777
+ });
778
+ parent
779
+ .command("digov-list-deals-v2")
780
+ .description("List deals")
781
+ .action(async () => {
782
+ console.log(JSON.stringify((await L()).listDigovDealsV2(), null, 2));
783
+ });
784
+ parent
785
+ .command("digov-auto-stale-idle-v2")
786
+ .description("Auto-stale idle")
787
+ .action(async () => {
788
+ console.log(
789
+ JSON.stringify((await L()).autoStaleIdleDigovProfilesV2(), null, 2),
790
+ );
791
+ });
792
+ parent
793
+ .command("digov-auto-fail-stuck-v2")
794
+ .description("Auto-fail stuck deals")
795
+ .action(async () => {
796
+ console.log(
797
+ JSON.stringify((await L()).autoFailStuckDigovDealsV2(), null, 2),
798
+ );
799
+ });
800
+ parent
801
+ .command("digov-gov-stats-v2")
802
+ .description("V2 gov stats")
803
+ .action(async () => {
804
+ console.log(
805
+ JSON.stringify((await L()).getDecentralInfraGovStatsV2(), null, 2),
806
+ );
807
+ });
808
+ }