chainlesschain 0.132.0 → 0.145.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/package.json +1 -1
  2. package/src/commands/a2a.js +230 -0
  3. package/src/commands/activitypub.js +191 -0
  4. package/src/commands/agent.js +601 -0
  5. package/src/commands/audit.js +206 -0
  6. package/src/commands/bi.js +186 -0
  7. package/src/commands/bm25.js +162 -0
  8. package/src/commands/browse.js +225 -0
  9. package/src/commands/ccron.js +178 -0
  10. package/src/commands/chat.js +207 -0
  11. package/src/commands/compliance.js +420 -0
  12. package/src/commands/compt.js +176 -0
  13. package/src/commands/consol.js +237 -0
  14. package/src/commands/cowork.js +588 -0
  15. package/src/commands/crosschain.js +216 -0
  16. package/src/commands/dao.js +216 -0
  17. package/src/commands/dlp.js +206 -0
  18. package/src/commands/economy.js +211 -0
  19. package/src/commands/evolution.js +209 -0
  20. package/src/commands/evomap.js +216 -0
  21. package/src/commands/fflag.js +230 -0
  22. package/src/commands/git.js +185 -0
  23. package/src/commands/hardening.js +209 -0
  24. package/src/commands/hmemory.js +210 -0
  25. package/src/commands/incentive.js +209 -0
  26. package/src/commands/inference.js +178 -0
  27. package/src/commands/itbudget.js +161 -0
  28. package/src/commands/kg.js +206 -0
  29. package/src/commands/lowcode.js +201 -0
  30. package/src/commands/marketplace.js +206 -0
  31. package/src/commands/matrix.js +214 -0
  32. package/src/commands/mcpscaf.js +153 -0
  33. package/src/commands/meminj.js +153 -0
  34. package/src/commands/nostr.js +213 -0
  35. package/src/commands/orchestrate.js +217 -0
  36. package/src/commands/orchgov.js +156 -0
  37. package/src/commands/pdfp.js +160 -0
  38. package/src/commands/perf.js +176 -0
  39. package/src/commands/perm.js +156 -0
  40. package/src/commands/pipeline.js +211 -0
  41. package/src/commands/planmode.js +154 -0
  42. package/src/commands/privacy.js +203 -0
  43. package/src/commands/promcomp.js +166 -0
  44. package/src/commands/recommend.js +185 -0
  45. package/src/commands/reputation.js +208 -0
  46. package/src/commands/sandbox.js +206 -0
  47. package/src/commands/seshhook.js +153 -0
  48. package/src/commands/seshsearch.js +149 -0
  49. package/src/commands/seshtail.js +152 -0
  50. package/src/commands/seshu.js +160 -0
  51. package/src/commands/sganal.js +172 -0
  52. package/src/commands/siem.js +207 -0
  53. package/src/commands/sla.js +212 -0
  54. package/src/commands/slotfill.js +154 -0
  55. package/src/commands/social.js +159 -0
  56. package/src/commands/stress.js +206 -0
  57. package/src/commands/svccont.js +157 -0
  58. package/src/commands/terraform.js +206 -0
  59. package/src/commands/tms.js +183 -0
  60. package/src/commands/topiccls.js +158 -0
  61. package/src/commands/uprof.js +154 -0
  62. package/src/commands/vcheck.js +172 -0
  63. package/src/commands/webfetch.js +150 -0
  64. package/src/commands/zkp.js +218 -0
  65. package/src/harness/prompt-compressor.js +331 -0
  66. package/src/index.js +101 -1
  67. package/src/lib/a2a-protocol.js +373 -0
  68. package/src/lib/activitypub-bridge.js +343 -0
  69. package/src/lib/agent-economy.js +358 -0
  70. package/src/lib/app-builder.js +338 -0
  71. package/src/lib/audit-logger.js +321 -0
  72. package/src/lib/autonomous-agent.js +341 -0
  73. package/src/lib/bi-engine.js +339 -0
  74. package/src/lib/bm25-search.js +333 -0
  75. package/src/lib/browser-automation.js +352 -0
  76. package/src/lib/chat-core.js +336 -0
  77. package/src/lib/claude-code-bridge.js +341 -0
  78. package/src/lib/compliance-framework-reporter.js +359 -0
  79. package/src/lib/compliance-manager.js +330 -0
  80. package/src/lib/compression-telemetry.js +333 -0
  81. package/src/lib/content-recommender.js +370 -0
  82. package/src/lib/cowork-cron.js +330 -0
  83. package/src/lib/cowork-learning.js +333 -0
  84. package/src/lib/cowork-task-runner.js +362 -0
  85. package/src/lib/cowork-workflow.js +327 -0
  86. package/src/lib/cross-chain.js +365 -0
  87. package/src/lib/dao-governance.js +339 -0
  88. package/src/lib/dlp-engine.js +343 -0
  89. package/src/lib/evolution-system.js +336 -0
  90. package/src/lib/evomap-manager.js +339 -0
  91. package/src/lib/execution-backend.js +351 -0
  92. package/src/lib/feature-flags.js +330 -0
  93. package/src/lib/git-integration.js +343 -0
  94. package/src/lib/hardening-manager.js +341 -0
  95. package/src/lib/hierarchical-memory.js +341 -0
  96. package/src/lib/inference-network.js +362 -0
  97. package/src/lib/iteration-budget.js +357 -0
  98. package/src/lib/knowledge-graph.js +333 -0
  99. package/src/lib/matrix-bridge.js +339 -0
  100. package/src/lib/mcp-scaffold.js +345 -0
  101. package/src/lib/memory-injection.js +320 -0
  102. package/src/lib/nostr-bridge.js +342 -0
  103. package/src/lib/orchestrator.js +350 -0
  104. package/src/lib/pdf-parser.js +330 -0
  105. package/src/lib/perf-tuning.js +364 -0
  106. package/src/lib/permission-engine.js +319 -0
  107. package/src/lib/pipeline-orchestrator.js +345 -0
  108. package/src/lib/plan-mode.js +328 -0
  109. package/src/lib/privacy-computing.js +335 -0
  110. package/src/lib/prompt-compressor.js +1 -10
  111. package/src/lib/reputation-optimizer.js +340 -0
  112. package/src/lib/sandbox-v2.js +327 -0
  113. package/src/lib/service-container.js +342 -0
  114. package/src/lib/session-consolidator.js +352 -0
  115. package/src/lib/session-hooks.js +340 -0
  116. package/src/lib/session-search.js +334 -0
  117. package/src/lib/session-tail.js +320 -0
  118. package/src/lib/session-usage.js +329 -0
  119. package/src/lib/siem-exporter.js +352 -0
  120. package/src/lib/skill-marketplace.js +345 -0
  121. package/src/lib/sla-manager.js +341 -0
  122. package/src/lib/slot-filler.js +333 -0
  123. package/src/lib/social-graph-analytics.js +327 -0
  124. package/src/lib/social-graph.js +304 -0
  125. package/src/lib/stress-tester.js +342 -0
  126. package/src/lib/sub-agent-registry.js +359 -0
  127. package/src/lib/task-model-selector.js +333 -0
  128. package/src/lib/terraform-manager.js +333 -0
  129. package/src/lib/todo-manager.js +339 -0
  130. package/src/lib/token-incentive.js +341 -0
  131. package/src/lib/topic-classifier.js +353 -0
  132. package/src/lib/user-profile.js +325 -0
  133. package/src/lib/version-checker.js +335 -0
  134. package/src/lib/web-fetch.js +322 -0
  135. package/src/lib/zkp-engine.js +342 -0
@@ -609,3 +609,215 @@ export function registerSlaCommand(program) {
609
609
  console.log(JSON.stringify(getSLAStatsV2(), null, 2));
610
610
  });
611
611
  }
612
+
613
+ // === Iter16 V2 governance overlay ===
614
+ export function registerSlagovV2Commands(program) {
615
+ const parent = program.commands.find((c) => c.name() === "sla");
616
+ if (!parent) return;
617
+ const L = async () => await import("../lib/sla-manager.js");
618
+ parent
619
+ .command("slagov-enums-v2")
620
+ .description("Show V2 enums (slagov maturity + measurement lifecycle)")
621
+ .action(async () => {
622
+ const m = await L();
623
+ console.log(
624
+ JSON.stringify(
625
+ {
626
+ profileMaturity: m.SLAGOV_PROFILE_MATURITY_V2,
627
+ measurementLifecycle: m.SLAGOV_MEASUREMENT_LIFECYCLE_V2,
628
+ },
629
+ null,
630
+ 2,
631
+ ),
632
+ );
633
+ });
634
+ parent
635
+ .command("slagov-config-v2")
636
+ .description("Show V2 config thresholds")
637
+ .action(async () => {
638
+ const m = await L();
639
+ console.log(
640
+ JSON.stringify(
641
+ {
642
+ maxActive: m.getMaxActiveSlagovProfilesPerOwnerV2(),
643
+ maxPending: m.getMaxPendingSlagovMeasurementsPerProfileV2(),
644
+ idleMs: m.getSlagovProfileIdleMsV2(),
645
+ stuckMs: m.getSlagovMeasurementStuckMsV2(),
646
+ },
647
+ null,
648
+ 2,
649
+ ),
650
+ );
651
+ });
652
+ parent
653
+ .command("slagov-set-max-active-v2 <n>")
654
+ .description("Set max active profiles per owner")
655
+ .action(async (n) => {
656
+ const m = await L();
657
+ m.setMaxActiveSlagovProfilesPerOwnerV2(Number(n));
658
+ console.log("ok");
659
+ });
660
+ parent
661
+ .command("slagov-set-max-pending-v2 <n>")
662
+ .description("Set max pending measurements per profile")
663
+ .action(async (n) => {
664
+ const m = await L();
665
+ m.setMaxPendingSlagovMeasurementsPerProfileV2(Number(n));
666
+ console.log("ok");
667
+ });
668
+ parent
669
+ .command("slagov-set-idle-ms-v2 <n>")
670
+ .description("Set profile idle threshold (ms)")
671
+ .action(async (n) => {
672
+ const m = await L();
673
+ m.setSlagovProfileIdleMsV2(Number(n));
674
+ console.log("ok");
675
+ });
676
+ parent
677
+ .command("slagov-set-stuck-ms-v2 <n>")
678
+ .description("Set measurement stuck threshold (ms)")
679
+ .action(async (n) => {
680
+ const m = await L();
681
+ m.setSlagovMeasurementStuckMsV2(Number(n));
682
+ console.log("ok");
683
+ });
684
+ parent
685
+ .command("slagov-register-v2 <id> <owner>")
686
+ .description("Register V2 slagov profile")
687
+ .option("--tier <v>", "tier")
688
+ .action(async (id, owner, o) => {
689
+ const m = await L();
690
+ console.log(
691
+ JSON.stringify(
692
+ m.registerSlagovProfileV2({ id, owner, tier: o.tier }),
693
+ null,
694
+ 2,
695
+ ),
696
+ );
697
+ });
698
+ parent
699
+ .command("slagov-activate-v2 <id>")
700
+ .description("Activate profile")
701
+ .action(async (id) => {
702
+ const m = await L();
703
+ console.log(JSON.stringify(m.activateSlagovProfileV2(id), null, 2));
704
+ });
705
+ parent
706
+ .command("slagov-breach-v2 <id>")
707
+ .description("Breach profile")
708
+ .action(async (id) => {
709
+ const m = await L();
710
+ console.log(JSON.stringify(m.breachSlagovProfileV2(id), null, 2));
711
+ });
712
+ parent
713
+ .command("slagov-archive-v2 <id>")
714
+ .description("Archive profile (terminal)")
715
+ .action(async (id) => {
716
+ const m = await L();
717
+ console.log(JSON.stringify(m.archiveSlagovProfileV2(id), null, 2));
718
+ });
719
+ parent
720
+ .command("slagov-touch-v2 <id>")
721
+ .description("Touch profile")
722
+ .action(async (id) => {
723
+ const m = await L();
724
+ console.log(JSON.stringify(m.touchSlagovProfileV2(id), null, 2));
725
+ });
726
+ parent
727
+ .command("slagov-get-v2 <id>")
728
+ .description("Get profile")
729
+ .action(async (id) => {
730
+ const m = await L();
731
+ console.log(JSON.stringify(m.getSlagovProfileV2(id), null, 2));
732
+ });
733
+ parent
734
+ .command("slagov-list-v2")
735
+ .description("List profiles")
736
+ .action(async () => {
737
+ const m = await L();
738
+ console.log(JSON.stringify(m.listSlagovProfilesV2(), null, 2));
739
+ });
740
+ parent
741
+ .command("slagov-create-measurement-v2 <id> <profileId>")
742
+ .description("Create measurement (queued)")
743
+ .option("--metric <v>", "metric")
744
+ .action(async (id, profileId, o) => {
745
+ const m = await L();
746
+ console.log(
747
+ JSON.stringify(
748
+ m.createSlagovMeasurementV2({ id, profileId, metric: o.metric }),
749
+ null,
750
+ 2,
751
+ ),
752
+ );
753
+ });
754
+ parent
755
+ .command("slagov-measuring-measurement-v2 <id>")
756
+ .description("Mark measurement as measuring")
757
+ .action(async (id) => {
758
+ const m = await L();
759
+ console.log(JSON.stringify(m.measuringSlagovMeasurementV2(id), null, 2));
760
+ });
761
+ parent
762
+ .command("slagov-complete-measurement-v2 <id>")
763
+ .description("Complete measurement")
764
+ .action(async (id) => {
765
+ const m = await L();
766
+ console.log(JSON.stringify(m.completeMeasurementSlagovV2(id), null, 2));
767
+ });
768
+ parent
769
+ .command("slagov-fail-measurement-v2 <id> [reason]")
770
+ .description("Fail measurement")
771
+ .action(async (id, reason) => {
772
+ const m = await L();
773
+ console.log(
774
+ JSON.stringify(m.failSlagovMeasurementV2(id, reason), null, 2),
775
+ );
776
+ });
777
+ parent
778
+ .command("slagov-cancel-measurement-v2 <id> [reason]")
779
+ .description("Cancel measurement")
780
+ .action(async (id, reason) => {
781
+ const m = await L();
782
+ console.log(
783
+ JSON.stringify(m.cancelSlagovMeasurementV2(id, reason), null, 2),
784
+ );
785
+ });
786
+ parent
787
+ .command("slagov-get-measurement-v2 <id>")
788
+ .description("Get measurement")
789
+ .action(async (id) => {
790
+ const m = await L();
791
+ console.log(JSON.stringify(m.getSlagovMeasurementV2(id), null, 2));
792
+ });
793
+ parent
794
+ .command("slagov-list-measurements-v2")
795
+ .description("List measurements")
796
+ .action(async () => {
797
+ const m = await L();
798
+ console.log(JSON.stringify(m.listSlagovMeasurementsV2(), null, 2));
799
+ });
800
+ parent
801
+ .command("slagov-auto-breach-idle-v2")
802
+ .description("Auto-breach idle profiles")
803
+ .action(async () => {
804
+ const m = await L();
805
+ console.log(JSON.stringify(m.autoBreachIdleSlagovProfilesV2(), null, 2));
806
+ });
807
+ parent
808
+ .command("slagov-auto-fail-stuck-v2")
809
+ .description("Auto-fail stuck measurements")
810
+ .action(async () => {
811
+ const m = await L();
812
+ console.log(
813
+ JSON.stringify(m.autoFailStuckSlagovMeasurementsV2(), null, 2),
814
+ );
815
+ });
816
+ parent
817
+ .command("slagov-gov-stats-v2")
818
+ .description("V2 gov aggregate stats")
819
+ .action(async () => {
820
+ const m = await L();
821
+ console.log(JSON.stringify(m.getSlaManagerGovStatsV2(), null, 2));
822
+ });
823
+ }
@@ -0,0 +1,154 @@
1
+ /**
2
+ * `cc slotfill` — Slot Filler V2 governance overlay (in-memory, atop lib/slot-filler.js).
3
+ */
4
+ import {
5
+ SLOTF_PROFILE_MATURITY_V2,
6
+ SLOTF_FILL_LIFECYCLE_V2,
7
+ setMaxActiveSlotfTemplatesPerOwnerV2,
8
+ getMaxActiveSlotfTemplatesPerOwnerV2,
9
+ setMaxPendingSlotfFillsPerTemplateV2,
10
+ getMaxPendingSlotfFillsPerTemplateV2,
11
+ setSlotfTemplateIdleMsV2,
12
+ getSlotfTemplateIdleMsV2,
13
+ setSlotfFillStuckMsV2,
14
+ getSlotfFillStuckMsV2,
15
+ registerSlotfTemplateV2,
16
+ activateSlotfTemplateV2,
17
+ staleSlotfTemplateV2,
18
+ archiveSlotfTemplateV2,
19
+ touchSlotfTemplateV2,
20
+ getSlotfTemplateV2,
21
+ listSlotfTemplatesV2,
22
+ createSlotfFillV2,
23
+ fillingSlotfFillV2,
24
+ fillSlotfFillV2,
25
+ failSlotfFillV2,
26
+ cancelSlotfFillV2,
27
+ getSlotfFillV2,
28
+ listSlotfFillsV2,
29
+ autoStaleIdleSlotfTemplatesV2,
30
+ autoFailStuckSlotfFillsV2,
31
+ getSlotFillerGovStatsV2,
32
+ _resetStateSlotFillerV2,
33
+ } from "../lib/slot-filler.js";
34
+
35
+ export function registerSlotfillCommand(program) {
36
+ const sf = program
37
+ .command("slotfill")
38
+ .description("Slot Filler V2 governance");
39
+ sf.command("enums-v2").action(() =>
40
+ console.log(
41
+ JSON.stringify(
42
+ {
43
+ profileMaturity: SLOTF_PROFILE_MATURITY_V2,
44
+ fillLifecycle: SLOTF_FILL_LIFECYCLE_V2,
45
+ },
46
+ null,
47
+ 2,
48
+ ),
49
+ ),
50
+ );
51
+ sf.command("config-v2").action(() =>
52
+ console.log(
53
+ JSON.stringify(
54
+ {
55
+ maxActiveSlotfTemplatesPerOwner:
56
+ getMaxActiveSlotfTemplatesPerOwnerV2(),
57
+ maxPendingSlotfFillsPerTemplate:
58
+ getMaxPendingSlotfFillsPerTemplateV2(),
59
+ slotfTemplateIdleMs: getSlotfTemplateIdleMsV2(),
60
+ slotfFillStuckMs: getSlotfFillStuckMsV2(),
61
+ },
62
+ null,
63
+ 2,
64
+ ),
65
+ ),
66
+ );
67
+ sf.command("set-max-active-v2 <n>").action((n) => {
68
+ setMaxActiveSlotfTemplatesPerOwnerV2(Number(n));
69
+ console.log("ok");
70
+ });
71
+ sf.command("set-max-pending-v2 <n>").action((n) => {
72
+ setMaxPendingSlotfFillsPerTemplateV2(Number(n));
73
+ console.log("ok");
74
+ });
75
+ sf.command("set-idle-ms-v2 <n>").action((n) => {
76
+ setSlotfTemplateIdleMsV2(Number(n));
77
+ console.log("ok");
78
+ });
79
+ sf.command("set-stuck-ms-v2 <n>").action((n) => {
80
+ setSlotfFillStuckMsV2(Number(n));
81
+ console.log("ok");
82
+ });
83
+ sf.command("register-template-v2 <id> <owner>")
84
+ .option("--schema <s>", "schema")
85
+ .action((id, owner, o) =>
86
+ console.log(
87
+ JSON.stringify(
88
+ registerSlotfTemplateV2({ id, owner, schema: o.schema }),
89
+ null,
90
+ 2,
91
+ ),
92
+ ),
93
+ );
94
+ sf.command("activate-template-v2 <id>").action((id) =>
95
+ console.log(JSON.stringify(activateSlotfTemplateV2(id), null, 2)),
96
+ );
97
+ sf.command("stale-template-v2 <id>").action((id) =>
98
+ console.log(JSON.stringify(staleSlotfTemplateV2(id), null, 2)),
99
+ );
100
+ sf.command("archive-template-v2 <id>").action((id) =>
101
+ console.log(JSON.stringify(archiveSlotfTemplateV2(id), null, 2)),
102
+ );
103
+ sf.command("touch-template-v2 <id>").action((id) =>
104
+ console.log(JSON.stringify(touchSlotfTemplateV2(id), null, 2)),
105
+ );
106
+ sf.command("get-template-v2 <id>").action((id) =>
107
+ console.log(JSON.stringify(getSlotfTemplateV2(id), null, 2)),
108
+ );
109
+ sf.command("list-templates-v2").action(() =>
110
+ console.log(JSON.stringify(listSlotfTemplatesV2(), null, 2)),
111
+ );
112
+ sf.command("create-fill-v2 <id> <templateId>")
113
+ .option("--input <s>", "input")
114
+ .action((id, templateId, o) =>
115
+ console.log(
116
+ JSON.stringify(
117
+ createSlotfFillV2({ id, templateId, input: o.input }),
118
+ null,
119
+ 2,
120
+ ),
121
+ ),
122
+ );
123
+ sf.command("filling-fill-v2 <id>").action((id) =>
124
+ console.log(JSON.stringify(fillingSlotfFillV2(id), null, 2)),
125
+ );
126
+ sf.command("fill-fill-v2 <id>").action((id) =>
127
+ console.log(JSON.stringify(fillSlotfFillV2(id), null, 2)),
128
+ );
129
+ sf.command("fail-fill-v2 <id> [reason]").action((id, reason) =>
130
+ console.log(JSON.stringify(failSlotfFillV2(id, reason), null, 2)),
131
+ );
132
+ sf.command("cancel-fill-v2 <id> [reason]").action((id, reason) =>
133
+ console.log(JSON.stringify(cancelSlotfFillV2(id, reason), null, 2)),
134
+ );
135
+ sf.command("get-fill-v2 <id>").action((id) =>
136
+ console.log(JSON.stringify(getSlotfFillV2(id), null, 2)),
137
+ );
138
+ sf.command("list-fills-v2").action(() =>
139
+ console.log(JSON.stringify(listSlotfFillsV2(), null, 2)),
140
+ );
141
+ sf.command("auto-stale-idle-v2").action(() =>
142
+ console.log(JSON.stringify(autoStaleIdleSlotfTemplatesV2(), null, 2)),
143
+ );
144
+ sf.command("auto-fail-stuck-v2").action(() =>
145
+ console.log(JSON.stringify(autoFailStuckSlotfFillsV2(), null, 2)),
146
+ );
147
+ sf.command("gov-stats-v2").action(() =>
148
+ console.log(JSON.stringify(getSlotFillerGovStatsV2(), null, 2)),
149
+ );
150
+ sf.command("reset-state-v2").action(() => {
151
+ _resetStateSlotFillerV2();
152
+ console.log(JSON.stringify({ ok: true }, null, 2));
153
+ });
154
+ }
@@ -63,6 +63,34 @@ import {
63
63
  loadFromDb as graphLoadFromDb,
64
64
  subscribe as graphSubscribe,
65
65
  EDGE_TYPES,
66
+ SG_NODE_MATURITY_V2,
67
+ SG_EDGE_LIFECYCLE_V2,
68
+ setMaxActiveSgNodesPerOwnerV2,
69
+ getMaxActiveSgNodesPerOwnerV2,
70
+ setMaxPendingSgEdgesPerNodeV2,
71
+ getMaxPendingSgEdgesPerNodeV2,
72
+ setSgNodeIdleMsV2,
73
+ getSgNodeIdleMsV2,
74
+ setSgEdgeStuckMsV2,
75
+ getSgEdgeStuckMsV2,
76
+ registerSgNodeV2,
77
+ activateSgNodeV2,
78
+ deactivateSgNodeV2,
79
+ removeSgNodeV2,
80
+ touchSgNodeV2,
81
+ getSgNodeV2,
82
+ listSgNodesV2,
83
+ createSgEdgeV2,
84
+ establishSgEdgeV2,
85
+ severSgEdgeV2,
86
+ expireSgEdgeV2,
87
+ cancelSgEdgeV2,
88
+ getSgEdgeV2,
89
+ listSgEdgesV2,
90
+ autoDeactivateIdleSgNodesV2,
91
+ autoExpireStaleSgEdgesV2,
92
+ getSocialGraphGovStatsV2,
93
+ _resetStateSocialGraphV2,
66
94
  } from "../lib/social-graph.js";
67
95
  import {
68
96
  METRICS as ANALYTICS_METRICS,
@@ -1309,4 +1337,135 @@ export function registerSocialCommand(program) {
1309
1337
  const flipped = autoAbandonStuckThreadsV2();
1310
1338
  console.log(JSON.stringify(flipped, null, 2));
1311
1339
  });
1340
+
1341
+ // ===== Social Graph V2 governance overlay (sg-*-v2 prefix) =====
1342
+ social.command("sg-enums-v2").action(() =>
1343
+ console.log(
1344
+ JSON.stringify(
1345
+ {
1346
+ nodeMaturity: SG_NODE_MATURITY_V2,
1347
+ edgeLifecycle: SG_EDGE_LIFECYCLE_V2,
1348
+ },
1349
+ null,
1350
+ 2,
1351
+ ),
1352
+ ),
1353
+ );
1354
+ social.command("sg-config-v2").action(() =>
1355
+ console.log(
1356
+ JSON.stringify(
1357
+ {
1358
+ maxActiveSgNodesPerOwner: getMaxActiveSgNodesPerOwnerV2(),
1359
+ maxPendingSgEdgesPerNode: getMaxPendingSgEdgesPerNodeV2(),
1360
+ sgNodeIdleMs: getSgNodeIdleMsV2(),
1361
+ sgEdgeStuckMs: getSgEdgeStuckMsV2(),
1362
+ },
1363
+ null,
1364
+ 2,
1365
+ ),
1366
+ ),
1367
+ );
1368
+ social.command("sg-set-max-active-v2 <n>").action((n) => {
1369
+ setMaxActiveSgNodesPerOwnerV2(Number(n));
1370
+ console.log("ok");
1371
+ });
1372
+ social.command("sg-set-max-pending-v2 <n>").action((n) => {
1373
+ setMaxPendingSgEdgesPerNodeV2(Number(n));
1374
+ console.log("ok");
1375
+ });
1376
+ social.command("sg-set-idle-ms-v2 <n>").action((n) => {
1377
+ setSgNodeIdleMsV2(Number(n));
1378
+ console.log("ok");
1379
+ });
1380
+ social.command("sg-set-stuck-ms-v2 <n>").action((n) => {
1381
+ setSgEdgeStuckMsV2(Number(n));
1382
+ console.log("ok");
1383
+ });
1384
+ social
1385
+ .command("sg-register-node-v2 <id> <owner>")
1386
+ .option("--handle <h>", "handle")
1387
+ .action((id, owner, o) =>
1388
+ console.log(
1389
+ JSON.stringify(
1390
+ registerSgNodeV2({ id, owner, handle: o.handle }),
1391
+ null,
1392
+ 2,
1393
+ ),
1394
+ ),
1395
+ );
1396
+ social
1397
+ .command("sg-activate-node-v2 <id>")
1398
+ .action((id) => console.log(JSON.stringify(activateSgNodeV2(id), null, 2)));
1399
+ social
1400
+ .command("sg-deactivate-node-v2 <id>")
1401
+ .action((id) =>
1402
+ console.log(JSON.stringify(deactivateSgNodeV2(id), null, 2)),
1403
+ );
1404
+ social
1405
+ .command("sg-remove-node-v2 <id>")
1406
+ .action((id) => console.log(JSON.stringify(removeSgNodeV2(id), null, 2)));
1407
+ social
1408
+ .command("sg-touch-node-v2 <id>")
1409
+ .action((id) => console.log(JSON.stringify(touchSgNodeV2(id), null, 2)));
1410
+ social
1411
+ .command("sg-get-node-v2 <id>")
1412
+ .action((id) => console.log(JSON.stringify(getSgNodeV2(id), null, 2)));
1413
+ social
1414
+ .command("sg-list-nodes-v2")
1415
+ .action(() => console.log(JSON.stringify(listSgNodesV2(), null, 2)));
1416
+ social
1417
+ .command("sg-create-edge-v2 <id> <nodeId>")
1418
+ .option("--target <t>", "targetId")
1419
+ .action((id, nodeId, o) =>
1420
+ console.log(
1421
+ JSON.stringify(
1422
+ createSgEdgeV2({ id, nodeId, targetId: o.target }),
1423
+ null,
1424
+ 2,
1425
+ ),
1426
+ ),
1427
+ );
1428
+ social
1429
+ .command("sg-establish-edge-v2 <id>")
1430
+ .action((id) =>
1431
+ console.log(JSON.stringify(establishSgEdgeV2(id), null, 2)),
1432
+ );
1433
+ social
1434
+ .command("sg-sever-edge-v2 <id> [reason]")
1435
+ .action((id, reason) =>
1436
+ console.log(JSON.stringify(severSgEdgeV2(id, reason), null, 2)),
1437
+ );
1438
+ social
1439
+ .command("sg-expire-edge-v2 <id>")
1440
+ .action((id) => console.log(JSON.stringify(expireSgEdgeV2(id), null, 2)));
1441
+ social
1442
+ .command("sg-cancel-edge-v2 <id> [reason]")
1443
+ .action((id, reason) =>
1444
+ console.log(JSON.stringify(cancelSgEdgeV2(id, reason), null, 2)),
1445
+ );
1446
+ social
1447
+ .command("sg-get-edge-v2 <id>")
1448
+ .action((id) => console.log(JSON.stringify(getSgEdgeV2(id), null, 2)));
1449
+ social
1450
+ .command("sg-list-edges-v2")
1451
+ .action(() => console.log(JSON.stringify(listSgEdgesV2(), null, 2)));
1452
+ social
1453
+ .command("sg-auto-deactivate-idle-v2")
1454
+ .action(() =>
1455
+ console.log(JSON.stringify(autoDeactivateIdleSgNodesV2(), null, 2)),
1456
+ );
1457
+ social
1458
+ .command("sg-auto-expire-stale-v2")
1459
+ .action(() =>
1460
+ console.log(JSON.stringify(autoExpireStaleSgEdgesV2(), null, 2)),
1461
+ );
1462
+ social
1463
+ .command("sg-gov-stats-v2")
1464
+ .action(() =>
1465
+ console.log(JSON.stringify(getSocialGraphGovStatsV2(), null, 2)),
1466
+ );
1467
+ social.command("sg-reset-state-v2").action(() => {
1468
+ _resetStateSocialGraphV2();
1469
+ console.log(JSON.stringify({ ok: true }, null, 2));
1470
+ });
1312
1471
  }