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.
- package/package.json +1 -1
- package/src/commands/a2a.js +196 -28
- package/src/commands/activitypub.js +364 -27
- package/src/commands/agent-network.js +217 -0
- package/src/commands/agent.js +587 -103
- package/src/commands/audit.js +206 -0
- package/src/commands/automation.js +201 -0
- package/src/commands/bi.js +355 -27
- package/src/commands/bm25.js +111 -27
- package/src/commands/browse.js +403 -29
- package/src/commands/ccron.js +128 -28
- package/src/commands/chat.js +207 -0
- package/src/commands/codegen.js +207 -0
- package/src/commands/collab.js +211 -0
- package/src/commands/compliance.js +824 -34
- package/src/commands/compt.js +127 -29
- package/src/commands/consol.js +8 -2
- package/src/commands/cowork.js +783 -34
- package/src/commands/crosschain.js +182 -28
- package/src/commands/dao.js +182 -28
- package/src/commands/dbevo.js +227 -0
- package/src/commands/dev.js +207 -0
- package/src/commands/did-v2.js +217 -0
- package/src/commands/did.js +221 -0
- package/src/commands/dlp.js +385 -27
- package/src/commands/economy.js +205 -50
- package/src/commands/evolution.js +203 -50
- package/src/commands/evomap.js +387 -27
- package/src/commands/export.js +213 -0
- package/src/commands/federation.js +209 -0
- package/src/commands/fflag.js +74 -22
- package/src/commands/fusion.js +205 -0
- package/src/commands/git.js +177 -37
- package/src/commands/governance.js +209 -0
- package/src/commands/hardening.js +209 -0
- package/src/commands/hmemory.js +204 -50
- package/src/commands/hook.js +209 -0
- package/src/commands/import.js +209 -0
- package/src/commands/incentive.js +209 -0
- package/src/commands/inference.js +170 -34
- package/src/commands/infra.js +203 -0
- package/src/commands/instinct.js +209 -0
- package/src/commands/ipfs.js +207 -0
- package/src/commands/itbudget.js +149 -33
- package/src/commands/kg.js +206 -0
- package/src/commands/llm.js +217 -0
- package/src/commands/lowcode.js +195 -38
- package/src/commands/marketplace.js +206 -0
- package/src/commands/matrix.js +386 -27
- package/src/commands/mcp.js +217 -0
- package/src/commands/mcpscaf.js +145 -33
- package/src/commands/meminj.js +145 -33
- package/src/commands/memory.js +209 -0
- package/src/commands/multimodal.js +203 -0
- package/src/commands/nlprog.js +225 -0
- package/src/commands/nostr.js +387 -27
- package/src/commands/note.js +205 -0
- package/src/commands/ops.js +219 -0
- package/src/commands/orchestrate.js +217 -0
- package/src/commands/orchgov.js +144 -33
- package/src/commands/org.js +209 -0
- package/src/commands/p2p.js +209 -0
- package/src/commands/pdfp.js +109 -27
- package/src/commands/perception.js +209 -0
- package/src/commands/perf.js +169 -32
- package/src/commands/perm.js +144 -33
- package/src/commands/permmem.js +203 -0
- package/src/commands/pipeline.js +207 -52
- package/src/commands/planmode.js +141 -32
- package/src/commands/plugin-ecosystem.js +209 -0
- package/src/commands/pqc.js +213 -0
- package/src/commands/privacy.js +203 -0
- package/src/commands/promcomp.js +111 -27
- package/src/commands/quantization.js +207 -0
- package/src/commands/rcache.js +205 -0
- package/src/commands/recommend.js +410 -34
- package/src/commands/reputation.js +208 -0
- package/src/commands/runtime.js +205 -0
- package/src/commands/sandbox.js +206 -0
- package/src/commands/scim.js +209 -0
- package/src/commands/seshhook.js +145 -33
- package/src/commands/seshsearch.js +141 -33
- package/src/commands/seshtail.js +144 -33
- package/src/commands/seshu.js +152 -33
- package/src/commands/session.js +209 -0
- package/src/commands/sganal.js +123 -29
- package/src/commands/siem.js +201 -34
- package/src/commands/skill.js +207 -0
- package/src/commands/sla.js +212 -0
- package/src/commands/slotfill.js +146 -33
- package/src/commands/social.js +358 -32
- package/src/commands/sso.js +209 -0
- package/src/commands/stress.js +206 -0
- package/src/commands/svccont.js +145 -33
- package/src/commands/sync.js +209 -0
- package/src/commands/tech.js +209 -0
- package/src/commands/tenant.js +217 -0
- package/src/commands/terraform.js +206 -0
- package/src/commands/tms.js +171 -33
- package/src/commands/tokens.js +209 -0
- package/src/commands/topiccls.js +146 -33
- package/src/commands/trust.js +217 -0
- package/src/commands/uprof.js +141 -32
- package/src/commands/vcheck.js +122 -28
- package/src/commands/wallet.js +209 -0
- package/src/commands/webfetch.js +141 -32
- package/src/commands/workflow.js +203 -0
- package/src/commands/zkp.js +184 -28
- package/src/index.js +180 -0
- package/src/lib/a2a-protocol.js +319 -51
- package/src/lib/activitypub-bridge.js +622 -50
- package/src/lib/agent-economy.js +304 -51
- package/src/lib/agent-network.js +341 -0
- package/src/lib/aiops.js +346 -0
- package/src/lib/app-builder.js +279 -46
- package/src/lib/audit-logger.js +321 -0
- package/src/lib/automation-engine.js +335 -0
- package/src/lib/autonomous-agent.js +284 -48
- package/src/lib/autonomous-developer.js +332 -0
- package/src/lib/bi-engine.js +616 -49
- package/src/lib/bm25-search.js +301 -49
- package/src/lib/browser-automation.js +630 -49
- package/src/lib/chat-core.js +336 -0
- package/src/lib/claude-code-bridge.js +341 -0
- package/src/lib/code-agent.js +339 -0
- package/src/lib/collaboration-governance.js +334 -0
- package/src/lib/community-governance.js +346 -0
- package/src/lib/compliance-framework-reporter.js +305 -51
- package/src/lib/compliance-manager.js +330 -0
- package/src/lib/compression-telemetry.js +301 -49
- package/src/lib/content-recommendation.js +351 -0
- package/src/lib/content-recommender.js +317 -52
- package/src/lib/cowork-cron.js +298 -49
- package/src/lib/cowork-learning.js +333 -0
- package/src/lib/cowork-share.js +338 -0
- package/src/lib/cowork-task-runner.js +308 -51
- package/src/lib/cowork-workflow.js +327 -0
- package/src/lib/cross-chain.js +311 -51
- package/src/lib/dao-governance.js +280 -46
- package/src/lib/dbevo.js +351 -0
- package/src/lib/decentral-infra.js +330 -0
- package/src/lib/did-manager.js +341 -0
- package/src/lib/did-v2-manager.js +341 -0
- package/src/lib/dlp-engine.js +626 -49
- package/src/lib/evolution-system.js +278 -47
- package/src/lib/evomap-governance.js +334 -0
- package/src/lib/evomap-manager.js +280 -46
- package/src/lib/execution-backend.js +294 -48
- package/src/lib/feature-flags.js +294 -49
- package/src/lib/federation-hardening.js +340 -0
- package/src/lib/git-integration.js +285 -47
- package/src/lib/hardening-manager.js +341 -0
- package/src/lib/hierarchical-memory.js +284 -48
- package/src/lib/hook-manager.js +341 -0
- package/src/lib/inference-network.js +308 -51
- package/src/lib/instinct-manager.js +346 -0
- package/src/lib/ipfs-storage.js +334 -0
- package/src/lib/iteration-budget.js +302 -50
- package/src/lib/knowledge-exporter.js +341 -0
- package/src/lib/knowledge-graph.js +333 -0
- package/src/lib/knowledge-importer.js +341 -0
- package/src/lib/llm-providers.js +346 -0
- package/src/lib/matrix-bridge.js +620 -47
- package/src/lib/mcp-registry.js +346 -0
- package/src/lib/mcp-scaffold.js +318 -54
- package/src/lib/memory-injection.js +288 -49
- package/src/lib/memory-manager.js +336 -0
- package/src/lib/multimodal.js +330 -0
- package/src/lib/nl-programming.js +341 -0
- package/src/lib/nostr-bridge.js +622 -49
- package/src/lib/note-versioning.js +339 -0
- package/src/lib/orchestrator.js +293 -48
- package/src/lib/org-manager.js +336 -0
- package/src/lib/p2p-manager.js +341 -0
- package/src/lib/pdf-parser.js +298 -49
- package/src/lib/perception.js +346 -0
- package/src/lib/perf-tuning.js +309 -50
- package/src/lib/permanent-memory.js +327 -0
- package/src/lib/permission-engine.js +287 -49
- package/src/lib/pipeline-orchestrator.js +289 -49
- package/src/lib/plan-mode.js +298 -51
- package/src/lib/plugin-ecosystem.js +346 -0
- package/src/lib/pqc-manager.js +346 -0
- package/src/lib/privacy-computing.js +335 -0
- package/src/lib/protocol-fusion.js +338 -0
- package/src/lib/quantization.js +337 -0
- package/src/lib/reputation-optimizer.js +340 -0
- package/src/lib/response-cache.js +333 -0
- package/src/lib/sandbox-v2.js +327 -0
- package/src/lib/scim-manager.js +346 -0
- package/src/lib/service-container.js +313 -52
- package/src/lib/session-consolidator.js +296 -49
- package/src/lib/session-hooks.js +312 -53
- package/src/lib/session-manager.js +334 -0
- package/src/lib/session-search.js +304 -51
- package/src/lib/session-tail.js +288 -49
- package/src/lib/session-usage.js +298 -52
- package/src/lib/siem-exporter.js +298 -51
- package/src/lib/skill-loader.js +334 -0
- package/src/lib/skill-marketplace.js +345 -0
- package/src/lib/sla-manager.js +341 -0
- package/src/lib/slot-filler.js +303 -51
- package/src/lib/social-graph-analytics.js +295 -49
- package/src/lib/social-graph.js +272 -49
- package/src/lib/social-manager.js +330 -0
- package/src/lib/sso-manager.js +340 -0
- package/src/lib/stress-tester.js +342 -0
- package/src/lib/sub-agent-registry.js +302 -53
- package/src/lib/sync-manager.js +336 -0
- package/src/lib/task-model-selector.js +302 -50
- package/src/lib/tech-learning-engine.js +341 -0
- package/src/lib/tenant-saas.js +341 -0
- package/src/lib/terraform-manager.js +333 -0
- package/src/lib/threat-intel.js +330 -0
- package/src/lib/todo-manager.js +281 -47
- package/src/lib/token-incentive.js +341 -0
- package/src/lib/token-tracker.js +336 -0
- package/src/lib/topic-classifier.js +297 -49
- package/src/lib/trust-security.js +343 -0
- package/src/lib/ueba.js +340 -0
- package/src/lib/universal-runtime.js +330 -0
- package/src/lib/user-profile.js +294 -50
- package/src/lib/version-checker.js +304 -50
- package/src/lib/wallet-manager.js +336 -0
- package/src/lib/web-fetch.js +292 -51
- package/src/lib/workflow-engine.js +330 -0
- package/src/lib/zkp-engine.js +286 -49
package/src/commands/mcp.js
CHANGED
|
@@ -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
|
+
}
|
package/src/commands/mcpscaf.js
CHANGED
|
@@ -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,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ms.command("
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
ms.command("
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
}
|
package/src/commands/meminj.js
CHANGED
|
@@ -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,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
mi.command("
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
mi.command("
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
}
|