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
@@ -718,54 +718,208 @@ export function registerHmemoryCommand(program) {
718
718
  function _registerHmemoryV2Commands(parent) {
719
719
  const L = async () => await import("../lib/hierarchical-memory.js");
720
720
 
721
- parent.command("enums-v2").description("Show V2 enums (tier maturity + promotion lifecycle)")
722
- .action(async () => { const m = await L(); console.log(JSON.stringify({ tierMaturity: m.HMEM_TIER_MATURITY_V2, promotionLifecycle: m.HMEM_PROMOTION_LIFECYCLE_V2 }, null, 2)); });
723
- parent.command("config-v2").description("Show V2 config thresholds")
724
- .action(async () => { const m = await L(); console.log(JSON.stringify({ maxActiveHmemTiersPerOwner: m.getMaxActiveHmemTiersPerOwnerV2(), maxPendingHmemPromotionsPerTier: m.getMaxPendingHmemPromotionsPerTierV2(), hmemTierIdleMs: m.getHmemTierIdleMsV2(), hmemPromotionStuckMs: m.getHmemPromotionStuckMsV2() }, null, 2)); });
725
- parent.command("set-max-active-tiers-v2 <n>").description("Set max active tiers per owner")
726
- .action(async (n) => { const m = await L(); m.setMaxActiveHmemTiersPerOwnerV2(Number(n)); console.log("ok"); });
727
- parent.command("set-max-pending-promotions-v2 <n>").description("Set max pending promotions per tier")
728
- .action(async (n) => { const m = await L(); m.setMaxPendingHmemPromotionsPerTierV2(Number(n)); console.log("ok"); });
729
- parent.command("set-tier-idle-ms-v2 <n>").description("Set tier idle threshold (ms)")
730
- .action(async (n) => { const m = await L(); m.setHmemTierIdleMsV2(Number(n)); console.log("ok"); });
731
- parent.command("set-promotion-stuck-ms-v2 <n>").description("Set promotion stuck threshold (ms)")
732
- .action(async (n) => { const m = await L(); m.setHmemPromotionStuckMsV2(Number(n)); console.log("ok"); });
733
-
734
- parent.command("register-tier-v2 <id> <owner>").description("Register V2 memory tier")
735
- .option("--level <l>", "Tier level", "short-term").action(async (id, owner, o) => { const m = await L(); console.log(JSON.stringify(m.registerHmemTierV2({ id, owner, level: o.level }), null, 2)); });
736
- parent.command("activate-tier-v2 <id>").description("Activate tier")
737
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.activateHmemTierV2(id), null, 2)); });
738
- parent.command("dormant-tier-v2 <id>").description("Mark tier dormant")
739
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.dormantHmemTierV2(id), null, 2)); });
740
- parent.command("retire-tier-v2 <id>").description("Retire tier (terminal)")
741
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.retireHmemTierV2(id), null, 2)); });
742
- parent.command("touch-tier-v2 <id>").description("Touch tier lastTouchedAt")
743
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.touchHmemTierV2(id), null, 2)); });
744
- parent.command("get-tier-v2 <id>").description("Get V2 tier")
745
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.getHmemTierV2(id), null, 2)); });
746
- parent.command("list-tiers-v2").description("List all V2 tiers")
747
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.listHmemTiersV2(), null, 2)); });
748
-
749
- parent.command("create-promotion-v2 <id> <tierId>").description("Create V2 promotion (queued)")
750
- .option("--item-key <k>", "Item key", "").action(async (id, tierId, o) => { const m = await L(); console.log(JSON.stringify(m.createHmemPromotionV2({ id, tierId, itemKey: o.itemKey }), null, 2)); });
751
- parent.command("start-promotion-v2 <id>").description("Start promotion (queued→promoting)")
752
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.startHmemPromotionV2(id), null, 2)); });
753
- parent.command("complete-promotion-v2 <id>").description("Complete promotion (promoting→promoted)")
754
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.completeHmemPromotionV2(id), null, 2)); });
755
- parent.command("fail-promotion-v2 <id> [reason]").description("Fail promotion")
756
- .action(async (id, reason) => { const m = await L(); console.log(JSON.stringify(m.failHmemPromotionV2(id, reason), null, 2)); });
757
- parent.command("cancel-promotion-v2 <id> [reason]").description("Cancel promotion")
758
- .action(async (id, reason) => { const m = await L(); console.log(JSON.stringify(m.cancelHmemPromotionV2(id, reason), null, 2)); });
759
- parent.command("get-promotion-v2 <id>").description("Get V2 promotion")
760
- .action(async (id) => { const m = await L(); console.log(JSON.stringify(m.getHmemPromotionV2(id), null, 2)); });
761
- parent.command("list-promotions-v2").description("List all V2 promotions")
762
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.listHmemPromotionsV2(), null, 2)); });
763
-
764
- parent.command("auto-dormant-idle-v2").description("Auto-dormant idle active tiers")
765
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.autoDormantIdleHmemTiersV2(), null, 2)); });
766
- parent.command("auto-fail-stuck-v2").description("Auto-fail stuck promoting promotions")
767
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.autoFailStuckHmemPromotionsV2(), null, 2)); });
768
-
769
- parent.command("gov-stats-v2").description("V2 governance aggregate stats")
770
- .action(async () => { const m = await L(); console.log(JSON.stringify(m.getHierarchicalMemoryGovStatsV2(), null, 2)); });
721
+ parent
722
+ .command("enums-v2")
723
+ .description("Show V2 enums (tier maturity + promotion lifecycle)")
724
+ .action(async () => {
725
+ const m = await L();
726
+ console.log(
727
+ JSON.stringify(
728
+ {
729
+ tierMaturity: m.HMEM_TIER_MATURITY_V2,
730
+ promotionLifecycle: m.HMEM_PROMOTION_LIFECYCLE_V2,
731
+ },
732
+ null,
733
+ 2,
734
+ ),
735
+ );
736
+ });
737
+ parent
738
+ .command("config-v2")
739
+ .description("Show V2 config thresholds")
740
+ .action(async () => {
741
+ const m = await L();
742
+ console.log(
743
+ JSON.stringify(
744
+ {
745
+ maxActiveHmemTiersPerOwner: m.getMaxActiveHmemTiersPerOwnerV2(),
746
+ maxPendingHmemPromotionsPerTier:
747
+ m.getMaxPendingHmemPromotionsPerTierV2(),
748
+ hmemTierIdleMs: m.getHmemTierIdleMsV2(),
749
+ hmemPromotionStuckMs: m.getHmemPromotionStuckMsV2(),
750
+ },
751
+ null,
752
+ 2,
753
+ ),
754
+ );
755
+ });
756
+ parent
757
+ .command("set-max-active-tiers-v2 <n>")
758
+ .description("Set max active tiers per owner")
759
+ .action(async (n) => {
760
+ const m = await L();
761
+ m.setMaxActiveHmemTiersPerOwnerV2(Number(n));
762
+ console.log("ok");
763
+ });
764
+ parent
765
+ .command("set-max-pending-promotions-v2 <n>")
766
+ .description("Set max pending promotions per tier")
767
+ .action(async (n) => {
768
+ const m = await L();
769
+ m.setMaxPendingHmemPromotionsPerTierV2(Number(n));
770
+ console.log("ok");
771
+ });
772
+ parent
773
+ .command("set-tier-idle-ms-v2 <n>")
774
+ .description("Set tier idle threshold (ms)")
775
+ .action(async (n) => {
776
+ const m = await L();
777
+ m.setHmemTierIdleMsV2(Number(n));
778
+ console.log("ok");
779
+ });
780
+ parent
781
+ .command("set-promotion-stuck-ms-v2 <n>")
782
+ .description("Set promotion stuck threshold (ms)")
783
+ .action(async (n) => {
784
+ const m = await L();
785
+ m.setHmemPromotionStuckMsV2(Number(n));
786
+ console.log("ok");
787
+ });
788
+
789
+ parent
790
+ .command("register-tier-v2 <id> <owner>")
791
+ .description("Register V2 memory tier")
792
+ .option("--level <l>", "Tier level", "short-term")
793
+ .action(async (id, owner, o) => {
794
+ const m = await L();
795
+ console.log(
796
+ JSON.stringify(
797
+ m.registerHmemTierV2({ id, owner, level: o.level }),
798
+ null,
799
+ 2,
800
+ ),
801
+ );
802
+ });
803
+ parent
804
+ .command("activate-tier-v2 <id>")
805
+ .description("Activate tier")
806
+ .action(async (id) => {
807
+ const m = await L();
808
+ console.log(JSON.stringify(m.activateHmemTierV2(id), null, 2));
809
+ });
810
+ parent
811
+ .command("dormant-tier-v2 <id>")
812
+ .description("Mark tier dormant")
813
+ .action(async (id) => {
814
+ const m = await L();
815
+ console.log(JSON.stringify(m.dormantHmemTierV2(id), null, 2));
816
+ });
817
+ parent
818
+ .command("retire-tier-v2 <id>")
819
+ .description("Retire tier (terminal)")
820
+ .action(async (id) => {
821
+ const m = await L();
822
+ console.log(JSON.stringify(m.retireHmemTierV2(id), null, 2));
823
+ });
824
+ parent
825
+ .command("touch-tier-v2 <id>")
826
+ .description("Touch tier lastTouchedAt")
827
+ .action(async (id) => {
828
+ const m = await L();
829
+ console.log(JSON.stringify(m.touchHmemTierV2(id), null, 2));
830
+ });
831
+ parent
832
+ .command("get-tier-v2 <id>")
833
+ .description("Get V2 tier")
834
+ .action(async (id) => {
835
+ const m = await L();
836
+ console.log(JSON.stringify(m.getHmemTierV2(id), null, 2));
837
+ });
838
+ parent
839
+ .command("list-tiers-v2")
840
+ .description("List all V2 tiers")
841
+ .action(async () => {
842
+ const m = await L();
843
+ console.log(JSON.stringify(m.listHmemTiersV2(), null, 2));
844
+ });
845
+
846
+ parent
847
+ .command("create-promotion-v2 <id> <tierId>")
848
+ .description("Create V2 promotion (queued)")
849
+ .option("--item-key <k>", "Item key", "")
850
+ .action(async (id, tierId, o) => {
851
+ const m = await L();
852
+ console.log(
853
+ JSON.stringify(
854
+ m.createHmemPromotionV2({ id, tierId, itemKey: o.itemKey }),
855
+ null,
856
+ 2,
857
+ ),
858
+ );
859
+ });
860
+ parent
861
+ .command("start-promotion-v2 <id>")
862
+ .description("Start promotion (queued→promoting)")
863
+ .action(async (id) => {
864
+ const m = await L();
865
+ console.log(JSON.stringify(m.startHmemPromotionV2(id), null, 2));
866
+ });
867
+ parent
868
+ .command("complete-promotion-v2 <id>")
869
+ .description("Complete promotion (promoting→promoted)")
870
+ .action(async (id) => {
871
+ const m = await L();
872
+ console.log(JSON.stringify(m.completeHmemPromotionV2(id), null, 2));
873
+ });
874
+ parent
875
+ .command("fail-promotion-v2 <id> [reason]")
876
+ .description("Fail promotion")
877
+ .action(async (id, reason) => {
878
+ const m = await L();
879
+ console.log(JSON.stringify(m.failHmemPromotionV2(id, reason), null, 2));
880
+ });
881
+ parent
882
+ .command("cancel-promotion-v2 <id> [reason]")
883
+ .description("Cancel promotion")
884
+ .action(async (id, reason) => {
885
+ const m = await L();
886
+ console.log(JSON.stringify(m.cancelHmemPromotionV2(id, reason), null, 2));
887
+ });
888
+ parent
889
+ .command("get-promotion-v2 <id>")
890
+ .description("Get V2 promotion")
891
+ .action(async (id) => {
892
+ const m = await L();
893
+ console.log(JSON.stringify(m.getHmemPromotionV2(id), null, 2));
894
+ });
895
+ parent
896
+ .command("list-promotions-v2")
897
+ .description("List all V2 promotions")
898
+ .action(async () => {
899
+ const m = await L();
900
+ console.log(JSON.stringify(m.listHmemPromotionsV2(), null, 2));
901
+ });
902
+
903
+ parent
904
+ .command("auto-dormant-idle-v2")
905
+ .description("Auto-dormant idle active tiers")
906
+ .action(async () => {
907
+ const m = await L();
908
+ console.log(JSON.stringify(m.autoDormantIdleHmemTiersV2(), null, 2));
909
+ });
910
+ parent
911
+ .command("auto-fail-stuck-v2")
912
+ .description("Auto-fail stuck promoting promotions")
913
+ .action(async () => {
914
+ const m = await L();
915
+ console.log(JSON.stringify(m.autoFailStuckHmemPromotionsV2(), null, 2));
916
+ });
917
+
918
+ parent
919
+ .command("gov-stats-v2")
920
+ .description("V2 governance aggregate stats")
921
+ .action(async () => {
922
+ const m = await L();
923
+ console.log(JSON.stringify(m.getHierarchicalMemoryGovStatsV2(), null, 2));
924
+ });
771
925
  }
@@ -483,3 +483,212 @@ export function registerHookCommand(program) {
483
483
  console.log(JSON.stringify({ ok: true }, null, 2));
484
484
  });
485
485
  }
486
+
487
+ // === Iter21 V2 governance overlay ===
488
+ export function registerHookgovV2Commands(program) {
489
+ const parent = program.commands.find((c) => c.name() === "hook");
490
+ if (!parent) return;
491
+ const L = async () => await import("../lib/hook-manager.js");
492
+ parent
493
+ .command("hookgov-enums-v2")
494
+ .description("Show V2 enums")
495
+ .action(async () => {
496
+ const m = await L();
497
+ console.log(
498
+ JSON.stringify(
499
+ {
500
+ profileMaturity: m.HOOKGOV_PROFILE_MATURITY_V2,
501
+ triggerLifecycle: m.HOOKGOV_TRIGGER_LIFECYCLE_V2,
502
+ },
503
+ null,
504
+ 2,
505
+ ),
506
+ );
507
+ });
508
+ parent
509
+ .command("hookgov-config-v2")
510
+ .description("Show V2 config")
511
+ .action(async () => {
512
+ const m = await L();
513
+ console.log(
514
+ JSON.stringify(
515
+ {
516
+ maxActive: m.getMaxActiveHookgovProfilesPerOwnerV2(),
517
+ maxPending: m.getMaxPendingHookgovTriggersPerProfileV2(),
518
+ idleMs: m.getHookgovProfileIdleMsV2(),
519
+ stuckMs: m.getHookgovTriggerStuckMsV2(),
520
+ },
521
+ null,
522
+ 2,
523
+ ),
524
+ );
525
+ });
526
+ parent
527
+ .command("hookgov-set-max-active-v2 <n>")
528
+ .description("Set max active")
529
+ .action(async (n) => {
530
+ (await L()).setMaxActiveHookgovProfilesPerOwnerV2(Number(n));
531
+ console.log("ok");
532
+ });
533
+ parent
534
+ .command("hookgov-set-max-pending-v2 <n>")
535
+ .description("Set max pending")
536
+ .action(async (n) => {
537
+ (await L()).setMaxPendingHookgovTriggersPerProfileV2(Number(n));
538
+ console.log("ok");
539
+ });
540
+ parent
541
+ .command("hookgov-set-idle-ms-v2 <n>")
542
+ .description("Set idle threshold ms")
543
+ .action(async (n) => {
544
+ (await L()).setHookgovProfileIdleMsV2(Number(n));
545
+ console.log("ok");
546
+ });
547
+ parent
548
+ .command("hookgov-set-stuck-ms-v2 <n>")
549
+ .description("Set stuck threshold ms")
550
+ .action(async (n) => {
551
+ (await L()).setHookgovTriggerStuckMsV2(Number(n));
552
+ console.log("ok");
553
+ });
554
+ parent
555
+ .command("hookgov-register-v2 <id> <owner>")
556
+ .description("Register V2 profile")
557
+ .option("--event <v>", "event")
558
+ .action(async (id, owner, o) => {
559
+ const m = await L();
560
+ console.log(
561
+ JSON.stringify(
562
+ m.registerHookgovProfileV2({ id, owner, event: o.event }),
563
+ null,
564
+ 2,
565
+ ),
566
+ );
567
+ });
568
+ parent
569
+ .command("hookgov-activate-v2 <id>")
570
+ .description("Activate profile")
571
+ .action(async (id) => {
572
+ console.log(
573
+ JSON.stringify((await L()).activateHookgovProfileV2(id), null, 2),
574
+ );
575
+ });
576
+ parent
577
+ .command("hookgov-disable-v2 <id>")
578
+ .description("Disable profile")
579
+ .action(async (id) => {
580
+ console.log(
581
+ JSON.stringify((await L()).disableHookgovProfileV2(id), null, 2),
582
+ );
583
+ });
584
+ parent
585
+ .command("hookgov-archive-v2 <id>")
586
+ .description("Archive profile")
587
+ .action(async (id) => {
588
+ console.log(
589
+ JSON.stringify((await L()).archiveHookgovProfileV2(id), null, 2),
590
+ );
591
+ });
592
+ parent
593
+ .command("hookgov-touch-v2 <id>")
594
+ .description("Touch profile")
595
+ .action(async (id) => {
596
+ console.log(
597
+ JSON.stringify((await L()).touchHookgovProfileV2(id), null, 2),
598
+ );
599
+ });
600
+ parent
601
+ .command("hookgov-get-v2 <id>")
602
+ .description("Get profile")
603
+ .action(async (id) => {
604
+ console.log(JSON.stringify((await L()).getHookgovProfileV2(id), null, 2));
605
+ });
606
+ parent
607
+ .command("hookgov-list-v2")
608
+ .description("List profiles")
609
+ .action(async () => {
610
+ console.log(JSON.stringify((await L()).listHookgovProfilesV2(), null, 2));
611
+ });
612
+ parent
613
+ .command("hookgov-create-trigger-v2 <id> <profileId>")
614
+ .description("Create trigger")
615
+ .option("--payload <v>", "payload")
616
+ .action(async (id, profileId, o) => {
617
+ const m = await L();
618
+ console.log(
619
+ JSON.stringify(
620
+ m.createHookgovTriggerV2({ id, profileId, payload: o.payload }),
621
+ null,
622
+ 2,
623
+ ),
624
+ );
625
+ });
626
+ parent
627
+ .command("hookgov-firing-trigger-v2 <id>")
628
+ .description("Mark trigger as firing")
629
+ .action(async (id) => {
630
+ console.log(
631
+ JSON.stringify((await L()).firingHookgovTriggerV2(id), null, 2),
632
+ );
633
+ });
634
+ parent
635
+ .command("hookgov-complete-trigger-v2 <id>")
636
+ .description("Complete trigger")
637
+ .action(async (id) => {
638
+ console.log(
639
+ JSON.stringify((await L()).completeTriggerHookgovV2(id), null, 2),
640
+ );
641
+ });
642
+ parent
643
+ .command("hookgov-fail-trigger-v2 <id> [reason]")
644
+ .description("Fail trigger")
645
+ .action(async (id, reason) => {
646
+ console.log(
647
+ JSON.stringify((await L()).failHookgovTriggerV2(id, reason), null, 2),
648
+ );
649
+ });
650
+ parent
651
+ .command("hookgov-cancel-trigger-v2 <id> [reason]")
652
+ .description("Cancel trigger")
653
+ .action(async (id, reason) => {
654
+ console.log(
655
+ JSON.stringify((await L()).cancelHookgovTriggerV2(id, reason), null, 2),
656
+ );
657
+ });
658
+ parent
659
+ .command("hookgov-get-trigger-v2 <id>")
660
+ .description("Get trigger")
661
+ .action(async (id) => {
662
+ console.log(JSON.stringify((await L()).getHookgovTriggerV2(id), null, 2));
663
+ });
664
+ parent
665
+ .command("hookgov-list-triggers-v2")
666
+ .description("List triggers")
667
+ .action(async () => {
668
+ console.log(JSON.stringify((await L()).listHookgovTriggersV2(), null, 2));
669
+ });
670
+ parent
671
+ .command("hookgov-auto-disable-idle-v2")
672
+ .description("Auto-disable idle")
673
+ .action(async () => {
674
+ console.log(
675
+ JSON.stringify((await L()).autoDisableIdleHookgovProfilesV2(), null, 2),
676
+ );
677
+ });
678
+ parent
679
+ .command("hookgov-auto-fail-stuck-v2")
680
+ .description("Auto-fail stuck triggers")
681
+ .action(async () => {
682
+ console.log(
683
+ JSON.stringify((await L()).autoFailStuckHookgovTriggersV2(), null, 2),
684
+ );
685
+ });
686
+ parent
687
+ .command("hookgov-gov-stats-v2")
688
+ .description("V2 gov stats")
689
+ .action(async () => {
690
+ console.log(
691
+ JSON.stringify((await L()).getHookManagerGovStatsV2(), null, 2),
692
+ );
693
+ });
694
+ }
@@ -509,3 +509,212 @@ export function registerImportCommand(program) {
509
509
  .description("Auto-fail stuck V2 import jobs")
510
510
  .action(() => out(autoFailStuckImportJobsV2()));
511
511
  }
512
+
513
+ // === Iter22 V2 governance overlay ===
514
+ export function registerKimpgovV2Commands(program) {
515
+ const parent = program.commands.find((c) => c.name() === "import");
516
+ if (!parent) return;
517
+ const L = async () => await import("../lib/knowledge-importer.js");
518
+ parent
519
+ .command("kimpgov-enums-v2")
520
+ .description("Show V2 enums")
521
+ .action(async () => {
522
+ const m = await L();
523
+ console.log(
524
+ JSON.stringify(
525
+ {
526
+ profileMaturity: m.KIMPGOV_PROFILE_MATURITY_V2,
527
+ importLifecycle: m.KIMPGOV_IMPORT_LIFECYCLE_V2,
528
+ },
529
+ null,
530
+ 2,
531
+ ),
532
+ );
533
+ });
534
+ parent
535
+ .command("kimpgov-config-v2")
536
+ .description("Show V2 config")
537
+ .action(async () => {
538
+ const m = await L();
539
+ console.log(
540
+ JSON.stringify(
541
+ {
542
+ maxActive: m.getMaxActiveKimpgovProfilesPerOwnerV2(),
543
+ maxPending: m.getMaxPendingKimpgovImportsPerProfileV2(),
544
+ idleMs: m.getKimpgovProfileIdleMsV2(),
545
+ stuckMs: m.getKimpgovImportStuckMsV2(),
546
+ },
547
+ null,
548
+ 2,
549
+ ),
550
+ );
551
+ });
552
+ parent
553
+ .command("kimpgov-set-max-active-v2 <n>")
554
+ .description("Set max active")
555
+ .action(async (n) => {
556
+ (await L()).setMaxActiveKimpgovProfilesPerOwnerV2(Number(n));
557
+ console.log("ok");
558
+ });
559
+ parent
560
+ .command("kimpgov-set-max-pending-v2 <n>")
561
+ .description("Set max pending")
562
+ .action(async (n) => {
563
+ (await L()).setMaxPendingKimpgovImportsPerProfileV2(Number(n));
564
+ console.log("ok");
565
+ });
566
+ parent
567
+ .command("kimpgov-set-idle-ms-v2 <n>")
568
+ .description("Set idle threshold ms")
569
+ .action(async (n) => {
570
+ (await L()).setKimpgovProfileIdleMsV2(Number(n));
571
+ console.log("ok");
572
+ });
573
+ parent
574
+ .command("kimpgov-set-stuck-ms-v2 <n>")
575
+ .description("Set stuck threshold ms")
576
+ .action(async (n) => {
577
+ (await L()).setKimpgovImportStuckMsV2(Number(n));
578
+ console.log("ok");
579
+ });
580
+ parent
581
+ .command("kimpgov-register-v2 <id> <owner>")
582
+ .description("Register V2 profile")
583
+ .option("--format <v>", "format")
584
+ .action(async (id, owner, o) => {
585
+ const m = await L();
586
+ console.log(
587
+ JSON.stringify(
588
+ m.registerKimpgovProfileV2({ id, owner, format: o.format }),
589
+ null,
590
+ 2,
591
+ ),
592
+ );
593
+ });
594
+ parent
595
+ .command("kimpgov-activate-v2 <id>")
596
+ .description("Activate profile")
597
+ .action(async (id) => {
598
+ console.log(
599
+ JSON.stringify((await L()).activateKimpgovProfileV2(id), null, 2),
600
+ );
601
+ });
602
+ parent
603
+ .command("kimpgov-stale-v2 <id>")
604
+ .description("Stale profile")
605
+ .action(async (id) => {
606
+ console.log(
607
+ JSON.stringify((await L()).staleKimpgovProfileV2(id), null, 2),
608
+ );
609
+ });
610
+ parent
611
+ .command("kimpgov-archive-v2 <id>")
612
+ .description("Archive profile")
613
+ .action(async (id) => {
614
+ console.log(
615
+ JSON.stringify((await L()).archiveKimpgovProfileV2(id), null, 2),
616
+ );
617
+ });
618
+ parent
619
+ .command("kimpgov-touch-v2 <id>")
620
+ .description("Touch profile")
621
+ .action(async (id) => {
622
+ console.log(
623
+ JSON.stringify((await L()).touchKimpgovProfileV2(id), null, 2),
624
+ );
625
+ });
626
+ parent
627
+ .command("kimpgov-get-v2 <id>")
628
+ .description("Get profile")
629
+ .action(async (id) => {
630
+ console.log(JSON.stringify((await L()).getKimpgovProfileV2(id), null, 2));
631
+ });
632
+ parent
633
+ .command("kimpgov-list-v2")
634
+ .description("List profiles")
635
+ .action(async () => {
636
+ console.log(JSON.stringify((await L()).listKimpgovProfilesV2(), null, 2));
637
+ });
638
+ parent
639
+ .command("kimpgov-create-import-v2 <id> <profileId>")
640
+ .description("Create import")
641
+ .option("--source <v>", "source")
642
+ .action(async (id, profileId, o) => {
643
+ const m = await L();
644
+ console.log(
645
+ JSON.stringify(
646
+ m.createKimpgovImportV2({ id, profileId, source: o.source }),
647
+ null,
648
+ 2,
649
+ ),
650
+ );
651
+ });
652
+ parent
653
+ .command("kimpgov-importing-import-v2 <id>")
654
+ .description("Mark import as importing")
655
+ .action(async (id) => {
656
+ console.log(
657
+ JSON.stringify((await L()).importingKimpgovImportV2(id), null, 2),
658
+ );
659
+ });
660
+ parent
661
+ .command("kimpgov-complete-import-v2 <id>")
662
+ .description("Complete import")
663
+ .action(async (id) => {
664
+ console.log(
665
+ JSON.stringify((await L()).completeImportKimpgovV2(id), null, 2),
666
+ );
667
+ });
668
+ parent
669
+ .command("kimpgov-fail-import-v2 <id> [reason]")
670
+ .description("Fail import")
671
+ .action(async (id, reason) => {
672
+ console.log(
673
+ JSON.stringify((await L()).failKimpgovImportV2(id, reason), null, 2),
674
+ );
675
+ });
676
+ parent
677
+ .command("kimpgov-cancel-import-v2 <id> [reason]")
678
+ .description("Cancel import")
679
+ .action(async (id, reason) => {
680
+ console.log(
681
+ JSON.stringify((await L()).cancelKimpgovImportV2(id, reason), null, 2),
682
+ );
683
+ });
684
+ parent
685
+ .command("kimpgov-get-import-v2 <id>")
686
+ .description("Get import")
687
+ .action(async (id) => {
688
+ console.log(JSON.stringify((await L()).getKimpgovImportV2(id), null, 2));
689
+ });
690
+ parent
691
+ .command("kimpgov-list-imports-v2")
692
+ .description("List imports")
693
+ .action(async () => {
694
+ console.log(JSON.stringify((await L()).listKimpgovImportsV2(), null, 2));
695
+ });
696
+ parent
697
+ .command("kimpgov-auto-stale-idle-v2")
698
+ .description("Auto-stale idle")
699
+ .action(async () => {
700
+ console.log(
701
+ JSON.stringify((await L()).autoStaleIdleKimpgovProfilesV2(), null, 2),
702
+ );
703
+ });
704
+ parent
705
+ .command("kimpgov-auto-fail-stuck-v2")
706
+ .description("Auto-fail stuck imports")
707
+ .action(async () => {
708
+ console.log(
709
+ JSON.stringify((await L()).autoFailStuckKimpgovImportsV2(), null, 2),
710
+ );
711
+ });
712
+ parent
713
+ .command("kimpgov-gov-stats-v2")
714
+ .description("V2 gov stats")
715
+ .action(async () => {
716
+ console.log(
717
+ JSON.stringify((await L()).getKnowledgeImporterGovStatsV2(), null, 2),
718
+ );
719
+ });
720
+ }