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
@@ -375,7 +375,6 @@ export function registerNostrCommand(program) {
375
375
  registerNostrV2Command(nostr);
376
376
  }
377
377
 
378
-
379
378
  import {
380
379
  NOSTR_RELAY_MATURITY_V2,
381
380
  NOSTR_EVENT_LIFECYCLE_V2,
@@ -407,30 +406,391 @@ import {
407
406
  } from "../lib/nostr-bridge.js";
408
407
 
409
408
  export function registerNostrV2Command(nostr) {
410
- nostr.command("enums-v2").description("Show V2 enums").action(() => { console.log(JSON.stringify({ NOSTR_RELAY_MATURITY_V2, NOSTR_EVENT_LIFECYCLE_V2 }, null, 2)); });
411
- nostr.command("register-relay-v2").description("Register a nostr relay profile (pending)")
412
- .requiredOption("--id <id>").requiredOption("--owner <owner>").option("--url <url>")
413
- .action((o) => { console.log(JSON.stringify(registerNostrRelayV2(o), null, 2)); });
414
- nostr.command("activate-relay-v2 <id>").description("Activate relay").action((id) => { console.log(JSON.stringify(activateNostrRelayV2(id), null, 2)); });
415
- nostr.command("offline-relay-v2 <id>").description("Mark relay offline").action((id) => { console.log(JSON.stringify(offlineNostrRelayV2(id), null, 2)); });
416
- nostr.command("retire-relay-v2 <id>").description("Retire relay (terminal)").action((id) => { console.log(JSON.stringify(retireNostrRelayV2(id), null, 2)); });
417
- nostr.command("touch-relay-v2 <id>").description("Refresh lastTouchedAt").action((id) => { console.log(JSON.stringify(touchNostrRelayV2(id), null, 2)); });
418
- nostr.command("get-relay-v2 <id>").description("Get a relay").action((id) => { console.log(JSON.stringify(getNostrRelayV2(id), null, 2)); });
419
- nostr.command("list-relays-v2").description("List relays").action(() => { console.log(JSON.stringify(listNostrRelaysV2(), null, 2)); });
420
- nostr.command("create-event-v2").description("Create a nostr event (queued)")
421
- .requiredOption("--id <id>").requiredOption("--relay-id <relayId>").option("--kind <kind>", "event kind", (v) => Number(v))
422
- .action((o) => { console.log(JSON.stringify(createNostrEventV2({ id: o.id, relayId: o.relayId, kind: o.kind }), null, 2)); });
423
- nostr.command("start-event-v2 <id>").description("Transition event to publishing").action((id) => { console.log(JSON.stringify(startNostrEventV2(id), null, 2)); });
424
- nostr.command("publish-event-v2 <id>").description("Transition event to published").action((id) => { console.log(JSON.stringify(publishNostrEventV2(id), null, 2)); });
425
- nostr.command("fail-event-v2 <id>").description("Fail event").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(failNostrEventV2(id, o.reason), null, 2)); });
426
- nostr.command("cancel-event-v2 <id>").description("Cancel event").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(cancelNostrEventV2(id, o.reason), null, 2)); });
427
- nostr.command("get-event-v2 <id>").description("Get event").action((id) => { console.log(JSON.stringify(getNostrEventV2(id), null, 2)); });
428
- nostr.command("list-events-v2").description("List events").action(() => { console.log(JSON.stringify(listNostrEventsV2(), null, 2)); });
429
- nostr.command("set-max-active-relays-v2 <n>").description("Set per-owner active cap").action((n) => { setMaxActiveNostrRelaysPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveNostrRelaysPerOwner: getMaxActiveNostrRelaysPerOwnerV2() }, null, 2)); });
430
- nostr.command("set-max-pending-events-v2 <n>").description("Set per-relay pending cap").action((n) => { setMaxPendingNostrEventsPerRelayV2(Number(n)); console.log(JSON.stringify({ maxPendingNostrEventsPerRelay: getMaxPendingNostrEventsPerRelayV2() }, null, 2)); });
431
- nostr.command("set-relay-idle-ms-v2 <n>").description("Set idle threshold").action((n) => { setNostrRelayIdleMsV2(Number(n)); console.log(JSON.stringify({ nostrRelayIdleMs: getNostrRelayIdleMsV2() }, null, 2)); });
432
- nostr.command("set-event-stuck-ms-v2 <n>").description("Set stuck threshold").action((n) => { setNostrEventStuckMsV2(Number(n)); console.log(JSON.stringify({ nostrEventStuckMs: getNostrEventStuckMsV2() }, null, 2)); });
433
- nostr.command("auto-offline-idle-relays-v2").description("Auto-offline idle relays").action(() => { console.log(JSON.stringify(autoOfflineIdleNostrRelaysV2(), null, 2)); });
434
- nostr.command("auto-fail-stuck-events-v2").description("Auto-fail stuck publishing events").action(() => { console.log(JSON.stringify(autoFailStuckNostrEventsV2(), null, 2)); });
435
- nostr.command("stats-v2").description("V2 aggregate stats").action(() => { console.log(JSON.stringify(getNostrBridgeStatsV2(), null, 2)); });
409
+ nostr
410
+ .command("enums-v2")
411
+ .description("Show V2 enums")
412
+ .action(() => {
413
+ console.log(
414
+ JSON.stringify(
415
+ { NOSTR_RELAY_MATURITY_V2, NOSTR_EVENT_LIFECYCLE_V2 },
416
+ null,
417
+ 2,
418
+ ),
419
+ );
420
+ });
421
+ nostr
422
+ .command("register-relay-v2")
423
+ .description("Register a nostr relay profile (pending)")
424
+ .requiredOption("--id <id>")
425
+ .requiredOption("--owner <owner>")
426
+ .option("--url <url>")
427
+ .action((o) => {
428
+ console.log(JSON.stringify(registerNostrRelayV2(o), null, 2));
429
+ });
430
+ nostr
431
+ .command("activate-relay-v2 <id>")
432
+ .description("Activate relay")
433
+ .action((id) => {
434
+ console.log(JSON.stringify(activateNostrRelayV2(id), null, 2));
435
+ });
436
+ nostr
437
+ .command("offline-relay-v2 <id>")
438
+ .description("Mark relay offline")
439
+ .action((id) => {
440
+ console.log(JSON.stringify(offlineNostrRelayV2(id), null, 2));
441
+ });
442
+ nostr
443
+ .command("retire-relay-v2 <id>")
444
+ .description("Retire relay (terminal)")
445
+ .action((id) => {
446
+ console.log(JSON.stringify(retireNostrRelayV2(id), null, 2));
447
+ });
448
+ nostr
449
+ .command("touch-relay-v2 <id>")
450
+ .description("Refresh lastTouchedAt")
451
+ .action((id) => {
452
+ console.log(JSON.stringify(touchNostrRelayV2(id), null, 2));
453
+ });
454
+ nostr
455
+ .command("get-relay-v2 <id>")
456
+ .description("Get a relay")
457
+ .action((id) => {
458
+ console.log(JSON.stringify(getNostrRelayV2(id), null, 2));
459
+ });
460
+ nostr
461
+ .command("list-relays-v2")
462
+ .description("List relays")
463
+ .action(() => {
464
+ console.log(JSON.stringify(listNostrRelaysV2(), null, 2));
465
+ });
466
+ nostr
467
+ .command("create-event-v2")
468
+ .description("Create a nostr event (queued)")
469
+ .requiredOption("--id <id>")
470
+ .requiredOption("--relay-id <relayId>")
471
+ .option("--kind <kind>", "event kind", (v) => Number(v))
472
+ .action((o) => {
473
+ console.log(
474
+ JSON.stringify(
475
+ createNostrEventV2({ id: o.id, relayId: o.relayId, kind: o.kind }),
476
+ null,
477
+ 2,
478
+ ),
479
+ );
480
+ });
481
+ nostr
482
+ .command("start-event-v2 <id>")
483
+ .description("Transition event to publishing")
484
+ .action((id) => {
485
+ console.log(JSON.stringify(startNostrEventV2(id), null, 2));
486
+ });
487
+ nostr
488
+ .command("publish-event-v2 <id>")
489
+ .description("Transition event to published")
490
+ .action((id) => {
491
+ console.log(JSON.stringify(publishNostrEventV2(id), null, 2));
492
+ });
493
+ nostr
494
+ .command("fail-event-v2 <id>")
495
+ .description("Fail event")
496
+ .option("--reason <r>")
497
+ .action((id, o) => {
498
+ console.log(JSON.stringify(failNostrEventV2(id, o.reason), null, 2));
499
+ });
500
+ nostr
501
+ .command("cancel-event-v2 <id>")
502
+ .description("Cancel event")
503
+ .option("--reason <r>")
504
+ .action((id, o) => {
505
+ console.log(JSON.stringify(cancelNostrEventV2(id, o.reason), null, 2));
506
+ });
507
+ nostr
508
+ .command("get-event-v2 <id>")
509
+ .description("Get event")
510
+ .action((id) => {
511
+ console.log(JSON.stringify(getNostrEventV2(id), null, 2));
512
+ });
513
+ nostr
514
+ .command("list-events-v2")
515
+ .description("List events")
516
+ .action(() => {
517
+ console.log(JSON.stringify(listNostrEventsV2(), null, 2));
518
+ });
519
+ nostr
520
+ .command("set-max-active-relays-v2 <n>")
521
+ .description("Set per-owner active cap")
522
+ .action((n) => {
523
+ setMaxActiveNostrRelaysPerOwnerV2(Number(n));
524
+ console.log(
525
+ JSON.stringify(
526
+ { maxActiveNostrRelaysPerOwner: getMaxActiveNostrRelaysPerOwnerV2() },
527
+ null,
528
+ 2,
529
+ ),
530
+ );
531
+ });
532
+ nostr
533
+ .command("set-max-pending-events-v2 <n>")
534
+ .description("Set per-relay pending cap")
535
+ .action((n) => {
536
+ setMaxPendingNostrEventsPerRelayV2(Number(n));
537
+ console.log(
538
+ JSON.stringify(
539
+ {
540
+ maxPendingNostrEventsPerRelay: getMaxPendingNostrEventsPerRelayV2(),
541
+ },
542
+ null,
543
+ 2,
544
+ ),
545
+ );
546
+ });
547
+ nostr
548
+ .command("set-relay-idle-ms-v2 <n>")
549
+ .description("Set idle threshold")
550
+ .action((n) => {
551
+ setNostrRelayIdleMsV2(Number(n));
552
+ console.log(
553
+ JSON.stringify({ nostrRelayIdleMs: getNostrRelayIdleMsV2() }, null, 2),
554
+ );
555
+ });
556
+ nostr
557
+ .command("set-event-stuck-ms-v2 <n>")
558
+ .description("Set stuck threshold")
559
+ .action((n) => {
560
+ setNostrEventStuckMsV2(Number(n));
561
+ console.log(
562
+ JSON.stringify(
563
+ { nostrEventStuckMs: getNostrEventStuckMsV2() },
564
+ null,
565
+ 2,
566
+ ),
567
+ );
568
+ });
569
+ nostr
570
+ .command("auto-offline-idle-relays-v2")
571
+ .description("Auto-offline idle relays")
572
+ .action(() => {
573
+ console.log(JSON.stringify(autoOfflineIdleNostrRelaysV2(), null, 2));
574
+ });
575
+ nostr
576
+ .command("auto-fail-stuck-events-v2")
577
+ .description("Auto-fail stuck publishing events")
578
+ .action(() => {
579
+ console.log(JSON.stringify(autoFailStuckNostrEventsV2(), null, 2));
580
+ });
581
+ nostr
582
+ .command("stats-v2")
583
+ .description("V2 aggregate stats")
584
+ .action(() => {
585
+ console.log(JSON.stringify(getNostrBridgeStatsV2(), null, 2));
586
+ });
587
+ }
588
+
589
+ // === Iter21 V2 governance overlay ===
590
+ export function registerNosgovV2Commands(program) {
591
+ const parent = program.commands.find((c) => c.name() === "nostr");
592
+ if (!parent) return;
593
+ const L = async () => await import("../lib/nostr-bridge.js");
594
+ parent
595
+ .command("nosgov-enums-v2")
596
+ .description("Show V2 enums")
597
+ .action(async () => {
598
+ const m = await L();
599
+ console.log(
600
+ JSON.stringify(
601
+ {
602
+ profileMaturity: m.NOSGOV_PROFILE_MATURITY_V2,
603
+ publishLifecycle: m.NOSGOV_PUBLISH_LIFECYCLE_V2,
604
+ },
605
+ null,
606
+ 2,
607
+ ),
608
+ );
609
+ });
610
+ parent
611
+ .command("nosgov-config-v2")
612
+ .description("Show V2 config")
613
+ .action(async () => {
614
+ const m = await L();
615
+ console.log(
616
+ JSON.stringify(
617
+ {
618
+ maxActive: m.getMaxActiveNosgovProfilesPerOwnerV2(),
619
+ maxPending: m.getMaxPendingNosgovPublishsPerProfileV2(),
620
+ idleMs: m.getNosgovProfileIdleMsV2(),
621
+ stuckMs: m.getNosgovPublishStuckMsV2(),
622
+ },
623
+ null,
624
+ 2,
625
+ ),
626
+ );
627
+ });
628
+ parent
629
+ .command("nosgov-set-max-active-v2 <n>")
630
+ .description("Set max active")
631
+ .action(async (n) => {
632
+ (await L()).setMaxActiveNosgovProfilesPerOwnerV2(Number(n));
633
+ console.log("ok");
634
+ });
635
+ parent
636
+ .command("nosgov-set-max-pending-v2 <n>")
637
+ .description("Set max pending")
638
+ .action(async (n) => {
639
+ (await L()).setMaxPendingNosgovPublishsPerProfileV2(Number(n));
640
+ console.log("ok");
641
+ });
642
+ parent
643
+ .command("nosgov-set-idle-ms-v2 <n>")
644
+ .description("Set idle threshold ms")
645
+ .action(async (n) => {
646
+ (await L()).setNosgovProfileIdleMsV2(Number(n));
647
+ console.log("ok");
648
+ });
649
+ parent
650
+ .command("nosgov-set-stuck-ms-v2 <n>")
651
+ .description("Set stuck threshold ms")
652
+ .action(async (n) => {
653
+ (await L()).setNosgovPublishStuckMsV2(Number(n));
654
+ console.log("ok");
655
+ });
656
+ parent
657
+ .command("nosgov-register-v2 <id> <owner>")
658
+ .description("Register V2 profile")
659
+ .option("--relay <v>", "relay")
660
+ .action(async (id, owner, o) => {
661
+ const m = await L();
662
+ console.log(
663
+ JSON.stringify(
664
+ m.registerNosgovProfileV2({ id, owner, relay: o.relay }),
665
+ null,
666
+ 2,
667
+ ),
668
+ );
669
+ });
670
+ parent
671
+ .command("nosgov-activate-v2 <id>")
672
+ .description("Activate profile")
673
+ .action(async (id) => {
674
+ console.log(
675
+ JSON.stringify((await L()).activateNosgovProfileV2(id), null, 2),
676
+ );
677
+ });
678
+ parent
679
+ .command("nosgov-suspend-v2 <id>")
680
+ .description("Suspend profile")
681
+ .action(async (id) => {
682
+ console.log(
683
+ JSON.stringify((await L()).suspendNosgovProfileV2(id), null, 2),
684
+ );
685
+ });
686
+ parent
687
+ .command("nosgov-archive-v2 <id>")
688
+ .description("Archive profile")
689
+ .action(async (id) => {
690
+ console.log(
691
+ JSON.stringify((await L()).archiveNosgovProfileV2(id), null, 2),
692
+ );
693
+ });
694
+ parent
695
+ .command("nosgov-touch-v2 <id>")
696
+ .description("Touch profile")
697
+ .action(async (id) => {
698
+ console.log(
699
+ JSON.stringify((await L()).touchNosgovProfileV2(id), null, 2),
700
+ );
701
+ });
702
+ parent
703
+ .command("nosgov-get-v2 <id>")
704
+ .description("Get profile")
705
+ .action(async (id) => {
706
+ console.log(JSON.stringify((await L()).getNosgovProfileV2(id), null, 2));
707
+ });
708
+ parent
709
+ .command("nosgov-list-v2")
710
+ .description("List profiles")
711
+ .action(async () => {
712
+ console.log(JSON.stringify((await L()).listNosgovProfilesV2(), null, 2));
713
+ });
714
+ parent
715
+ .command("nosgov-create-publish-v2 <id> <profileId>")
716
+ .description("Create publish")
717
+ .option("--kind <v>", "kind")
718
+ .action(async (id, profileId, o) => {
719
+ const m = await L();
720
+ console.log(
721
+ JSON.stringify(
722
+ m.createNosgovPublishV2({ id, profileId, kind: o.kind }),
723
+ null,
724
+ 2,
725
+ ),
726
+ );
727
+ });
728
+ parent
729
+ .command("nosgov-publishing-publish-v2 <id>")
730
+ .description("Mark publish as publishing")
731
+ .action(async (id) => {
732
+ console.log(
733
+ JSON.stringify((await L()).publishingNosgovPublishV2(id), null, 2),
734
+ );
735
+ });
736
+ parent
737
+ .command("nosgov-complete-publish-v2 <id>")
738
+ .description("Complete publish")
739
+ .action(async (id) => {
740
+ console.log(
741
+ JSON.stringify((await L()).completePublishNosgovV2(id), null, 2),
742
+ );
743
+ });
744
+ parent
745
+ .command("nosgov-fail-publish-v2 <id> [reason]")
746
+ .description("Fail publish")
747
+ .action(async (id, reason) => {
748
+ console.log(
749
+ JSON.stringify((await L()).failNosgovPublishV2(id, reason), null, 2),
750
+ );
751
+ });
752
+ parent
753
+ .command("nosgov-cancel-publish-v2 <id> [reason]")
754
+ .description("Cancel publish")
755
+ .action(async (id, reason) => {
756
+ console.log(
757
+ JSON.stringify((await L()).cancelNosgovPublishV2(id, reason), null, 2),
758
+ );
759
+ });
760
+ parent
761
+ .command("nosgov-get-publish-v2 <id>")
762
+ .description("Get publish")
763
+ .action(async (id) => {
764
+ console.log(JSON.stringify((await L()).getNosgovPublishV2(id), null, 2));
765
+ });
766
+ parent
767
+ .command("nosgov-list-publishs-v2")
768
+ .description("List publishs")
769
+ .action(async () => {
770
+ console.log(JSON.stringify((await L()).listNosgovPublishsV2(), null, 2));
771
+ });
772
+ parent
773
+ .command("nosgov-auto-suspend-idle-v2")
774
+ .description("Auto-suspend idle")
775
+ .action(async () => {
776
+ console.log(
777
+ JSON.stringify((await L()).autoSuspendIdleNosgovProfilesV2(), null, 2),
778
+ );
779
+ });
780
+ parent
781
+ .command("nosgov-auto-fail-stuck-v2")
782
+ .description("Auto-fail stuck publishs")
783
+ .action(async () => {
784
+ console.log(
785
+ JSON.stringify((await L()).autoFailStuckNosgovPublishsV2(), null, 2),
786
+ );
787
+ });
788
+ parent
789
+ .command("nosgov-gov-stats-v2")
790
+ .description("V2 gov stats")
791
+ .action(async () => {
792
+ console.log(
793
+ JSON.stringify((await L()).getNostrBridgeGovStatsV2(), null, 2),
794
+ );
795
+ });
436
796
  }
@@ -731,3 +731,208 @@ export function registerNoteCommand(program) {
731
731
  console.log(JSON.stringify(autoDiscardStaleRevisionsV2(), null, 2)),
732
732
  );
733
733
  }
734
+
735
+ // === Iter23 V2 governance overlay ===
736
+ export function registerNtgovV2Commands(program) {
737
+ const parent = program.commands.find((c) => c.name() === "note");
738
+ if (!parent) return;
739
+ const L = async () => await import("../lib/note-versioning.js");
740
+ parent
741
+ .command("ntgov-enums-v2")
742
+ .description("Show V2 enums")
743
+ .action(async () => {
744
+ const m = await L();
745
+ console.log(
746
+ JSON.stringify(
747
+ {
748
+ profileMaturity: m.NTGOV_PROFILE_MATURITY_V2,
749
+ revisionLifecycle: m.NTGOV_REVISION_LIFECYCLE_V2,
750
+ },
751
+ null,
752
+ 2,
753
+ ),
754
+ );
755
+ });
756
+ parent
757
+ .command("ntgov-config-v2")
758
+ .description("Show V2 config")
759
+ .action(async () => {
760
+ const m = await L();
761
+ console.log(
762
+ JSON.stringify(
763
+ {
764
+ maxActive: m.getMaxActiveNtgovProfilesPerOwnerV2(),
765
+ maxPending: m.getMaxPendingNtgovRevisionsPerProfileV2(),
766
+ idleMs: m.getNtgovProfileIdleMsV2(),
767
+ stuckMs: m.getNtgovRevisionStuckMsV2(),
768
+ },
769
+ null,
770
+ 2,
771
+ ),
772
+ );
773
+ });
774
+ parent
775
+ .command("ntgov-set-max-active-v2 <n>")
776
+ .description("Set max active")
777
+ .action(async (n) => {
778
+ (await L()).setMaxActiveNtgovProfilesPerOwnerV2(Number(n));
779
+ console.log("ok");
780
+ });
781
+ parent
782
+ .command("ntgov-set-max-pending-v2 <n>")
783
+ .description("Set max pending")
784
+ .action(async (n) => {
785
+ (await L()).setMaxPendingNtgovRevisionsPerProfileV2(Number(n));
786
+ console.log("ok");
787
+ });
788
+ parent
789
+ .command("ntgov-set-idle-ms-v2 <n>")
790
+ .description("Set idle threshold ms")
791
+ .action(async (n) => {
792
+ (await L()).setNtgovProfileIdleMsV2(Number(n));
793
+ console.log("ok");
794
+ });
795
+ parent
796
+ .command("ntgov-set-stuck-ms-v2 <n>")
797
+ .description("Set stuck threshold ms")
798
+ .action(async (n) => {
799
+ (await L()).setNtgovRevisionStuckMsV2(Number(n));
800
+ console.log("ok");
801
+ });
802
+ parent
803
+ .command("ntgov-register-v2 <id> <owner>")
804
+ .description("Register V2 profile")
805
+ .option("--series <v>", "series")
806
+ .action(async (id, owner, o) => {
807
+ const m = await L();
808
+ console.log(
809
+ JSON.stringify(
810
+ m.registerNtgovProfileV2({ id, owner, series: o.series }),
811
+ null,
812
+ 2,
813
+ ),
814
+ );
815
+ });
816
+ parent
817
+ .command("ntgov-activate-v2 <id>")
818
+ .description("Activate profile")
819
+ .action(async (id) => {
820
+ console.log(
821
+ JSON.stringify((await L()).activateNtgovProfileV2(id), null, 2),
822
+ );
823
+ });
824
+ parent
825
+ .command("ntgov-stale-v2 <id>")
826
+ .description("Stale profile")
827
+ .action(async (id) => {
828
+ console.log(JSON.stringify((await L()).staleNtgovProfileV2(id), null, 2));
829
+ });
830
+ parent
831
+ .command("ntgov-archive-v2 <id>")
832
+ .description("Archive profile")
833
+ .action(async (id) => {
834
+ console.log(
835
+ JSON.stringify((await L()).archiveNtgovProfileV2(id), null, 2),
836
+ );
837
+ });
838
+ parent
839
+ .command("ntgov-touch-v2 <id>")
840
+ .description("Touch profile")
841
+ .action(async (id) => {
842
+ console.log(JSON.stringify((await L()).touchNtgovProfileV2(id), null, 2));
843
+ });
844
+ parent
845
+ .command("ntgov-get-v2 <id>")
846
+ .description("Get profile")
847
+ .action(async (id) => {
848
+ console.log(JSON.stringify((await L()).getNtgovProfileV2(id), null, 2));
849
+ });
850
+ parent
851
+ .command("ntgov-list-v2")
852
+ .description("List profiles")
853
+ .action(async () => {
854
+ console.log(JSON.stringify((await L()).listNtgovProfilesV2(), null, 2));
855
+ });
856
+ parent
857
+ .command("ntgov-create-revision-v2 <id> <profileId>")
858
+ .description("Create revision")
859
+ .option("--author <v>", "author")
860
+ .action(async (id, profileId, o) => {
861
+ const m = await L();
862
+ console.log(
863
+ JSON.stringify(
864
+ m.createNtgovRevisionV2({ id, profileId, author: o.author }),
865
+ null,
866
+ 2,
867
+ ),
868
+ );
869
+ });
870
+ parent
871
+ .command("ntgov-reviewing-revision-v2 <id>")
872
+ .description("Mark revision as reviewing")
873
+ .action(async (id) => {
874
+ console.log(
875
+ JSON.stringify((await L()).reviewingNtgovRevisionV2(id), null, 2),
876
+ );
877
+ });
878
+ parent
879
+ .command("ntgov-complete-revision-v2 <id>")
880
+ .description("Merge revision")
881
+ .action(async (id) => {
882
+ console.log(
883
+ JSON.stringify((await L()).completeRevisionNtgovV2(id), null, 2),
884
+ );
885
+ });
886
+ parent
887
+ .command("ntgov-fail-revision-v2 <id> [reason]")
888
+ .description("Fail revision")
889
+ .action(async (id, reason) => {
890
+ console.log(
891
+ JSON.stringify((await L()).failNtgovRevisionV2(id, reason), null, 2),
892
+ );
893
+ });
894
+ parent
895
+ .command("ntgov-cancel-revision-v2 <id> [reason]")
896
+ .description("Cancel revision")
897
+ .action(async (id, reason) => {
898
+ console.log(
899
+ JSON.stringify((await L()).cancelNtgovRevisionV2(id, reason), null, 2),
900
+ );
901
+ });
902
+ parent
903
+ .command("ntgov-get-revision-v2 <id>")
904
+ .description("Get revision")
905
+ .action(async (id) => {
906
+ console.log(JSON.stringify((await L()).getNtgovRevisionV2(id), null, 2));
907
+ });
908
+ parent
909
+ .command("ntgov-list-revisions-v2")
910
+ .description("List revisions")
911
+ .action(async () => {
912
+ console.log(JSON.stringify((await L()).listNtgovRevisionsV2(), null, 2));
913
+ });
914
+ parent
915
+ .command("ntgov-auto-stale-idle-v2")
916
+ .description("Auto-stale idle")
917
+ .action(async () => {
918
+ console.log(
919
+ JSON.stringify((await L()).autoStaleIdleNtgovProfilesV2(), null, 2),
920
+ );
921
+ });
922
+ parent
923
+ .command("ntgov-auto-fail-stuck-v2")
924
+ .description("Auto-fail stuck revisions")
925
+ .action(async () => {
926
+ console.log(
927
+ JSON.stringify((await L()).autoFailStuckNtgovRevisionsV2(), null, 2),
928
+ );
929
+ });
930
+ parent
931
+ .command("ntgov-gov-stats-v2")
932
+ .description("V2 gov stats")
933
+ .action(async () => {
934
+ console.log(
935
+ JSON.stringify((await L()).getNoteVersioningGovStatsV2(), null, 2),
936
+ );
937
+ });
938
+ }