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
@@ -1026,3 +1026,220 @@ export function registerMcpCommand(program) {
1026
1026
  console.log(JSON.stringify({ ok: true }, null, 2));
1027
1027
  });
1028
1028
  }
1029
+
1030
+ // === Iter24 V2 governance overlay ===
1031
+ export function registerMcpgovV2Commands(program) {
1032
+ const parent = program.commands.find((c) => c.name() === "mcp");
1033
+ if (!parent) return;
1034
+ const L = async () => await import("../lib/mcp-registry.js");
1035
+ parent
1036
+ .command("mcpgov-enums-v2")
1037
+ .description("Show V2 enums")
1038
+ .action(async () => {
1039
+ const m = await L();
1040
+ console.log(
1041
+ JSON.stringify(
1042
+ {
1043
+ profileMaturity: m.MCPGOV_PROFILE_MATURITY_V2,
1044
+ invocationLifecycle: m.MCPGOV_INVOCATION_LIFECYCLE_V2,
1045
+ },
1046
+ null,
1047
+ 2,
1048
+ ),
1049
+ );
1050
+ });
1051
+ parent
1052
+ .command("mcpgov-config-v2")
1053
+ .description("Show V2 config")
1054
+ .action(async () => {
1055
+ const m = await L();
1056
+ console.log(
1057
+ JSON.stringify(
1058
+ {
1059
+ maxActive: m.getMaxActiveMcpgovProfilesPerOwnerV2(),
1060
+ maxPending: m.getMaxPendingMcpgovInvocationsPerProfileV2(),
1061
+ idleMs: m.getMcpgovProfileIdleMsV2(),
1062
+ stuckMs: m.getMcpgovInvocationStuckMsV2(),
1063
+ },
1064
+ null,
1065
+ 2,
1066
+ ),
1067
+ );
1068
+ });
1069
+ parent
1070
+ .command("mcpgov-set-max-active-v2 <n>")
1071
+ .description("Set max active")
1072
+ .action(async (n) => {
1073
+ (await L()).setMaxActiveMcpgovProfilesPerOwnerV2(Number(n));
1074
+ console.log("ok");
1075
+ });
1076
+ parent
1077
+ .command("mcpgov-set-max-pending-v2 <n>")
1078
+ .description("Set max pending")
1079
+ .action(async (n) => {
1080
+ (await L()).setMaxPendingMcpgovInvocationsPerProfileV2(Number(n));
1081
+ console.log("ok");
1082
+ });
1083
+ parent
1084
+ .command("mcpgov-set-idle-ms-v2 <n>")
1085
+ .description("Set idle threshold ms")
1086
+ .action(async (n) => {
1087
+ (await L()).setMcpgovProfileIdleMsV2(Number(n));
1088
+ console.log("ok");
1089
+ });
1090
+ parent
1091
+ .command("mcpgov-set-stuck-ms-v2 <n>")
1092
+ .description("Set stuck threshold ms")
1093
+ .action(async (n) => {
1094
+ (await L()).setMcpgovInvocationStuckMsV2(Number(n));
1095
+ console.log("ok");
1096
+ });
1097
+ parent
1098
+ .command("mcpgov-register-v2 <id> <owner>")
1099
+ .description("Register V2 profile")
1100
+ .option("--transport <v>", "transport")
1101
+ .action(async (id, owner, o) => {
1102
+ const m = await L();
1103
+ console.log(
1104
+ JSON.stringify(
1105
+ m.registerMcpgovProfileV2({ id, owner, transport: o.transport }),
1106
+ null,
1107
+ 2,
1108
+ ),
1109
+ );
1110
+ });
1111
+ parent
1112
+ .command("mcpgov-activate-v2 <id>")
1113
+ .description("Activate profile")
1114
+ .action(async (id) => {
1115
+ console.log(
1116
+ JSON.stringify((await L()).activateMcpgovProfileV2(id), null, 2),
1117
+ );
1118
+ });
1119
+ parent
1120
+ .command("mcpgov-suspend-v2 <id>")
1121
+ .description("Suspend profile")
1122
+ .action(async (id) => {
1123
+ console.log(
1124
+ JSON.stringify((await L()).suspendMcpgovProfileV2(id), null, 2),
1125
+ );
1126
+ });
1127
+ parent
1128
+ .command("mcpgov-archive-v2 <id>")
1129
+ .description("Archive profile")
1130
+ .action(async (id) => {
1131
+ console.log(
1132
+ JSON.stringify((await L()).archiveMcpgovProfileV2(id), null, 2),
1133
+ );
1134
+ });
1135
+ parent
1136
+ .command("mcpgov-touch-v2 <id>")
1137
+ .description("Touch profile")
1138
+ .action(async (id) => {
1139
+ console.log(
1140
+ JSON.stringify((await L()).touchMcpgovProfileV2(id), null, 2),
1141
+ );
1142
+ });
1143
+ parent
1144
+ .command("mcpgov-get-v2 <id>")
1145
+ .description("Get profile")
1146
+ .action(async (id) => {
1147
+ console.log(JSON.stringify((await L()).getMcpgovProfileV2(id), null, 2));
1148
+ });
1149
+ parent
1150
+ .command("mcpgov-list-v2")
1151
+ .description("List profiles")
1152
+ .action(async () => {
1153
+ console.log(JSON.stringify((await L()).listMcpgovProfilesV2(), null, 2));
1154
+ });
1155
+ parent
1156
+ .command("mcpgov-create-invocation-v2 <id> <profileId>")
1157
+ .description("Create invocation")
1158
+ .option("--tool <v>", "tool")
1159
+ .action(async (id, profileId, o) => {
1160
+ const m = await L();
1161
+ console.log(
1162
+ JSON.stringify(
1163
+ m.createMcpgovInvocationV2({ id, profileId, tool: o.tool }),
1164
+ null,
1165
+ 2,
1166
+ ),
1167
+ );
1168
+ });
1169
+ parent
1170
+ .command("mcpgov-invoking-invocation-v2 <id>")
1171
+ .description("Mark invocation as invoking")
1172
+ .action(async (id) => {
1173
+ console.log(
1174
+ JSON.stringify((await L()).invokingMcpgovInvocationV2(id), null, 2),
1175
+ );
1176
+ });
1177
+ parent
1178
+ .command("mcpgov-complete-invocation-v2 <id>")
1179
+ .description("Complete invocation")
1180
+ .action(async (id) => {
1181
+ console.log(
1182
+ JSON.stringify((await L()).completeInvocationMcpgovV2(id), null, 2),
1183
+ );
1184
+ });
1185
+ parent
1186
+ .command("mcpgov-fail-invocation-v2 <id> [reason]")
1187
+ .description("Fail invocation")
1188
+ .action(async (id, reason) => {
1189
+ console.log(
1190
+ JSON.stringify((await L()).failMcpgovInvocationV2(id, reason), null, 2),
1191
+ );
1192
+ });
1193
+ parent
1194
+ .command("mcpgov-cancel-invocation-v2 <id> [reason]")
1195
+ .description("Cancel invocation")
1196
+ .action(async (id, reason) => {
1197
+ console.log(
1198
+ JSON.stringify(
1199
+ (await L()).cancelMcpgovInvocationV2(id, reason),
1200
+ null,
1201
+ 2,
1202
+ ),
1203
+ );
1204
+ });
1205
+ parent
1206
+ .command("mcpgov-get-invocation-v2 <id>")
1207
+ .description("Get invocation")
1208
+ .action(async (id) => {
1209
+ console.log(
1210
+ JSON.stringify((await L()).getMcpgovInvocationV2(id), null, 2),
1211
+ );
1212
+ });
1213
+ parent
1214
+ .command("mcpgov-list-invocations-v2")
1215
+ .description("List invocations")
1216
+ .action(async () => {
1217
+ console.log(
1218
+ JSON.stringify((await L()).listMcpgovInvocationsV2(), null, 2),
1219
+ );
1220
+ });
1221
+ parent
1222
+ .command("mcpgov-auto-suspend-idle-v2")
1223
+ .description("Auto-suspend idle")
1224
+ .action(async () => {
1225
+ console.log(
1226
+ JSON.stringify((await L()).autoSuspendIdleMcpgovProfilesV2(), null, 2),
1227
+ );
1228
+ });
1229
+ parent
1230
+ .command("mcpgov-auto-fail-stuck-v2")
1231
+ .description("Auto-fail stuck invocations")
1232
+ .action(async () => {
1233
+ console.log(
1234
+ JSON.stringify((await L()).autoFailStuckMcpgovInvocationsV2(), null, 2),
1235
+ );
1236
+ });
1237
+ parent
1238
+ .command("mcpgov-gov-stats-v2")
1239
+ .description("V2 gov stats")
1240
+ .action(async () => {
1241
+ console.log(
1242
+ JSON.stringify((await L()).getMcpRegistryGovStatsV2(), null, 2),
1243
+ );
1244
+ });
1245
+ }
@@ -2,40 +2,152 @@
2
2
  * `cc mcpscaf` — MCP Scaffold V2 governance overlay (in-memory, atop lib/mcp-scaffold.js).
3
3
  */
4
4
  import {
5
- MSCAF_PROFILE_MATURITY_V2, MSCAF_GENERATION_LIFECYCLE_V2,
6
- setMaxActiveMscafProfilesPerOwnerV2, getMaxActiveMscafProfilesPerOwnerV2,
7
- setMaxPendingMscafGenerationsPerProfileV2, getMaxPendingMscafGenerationsPerProfileV2,
8
- setMscafProfileIdleMsV2, getMscafProfileIdleMsV2,
9
- setMscafGenerationStuckMsV2, getMscafGenerationStuckMsV2,
10
- registerMscafProfileV2, activateMscafProfileV2, staleMscafProfileV2, archiveMscafProfileV2, touchMscafProfileV2, getMscafProfileV2, listMscafProfilesV2,
11
- createMscafGenerationV2, generatingMscafGenerationV2, generateMscafGenerationV2, failMscafGenerationV2, cancelMscafGenerationV2, getMscafGenerationV2, listMscafGenerationsV2,
12
- autoStaleIdleMscafProfilesV2, autoFailStuckMscafGenerationsV2, getMcpScaffoldGovStatsV2, _resetStateMcpScaffoldV2,
5
+ MSCAF_PROFILE_MATURITY_V2,
6
+ MSCAF_GENERATION_LIFECYCLE_V2,
7
+ setMaxActiveMscafProfilesPerOwnerV2,
8
+ getMaxActiveMscafProfilesPerOwnerV2,
9
+ setMaxPendingMscafGenerationsPerProfileV2,
10
+ getMaxPendingMscafGenerationsPerProfileV2,
11
+ setMscafProfileIdleMsV2,
12
+ getMscafProfileIdleMsV2,
13
+ setMscafGenerationStuckMsV2,
14
+ getMscafGenerationStuckMsV2,
15
+ registerMscafProfileV2,
16
+ activateMscafProfileV2,
17
+ staleMscafProfileV2,
18
+ archiveMscafProfileV2,
19
+ touchMscafProfileV2,
20
+ getMscafProfileV2,
21
+ listMscafProfilesV2,
22
+ createMscafGenerationV2,
23
+ generatingMscafGenerationV2,
24
+ generateMscafGenerationV2,
25
+ failMscafGenerationV2,
26
+ cancelMscafGenerationV2,
27
+ getMscafGenerationV2,
28
+ listMscafGenerationsV2,
29
+ autoStaleIdleMscafProfilesV2,
30
+ autoFailStuckMscafGenerationsV2,
31
+ getMcpScaffoldGovStatsV2,
32
+ _resetStateMcpScaffoldV2,
13
33
  } from "../lib/mcp-scaffold.js";
14
34
 
15
35
  export function registerMcpscafCommand(program) {
16
- const ms = program.command("mcpscaf").description("MCP Scaffold V2 governance");
17
- ms.command("enums-v2").action(() => console.log(JSON.stringify({ profileMaturity: MSCAF_PROFILE_MATURITY_V2, generationLifecycle: MSCAF_GENERATION_LIFECYCLE_V2 }, null, 2)));
18
- ms.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveMscafProfilesPerOwner: getMaxActiveMscafProfilesPerOwnerV2(), maxPendingMscafGenerationsPerProfile: getMaxPendingMscafGenerationsPerProfileV2(), mscafProfileIdleMs: getMscafProfileIdleMsV2(), mscafGenerationStuckMs: getMscafGenerationStuckMsV2() }, null, 2)));
19
- ms.command("set-max-active-v2 <n>").action((n) => { setMaxActiveMscafProfilesPerOwnerV2(Number(n)); console.log("ok"); });
20
- ms.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingMscafGenerationsPerProfileV2(Number(n)); console.log("ok"); });
21
- ms.command("set-idle-ms-v2 <n>").action((n) => { setMscafProfileIdleMsV2(Number(n)); console.log("ok"); });
22
- ms.command("set-stuck-ms-v2 <n>").action((n) => { setMscafGenerationStuckMsV2(Number(n)); console.log("ok"); });
23
- ms.command("register-profile-v2 <id> <owner>").option("--transport <t>", "transport").action((id, owner, o) => console.log(JSON.stringify(registerMscafProfileV2({ id, owner, transport: o.transport }), null, 2)));
24
- ms.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activateMscafProfileV2(id), null, 2)));
25
- ms.command("stale-profile-v2 <id>").action((id) => console.log(JSON.stringify(staleMscafProfileV2(id), null, 2)));
26
- ms.command("archive-profile-v2 <id>").action((id) => console.log(JSON.stringify(archiveMscafProfileV2(id), null, 2)));
27
- ms.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchMscafProfileV2(id), null, 2)));
28
- ms.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getMscafProfileV2(id), null, 2)));
29
- ms.command("list-profiles-v2").action(() => console.log(JSON.stringify(listMscafProfilesV2(), null, 2)));
30
- ms.command("create-generation-v2 <id> <profileId>").option("--target <t>", "target").action((id, profileId, o) => console.log(JSON.stringify(createMscafGenerationV2({ id, profileId, target: o.target }), null, 2)));
31
- ms.command("generating-generation-v2 <id>").action((id) => console.log(JSON.stringify(generatingMscafGenerationV2(id), null, 2)));
32
- ms.command("generate-generation-v2 <id>").action((id) => console.log(JSON.stringify(generateMscafGenerationV2(id), null, 2)));
33
- ms.command("fail-generation-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failMscafGenerationV2(id, reason), null, 2)));
34
- ms.command("cancel-generation-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelMscafGenerationV2(id, reason), null, 2)));
35
- ms.command("get-generation-v2 <id>").action((id) => console.log(JSON.stringify(getMscafGenerationV2(id), null, 2)));
36
- ms.command("list-generations-v2").action(() => console.log(JSON.stringify(listMscafGenerationsV2(), null, 2)));
37
- ms.command("auto-stale-idle-v2").action(() => console.log(JSON.stringify(autoStaleIdleMscafProfilesV2(), null, 2)));
38
- ms.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckMscafGenerationsV2(), null, 2)));
39
- ms.command("gov-stats-v2").action(() => console.log(JSON.stringify(getMcpScaffoldGovStatsV2(), null, 2)));
40
- ms.command("reset-state-v2").action(() => { _resetStateMcpScaffoldV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
36
+ const ms = program
37
+ .command("mcpscaf")
38
+ .description("MCP Scaffold V2 governance");
39
+ ms.command("enums-v2").action(() =>
40
+ console.log(
41
+ JSON.stringify(
42
+ {
43
+ profileMaturity: MSCAF_PROFILE_MATURITY_V2,
44
+ generationLifecycle: MSCAF_GENERATION_LIFECYCLE_V2,
45
+ },
46
+ null,
47
+ 2,
48
+ ),
49
+ ),
50
+ );
51
+ ms.command("config-v2").action(() =>
52
+ console.log(
53
+ JSON.stringify(
54
+ {
55
+ maxActiveMscafProfilesPerOwner: getMaxActiveMscafProfilesPerOwnerV2(),
56
+ maxPendingMscafGenerationsPerProfile:
57
+ getMaxPendingMscafGenerationsPerProfileV2(),
58
+ mscafProfileIdleMs: getMscafProfileIdleMsV2(),
59
+ mscafGenerationStuckMs: getMscafGenerationStuckMsV2(),
60
+ },
61
+ null,
62
+ 2,
63
+ ),
64
+ ),
65
+ );
66
+ ms.command("set-max-active-v2 <n>").action((n) => {
67
+ setMaxActiveMscafProfilesPerOwnerV2(Number(n));
68
+ console.log("ok");
69
+ });
70
+ ms.command("set-max-pending-v2 <n>").action((n) => {
71
+ setMaxPendingMscafGenerationsPerProfileV2(Number(n));
72
+ console.log("ok");
73
+ });
74
+ ms.command("set-idle-ms-v2 <n>").action((n) => {
75
+ setMscafProfileIdleMsV2(Number(n));
76
+ console.log("ok");
77
+ });
78
+ ms.command("set-stuck-ms-v2 <n>").action((n) => {
79
+ setMscafGenerationStuckMsV2(Number(n));
80
+ console.log("ok");
81
+ });
82
+ ms.command("register-profile-v2 <id> <owner>")
83
+ .option("--transport <t>", "transport")
84
+ .action((id, owner, o) =>
85
+ console.log(
86
+ JSON.stringify(
87
+ registerMscafProfileV2({ id, owner, transport: o.transport }),
88
+ null,
89
+ 2,
90
+ ),
91
+ ),
92
+ );
93
+ ms.command("activate-profile-v2 <id>").action((id) =>
94
+ console.log(JSON.stringify(activateMscafProfileV2(id), null, 2)),
95
+ );
96
+ ms.command("stale-profile-v2 <id>").action((id) =>
97
+ console.log(JSON.stringify(staleMscafProfileV2(id), null, 2)),
98
+ );
99
+ ms.command("archive-profile-v2 <id>").action((id) =>
100
+ console.log(JSON.stringify(archiveMscafProfileV2(id), null, 2)),
101
+ );
102
+ ms.command("touch-profile-v2 <id>").action((id) =>
103
+ console.log(JSON.stringify(touchMscafProfileV2(id), null, 2)),
104
+ );
105
+ ms.command("get-profile-v2 <id>").action((id) =>
106
+ console.log(JSON.stringify(getMscafProfileV2(id), null, 2)),
107
+ );
108
+ ms.command("list-profiles-v2").action(() =>
109
+ console.log(JSON.stringify(listMscafProfilesV2(), null, 2)),
110
+ );
111
+ ms.command("create-generation-v2 <id> <profileId>")
112
+ .option("--target <t>", "target")
113
+ .action((id, profileId, o) =>
114
+ console.log(
115
+ JSON.stringify(
116
+ createMscafGenerationV2({ id, profileId, target: o.target }),
117
+ null,
118
+ 2,
119
+ ),
120
+ ),
121
+ );
122
+ ms.command("generating-generation-v2 <id>").action((id) =>
123
+ console.log(JSON.stringify(generatingMscafGenerationV2(id), null, 2)),
124
+ );
125
+ ms.command("generate-generation-v2 <id>").action((id) =>
126
+ console.log(JSON.stringify(generateMscafGenerationV2(id), null, 2)),
127
+ );
128
+ ms.command("fail-generation-v2 <id> [reason]").action((id, reason) =>
129
+ console.log(JSON.stringify(failMscafGenerationV2(id, reason), null, 2)),
130
+ );
131
+ ms.command("cancel-generation-v2 <id> [reason]").action((id, reason) =>
132
+ console.log(JSON.stringify(cancelMscafGenerationV2(id, reason), null, 2)),
133
+ );
134
+ ms.command("get-generation-v2 <id>").action((id) =>
135
+ console.log(JSON.stringify(getMscafGenerationV2(id), null, 2)),
136
+ );
137
+ ms.command("list-generations-v2").action(() =>
138
+ console.log(JSON.stringify(listMscafGenerationsV2(), null, 2)),
139
+ );
140
+ ms.command("auto-stale-idle-v2").action(() =>
141
+ console.log(JSON.stringify(autoStaleIdleMscafProfilesV2(), null, 2)),
142
+ );
143
+ ms.command("auto-fail-stuck-v2").action(() =>
144
+ console.log(JSON.stringify(autoFailStuckMscafGenerationsV2(), null, 2)),
145
+ );
146
+ ms.command("gov-stats-v2").action(() =>
147
+ console.log(JSON.stringify(getMcpScaffoldGovStatsV2(), null, 2)),
148
+ );
149
+ ms.command("reset-state-v2").action(() => {
150
+ _resetStateMcpScaffoldV2();
151
+ console.log(JSON.stringify({ ok: true }, null, 2));
152
+ });
41
153
  }
@@ -2,40 +2,152 @@
2
2
  * `cc meminj` — Memory Injection V2 governance overlay (in-memory, atop lib/memory-injection.js).
3
3
  */
4
4
  import {
5
- MINJ_RULE_MATURITY_V2, MINJ_INJECTION_LIFECYCLE_V2,
6
- setMaxActiveMinjRulesPerOwnerV2, getMaxActiveMinjRulesPerOwnerV2,
7
- setMaxPendingMinjInjectionsPerRuleV2, getMaxPendingMinjInjectionsPerRuleV2,
8
- setMinjRuleIdleMsV2, getMinjRuleIdleMsV2,
9
- setMinjInjectionStuckMsV2, getMinjInjectionStuckMsV2,
10
- registerMinjRuleV2, activateMinjRuleV2, pauseMinjRuleV2, archiveMinjRuleV2, touchMinjRuleV2, getMinjRuleV2, listMinjRulesV2,
11
- createMinjInjectionV2, injectingMinjInjectionV2, applyMinjInjectionV2, failMinjInjectionV2, cancelMinjInjectionV2, getMinjInjectionV2, listMinjInjectionsV2,
12
- autoPauseIdleMinjRulesV2, autoFailStuckMinjInjectionsV2, getMemoryInjectionGovStatsV2, _resetStateMemoryInjectionV2,
5
+ MINJ_RULE_MATURITY_V2,
6
+ MINJ_INJECTION_LIFECYCLE_V2,
7
+ setMaxActiveMinjRulesPerOwnerV2,
8
+ getMaxActiveMinjRulesPerOwnerV2,
9
+ setMaxPendingMinjInjectionsPerRuleV2,
10
+ getMaxPendingMinjInjectionsPerRuleV2,
11
+ setMinjRuleIdleMsV2,
12
+ getMinjRuleIdleMsV2,
13
+ setMinjInjectionStuckMsV2,
14
+ getMinjInjectionStuckMsV2,
15
+ registerMinjRuleV2,
16
+ activateMinjRuleV2,
17
+ pauseMinjRuleV2,
18
+ archiveMinjRuleV2,
19
+ touchMinjRuleV2,
20
+ getMinjRuleV2,
21
+ listMinjRulesV2,
22
+ createMinjInjectionV2,
23
+ injectingMinjInjectionV2,
24
+ applyMinjInjectionV2,
25
+ failMinjInjectionV2,
26
+ cancelMinjInjectionV2,
27
+ getMinjInjectionV2,
28
+ listMinjInjectionsV2,
29
+ autoPauseIdleMinjRulesV2,
30
+ autoFailStuckMinjInjectionsV2,
31
+ getMemoryInjectionGovStatsV2,
32
+ _resetStateMemoryInjectionV2,
13
33
  } from "../lib/memory-injection.js";
14
34
 
15
35
  export function registerMeminjCommand(program) {
16
- const mi = program.command("meminj").description("Memory Injection V2 governance");
17
- mi.command("enums-v2").action(() => console.log(JSON.stringify({ ruleMaturity: MINJ_RULE_MATURITY_V2, injectionLifecycle: MINJ_INJECTION_LIFECYCLE_V2 }, null, 2)));
18
- mi.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveMinjRulesPerOwner: getMaxActiveMinjRulesPerOwnerV2(), maxPendingMinjInjectionsPerRule: getMaxPendingMinjInjectionsPerRuleV2(), minjRuleIdleMs: getMinjRuleIdleMsV2(), minjInjectionStuckMs: getMinjInjectionStuckMsV2() }, null, 2)));
19
- mi.command("set-max-active-v2 <n>").action((n) => { setMaxActiveMinjRulesPerOwnerV2(Number(n)); console.log("ok"); });
20
- mi.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingMinjInjectionsPerRuleV2(Number(n)); console.log("ok"); });
21
- mi.command("set-idle-ms-v2 <n>").action((n) => { setMinjRuleIdleMsV2(Number(n)); console.log("ok"); });
22
- mi.command("set-stuck-ms-v2 <n>").action((n) => { setMinjInjectionStuckMsV2(Number(n)); console.log("ok"); });
23
- mi.command("register-rule-v2 <id> <owner>").option("--scope <s>", "scope").action((id, owner, o) => console.log(JSON.stringify(registerMinjRuleV2({ id, owner, scope: o.scope }), null, 2)));
24
- mi.command("activate-rule-v2 <id>").action((id) => console.log(JSON.stringify(activateMinjRuleV2(id), null, 2)));
25
- mi.command("pause-rule-v2 <id>").action((id) => console.log(JSON.stringify(pauseMinjRuleV2(id), null, 2)));
26
- mi.command("archive-rule-v2 <id>").action((id) => console.log(JSON.stringify(archiveMinjRuleV2(id), null, 2)));
27
- mi.command("touch-rule-v2 <id>").action((id) => console.log(JSON.stringify(touchMinjRuleV2(id), null, 2)));
28
- mi.command("get-rule-v2 <id>").action((id) => console.log(JSON.stringify(getMinjRuleV2(id), null, 2)));
29
- mi.command("list-rules-v2").action(() => console.log(JSON.stringify(listMinjRulesV2(), null, 2)));
30
- mi.command("create-injection-v2 <id> <ruleId>").option("--payload <p>", "payload").action((id, ruleId, o) => console.log(JSON.stringify(createMinjInjectionV2({ id, ruleId, payload: o.payload }), null, 2)));
31
- mi.command("injecting-injection-v2 <id>").action((id) => console.log(JSON.stringify(injectingMinjInjectionV2(id), null, 2)));
32
- mi.command("apply-injection-v2 <id>").action((id) => console.log(JSON.stringify(applyMinjInjectionV2(id), null, 2)));
33
- mi.command("fail-injection-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failMinjInjectionV2(id, reason), null, 2)));
34
- mi.command("cancel-injection-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelMinjInjectionV2(id, reason), null, 2)));
35
- mi.command("get-injection-v2 <id>").action((id) => console.log(JSON.stringify(getMinjInjectionV2(id), null, 2)));
36
- mi.command("list-injections-v2").action(() => console.log(JSON.stringify(listMinjInjectionsV2(), null, 2)));
37
- mi.command("auto-pause-idle-v2").action(() => console.log(JSON.stringify(autoPauseIdleMinjRulesV2(), null, 2)));
38
- mi.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckMinjInjectionsV2(), null, 2)));
39
- mi.command("gov-stats-v2").action(() => console.log(JSON.stringify(getMemoryInjectionGovStatsV2(), null, 2)));
40
- mi.command("reset-state-v2").action(() => { _resetStateMemoryInjectionV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
36
+ const mi = program
37
+ .command("meminj")
38
+ .description("Memory Injection V2 governance");
39
+ mi.command("enums-v2").action(() =>
40
+ console.log(
41
+ JSON.stringify(
42
+ {
43
+ ruleMaturity: MINJ_RULE_MATURITY_V2,
44
+ injectionLifecycle: MINJ_INJECTION_LIFECYCLE_V2,
45
+ },
46
+ null,
47
+ 2,
48
+ ),
49
+ ),
50
+ );
51
+ mi.command("config-v2").action(() =>
52
+ console.log(
53
+ JSON.stringify(
54
+ {
55
+ maxActiveMinjRulesPerOwner: getMaxActiveMinjRulesPerOwnerV2(),
56
+ maxPendingMinjInjectionsPerRule:
57
+ getMaxPendingMinjInjectionsPerRuleV2(),
58
+ minjRuleIdleMs: getMinjRuleIdleMsV2(),
59
+ minjInjectionStuckMs: getMinjInjectionStuckMsV2(),
60
+ },
61
+ null,
62
+ 2,
63
+ ),
64
+ ),
65
+ );
66
+ mi.command("set-max-active-v2 <n>").action((n) => {
67
+ setMaxActiveMinjRulesPerOwnerV2(Number(n));
68
+ console.log("ok");
69
+ });
70
+ mi.command("set-max-pending-v2 <n>").action((n) => {
71
+ setMaxPendingMinjInjectionsPerRuleV2(Number(n));
72
+ console.log("ok");
73
+ });
74
+ mi.command("set-idle-ms-v2 <n>").action((n) => {
75
+ setMinjRuleIdleMsV2(Number(n));
76
+ console.log("ok");
77
+ });
78
+ mi.command("set-stuck-ms-v2 <n>").action((n) => {
79
+ setMinjInjectionStuckMsV2(Number(n));
80
+ console.log("ok");
81
+ });
82
+ mi.command("register-rule-v2 <id> <owner>")
83
+ .option("--scope <s>", "scope")
84
+ .action((id, owner, o) =>
85
+ console.log(
86
+ JSON.stringify(
87
+ registerMinjRuleV2({ id, owner, scope: o.scope }),
88
+ null,
89
+ 2,
90
+ ),
91
+ ),
92
+ );
93
+ mi.command("activate-rule-v2 <id>").action((id) =>
94
+ console.log(JSON.stringify(activateMinjRuleV2(id), null, 2)),
95
+ );
96
+ mi.command("pause-rule-v2 <id>").action((id) =>
97
+ console.log(JSON.stringify(pauseMinjRuleV2(id), null, 2)),
98
+ );
99
+ mi.command("archive-rule-v2 <id>").action((id) =>
100
+ console.log(JSON.stringify(archiveMinjRuleV2(id), null, 2)),
101
+ );
102
+ mi.command("touch-rule-v2 <id>").action((id) =>
103
+ console.log(JSON.stringify(touchMinjRuleV2(id), null, 2)),
104
+ );
105
+ mi.command("get-rule-v2 <id>").action((id) =>
106
+ console.log(JSON.stringify(getMinjRuleV2(id), null, 2)),
107
+ );
108
+ mi.command("list-rules-v2").action(() =>
109
+ console.log(JSON.stringify(listMinjRulesV2(), null, 2)),
110
+ );
111
+ mi.command("create-injection-v2 <id> <ruleId>")
112
+ .option("--payload <p>", "payload")
113
+ .action((id, ruleId, o) =>
114
+ console.log(
115
+ JSON.stringify(
116
+ createMinjInjectionV2({ id, ruleId, payload: o.payload }),
117
+ null,
118
+ 2,
119
+ ),
120
+ ),
121
+ );
122
+ mi.command("injecting-injection-v2 <id>").action((id) =>
123
+ console.log(JSON.stringify(injectingMinjInjectionV2(id), null, 2)),
124
+ );
125
+ mi.command("apply-injection-v2 <id>").action((id) =>
126
+ console.log(JSON.stringify(applyMinjInjectionV2(id), null, 2)),
127
+ );
128
+ mi.command("fail-injection-v2 <id> [reason]").action((id, reason) =>
129
+ console.log(JSON.stringify(failMinjInjectionV2(id, reason), null, 2)),
130
+ );
131
+ mi.command("cancel-injection-v2 <id> [reason]").action((id, reason) =>
132
+ console.log(JSON.stringify(cancelMinjInjectionV2(id, reason), null, 2)),
133
+ );
134
+ mi.command("get-injection-v2 <id>").action((id) =>
135
+ console.log(JSON.stringify(getMinjInjectionV2(id), null, 2)),
136
+ );
137
+ mi.command("list-injections-v2").action(() =>
138
+ console.log(JSON.stringify(listMinjInjectionsV2(), null, 2)),
139
+ );
140
+ mi.command("auto-pause-idle-v2").action(() =>
141
+ console.log(JSON.stringify(autoPauseIdleMinjRulesV2(), null, 2)),
142
+ );
143
+ mi.command("auto-fail-stuck-v2").action(() =>
144
+ console.log(JSON.stringify(autoFailStuckMinjInjectionsV2(), null, 2)),
145
+ );
146
+ mi.command("gov-stats-v2").action(() =>
147
+ console.log(JSON.stringify(getMemoryInjectionGovStatsV2(), null, 2)),
148
+ );
149
+ mi.command("reset-state-v2").action(() => {
150
+ _resetStateMemoryInjectionV2();
151
+ console.log(JSON.stringify({ ok: true }, null, 2));
152
+ });
41
153
  }