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
@@ -760,3 +760,222 @@ export function registerOpsCommand(program) {
760
760
 
761
761
  program.addCommand(ops);
762
762
  }
763
+
764
+ // === Iter18 V2 governance overlay ===
765
+ export function registerAiopsgovV2Commands(program) {
766
+ const parent = program.commands.find((c) => c.name() === "ops");
767
+ if (!parent) return;
768
+ const L = async () => await import("../lib/aiops.js");
769
+ parent
770
+ .command("aiopsgov-enums-v2")
771
+ .description("Show V2 enums")
772
+ .action(async () => {
773
+ const m = await L();
774
+ console.log(
775
+ JSON.stringify(
776
+ {
777
+ profileMaturity: m.AIOPSGOV_PROFILE_MATURITY_V2,
778
+ incidentLifecycle: m.AIOPSGOV_INCIDENT_LIFECYCLE_V2,
779
+ },
780
+ null,
781
+ 2,
782
+ ),
783
+ );
784
+ });
785
+ parent
786
+ .command("aiopsgov-config-v2")
787
+ .description("Show V2 config")
788
+ .action(async () => {
789
+ const m = await L();
790
+ console.log(
791
+ JSON.stringify(
792
+ {
793
+ maxActive: m.getMaxActiveAiopsgovProfilesPerOwnerV2(),
794
+ maxPending: m.getMaxPendingAiopsgovIncidentsPerProfileV2(),
795
+ idleMs: m.getAiopsgovProfileIdleMsV2(),
796
+ stuckMs: m.getAiopsgovIncidentStuckMsV2(),
797
+ },
798
+ null,
799
+ 2,
800
+ ),
801
+ );
802
+ });
803
+ parent
804
+ .command("aiopsgov-set-max-active-v2 <n>")
805
+ .description("Set max active")
806
+ .action(async (n) => {
807
+ (await L()).setMaxActiveAiopsgovProfilesPerOwnerV2(Number(n));
808
+ console.log("ok");
809
+ });
810
+ parent
811
+ .command("aiopsgov-set-max-pending-v2 <n>")
812
+ .description("Set max pending")
813
+ .action(async (n) => {
814
+ (await L()).setMaxPendingAiopsgovIncidentsPerProfileV2(Number(n));
815
+ console.log("ok");
816
+ });
817
+ parent
818
+ .command("aiopsgov-set-idle-ms-v2 <n>")
819
+ .description("Set idle threshold ms")
820
+ .action(async (n) => {
821
+ (await L()).setAiopsgovProfileIdleMsV2(Number(n));
822
+ console.log("ok");
823
+ });
824
+ parent
825
+ .command("aiopsgov-set-stuck-ms-v2 <n>")
826
+ .description("Set stuck threshold ms")
827
+ .action(async (n) => {
828
+ (await L()).setAiopsgovIncidentStuckMsV2(Number(n));
829
+ console.log("ok");
830
+ });
831
+ parent
832
+ .command("aiopsgov-register-v2 <id> <owner>")
833
+ .description("Register V2 profile")
834
+ .option("--mode <v>", "mode")
835
+ .action(async (id, owner, o) => {
836
+ const m = await L();
837
+ console.log(
838
+ JSON.stringify(
839
+ m.registerAiopsgovProfileV2({ id, owner, mode: o.mode }),
840
+ null,
841
+ 2,
842
+ ),
843
+ );
844
+ });
845
+ parent
846
+ .command("aiopsgov-activate-v2 <id>")
847
+ .description("Activate profile")
848
+ .action(async (id) => {
849
+ console.log(
850
+ JSON.stringify((await L()).activateAiopsgovProfileV2(id), null, 2),
851
+ );
852
+ });
853
+ parent
854
+ .command("aiopsgov-stale-v2 <id>")
855
+ .description("Stale profile")
856
+ .action(async (id) => {
857
+ console.log(
858
+ JSON.stringify((await L()).staleAiopsgovProfileV2(id), null, 2),
859
+ );
860
+ });
861
+ parent
862
+ .command("aiopsgov-archive-v2 <id>")
863
+ .description("Archive profile")
864
+ .action(async (id) => {
865
+ console.log(
866
+ JSON.stringify((await L()).archiveAiopsgovProfileV2(id), null, 2),
867
+ );
868
+ });
869
+ parent
870
+ .command("aiopsgov-touch-v2 <id>")
871
+ .description("Touch profile")
872
+ .action(async (id) => {
873
+ console.log(
874
+ JSON.stringify((await L()).touchAiopsgovProfileV2(id), null, 2),
875
+ );
876
+ });
877
+ parent
878
+ .command("aiopsgov-get-v2 <id>")
879
+ .description("Get profile")
880
+ .action(async (id) => {
881
+ console.log(
882
+ JSON.stringify((await L()).getAiopsgovProfileV2(id), null, 2),
883
+ );
884
+ });
885
+ parent
886
+ .command("aiopsgov-list-v2")
887
+ .description("List profiles")
888
+ .action(async () => {
889
+ console.log(
890
+ JSON.stringify((await L()).listAiopsgovProfilesV2(), null, 2),
891
+ );
892
+ });
893
+ parent
894
+ .command("aiopsgov-create-incident-v2 <id> <profileId>")
895
+ .description("Create incident")
896
+ .option("--summary <v>", "summary")
897
+ .action(async (id, profileId, o) => {
898
+ const m = await L();
899
+ console.log(
900
+ JSON.stringify(
901
+ m.createAiopsgovIncidentV2({ id, profileId, summary: o.summary }),
902
+ null,
903
+ 2,
904
+ ),
905
+ );
906
+ });
907
+ parent
908
+ .command("aiopsgov-triaging-incident-v2 <id>")
909
+ .description("Mark incident as triaging")
910
+ .action(async (id) => {
911
+ console.log(
912
+ JSON.stringify((await L()).triagingAiopsgovIncidentV2(id), null, 2),
913
+ );
914
+ });
915
+ parent
916
+ .command("aiopsgov-complete-incident-v2 <id>")
917
+ .description("Complete incident")
918
+ .action(async (id) => {
919
+ console.log(
920
+ JSON.stringify((await L()).completeIncidentAiopsgovV2(id), null, 2),
921
+ );
922
+ });
923
+ parent
924
+ .command("aiopsgov-fail-incident-v2 <id> [reason]")
925
+ .description("Fail incident")
926
+ .action(async (id, reason) => {
927
+ console.log(
928
+ JSON.stringify((await L()).failAiopsgovIncidentV2(id, reason), null, 2),
929
+ );
930
+ });
931
+ parent
932
+ .command("aiopsgov-cancel-incident-v2 <id> [reason]")
933
+ .description("Cancel incident")
934
+ .action(async (id, reason) => {
935
+ console.log(
936
+ JSON.stringify(
937
+ (await L()).cancelAiopsgovIncidentV2(id, reason),
938
+ null,
939
+ 2,
940
+ ),
941
+ );
942
+ });
943
+ parent
944
+ .command("aiopsgov-get-incident-v2 <id>")
945
+ .description("Get incident")
946
+ .action(async (id) => {
947
+ console.log(
948
+ JSON.stringify((await L()).getAiopsgovIncidentV2(id), null, 2),
949
+ );
950
+ });
951
+ parent
952
+ .command("aiopsgov-list-incidents-v2")
953
+ .description("List incidents")
954
+ .action(async () => {
955
+ console.log(
956
+ JSON.stringify((await L()).listAiopsgovIncidentsV2(), null, 2),
957
+ );
958
+ });
959
+ parent
960
+ .command("aiopsgov-auto-stale-idle-v2")
961
+ .description("Auto-stale idle")
962
+ .action(async () => {
963
+ console.log(
964
+ JSON.stringify((await L()).autoStaleIdleAiopsgovProfilesV2(), null, 2),
965
+ );
966
+ });
967
+ parent
968
+ .command("aiopsgov-auto-fail-stuck-v2")
969
+ .description("Auto-fail stuck incidents")
970
+ .action(async () => {
971
+ console.log(
972
+ JSON.stringify((await L()).autoFailStuckAiopsgovIncidentsV2(), null, 2),
973
+ );
974
+ });
975
+ parent
976
+ .command("aiopsgov-gov-stats-v2")
977
+ .description("V2 gov stats")
978
+ .action(async () => {
979
+ console.log(JSON.stringify((await L()).getAiopsGovStatsV2(), null, 2));
980
+ });
981
+ }
@@ -677,3 +677,220 @@ function _statusColor(status) {
677
677
  };
678
678
  return (colors[status] || chalk.white)(status);
679
679
  }
680
+
681
+ // === Iter17 V2 governance overlay ===
682
+ export function registerCcbgovV2Commands(program) {
683
+ const parent = program.commands.find((c) => c.name() === "orchestrate");
684
+ if (!parent) return;
685
+ const L = async () => await import("../lib/claude-code-bridge.js");
686
+ parent
687
+ .command("ccbgov-enums-v2")
688
+ .description("Show V2 enums")
689
+ .action(async () => {
690
+ const m = await L();
691
+ console.log(
692
+ JSON.stringify(
693
+ {
694
+ profileMaturity: m.CCBGOV_PROFILE_MATURITY_V2,
695
+ invocationLifecycle: m.CCBGOV_INVOCATION_LIFECYCLE_V2,
696
+ },
697
+ null,
698
+ 2,
699
+ ),
700
+ );
701
+ });
702
+ parent
703
+ .command("ccbgov-config-v2")
704
+ .description("Show V2 config")
705
+ .action(async () => {
706
+ const m = await L();
707
+ console.log(
708
+ JSON.stringify(
709
+ {
710
+ maxActive: m.getMaxActiveCcbgovProfilesPerOwnerV2(),
711
+ maxPending: m.getMaxPendingCcbgovInvocationsPerProfileV2(),
712
+ idleMs: m.getCcbgovProfileIdleMsV2(),
713
+ stuckMs: m.getCcbgovInvocationStuckMsV2(),
714
+ },
715
+ null,
716
+ 2,
717
+ ),
718
+ );
719
+ });
720
+ parent
721
+ .command("ccbgov-set-max-active-v2 <n>")
722
+ .description("Set max active")
723
+ .action(async (n) => {
724
+ (await L()).setMaxActiveCcbgovProfilesPerOwnerV2(Number(n));
725
+ console.log("ok");
726
+ });
727
+ parent
728
+ .command("ccbgov-set-max-pending-v2 <n>")
729
+ .description("Set max pending")
730
+ .action(async (n) => {
731
+ (await L()).setMaxPendingCcbgovInvocationsPerProfileV2(Number(n));
732
+ console.log("ok");
733
+ });
734
+ parent
735
+ .command("ccbgov-set-idle-ms-v2 <n>")
736
+ .description("Set idle threshold ms")
737
+ .action(async (n) => {
738
+ (await L()).setCcbgovProfileIdleMsV2(Number(n));
739
+ console.log("ok");
740
+ });
741
+ parent
742
+ .command("ccbgov-set-stuck-ms-v2 <n>")
743
+ .description("Set stuck threshold ms")
744
+ .action(async (n) => {
745
+ (await L()).setCcbgovInvocationStuckMsV2(Number(n));
746
+ console.log("ok");
747
+ });
748
+ parent
749
+ .command("ccbgov-register-v2 <id> <owner>")
750
+ .description("Register V2 profile")
751
+ .option("--channel <v>", "channel")
752
+ .action(async (id, owner, o) => {
753
+ const m = await L();
754
+ console.log(
755
+ JSON.stringify(
756
+ m.registerCcbgovProfileV2({ id, owner, channel: o.channel }),
757
+ null,
758
+ 2,
759
+ ),
760
+ );
761
+ });
762
+ parent
763
+ .command("ccbgov-activate-v2 <id>")
764
+ .description("Activate profile")
765
+ .action(async (id) => {
766
+ console.log(
767
+ JSON.stringify((await L()).activateCcbgovProfileV2(id), null, 2),
768
+ );
769
+ });
770
+ parent
771
+ .command("ccbgov-degrade-v2 <id>")
772
+ .description("Degrade profile")
773
+ .action(async (id) => {
774
+ console.log(
775
+ JSON.stringify((await L()).degradeCcbgovProfileV2(id), null, 2),
776
+ );
777
+ });
778
+ parent
779
+ .command("ccbgov-archive-v2 <id>")
780
+ .description("Archive profile")
781
+ .action(async (id) => {
782
+ console.log(
783
+ JSON.stringify((await L()).archiveCcbgovProfileV2(id), null, 2),
784
+ );
785
+ });
786
+ parent
787
+ .command("ccbgov-touch-v2 <id>")
788
+ .description("Touch profile")
789
+ .action(async (id) => {
790
+ console.log(
791
+ JSON.stringify((await L()).touchCcbgovProfileV2(id), null, 2),
792
+ );
793
+ });
794
+ parent
795
+ .command("ccbgov-get-v2 <id>")
796
+ .description("Get profile")
797
+ .action(async (id) => {
798
+ console.log(JSON.stringify((await L()).getCcbgovProfileV2(id), null, 2));
799
+ });
800
+ parent
801
+ .command("ccbgov-list-v2")
802
+ .description("List profiles")
803
+ .action(async () => {
804
+ console.log(JSON.stringify((await L()).listCcbgovProfilesV2(), null, 2));
805
+ });
806
+ parent
807
+ .command("ccbgov-create-invocation-v2 <id> <profileId>")
808
+ .description("Create invocation")
809
+ .option("--command <v>", "command")
810
+ .action(async (id, profileId, o) => {
811
+ const m = await L();
812
+ console.log(
813
+ JSON.stringify(
814
+ m.createCcbgovInvocationV2({ id, profileId, command: o.command }),
815
+ null,
816
+ 2,
817
+ ),
818
+ );
819
+ });
820
+ parent
821
+ .command("ccbgov-running-invocation-v2 <id>")
822
+ .description("Mark invocation as running")
823
+ .action(async (id) => {
824
+ console.log(
825
+ JSON.stringify((await L()).runningCcbgovInvocationV2(id), null, 2),
826
+ );
827
+ });
828
+ parent
829
+ .command("ccbgov-complete-invocation-v2 <id>")
830
+ .description("Complete invocation")
831
+ .action(async (id) => {
832
+ console.log(
833
+ JSON.stringify((await L()).completeInvocationCcbgovV2(id), null, 2),
834
+ );
835
+ });
836
+ parent
837
+ .command("ccbgov-fail-invocation-v2 <id> [reason]")
838
+ .description("Fail invocation")
839
+ .action(async (id, reason) => {
840
+ console.log(
841
+ JSON.stringify((await L()).failCcbgovInvocationV2(id, reason), null, 2),
842
+ );
843
+ });
844
+ parent
845
+ .command("ccbgov-cancel-invocation-v2 <id> [reason]")
846
+ .description("Cancel invocation")
847
+ .action(async (id, reason) => {
848
+ console.log(
849
+ JSON.stringify(
850
+ (await L()).cancelCcbgovInvocationV2(id, reason),
851
+ null,
852
+ 2,
853
+ ),
854
+ );
855
+ });
856
+ parent
857
+ .command("ccbgov-get-invocation-v2 <id>")
858
+ .description("Get invocation")
859
+ .action(async (id) => {
860
+ console.log(
861
+ JSON.stringify((await L()).getCcbgovInvocationV2(id), null, 2),
862
+ );
863
+ });
864
+ parent
865
+ .command("ccbgov-list-invocations-v2")
866
+ .description("List invocations")
867
+ .action(async () => {
868
+ console.log(
869
+ JSON.stringify((await L()).listCcbgovInvocationsV2(), null, 2),
870
+ );
871
+ });
872
+ parent
873
+ .command("ccbgov-auto-degrade-idle-v2")
874
+ .description("Auto-degrade idle")
875
+ .action(async () => {
876
+ console.log(
877
+ JSON.stringify((await L()).autoDegradeIdleCcbgovProfilesV2(), null, 2),
878
+ );
879
+ });
880
+ parent
881
+ .command("ccbgov-auto-fail-stuck-v2")
882
+ .description("Auto-fail stuck invocations")
883
+ .action(async () => {
884
+ console.log(
885
+ JSON.stringify((await L()).autoFailStuckCcbgovInvocationsV2(), null, 2),
886
+ );
887
+ });
888
+ parent
889
+ .command("ccbgov-gov-stats-v2")
890
+ .description("V2 gov stats")
891
+ .action(async () => {
892
+ console.log(
893
+ JSON.stringify((await L()).getClaudeCodeBridgeGovStatsV2(), null, 2),
894
+ );
895
+ });
896
+ }
@@ -6,40 +6,151 @@
6
6
  */
7
7
 
8
8
  import {
9
- ORCH_PROFILE_MATURITY_V2, ORCH_TASK_LIFECYCLE_V2,
10
- setMaxActiveOrchProfilesPerOwnerV2, getMaxActiveOrchProfilesPerOwnerV2,
11
- setMaxPendingOrchTasksPerProfileV2, getMaxPendingOrchTasksPerProfileV2,
12
- setOrchProfileIdleMsV2, getOrchProfileIdleMsV2,
13
- setOrchTaskStuckMsV2, getOrchTaskStuckMsV2,
14
- registerOrchProfileV2, activateOrchProfileV2, pauseOrchProfileV2, retireOrchProfileV2, touchOrchProfileV2, getOrchProfileV2, listOrchProfilesV2,
15
- createOrchTaskV2, dispatchOrchTaskV2, completeOrchTaskV2, failOrchTaskV2, cancelOrchTaskV2, getOrchTaskV2, listOrchTasksV2,
16
- autoPauseIdleOrchProfilesV2, autoFailStuckOrchTasksV2, getOrchestratorGovStatsV2, _resetStateOrchestratorV2,
9
+ ORCH_PROFILE_MATURITY_V2,
10
+ ORCH_TASK_LIFECYCLE_V2,
11
+ setMaxActiveOrchProfilesPerOwnerV2,
12
+ getMaxActiveOrchProfilesPerOwnerV2,
13
+ setMaxPendingOrchTasksPerProfileV2,
14
+ getMaxPendingOrchTasksPerProfileV2,
15
+ setOrchProfileIdleMsV2,
16
+ getOrchProfileIdleMsV2,
17
+ setOrchTaskStuckMsV2,
18
+ getOrchTaskStuckMsV2,
19
+ registerOrchProfileV2,
20
+ activateOrchProfileV2,
21
+ pauseOrchProfileV2,
22
+ retireOrchProfileV2,
23
+ touchOrchProfileV2,
24
+ getOrchProfileV2,
25
+ listOrchProfilesV2,
26
+ createOrchTaskV2,
27
+ dispatchOrchTaskV2,
28
+ completeOrchTaskV2,
29
+ failOrchTaskV2,
30
+ cancelOrchTaskV2,
31
+ getOrchTaskV2,
32
+ listOrchTasksV2,
33
+ autoPauseIdleOrchProfilesV2,
34
+ autoFailStuckOrchTasksV2,
35
+ getOrchestratorGovStatsV2,
36
+ _resetStateOrchestratorV2,
17
37
  } from "../lib/orchestrator.js";
18
38
 
19
39
  export function registerOrchGovCommand(program) {
20
- const og = program.command("orchgov").description("Orchestrator V2 governance");
21
- og.command("enums-v2").action(() => console.log(JSON.stringify({ profileMaturity: ORCH_PROFILE_MATURITY_V2, taskLifecycle: ORCH_TASK_LIFECYCLE_V2 }, null, 2)));
22
- og.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveOrchProfilesPerOwner: getMaxActiveOrchProfilesPerOwnerV2(), maxPendingOrchTasksPerProfile: getMaxPendingOrchTasksPerProfileV2(), orchProfileIdleMs: getOrchProfileIdleMsV2(), orchTaskStuckMs: getOrchTaskStuckMsV2() }, null, 2)));
23
- og.command("set-max-active-v2 <n>").action((n) => { setMaxActiveOrchProfilesPerOwnerV2(Number(n)); console.log("ok"); });
24
- og.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingOrchTasksPerProfileV2(Number(n)); console.log("ok"); });
25
- og.command("set-idle-ms-v2 <n>").action((n) => { setOrchProfileIdleMsV2(Number(n)); console.log("ok"); });
26
- og.command("set-stuck-ms-v2 <n>").action((n) => { setOrchTaskStuckMsV2(Number(n)); console.log("ok"); });
27
- og.command("register-profile-v2 <id> <owner>").option("--source <s>", "source").action((id, owner, o) => console.log(JSON.stringify(registerOrchProfileV2({ id, owner, source: o.source }), null, 2)));
28
- og.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activateOrchProfileV2(id), null, 2)));
29
- og.command("pause-profile-v2 <id>").action((id) => console.log(JSON.stringify(pauseOrchProfileV2(id), null, 2)));
30
- og.command("retire-profile-v2 <id>").action((id) => console.log(JSON.stringify(retireOrchProfileV2(id), null, 2)));
31
- og.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchOrchProfileV2(id), null, 2)));
32
- og.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getOrchProfileV2(id), null, 2)));
33
- og.command("list-profiles-v2").action(() => console.log(JSON.stringify(listOrchProfilesV2(), null, 2)));
34
- og.command("create-task-v2 <id> <profileId>").option("--prompt <p>", "prompt").action((id, profileId, o) => console.log(JSON.stringify(createOrchTaskV2({ id, profileId, prompt: o.prompt }), null, 2)));
35
- og.command("dispatch-task-v2 <id>").action((id) => console.log(JSON.stringify(dispatchOrchTaskV2(id), null, 2)));
36
- og.command("complete-task-v2 <id>").action((id) => console.log(JSON.stringify(completeOrchTaskV2(id), null, 2)));
37
- og.command("fail-task-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failOrchTaskV2(id, reason), null, 2)));
38
- og.command("cancel-task-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelOrchTaskV2(id, reason), null, 2)));
39
- og.command("get-task-v2 <id>").action((id) => console.log(JSON.stringify(getOrchTaskV2(id), null, 2)));
40
- og.command("list-tasks-v2").action(() => console.log(JSON.stringify(listOrchTasksV2(), null, 2)));
41
- og.command("auto-pause-idle-v2").action(() => console.log(JSON.stringify(autoPauseIdleOrchProfilesV2(), null, 2)));
42
- og.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckOrchTasksV2(), null, 2)));
43
- og.command("gov-stats-v2").action(() => console.log(JSON.stringify(getOrchestratorGovStatsV2(), null, 2)));
44
- og.command("reset-state-v2").action(() => { _resetStateOrchestratorV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
40
+ const og = program
41
+ .command("orchgov")
42
+ .description("Orchestrator V2 governance");
43
+ og.command("enums-v2").action(() =>
44
+ console.log(
45
+ JSON.stringify(
46
+ {
47
+ profileMaturity: ORCH_PROFILE_MATURITY_V2,
48
+ taskLifecycle: ORCH_TASK_LIFECYCLE_V2,
49
+ },
50
+ null,
51
+ 2,
52
+ ),
53
+ ),
54
+ );
55
+ og.command("config-v2").action(() =>
56
+ console.log(
57
+ JSON.stringify(
58
+ {
59
+ maxActiveOrchProfilesPerOwner: getMaxActiveOrchProfilesPerOwnerV2(),
60
+ maxPendingOrchTasksPerProfile: getMaxPendingOrchTasksPerProfileV2(),
61
+ orchProfileIdleMs: getOrchProfileIdleMsV2(),
62
+ orchTaskStuckMs: getOrchTaskStuckMsV2(),
63
+ },
64
+ null,
65
+ 2,
66
+ ),
67
+ ),
68
+ );
69
+ og.command("set-max-active-v2 <n>").action((n) => {
70
+ setMaxActiveOrchProfilesPerOwnerV2(Number(n));
71
+ console.log("ok");
72
+ });
73
+ og.command("set-max-pending-v2 <n>").action((n) => {
74
+ setMaxPendingOrchTasksPerProfileV2(Number(n));
75
+ console.log("ok");
76
+ });
77
+ og.command("set-idle-ms-v2 <n>").action((n) => {
78
+ setOrchProfileIdleMsV2(Number(n));
79
+ console.log("ok");
80
+ });
81
+ og.command("set-stuck-ms-v2 <n>").action((n) => {
82
+ setOrchTaskStuckMsV2(Number(n));
83
+ console.log("ok");
84
+ });
85
+ og.command("register-profile-v2 <id> <owner>")
86
+ .option("--source <s>", "source")
87
+ .action((id, owner, o) =>
88
+ console.log(
89
+ JSON.stringify(
90
+ registerOrchProfileV2({ id, owner, source: o.source }),
91
+ null,
92
+ 2,
93
+ ),
94
+ ),
95
+ );
96
+ og.command("activate-profile-v2 <id>").action((id) =>
97
+ console.log(JSON.stringify(activateOrchProfileV2(id), null, 2)),
98
+ );
99
+ og.command("pause-profile-v2 <id>").action((id) =>
100
+ console.log(JSON.stringify(pauseOrchProfileV2(id), null, 2)),
101
+ );
102
+ og.command("retire-profile-v2 <id>").action((id) =>
103
+ console.log(JSON.stringify(retireOrchProfileV2(id), null, 2)),
104
+ );
105
+ og.command("touch-profile-v2 <id>").action((id) =>
106
+ console.log(JSON.stringify(touchOrchProfileV2(id), null, 2)),
107
+ );
108
+ og.command("get-profile-v2 <id>").action((id) =>
109
+ console.log(JSON.stringify(getOrchProfileV2(id), null, 2)),
110
+ );
111
+ og.command("list-profiles-v2").action(() =>
112
+ console.log(JSON.stringify(listOrchProfilesV2(), null, 2)),
113
+ );
114
+ og.command("create-task-v2 <id> <profileId>")
115
+ .option("--prompt <p>", "prompt")
116
+ .action((id, profileId, o) =>
117
+ console.log(
118
+ JSON.stringify(
119
+ createOrchTaskV2({ id, profileId, prompt: o.prompt }),
120
+ null,
121
+ 2,
122
+ ),
123
+ ),
124
+ );
125
+ og.command("dispatch-task-v2 <id>").action((id) =>
126
+ console.log(JSON.stringify(dispatchOrchTaskV2(id), null, 2)),
127
+ );
128
+ og.command("complete-task-v2 <id>").action((id) =>
129
+ console.log(JSON.stringify(completeOrchTaskV2(id), null, 2)),
130
+ );
131
+ og.command("fail-task-v2 <id> [reason]").action((id, reason) =>
132
+ console.log(JSON.stringify(failOrchTaskV2(id, reason), null, 2)),
133
+ );
134
+ og.command("cancel-task-v2 <id> [reason]").action((id, reason) =>
135
+ console.log(JSON.stringify(cancelOrchTaskV2(id, reason), null, 2)),
136
+ );
137
+ og.command("get-task-v2 <id>").action((id) =>
138
+ console.log(JSON.stringify(getOrchTaskV2(id), null, 2)),
139
+ );
140
+ og.command("list-tasks-v2").action(() =>
141
+ console.log(JSON.stringify(listOrchTasksV2(), null, 2)),
142
+ );
143
+ og.command("auto-pause-idle-v2").action(() =>
144
+ console.log(JSON.stringify(autoPauseIdleOrchProfilesV2(), null, 2)),
145
+ );
146
+ og.command("auto-fail-stuck-v2").action(() =>
147
+ console.log(JSON.stringify(autoFailStuckOrchTasksV2(), null, 2)),
148
+ );
149
+ og.command("gov-stats-v2").action(() =>
150
+ console.log(JSON.stringify(getOrchestratorGovStatsV2(), null, 2)),
151
+ );
152
+ og.command("reset-state-v2").action(() => {
153
+ _resetStateOrchestratorV2();
154
+ console.log(JSON.stringify({ ok: true }, null, 2));
155
+ });
45
156
  }