chainlesschain 0.145.0 → 0.156.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 (184) hide show
  1. package/README.md +52 -3
  2. package/package.json +1 -1
  3. package/src/commands/a2a.js +201 -0
  4. package/src/commands/activitypub.js +207 -0
  5. package/src/commands/agent-network.js +217 -0
  6. package/src/commands/agent.js +1250 -0
  7. package/src/commands/automation.js +201 -0
  8. package/src/commands/bi.js +203 -0
  9. package/src/commands/browse.js +213 -0
  10. package/src/commands/chat.js +605 -0
  11. package/src/commands/cli-anything.js +426 -0
  12. package/src/commands/codegen.js +207 -0
  13. package/src/commands/collab.js +211 -0
  14. package/src/commands/compliance.js +822 -0
  15. package/src/commands/config.js +213 -0
  16. package/src/commands/cowork.js +1666 -0
  17. package/src/commands/crosschain.js +203 -0
  18. package/src/commands/dao.js +203 -0
  19. package/src/commands/dbevo.js +227 -0
  20. package/src/commands/dev.js +207 -0
  21. package/src/commands/did-v2.js +217 -0
  22. package/src/commands/did.js +221 -0
  23. package/src/commands/dlp.js +213 -0
  24. package/src/commands/economy.js +199 -0
  25. package/src/commands/encrypt.js +201 -0
  26. package/src/commands/evolution.js +199 -0
  27. package/src/commands/evomap.js +830 -0
  28. package/src/commands/export.js +213 -0
  29. package/src/commands/federation.js +209 -0
  30. package/src/commands/fusion.js +205 -0
  31. package/src/commands/governance.js +209 -0
  32. package/src/commands/hmemory.js +203 -0
  33. package/src/commands/hook.js +209 -0
  34. package/src/commands/import.js +209 -0
  35. package/src/commands/inference.js +207 -0
  36. package/src/commands/infra.js +203 -0
  37. package/src/commands/instinct.js +209 -0
  38. package/src/commands/ipfs.js +207 -0
  39. package/src/commands/kg.js +195 -0
  40. package/src/commands/llm.js +426 -0
  41. package/src/commands/matrix.js +207 -0
  42. package/src/commands/mcp.js +217 -0
  43. package/src/commands/memory.js +412 -0
  44. package/src/commands/multimodal.js +203 -0
  45. package/src/commands/nlprog.js +225 -0
  46. package/src/commands/nostr.js +209 -0
  47. package/src/commands/note.js +205 -0
  48. package/src/commands/ops.js +219 -0
  49. package/src/commands/orchestrate.js +406 -0
  50. package/src/commands/org.js +209 -0
  51. package/src/commands/p2p.js +209 -0
  52. package/src/commands/perception.js +209 -0
  53. package/src/commands/permmem.js +203 -0
  54. package/src/commands/pipeline.js +199 -0
  55. package/src/commands/planmode.js +426 -0
  56. package/src/commands/plugin-ecosystem.js +209 -0
  57. package/src/commands/plugin.js +209 -0
  58. package/src/commands/pqc.js +213 -0
  59. package/src/commands/quantization.js +207 -0
  60. package/src/commands/rcache.js +205 -0
  61. package/src/commands/recommend.js +233 -0
  62. package/src/commands/runtime.js +205 -0
  63. package/src/commands/scim.js +209 -0
  64. package/src/commands/services.js +207 -0
  65. package/src/commands/session.js +209 -0
  66. package/src/commands/setup.js +205 -0
  67. package/src/commands/skill.js +414 -0
  68. package/src/commands/social.js +201 -0
  69. package/src/commands/sso.js +209 -0
  70. package/src/commands/start.js +209 -0
  71. package/src/commands/stream.js +213 -0
  72. package/src/commands/sync.js +209 -0
  73. package/src/commands/tech.js +209 -0
  74. package/src/commands/tenant.js +217 -0
  75. package/src/commands/tokens.js +209 -0
  76. package/src/commands/trust.js +217 -0
  77. package/src/commands/ui.js +225 -0
  78. package/src/commands/wallet.js +209 -0
  79. package/src/commands/workflow.js +412 -0
  80. package/src/index.js +252 -0
  81. package/src/lib/a2a-protocol.js +332 -0
  82. package/src/lib/activitypub-bridge.js +334 -0
  83. package/src/lib/agent-coordinator.js +334 -0
  84. package/src/lib/agent-economy.js +334 -0
  85. package/src/lib/agent-network.js +341 -0
  86. package/src/lib/agent-router.js +333 -0
  87. package/src/lib/aiops.js +346 -0
  88. package/src/lib/automation-engine.js +335 -0
  89. package/src/lib/autonomous-agent.js +332 -0
  90. package/src/lib/autonomous-developer.js +332 -0
  91. package/src/lib/bi-engine.js +333 -0
  92. package/src/lib/browser-automation.js +334 -0
  93. package/src/lib/chat-core.js +335 -0
  94. package/src/lib/cli-anything-bridge.js +341 -0
  95. package/src/lib/cli-context-engineering.js +351 -0
  96. package/src/lib/code-agent.js +339 -0
  97. package/src/lib/collaboration-governance.js +334 -0
  98. package/src/lib/community-governance.js +346 -0
  99. package/src/lib/compliance-manager.js +334 -0
  100. package/src/lib/content-recommendation.js +351 -0
  101. package/src/lib/cowork-adapter.js +336 -0
  102. package/src/lib/cowork-evomap-adapter.js +341 -0
  103. package/src/lib/cowork-mcp-tools.js +341 -0
  104. package/src/lib/cowork-observe-html.js +341 -0
  105. package/src/lib/cowork-observe.js +341 -0
  106. package/src/lib/cowork-share.js +338 -0
  107. package/src/lib/cowork-task-templates.js +342 -1
  108. package/src/lib/cowork-template-marketplace.js +340 -0
  109. package/src/lib/cross-chain.js +339 -0
  110. package/src/lib/crypto-manager.js +334 -0
  111. package/src/lib/dao-governance.js +339 -0
  112. package/src/lib/dbevo.js +351 -0
  113. package/src/lib/decentral-infra.js +330 -0
  114. package/src/lib/did-manager.js +341 -0
  115. package/src/lib/did-v2-manager.js +341 -0
  116. package/src/lib/dlp-engine.js +339 -0
  117. package/src/lib/downloader.js +334 -0
  118. package/src/lib/evolution-system.js +334 -0
  119. package/src/lib/evomap-client.js +342 -0
  120. package/src/lib/evomap-federation.js +338 -0
  121. package/src/lib/evomap-governance.js +334 -0
  122. package/src/lib/evomap-manager.js +330 -0
  123. package/src/lib/execution-backend.js +330 -0
  124. package/src/lib/federation-hardening.js +340 -0
  125. package/src/lib/hashline.js +338 -0
  126. package/src/lib/hierarchical-memory.js +334 -0
  127. package/src/lib/hook-manager.js +341 -0
  128. package/src/lib/inference-network.js +341 -0
  129. package/src/lib/instinct-manager.js +346 -0
  130. package/src/lib/interaction-adapter.js +330 -0
  131. package/src/lib/interactive-planner.js +354 -0
  132. package/src/lib/ipfs-storage.js +334 -0
  133. package/src/lib/knowledge-exporter.js +341 -0
  134. package/src/lib/knowledge-graph.js +331 -0
  135. package/src/lib/knowledge-importer.js +341 -0
  136. package/src/lib/llm-providers.js +346 -0
  137. package/src/lib/matrix-bridge.js +339 -0
  138. package/src/lib/mcp-registry.js +346 -0
  139. package/src/lib/memory-manager.js +336 -0
  140. package/src/lib/multimodal.js +330 -0
  141. package/src/lib/nl-programming.js +341 -0
  142. package/src/lib/nostr-bridge.js +336 -0
  143. package/src/lib/note-versioning.js +339 -0
  144. package/src/lib/org-manager.js +336 -0
  145. package/src/lib/p2p-manager.js +341 -0
  146. package/src/lib/perception.js +346 -0
  147. package/src/lib/permanent-memory.js +327 -0
  148. package/src/lib/pipeline-orchestrator.js +332 -0
  149. package/src/lib/plan-mode.js +336 -0
  150. package/src/lib/plugin-autodiscovery.js +334 -0
  151. package/src/lib/plugin-ecosystem.js +346 -0
  152. package/src/lib/pqc-manager.js +346 -0
  153. package/src/lib/process-manager.js +336 -0
  154. package/src/lib/protocol-fusion.js +338 -0
  155. package/src/lib/provider-options.js +346 -0
  156. package/src/lib/provider-stream.js +348 -0
  157. package/src/lib/quantization.js +337 -0
  158. package/src/lib/response-cache.js +333 -0
  159. package/src/lib/scim-manager.js +346 -0
  160. package/src/lib/service-manager.js +337 -0
  161. package/src/lib/session-core-singletons.js +341 -0
  162. package/src/lib/session-manager.js +334 -0
  163. package/src/lib/skill-loader.js +334 -0
  164. package/src/lib/skill-mcp.js +336 -0
  165. package/src/lib/social-manager.js +330 -0
  166. package/src/lib/sso-manager.js +340 -0
  167. package/src/lib/stix-parser.js +346 -0
  168. package/src/lib/sub-agent-context.js +343 -0
  169. package/src/lib/sub-agent-profiles.js +335 -0
  170. package/src/lib/sub-agent-registry.js +336 -0
  171. package/src/lib/sync-manager.js +336 -0
  172. package/src/lib/tech-learning-engine.js +341 -0
  173. package/src/lib/tenant-saas.js +341 -0
  174. package/src/lib/threat-intel.js +330 -0
  175. package/src/lib/todo-manager.js +336 -0
  176. package/src/lib/token-tracker.js +336 -0
  177. package/src/lib/trust-security.js +343 -0
  178. package/src/lib/ueba.js +340 -0
  179. package/src/lib/universal-runtime.js +330 -0
  180. package/src/lib/wallet-manager.js +336 -0
  181. package/src/lib/web-ui-server.js +348 -0
  182. package/src/lib/workflow-engine.js +330 -0
  183. package/src/lib/workflow-expr.js +346 -0
  184. package/src/lib/ws-chat-handler.js +337 -0
@@ -1166,3 +1166,833 @@ export function registerEvoMapV2Command(evomap) {
1166
1166
  console.log(JSON.stringify(getEvoMapManagerStatsV2(), null, 2));
1167
1167
  });
1168
1168
  }
1169
+
1170
+ // === Iter20 V2 governance overlay ===
1171
+ export function registerEvgovV2Commands(program) {
1172
+ const parent = program.commands.find((c) => c.name() === "evomap");
1173
+ if (!parent) return;
1174
+ const L = async () => await import("../lib/evomap-governance.js");
1175
+ parent
1176
+ .command("evgov-enums-v2")
1177
+ .description("Show V2 enums")
1178
+ .action(async () => {
1179
+ const m = await L();
1180
+ console.log(
1181
+ JSON.stringify(
1182
+ {
1183
+ profileMaturity: m.EVGOV_PROFILE_MATURITY_V2,
1184
+ proposalLifecycle: m.EVGOV_PROPOSAL_LIFECYCLE_V2,
1185
+ },
1186
+ null,
1187
+ 2,
1188
+ ),
1189
+ );
1190
+ });
1191
+ parent
1192
+ .command("evgov-config-v2")
1193
+ .description("Show V2 config")
1194
+ .action(async () => {
1195
+ const m = await L();
1196
+ console.log(
1197
+ JSON.stringify(
1198
+ {
1199
+ maxActive: m.getMaxActiveEvgovProfilesPerOwnerV2(),
1200
+ maxPending: m.getMaxPendingEvgovProposalsPerProfileV2(),
1201
+ idleMs: m.getEvgovProfileIdleMsV2(),
1202
+ stuckMs: m.getEvgovProposalStuckMsV2(),
1203
+ },
1204
+ null,
1205
+ 2,
1206
+ ),
1207
+ );
1208
+ });
1209
+ parent
1210
+ .command("evgov-set-max-active-v2 <n>")
1211
+ .description("Set max active")
1212
+ .action(async (n) => {
1213
+ (await L()).setMaxActiveEvgovProfilesPerOwnerV2(Number(n));
1214
+ console.log("ok");
1215
+ });
1216
+ parent
1217
+ .command("evgov-set-max-pending-v2 <n>")
1218
+ .description("Set max pending")
1219
+ .action(async (n) => {
1220
+ (await L()).setMaxPendingEvgovProposalsPerProfileV2(Number(n));
1221
+ console.log("ok");
1222
+ });
1223
+ parent
1224
+ .command("evgov-set-idle-ms-v2 <n>")
1225
+ .description("Set idle threshold ms")
1226
+ .action(async (n) => {
1227
+ (await L()).setEvgovProfileIdleMsV2(Number(n));
1228
+ console.log("ok");
1229
+ });
1230
+ parent
1231
+ .command("evgov-set-stuck-ms-v2 <n>")
1232
+ .description("Set stuck threshold ms")
1233
+ .action(async (n) => {
1234
+ (await L()).setEvgovProposalStuckMsV2(Number(n));
1235
+ console.log("ok");
1236
+ });
1237
+ parent
1238
+ .command("evgov-register-v2 <id> <owner>")
1239
+ .description("Register V2 profile")
1240
+ .option("--lane <v>", "lane")
1241
+ .action(async (id, owner, o) => {
1242
+ const m = await L();
1243
+ console.log(
1244
+ JSON.stringify(
1245
+ m.registerEvgovProfileV2({ id, owner, lane: o.lane }),
1246
+ null,
1247
+ 2,
1248
+ ),
1249
+ );
1250
+ });
1251
+ parent
1252
+ .command("evgov-activate-v2 <id>")
1253
+ .description("Activate profile")
1254
+ .action(async (id) => {
1255
+ console.log(
1256
+ JSON.stringify((await L()).activateEvgovProfileV2(id), null, 2),
1257
+ );
1258
+ });
1259
+ parent
1260
+ .command("evgov-pause-v2 <id>")
1261
+ .description("Pause profile")
1262
+ .action(async (id) => {
1263
+ console.log(JSON.stringify((await L()).pauseEvgovProfileV2(id), null, 2));
1264
+ });
1265
+ parent
1266
+ .command("evgov-archive-v2 <id>")
1267
+ .description("Archive profile")
1268
+ .action(async (id) => {
1269
+ console.log(
1270
+ JSON.stringify((await L()).archiveEvgovProfileV2(id), null, 2),
1271
+ );
1272
+ });
1273
+ parent
1274
+ .command("evgov-touch-v2 <id>")
1275
+ .description("Touch profile")
1276
+ .action(async (id) => {
1277
+ console.log(JSON.stringify((await L()).touchEvgovProfileV2(id), null, 2));
1278
+ });
1279
+ parent
1280
+ .command("evgov-get-v2 <id>")
1281
+ .description("Get profile")
1282
+ .action(async (id) => {
1283
+ console.log(JSON.stringify((await L()).getEvgovProfileV2(id), null, 2));
1284
+ });
1285
+ parent
1286
+ .command("evgov-list-v2")
1287
+ .description("List profiles")
1288
+ .action(async () => {
1289
+ console.log(JSON.stringify((await L()).listEvgovProfilesV2(), null, 2));
1290
+ });
1291
+ parent
1292
+ .command("evgov-create-proposal-v2 <id> <profileId>")
1293
+ .description("Create proposal")
1294
+ .option("--topic <v>", "topic")
1295
+ .action(async (id, profileId, o) => {
1296
+ const m = await L();
1297
+ console.log(
1298
+ JSON.stringify(
1299
+ m.createEvgovProposalV2({ id, profileId, topic: o.topic }),
1300
+ null,
1301
+ 2,
1302
+ ),
1303
+ );
1304
+ });
1305
+ parent
1306
+ .command("evgov-reviewing-proposal-v2 <id>")
1307
+ .description("Mark proposal as reviewing")
1308
+ .action(async (id) => {
1309
+ console.log(
1310
+ JSON.stringify((await L()).reviewingEvgovProposalV2(id), null, 2),
1311
+ );
1312
+ });
1313
+ parent
1314
+ .command("evgov-complete-proposal-v2 <id>")
1315
+ .description("Complete proposal")
1316
+ .action(async (id) => {
1317
+ console.log(
1318
+ JSON.stringify((await L()).completeProposalEvgovV2(id), null, 2),
1319
+ );
1320
+ });
1321
+ parent
1322
+ .command("evgov-fail-proposal-v2 <id> [reason]")
1323
+ .description("Fail proposal")
1324
+ .action(async (id, reason) => {
1325
+ console.log(
1326
+ JSON.stringify((await L()).failEvgovProposalV2(id, reason), null, 2),
1327
+ );
1328
+ });
1329
+ parent
1330
+ .command("evgov-cancel-proposal-v2 <id> [reason]")
1331
+ .description("Cancel proposal")
1332
+ .action(async (id, reason) => {
1333
+ console.log(
1334
+ JSON.stringify((await L()).cancelEvgovProposalV2(id, reason), null, 2),
1335
+ );
1336
+ });
1337
+ parent
1338
+ .command("evgov-get-proposal-v2 <id>")
1339
+ .description("Get proposal")
1340
+ .action(async (id) => {
1341
+ console.log(JSON.stringify((await L()).getEvgovProposalV2(id), null, 2));
1342
+ });
1343
+ parent
1344
+ .command("evgov-list-proposals-v2")
1345
+ .description("List proposals")
1346
+ .action(async () => {
1347
+ console.log(JSON.stringify((await L()).listEvgovProposalsV2(), null, 2));
1348
+ });
1349
+ parent
1350
+ .command("evgov-auto-pause-idle-v2")
1351
+ .description("Auto-pause idle")
1352
+ .action(async () => {
1353
+ console.log(
1354
+ JSON.stringify((await L()).autoPauseIdleEvgovProfilesV2(), null, 2),
1355
+ );
1356
+ });
1357
+ parent
1358
+ .command("evgov-auto-fail-stuck-v2")
1359
+ .description("Auto-fail stuck proposals")
1360
+ .action(async () => {
1361
+ console.log(
1362
+ JSON.stringify((await L()).autoFailStuckEvgovProposalsV2(), null, 2),
1363
+ );
1364
+ });
1365
+ parent
1366
+ .command("evgov-gov-stats-v2")
1367
+ .description("V2 gov stats")
1368
+ .action(async () => {
1369
+ console.log(
1370
+ JSON.stringify((await L()).getEvomapGovernanceGovStatsV2(), null, 2),
1371
+ );
1372
+ });
1373
+ }
1374
+
1375
+ // === Iter25 V2 governance overlay ===
1376
+ export function registerEvfedgovV2Commands(program) {
1377
+ const parent = program.commands.find((c) => c.name() === "evomap");
1378
+ if (!parent) return;
1379
+ const L = async () => await import("../lib/evomap-federation.js");
1380
+ parent
1381
+ .command("evfedgov-enums-v2")
1382
+ .description("Show V2 enums")
1383
+ .action(async () => {
1384
+ const m = await L();
1385
+ console.log(
1386
+ JSON.stringify(
1387
+ {
1388
+ profileMaturity: m.EVFEDGOV_PROFILE_MATURITY_V2,
1389
+ syncLifecycle: m.EVFEDGOV_SYNC_LIFECYCLE_V2,
1390
+ },
1391
+ null,
1392
+ 2,
1393
+ ),
1394
+ );
1395
+ });
1396
+ parent
1397
+ .command("evfedgov-config-v2")
1398
+ .description("Show V2 config")
1399
+ .action(async () => {
1400
+ const m = await L();
1401
+ console.log(
1402
+ JSON.stringify(
1403
+ {
1404
+ maxActive: m.getMaxActiveEvfedgovProfilesPerOwnerV2(),
1405
+ maxPending: m.getMaxPendingEvfedgovSyncsPerProfileV2(),
1406
+ idleMs: m.getEvfedgovProfileIdleMsV2(),
1407
+ stuckMs: m.getEvfedgovSyncStuckMsV2(),
1408
+ },
1409
+ null,
1410
+ 2,
1411
+ ),
1412
+ );
1413
+ });
1414
+ parent
1415
+ .command("evfedgov-set-max-active-v2 <n>")
1416
+ .description("Set max active")
1417
+ .action(async (n) => {
1418
+ (await L()).setMaxActiveEvfedgovProfilesPerOwnerV2(Number(n));
1419
+ console.log("ok");
1420
+ });
1421
+ parent
1422
+ .command("evfedgov-set-max-pending-v2 <n>")
1423
+ .description("Set max pending")
1424
+ .action(async (n) => {
1425
+ (await L()).setMaxPendingEvfedgovSyncsPerProfileV2(Number(n));
1426
+ console.log("ok");
1427
+ });
1428
+ parent
1429
+ .command("evfedgov-set-idle-ms-v2 <n>")
1430
+ .description("Set idle threshold ms")
1431
+ .action(async (n) => {
1432
+ (await L()).setEvfedgovProfileIdleMsV2(Number(n));
1433
+ console.log("ok");
1434
+ });
1435
+ parent
1436
+ .command("evfedgov-set-stuck-ms-v2 <n>")
1437
+ .description("Set stuck threshold ms")
1438
+ .action(async (n) => {
1439
+ (await L()).setEvfedgovSyncStuckMsV2(Number(n));
1440
+ console.log("ok");
1441
+ });
1442
+ parent
1443
+ .command("evfedgov-register-v2 <id> <owner>")
1444
+ .description("Register V2 profile")
1445
+ .option("--hub <v>", "hub")
1446
+ .action(async (id, owner, o) => {
1447
+ const m = await L();
1448
+ console.log(
1449
+ JSON.stringify(
1450
+ m.registerEvfedgovProfileV2({ id, owner, hub: o.hub }),
1451
+ null,
1452
+ 2,
1453
+ ),
1454
+ );
1455
+ });
1456
+ parent
1457
+ .command("evfedgov-activate-v2 <id>")
1458
+ .description("Activate profile")
1459
+ .action(async (id) => {
1460
+ console.log(
1461
+ JSON.stringify((await L()).activateEvfedgovProfileV2(id), null, 2),
1462
+ );
1463
+ });
1464
+ parent
1465
+ .command("evfedgov-stale-v2 <id>")
1466
+ .description("Stale profile")
1467
+ .action(async (id) => {
1468
+ console.log(
1469
+ JSON.stringify((await L()).staleEvfedgovProfileV2(id), null, 2),
1470
+ );
1471
+ });
1472
+ parent
1473
+ .command("evfedgov-archive-v2 <id>")
1474
+ .description("Archive profile")
1475
+ .action(async (id) => {
1476
+ console.log(
1477
+ JSON.stringify((await L()).archiveEvfedgovProfileV2(id), null, 2),
1478
+ );
1479
+ });
1480
+ parent
1481
+ .command("evfedgov-touch-v2 <id>")
1482
+ .description("Touch profile")
1483
+ .action(async (id) => {
1484
+ console.log(
1485
+ JSON.stringify((await L()).touchEvfedgovProfileV2(id), null, 2),
1486
+ );
1487
+ });
1488
+ parent
1489
+ .command("evfedgov-get-v2 <id>")
1490
+ .description("Get profile")
1491
+ .action(async (id) => {
1492
+ console.log(
1493
+ JSON.stringify((await L()).getEvfedgovProfileV2(id), null, 2),
1494
+ );
1495
+ });
1496
+ parent
1497
+ .command("evfedgov-list-v2")
1498
+ .description("List profiles")
1499
+ .action(async () => {
1500
+ console.log(
1501
+ JSON.stringify((await L()).listEvfedgovProfilesV2(), null, 2),
1502
+ );
1503
+ });
1504
+ parent
1505
+ .command("evfedgov-create-sync-v2 <id> <profileId>")
1506
+ .description("Create sync")
1507
+ .option("--geneId <v>", "geneId")
1508
+ .action(async (id, profileId, o) => {
1509
+ const m = await L();
1510
+ console.log(
1511
+ JSON.stringify(
1512
+ m.createEvfedgovSyncV2({ id, profileId, geneId: o.geneId }),
1513
+ null,
1514
+ 2,
1515
+ ),
1516
+ );
1517
+ });
1518
+ parent
1519
+ .command("evfedgov-syncing-sync-v2 <id>")
1520
+ .description("Mark sync as syncing")
1521
+ .action(async (id) => {
1522
+ console.log(
1523
+ JSON.stringify((await L()).syncingEvfedgovSyncV2(id), null, 2),
1524
+ );
1525
+ });
1526
+ parent
1527
+ .command("evfedgov-complete-sync-v2 <id>")
1528
+ .description("Complete sync")
1529
+ .action(async (id) => {
1530
+ console.log(
1531
+ JSON.stringify((await L()).completeSyncEvfedgovV2(id), null, 2),
1532
+ );
1533
+ });
1534
+ parent
1535
+ .command("evfedgov-fail-sync-v2 <id> [reason]")
1536
+ .description("Fail sync")
1537
+ .action(async (id, reason) => {
1538
+ console.log(
1539
+ JSON.stringify((await L()).failEvfedgovSyncV2(id, reason), null, 2),
1540
+ );
1541
+ });
1542
+ parent
1543
+ .command("evfedgov-cancel-sync-v2 <id> [reason]")
1544
+ .description("Cancel sync")
1545
+ .action(async (id, reason) => {
1546
+ console.log(
1547
+ JSON.stringify((await L()).cancelEvfedgovSyncV2(id, reason), null, 2),
1548
+ );
1549
+ });
1550
+ parent
1551
+ .command("evfedgov-get-sync-v2 <id>")
1552
+ .description("Get sync")
1553
+ .action(async (id) => {
1554
+ console.log(JSON.stringify((await L()).getEvfedgovSyncV2(id), null, 2));
1555
+ });
1556
+ parent
1557
+ .command("evfedgov-list-syncs-v2")
1558
+ .description("List syncs")
1559
+ .action(async () => {
1560
+ console.log(JSON.stringify((await L()).listEvfedgovSyncsV2(), null, 2));
1561
+ });
1562
+ parent
1563
+ .command("evfedgov-auto-stale-idle-v2")
1564
+ .description("Auto-stale idle")
1565
+ .action(async () => {
1566
+ console.log(
1567
+ JSON.stringify((await L()).autoStaleIdleEvfedgovProfilesV2(), null, 2),
1568
+ );
1569
+ });
1570
+ parent
1571
+ .command("evfedgov-auto-fail-stuck-v2")
1572
+ .description("Auto-fail stuck syncs")
1573
+ .action(async () => {
1574
+ console.log(
1575
+ JSON.stringify((await L()).autoFailStuckEvfedgovSyncsV2(), null, 2),
1576
+ );
1577
+ });
1578
+ parent
1579
+ .command("evfedgov-gov-stats-v2")
1580
+ .description("V2 gov stats")
1581
+ .action(async () => {
1582
+ console.log(
1583
+ JSON.stringify((await L()).getEvomapFederationGovStatsV2(), null, 2),
1584
+ );
1585
+ });
1586
+ }
1587
+
1588
+ // === Iter27 V2 governance overlay ===
1589
+ export function registerEvcligovV2Commands(program) {
1590
+ const parent = program.commands.find((c) => c.name() === "evomap");
1591
+ if (!parent) return;
1592
+ const L = async () => await import("../lib/evomap-client.js");
1593
+ parent
1594
+ .command("evcligov-enums-v2")
1595
+ .description("Show V2 enums")
1596
+ .action(async () => {
1597
+ const m = await L();
1598
+ console.log(
1599
+ JSON.stringify(
1600
+ {
1601
+ profileMaturity: m.EVCLIGOV_PROFILE_MATURITY_V2,
1602
+ rpcLifecycle: m.EVCLIGOV_RPC_LIFECYCLE_V2,
1603
+ },
1604
+ null,
1605
+ 2,
1606
+ ),
1607
+ );
1608
+ });
1609
+ parent
1610
+ .command("evcligov-config-v2")
1611
+ .description("Show V2 config")
1612
+ .action(async () => {
1613
+ const m = await L();
1614
+ console.log(
1615
+ JSON.stringify(
1616
+ {
1617
+ maxActive: m.getMaxActiveEvcligovProfilesPerOwnerV2(),
1618
+ maxPending: m.getMaxPendingEvcligovRpcsPerProfileV2(),
1619
+ idleMs: m.getEvcligovProfileIdleMsV2(),
1620
+ stuckMs: m.getEvcligovRpcStuckMsV2(),
1621
+ },
1622
+ null,
1623
+ 2,
1624
+ ),
1625
+ );
1626
+ });
1627
+ parent
1628
+ .command("evcligov-set-max-active-v2 <n>")
1629
+ .description("Set max active")
1630
+ .action(async (n) => {
1631
+ (await L()).setMaxActiveEvcligovProfilesPerOwnerV2(Number(n));
1632
+ console.log("ok");
1633
+ });
1634
+ parent
1635
+ .command("evcligov-set-max-pending-v2 <n>")
1636
+ .description("Set max pending")
1637
+ .action(async (n) => {
1638
+ (await L()).setMaxPendingEvcligovRpcsPerProfileV2(Number(n));
1639
+ console.log("ok");
1640
+ });
1641
+ parent
1642
+ .command("evcligov-set-idle-ms-v2 <n>")
1643
+ .description("Set idle threshold ms")
1644
+ .action(async (n) => {
1645
+ (await L()).setEvcligovProfileIdleMsV2(Number(n));
1646
+ console.log("ok");
1647
+ });
1648
+ parent
1649
+ .command("evcligov-set-stuck-ms-v2 <n>")
1650
+ .description("Set stuck threshold ms")
1651
+ .action(async (n) => {
1652
+ (await L()).setEvcligovRpcStuckMsV2(Number(n));
1653
+ console.log("ok");
1654
+ });
1655
+ parent
1656
+ .command("evcligov-register-v2 <id> <owner>")
1657
+ .description("Register V2 profile")
1658
+ .option("--endpoint <v>", "endpoint")
1659
+ .action(async (id, owner, o) => {
1660
+ const m = await L();
1661
+ console.log(
1662
+ JSON.stringify(
1663
+ m.registerEvcligovProfileV2({ id, owner, endpoint: o.endpoint }),
1664
+ null,
1665
+ 2,
1666
+ ),
1667
+ );
1668
+ });
1669
+ parent
1670
+ .command("evcligov-activate-v2 <id>")
1671
+ .description("Activate profile")
1672
+ .action(async (id) => {
1673
+ console.log(
1674
+ JSON.stringify((await L()).activateEvcligovProfileV2(id), null, 2),
1675
+ );
1676
+ });
1677
+ parent
1678
+ .command("evcligov-stale-v2 <id>")
1679
+ .description("Stale profile")
1680
+ .action(async (id) => {
1681
+ console.log(
1682
+ JSON.stringify((await L()).staleEvcligovProfileV2(id), null, 2),
1683
+ );
1684
+ });
1685
+ parent
1686
+ .command("evcligov-archive-v2 <id>")
1687
+ .description("Archive profile")
1688
+ .action(async (id) => {
1689
+ console.log(
1690
+ JSON.stringify((await L()).archiveEvcligovProfileV2(id), null, 2),
1691
+ );
1692
+ });
1693
+ parent
1694
+ .command("evcligov-touch-v2 <id>")
1695
+ .description("Touch profile")
1696
+ .action(async (id) => {
1697
+ console.log(
1698
+ JSON.stringify((await L()).touchEvcligovProfileV2(id), null, 2),
1699
+ );
1700
+ });
1701
+ parent
1702
+ .command("evcligov-get-v2 <id>")
1703
+ .description("Get profile")
1704
+ .action(async (id) => {
1705
+ console.log(
1706
+ JSON.stringify((await L()).getEvcligovProfileV2(id), null, 2),
1707
+ );
1708
+ });
1709
+ parent
1710
+ .command("evcligov-list-v2")
1711
+ .description("List profiles")
1712
+ .action(async () => {
1713
+ console.log(
1714
+ JSON.stringify((await L()).listEvcligovProfilesV2(), null, 2),
1715
+ );
1716
+ });
1717
+ parent
1718
+ .command("evcligov-create-rpc-v2 <id> <profileId>")
1719
+ .description("Create rpc")
1720
+ .option("--method <v>", "method")
1721
+ .action(async (id, profileId, o) => {
1722
+ const m = await L();
1723
+ console.log(
1724
+ JSON.stringify(
1725
+ m.createEvcligovRpcV2({ id, profileId, method: o.method }),
1726
+ null,
1727
+ 2,
1728
+ ),
1729
+ );
1730
+ });
1731
+ parent
1732
+ .command("evcligov-calling-rpc-v2 <id>")
1733
+ .description("Mark rpc as calling")
1734
+ .action(async (id) => {
1735
+ console.log(
1736
+ JSON.stringify((await L()).callingEvcligovRpcV2(id), null, 2),
1737
+ );
1738
+ });
1739
+ parent
1740
+ .command("evcligov-complete-rpc-v2 <id>")
1741
+ .description("Complete rpc")
1742
+ .action(async (id) => {
1743
+ console.log(
1744
+ JSON.stringify((await L()).completeRpcEvcligovV2(id), null, 2),
1745
+ );
1746
+ });
1747
+ parent
1748
+ .command("evcligov-fail-rpc-v2 <id> [reason]")
1749
+ .description("Fail rpc")
1750
+ .action(async (id, reason) => {
1751
+ console.log(
1752
+ JSON.stringify((await L()).failEvcligovRpcV2(id, reason), null, 2),
1753
+ );
1754
+ });
1755
+ parent
1756
+ .command("evcligov-cancel-rpc-v2 <id> [reason]")
1757
+ .description("Cancel rpc")
1758
+ .action(async (id, reason) => {
1759
+ console.log(
1760
+ JSON.stringify((await L()).cancelEvcligovRpcV2(id, reason), null, 2),
1761
+ );
1762
+ });
1763
+ parent
1764
+ .command("evcligov-get-rpc-v2 <id>")
1765
+ .description("Get rpc")
1766
+ .action(async (id) => {
1767
+ console.log(JSON.stringify((await L()).getEvcligovRpcV2(id), null, 2));
1768
+ });
1769
+ parent
1770
+ .command("evcligov-list-rpcs-v2")
1771
+ .description("List rpcs")
1772
+ .action(async () => {
1773
+ console.log(JSON.stringify((await L()).listEvcligovRpcsV2(), null, 2));
1774
+ });
1775
+ parent
1776
+ .command("evcligov-auto-stale-idle-v2")
1777
+ .description("Auto-stale idle")
1778
+ .action(async () => {
1779
+ console.log(
1780
+ JSON.stringify((await L()).autoStaleIdleEvcligovProfilesV2(), null, 2),
1781
+ );
1782
+ });
1783
+ parent
1784
+ .command("evcligov-auto-fail-stuck-v2")
1785
+ .description("Auto-fail stuck rpcs")
1786
+ .action(async () => {
1787
+ console.log(
1788
+ JSON.stringify((await L()).autoFailStuckEvcligovRpcsV2(), null, 2),
1789
+ );
1790
+ });
1791
+ parent
1792
+ .command("evcligov-gov-stats-v2")
1793
+ .description("V2 gov stats")
1794
+ .action(async () => {
1795
+ console.log(
1796
+ JSON.stringify((await L()).getEvomapClientGovStatsV2(), null, 2),
1797
+ );
1798
+ });
1799
+ }
1800
+
1801
+ // === Iter28 V2 governance overlay: Emgrgov ===
1802
+ export function registerEmgrV2Commands(program) {
1803
+ const parent = program.commands.find((c) => c.name() === "evomap");
1804
+ if (!parent) return;
1805
+ const L = async () => await import("../lib/evomap-manager.js");
1806
+ parent
1807
+ .command("emgrgov-enums-v2")
1808
+ .description("Show V2 enums")
1809
+ .action(async () => {
1810
+ const m = await L();
1811
+ console.log(
1812
+ JSON.stringify(
1813
+ {
1814
+ profileMaturity: m.EMGRGOV_PROFILE_MATURITY_V2,
1815
+ opLifecycle: m.EMGRGOV_OP_LIFECYCLE_V2,
1816
+ },
1817
+ null,
1818
+ 2,
1819
+ ),
1820
+ );
1821
+ });
1822
+ parent
1823
+ .command("emgrgov-config-v2")
1824
+ .description("Show V2 config")
1825
+ .action(async () => {
1826
+ const m = await L();
1827
+ console.log(
1828
+ JSON.stringify(
1829
+ {
1830
+ maxActive: m.getMaxActiveEmgrProfilesPerOwnerV2(),
1831
+ maxPending: m.getMaxPendingEmgrOpsPerProfileV2(),
1832
+ idleMs: m.getEmgrProfileIdleMsV2(),
1833
+ stuckMs: m.getEmgrOpStuckMsV2(),
1834
+ },
1835
+ null,
1836
+ 2,
1837
+ ),
1838
+ );
1839
+ });
1840
+ parent
1841
+ .command("emgrgov-set-max-active-v2 <n>")
1842
+ .description("Set max active")
1843
+ .action(async (n) => {
1844
+ (await L()).setMaxActiveEmgrProfilesPerOwnerV2(Number(n));
1845
+ console.log("ok");
1846
+ });
1847
+ parent
1848
+ .command("emgrgov-set-max-pending-v2 <n>")
1849
+ .description("Set max pending")
1850
+ .action(async (n) => {
1851
+ (await L()).setMaxPendingEmgrOpsPerProfileV2(Number(n));
1852
+ console.log("ok");
1853
+ });
1854
+ parent
1855
+ .command("emgrgov-set-idle-ms-v2 <n>")
1856
+ .description("Set idle threshold ms")
1857
+ .action(async (n) => {
1858
+ (await L()).setEmgrProfileIdleMsV2(Number(n));
1859
+ console.log("ok");
1860
+ });
1861
+ parent
1862
+ .command("emgrgov-set-stuck-ms-v2 <n>")
1863
+ .description("Set stuck threshold ms")
1864
+ .action(async (n) => {
1865
+ (await L()).setEmgrOpStuckMsV2(Number(n));
1866
+ console.log("ok");
1867
+ });
1868
+ parent
1869
+ .command("emgrgov-register-v2 <id> <owner>")
1870
+ .description("Register V2 profile")
1871
+ .option("--map <v>", "map")
1872
+ .action(async (id, owner, o) => {
1873
+ const m = await L();
1874
+ console.log(
1875
+ JSON.stringify(
1876
+ m.registerEmgrProfileV2({ id, owner, map: o.map }),
1877
+ null,
1878
+ 2,
1879
+ ),
1880
+ );
1881
+ });
1882
+ parent
1883
+ .command("emgrgov-activate-v2 <id>")
1884
+ .description("Activate profile")
1885
+ .action(async (id) => {
1886
+ console.log(
1887
+ JSON.stringify((await L()).activateEmgrProfileV2(id), null, 2),
1888
+ );
1889
+ });
1890
+ parent
1891
+ .command("emgrgov-stale-v2 <id>")
1892
+ .description("Stale profile")
1893
+ .action(async (id) => {
1894
+ console.log(JSON.stringify((await L()).staleEmgrProfileV2(id), null, 2));
1895
+ });
1896
+ parent
1897
+ .command("emgrgov-archive-v2 <id>")
1898
+ .description("Archive profile")
1899
+ .action(async (id) => {
1900
+ console.log(
1901
+ JSON.stringify((await L()).archiveEmgrProfileV2(id), null, 2),
1902
+ );
1903
+ });
1904
+ parent
1905
+ .command("emgrgov-touch-v2 <id>")
1906
+ .description("Touch profile")
1907
+ .action(async (id) => {
1908
+ console.log(JSON.stringify((await L()).touchEmgrProfileV2(id), null, 2));
1909
+ });
1910
+ parent
1911
+ .command("emgrgov-get-v2 <id>")
1912
+ .description("Get profile")
1913
+ .action(async (id) => {
1914
+ console.log(JSON.stringify((await L()).getEmgrProfileV2(id), null, 2));
1915
+ });
1916
+ parent
1917
+ .command("emgrgov-list-v2")
1918
+ .description("List profiles")
1919
+ .action(async () => {
1920
+ console.log(JSON.stringify((await L()).listEmgrProfilesV2(), null, 2));
1921
+ });
1922
+ parent
1923
+ .command("emgrgov-create-op-v2 <id> <profileId>")
1924
+ .description("Create op")
1925
+ .option("--opId <v>", "opId")
1926
+ .action(async (id, profileId, o) => {
1927
+ const m = await L();
1928
+ console.log(
1929
+ JSON.stringify(
1930
+ m.createEmgrOpV2({ id, profileId, opId: o.opId }),
1931
+ null,
1932
+ 2,
1933
+ ),
1934
+ );
1935
+ });
1936
+ parent
1937
+ .command("emgrgov-operating-op-v2 <id>")
1938
+ .description("Mark op as operating")
1939
+ .action(async (id) => {
1940
+ console.log(JSON.stringify((await L()).operatingEmgrOpV2(id), null, 2));
1941
+ });
1942
+ parent
1943
+ .command("emgrgov-complete-op-v2 <id>")
1944
+ .description("Complete op")
1945
+ .action(async (id) => {
1946
+ console.log(JSON.stringify((await L()).completeOpEmgrV2(id), null, 2));
1947
+ });
1948
+ parent
1949
+ .command("emgrgov-fail-op-v2 <id> [reason]")
1950
+ .description("Fail op")
1951
+ .action(async (id, reason) => {
1952
+ console.log(
1953
+ JSON.stringify((await L()).failEmgrOpV2(id, reason), null, 2),
1954
+ );
1955
+ });
1956
+ parent
1957
+ .command("emgrgov-cancel-op-v2 <id> [reason]")
1958
+ .description("Cancel op")
1959
+ .action(async (id, reason) => {
1960
+ console.log(
1961
+ JSON.stringify((await L()).cancelEmgrOpV2(id, reason), null, 2),
1962
+ );
1963
+ });
1964
+ parent
1965
+ .command("emgrgov-get-op-v2 <id>")
1966
+ .description("Get op")
1967
+ .action(async (id) => {
1968
+ console.log(JSON.stringify((await L()).getEmgrOpV2(id), null, 2));
1969
+ });
1970
+ parent
1971
+ .command("emgrgov-list-ops-v2")
1972
+ .description("List ops")
1973
+ .action(async () => {
1974
+ console.log(JSON.stringify((await L()).listEmgrOpsV2(), null, 2));
1975
+ });
1976
+ parent
1977
+ .command("emgrgov-auto-stale-idle-v2")
1978
+ .description("Auto-stale idle")
1979
+ .action(async () => {
1980
+ console.log(
1981
+ JSON.stringify((await L()).autoStaleIdleEmgrProfilesV2(), null, 2),
1982
+ );
1983
+ });
1984
+ parent
1985
+ .command("emgrgov-auto-fail-stuck-v2")
1986
+ .description("Auto-fail stuck ops")
1987
+ .action(async () => {
1988
+ console.log(
1989
+ JSON.stringify((await L()).autoFailStuckEmgrOpsV2(), null, 2),
1990
+ );
1991
+ });
1992
+ parent
1993
+ .command("emgrgov-gov-stats-v2")
1994
+ .description("V2 gov stats")
1995
+ .action(async () => {
1996
+ console.log(JSON.stringify((await L()).getEmgrgovStatsV2(), null, 2));
1997
+ });
1998
+ }