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
@@ -981,3 +981,212 @@ export function registerSsoCommand(program) {
981
981
  .description("V2 auto-fail stuck")
982
982
  .action(() => _v2json(autoFailStuckLoginsV2()));
983
983
  }
984
+
985
+ // === Iter19 V2 governance overlay ===
986
+ export function registerSsogovV2Commands(program) {
987
+ const parent = program.commands.find((c) => c.name() === "sso");
988
+ if (!parent) return;
989
+ const L = async () => await import("../lib/sso-manager.js");
990
+ parent
991
+ .command("ssogov-enums-v2")
992
+ .description("Show V2 enums")
993
+ .action(async () => {
994
+ const m = await L();
995
+ console.log(
996
+ JSON.stringify(
997
+ {
998
+ profileMaturity: m.SSOGOV_PROFILE_MATURITY_V2,
999
+ loginLifecycle: m.SSOGOV_LOGIN_LIFECYCLE_V2,
1000
+ },
1001
+ null,
1002
+ 2,
1003
+ ),
1004
+ );
1005
+ });
1006
+ parent
1007
+ .command("ssogov-config-v2")
1008
+ .description("Show V2 config")
1009
+ .action(async () => {
1010
+ const m = await L();
1011
+ console.log(
1012
+ JSON.stringify(
1013
+ {
1014
+ maxActive: m.getMaxActiveSsogovProfilesPerOwnerV2(),
1015
+ maxPending: m.getMaxPendingSsogovLoginsPerProfileV2(),
1016
+ idleMs: m.getSsogovProfileIdleMsV2(),
1017
+ stuckMs: m.getSsogovLoginStuckMsV2(),
1018
+ },
1019
+ null,
1020
+ 2,
1021
+ ),
1022
+ );
1023
+ });
1024
+ parent
1025
+ .command("ssogov-set-max-active-v2 <n>")
1026
+ .description("Set max active")
1027
+ .action(async (n) => {
1028
+ (await L()).setMaxActiveSsogovProfilesPerOwnerV2(Number(n));
1029
+ console.log("ok");
1030
+ });
1031
+ parent
1032
+ .command("ssogov-set-max-pending-v2 <n>")
1033
+ .description("Set max pending")
1034
+ .action(async (n) => {
1035
+ (await L()).setMaxPendingSsogovLoginsPerProfileV2(Number(n));
1036
+ console.log("ok");
1037
+ });
1038
+ parent
1039
+ .command("ssogov-set-idle-ms-v2 <n>")
1040
+ .description("Set idle threshold ms")
1041
+ .action(async (n) => {
1042
+ (await L()).setSsogovProfileIdleMsV2(Number(n));
1043
+ console.log("ok");
1044
+ });
1045
+ parent
1046
+ .command("ssogov-set-stuck-ms-v2 <n>")
1047
+ .description("Set stuck threshold ms")
1048
+ .action(async (n) => {
1049
+ (await L()).setSsogovLoginStuckMsV2(Number(n));
1050
+ console.log("ok");
1051
+ });
1052
+ parent
1053
+ .command("ssogov-register-v2 <id> <owner>")
1054
+ .description("Register V2 profile")
1055
+ .option("--protocol <v>", "protocol")
1056
+ .action(async (id, owner, o) => {
1057
+ const m = await L();
1058
+ console.log(
1059
+ JSON.stringify(
1060
+ m.registerSsogovProfileV2({ id, owner, protocol: o.protocol }),
1061
+ null,
1062
+ 2,
1063
+ ),
1064
+ );
1065
+ });
1066
+ parent
1067
+ .command("ssogov-activate-v2 <id>")
1068
+ .description("Activate profile")
1069
+ .action(async (id) => {
1070
+ console.log(
1071
+ JSON.stringify((await L()).activateSsogovProfileV2(id), null, 2),
1072
+ );
1073
+ });
1074
+ parent
1075
+ .command("ssogov-suspend-v2 <id>")
1076
+ .description("Suspend profile")
1077
+ .action(async (id) => {
1078
+ console.log(
1079
+ JSON.stringify((await L()).suspendSsogovProfileV2(id), null, 2),
1080
+ );
1081
+ });
1082
+ parent
1083
+ .command("ssogov-archive-v2 <id>")
1084
+ .description("Archive profile")
1085
+ .action(async (id) => {
1086
+ console.log(
1087
+ JSON.stringify((await L()).archiveSsogovProfileV2(id), null, 2),
1088
+ );
1089
+ });
1090
+ parent
1091
+ .command("ssogov-touch-v2 <id>")
1092
+ .description("Touch profile")
1093
+ .action(async (id) => {
1094
+ console.log(
1095
+ JSON.stringify((await L()).touchSsogovProfileV2(id), null, 2),
1096
+ );
1097
+ });
1098
+ parent
1099
+ .command("ssogov-get-v2 <id>")
1100
+ .description("Get profile")
1101
+ .action(async (id) => {
1102
+ console.log(JSON.stringify((await L()).getSsogovProfileV2(id), null, 2));
1103
+ });
1104
+ parent
1105
+ .command("ssogov-list-v2")
1106
+ .description("List profiles")
1107
+ .action(async () => {
1108
+ console.log(JSON.stringify((await L()).listSsogovProfilesV2(), null, 2));
1109
+ });
1110
+ parent
1111
+ .command("ssogov-create-login-v2 <id> <profileId>")
1112
+ .description("Create login")
1113
+ .option("--subject <v>", "subject")
1114
+ .action(async (id, profileId, o) => {
1115
+ const m = await L();
1116
+ console.log(
1117
+ JSON.stringify(
1118
+ m.createSsogovLoginV2({ id, profileId, subject: o.subject }),
1119
+ null,
1120
+ 2,
1121
+ ),
1122
+ );
1123
+ });
1124
+ parent
1125
+ .command("ssogov-authenticating-login-v2 <id>")
1126
+ .description("Mark login as authenticating")
1127
+ .action(async (id) => {
1128
+ console.log(
1129
+ JSON.stringify((await L()).authenticatingSsogovLoginV2(id), null, 2),
1130
+ );
1131
+ });
1132
+ parent
1133
+ .command("ssogov-complete-login-v2 <id>")
1134
+ .description("Complete login")
1135
+ .action(async (id) => {
1136
+ console.log(
1137
+ JSON.stringify((await L()).completeLoginSsogovV2(id), null, 2),
1138
+ );
1139
+ });
1140
+ parent
1141
+ .command("ssogov-fail-login-v2 <id> [reason]")
1142
+ .description("Fail login")
1143
+ .action(async (id, reason) => {
1144
+ console.log(
1145
+ JSON.stringify((await L()).failSsogovLoginV2(id, reason), null, 2),
1146
+ );
1147
+ });
1148
+ parent
1149
+ .command("ssogov-cancel-login-v2 <id> [reason]")
1150
+ .description("Cancel login")
1151
+ .action(async (id, reason) => {
1152
+ console.log(
1153
+ JSON.stringify((await L()).cancelSsogovLoginV2(id, reason), null, 2),
1154
+ );
1155
+ });
1156
+ parent
1157
+ .command("ssogov-get-login-v2 <id>")
1158
+ .description("Get login")
1159
+ .action(async (id) => {
1160
+ console.log(JSON.stringify((await L()).getSsogovLoginV2(id), null, 2));
1161
+ });
1162
+ parent
1163
+ .command("ssogov-list-logins-v2")
1164
+ .description("List logins")
1165
+ .action(async () => {
1166
+ console.log(JSON.stringify((await L()).listSsogovLoginsV2(), null, 2));
1167
+ });
1168
+ parent
1169
+ .command("ssogov-auto-suspend-idle-v2")
1170
+ .description("Auto-suspend idle")
1171
+ .action(async () => {
1172
+ console.log(
1173
+ JSON.stringify((await L()).autoSuspendIdleSsogovProfilesV2(), null, 2),
1174
+ );
1175
+ });
1176
+ parent
1177
+ .command("ssogov-auto-fail-stuck-v2")
1178
+ .description("Auto-fail stuck logins")
1179
+ .action(async () => {
1180
+ console.log(
1181
+ JSON.stringify((await L()).autoFailStuckSsogovLoginsV2(), null, 2),
1182
+ );
1183
+ });
1184
+ parent
1185
+ .command("ssogov-gov-stats-v2")
1186
+ .description("V2 gov stats")
1187
+ .action(async () => {
1188
+ console.log(
1189
+ JSON.stringify((await L()).getSsoManagerGovStatsV2(), null, 2),
1190
+ );
1191
+ });
1192
+ }
@@ -66,3 +66,212 @@ export function registerStartCommand(program) {
66
66
  }
67
67
  });
68
68
  }
69
+
70
+ // === Iter27 V2 governance overlay ===
71
+ export function registerPmgrgovV2Commands(program) {
72
+ const parent = program.commands.find((c) => c.name() === "start");
73
+ if (!parent) return;
74
+ const L = async () => await import("../lib/process-manager.js");
75
+ parent
76
+ .command("pmgrgov-enums-v2")
77
+ .description("Show V2 enums")
78
+ .action(async () => {
79
+ const m = await L();
80
+ console.log(
81
+ JSON.stringify(
82
+ {
83
+ profileMaturity: m.PMGRGOV_PROFILE_MATURITY_V2,
84
+ procLifecycle: m.PMGRGOV_PROC_LIFECYCLE_V2,
85
+ },
86
+ null,
87
+ 2,
88
+ ),
89
+ );
90
+ });
91
+ parent
92
+ .command("pmgrgov-config-v2")
93
+ .description("Show V2 config")
94
+ .action(async () => {
95
+ const m = await L();
96
+ console.log(
97
+ JSON.stringify(
98
+ {
99
+ maxActive: m.getMaxActivePmgrgovProfilesPerOwnerV2(),
100
+ maxPending: m.getMaxPendingPmgrgovProcsPerProfileV2(),
101
+ idleMs: m.getPmgrgovProfileIdleMsV2(),
102
+ stuckMs: m.getPmgrgovProcStuckMsV2(),
103
+ },
104
+ null,
105
+ 2,
106
+ ),
107
+ );
108
+ });
109
+ parent
110
+ .command("pmgrgov-set-max-active-v2 <n>")
111
+ .description("Set max active")
112
+ .action(async (n) => {
113
+ (await L()).setMaxActivePmgrgovProfilesPerOwnerV2(Number(n));
114
+ console.log("ok");
115
+ });
116
+ parent
117
+ .command("pmgrgov-set-max-pending-v2 <n>")
118
+ .description("Set max pending")
119
+ .action(async (n) => {
120
+ (await L()).setMaxPendingPmgrgovProcsPerProfileV2(Number(n));
121
+ console.log("ok");
122
+ });
123
+ parent
124
+ .command("pmgrgov-set-idle-ms-v2 <n>")
125
+ .description("Set idle threshold ms")
126
+ .action(async (n) => {
127
+ (await L()).setPmgrgovProfileIdleMsV2(Number(n));
128
+ console.log("ok");
129
+ });
130
+ parent
131
+ .command("pmgrgov-set-stuck-ms-v2 <n>")
132
+ .description("Set stuck threshold ms")
133
+ .action(async (n) => {
134
+ (await L()).setPmgrgovProcStuckMsV2(Number(n));
135
+ console.log("ok");
136
+ });
137
+ parent
138
+ .command("pmgrgov-register-v2 <id> <owner>")
139
+ .description("Register V2 profile")
140
+ .option("--kind <v>", "kind")
141
+ .action(async (id, owner, o) => {
142
+ const m = await L();
143
+ console.log(
144
+ JSON.stringify(
145
+ m.registerPmgrgovProfileV2({ id, owner, kind: o.kind }),
146
+ null,
147
+ 2,
148
+ ),
149
+ );
150
+ });
151
+ parent
152
+ .command("pmgrgov-activate-v2 <id>")
153
+ .description("Activate profile")
154
+ .action(async (id) => {
155
+ console.log(
156
+ JSON.stringify((await L()).activatePmgrgovProfileV2(id), null, 2),
157
+ );
158
+ });
159
+ parent
160
+ .command("pmgrgov-stop-v2 <id>")
161
+ .description("Stop profile")
162
+ .action(async (id) => {
163
+ console.log(
164
+ JSON.stringify((await L()).stopPmgrgovProfileV2(id), null, 2),
165
+ );
166
+ });
167
+ parent
168
+ .command("pmgrgov-archive-v2 <id>")
169
+ .description("Archive profile")
170
+ .action(async (id) => {
171
+ console.log(
172
+ JSON.stringify((await L()).archivePmgrgovProfileV2(id), null, 2),
173
+ );
174
+ });
175
+ parent
176
+ .command("pmgrgov-touch-v2 <id>")
177
+ .description("Touch profile")
178
+ .action(async (id) => {
179
+ console.log(
180
+ JSON.stringify((await L()).touchPmgrgovProfileV2(id), null, 2),
181
+ );
182
+ });
183
+ parent
184
+ .command("pmgrgov-get-v2 <id>")
185
+ .description("Get profile")
186
+ .action(async (id) => {
187
+ console.log(JSON.stringify((await L()).getPmgrgovProfileV2(id), null, 2));
188
+ });
189
+ parent
190
+ .command("pmgrgov-list-v2")
191
+ .description("List profiles")
192
+ .action(async () => {
193
+ console.log(JSON.stringify((await L()).listPmgrgovProfilesV2(), null, 2));
194
+ });
195
+ parent
196
+ .command("pmgrgov-create-proc-v2 <id> <profileId>")
197
+ .description("Create proc")
198
+ .option("--command <v>", "command")
199
+ .action(async (id, profileId, o) => {
200
+ const m = await L();
201
+ console.log(
202
+ JSON.stringify(
203
+ m.createPmgrgovProcV2({ id, profileId, command: o.command }),
204
+ null,
205
+ 2,
206
+ ),
207
+ );
208
+ });
209
+ parent
210
+ .command("pmgrgov-starting-proc-v2 <id>")
211
+ .description("Mark proc as starting")
212
+ .action(async (id) => {
213
+ console.log(
214
+ JSON.stringify((await L()).startingPmgrgovProcV2(id), null, 2),
215
+ );
216
+ });
217
+ parent
218
+ .command("pmgrgov-complete-proc-v2 <id>")
219
+ .description("Complete proc")
220
+ .action(async (id) => {
221
+ console.log(
222
+ JSON.stringify((await L()).completeProcPmgrgovV2(id), null, 2),
223
+ );
224
+ });
225
+ parent
226
+ .command("pmgrgov-fail-proc-v2 <id> [reason]")
227
+ .description("Fail proc")
228
+ .action(async (id, reason) => {
229
+ console.log(
230
+ JSON.stringify((await L()).failPmgrgovProcV2(id, reason), null, 2),
231
+ );
232
+ });
233
+ parent
234
+ .command("pmgrgov-cancel-proc-v2 <id> [reason]")
235
+ .description("Cancel proc")
236
+ .action(async (id, reason) => {
237
+ console.log(
238
+ JSON.stringify((await L()).cancelPmgrgovProcV2(id, reason), null, 2),
239
+ );
240
+ });
241
+ parent
242
+ .command("pmgrgov-get-proc-v2 <id>")
243
+ .description("Get proc")
244
+ .action(async (id) => {
245
+ console.log(JSON.stringify((await L()).getPmgrgovProcV2(id), null, 2));
246
+ });
247
+ parent
248
+ .command("pmgrgov-list-procs-v2")
249
+ .description("List procs")
250
+ .action(async () => {
251
+ console.log(JSON.stringify((await L()).listPmgrgovProcsV2(), null, 2));
252
+ });
253
+ parent
254
+ .command("pmgrgov-auto-stop-idle-v2")
255
+ .description("Auto-stop idle")
256
+ .action(async () => {
257
+ console.log(
258
+ JSON.stringify((await L()).autoStopIdlePmgrgovProfilesV2(), null, 2),
259
+ );
260
+ });
261
+ parent
262
+ .command("pmgrgov-auto-fail-stuck-v2")
263
+ .description("Auto-fail stuck procs")
264
+ .action(async () => {
265
+ console.log(
266
+ JSON.stringify((await L()).autoFailStuckPmgrgovProcsV2(), null, 2),
267
+ );
268
+ });
269
+ parent
270
+ .command("pmgrgov-gov-stats-v2")
271
+ .description("V2 gov stats")
272
+ .action(async () => {
273
+ console.log(
274
+ JSON.stringify((await L()).getProcessManagerGovStatsV2(), null, 2),
275
+ );
276
+ });
277
+ }
@@ -73,3 +73,216 @@ export function registerStreamCommand(program) {
73
73
  }
74
74
  });
75
75
  }
76
+
77
+ // === Iter27 V2 governance overlay ===
78
+ export function registerPstrmgovV2Commands(program) {
79
+ const parent = program.commands.find((c) => c.name() === "stream");
80
+ if (!parent) return;
81
+ const L = async () => await import("../lib/provider-stream.js");
82
+ parent
83
+ .command("pstrmgov-enums-v2")
84
+ .description("Show V2 enums")
85
+ .action(async () => {
86
+ const m = await L();
87
+ console.log(
88
+ JSON.stringify(
89
+ {
90
+ profileMaturity: m.PSTRMGOV_PROFILE_MATURITY_V2,
91
+ chunkLifecycle: m.PSTRMGOV_CHUNK_LIFECYCLE_V2,
92
+ },
93
+ null,
94
+ 2,
95
+ ),
96
+ );
97
+ });
98
+ parent
99
+ .command("pstrmgov-config-v2")
100
+ .description("Show V2 config")
101
+ .action(async () => {
102
+ const m = await L();
103
+ console.log(
104
+ JSON.stringify(
105
+ {
106
+ maxActive: m.getMaxActivePstrmgovProfilesPerOwnerV2(),
107
+ maxPending: m.getMaxPendingPstrmgovChunksPerProfileV2(),
108
+ idleMs: m.getPstrmgovProfileIdleMsV2(),
109
+ stuckMs: m.getPstrmgovChunkStuckMsV2(),
110
+ },
111
+ null,
112
+ 2,
113
+ ),
114
+ );
115
+ });
116
+ parent
117
+ .command("pstrmgov-set-max-active-v2 <n>")
118
+ .description("Set max active")
119
+ .action(async (n) => {
120
+ (await L()).setMaxActivePstrmgovProfilesPerOwnerV2(Number(n));
121
+ console.log("ok");
122
+ });
123
+ parent
124
+ .command("pstrmgov-set-max-pending-v2 <n>")
125
+ .description("Set max pending")
126
+ .action(async (n) => {
127
+ (await L()).setMaxPendingPstrmgovChunksPerProfileV2(Number(n));
128
+ console.log("ok");
129
+ });
130
+ parent
131
+ .command("pstrmgov-set-idle-ms-v2 <n>")
132
+ .description("Set idle threshold ms")
133
+ .action(async (n) => {
134
+ (await L()).setPstrmgovProfileIdleMsV2(Number(n));
135
+ console.log("ok");
136
+ });
137
+ parent
138
+ .command("pstrmgov-set-stuck-ms-v2 <n>")
139
+ .description("Set stuck threshold ms")
140
+ .action(async (n) => {
141
+ (await L()).setPstrmgovChunkStuckMsV2(Number(n));
142
+ console.log("ok");
143
+ });
144
+ parent
145
+ .command("pstrmgov-register-v2 <id> <owner>")
146
+ .description("Register V2 profile")
147
+ .option("--provider <v>", "provider")
148
+ .action(async (id, owner, o) => {
149
+ const m = await L();
150
+ console.log(
151
+ JSON.stringify(
152
+ m.registerPstrmgovProfileV2({ id, owner, provider: o.provider }),
153
+ null,
154
+ 2,
155
+ ),
156
+ );
157
+ });
158
+ parent
159
+ .command("pstrmgov-activate-v2 <id>")
160
+ .description("Activate profile")
161
+ .action(async (id) => {
162
+ console.log(
163
+ JSON.stringify((await L()).activatePstrmgovProfileV2(id), null, 2),
164
+ );
165
+ });
166
+ parent
167
+ .command("pstrmgov-stale-v2 <id>")
168
+ .description("Stale profile")
169
+ .action(async (id) => {
170
+ console.log(
171
+ JSON.stringify((await L()).stalePstrmgovProfileV2(id), null, 2),
172
+ );
173
+ });
174
+ parent
175
+ .command("pstrmgov-archive-v2 <id>")
176
+ .description("Archive profile")
177
+ .action(async (id) => {
178
+ console.log(
179
+ JSON.stringify((await L()).archivePstrmgovProfileV2(id), null, 2),
180
+ );
181
+ });
182
+ parent
183
+ .command("pstrmgov-touch-v2 <id>")
184
+ .description("Touch profile")
185
+ .action(async (id) => {
186
+ console.log(
187
+ JSON.stringify((await L()).touchPstrmgovProfileV2(id), null, 2),
188
+ );
189
+ });
190
+ parent
191
+ .command("pstrmgov-get-v2 <id>")
192
+ .description("Get profile")
193
+ .action(async (id) => {
194
+ console.log(
195
+ JSON.stringify((await L()).getPstrmgovProfileV2(id), null, 2),
196
+ );
197
+ });
198
+ parent
199
+ .command("pstrmgov-list-v2")
200
+ .description("List profiles")
201
+ .action(async () => {
202
+ console.log(
203
+ JSON.stringify((await L()).listPstrmgovProfilesV2(), null, 2),
204
+ );
205
+ });
206
+ parent
207
+ .command("pstrmgov-create-chunk-v2 <id> <profileId>")
208
+ .description("Create chunk")
209
+ .option("--tokenId <v>", "tokenId")
210
+ .action(async (id, profileId, o) => {
211
+ const m = await L();
212
+ console.log(
213
+ JSON.stringify(
214
+ m.createPstrmgovChunkV2({ id, profileId, tokenId: o.tokenId }),
215
+ null,
216
+ 2,
217
+ ),
218
+ );
219
+ });
220
+ parent
221
+ .command("pstrmgov-streaming-chunk-v2 <id>")
222
+ .description("Mark chunk as streaming")
223
+ .action(async (id) => {
224
+ console.log(
225
+ JSON.stringify((await L()).streamingPstrmgovChunkV2(id), null, 2),
226
+ );
227
+ });
228
+ parent
229
+ .command("pstrmgov-complete-chunk-v2 <id>")
230
+ .description("Complete chunk")
231
+ .action(async (id) => {
232
+ console.log(
233
+ JSON.stringify((await L()).completeChunkPstrmgovV2(id), null, 2),
234
+ );
235
+ });
236
+ parent
237
+ .command("pstrmgov-fail-chunk-v2 <id> [reason]")
238
+ .description("Fail chunk")
239
+ .action(async (id, reason) => {
240
+ console.log(
241
+ JSON.stringify((await L()).failPstrmgovChunkV2(id, reason), null, 2),
242
+ );
243
+ });
244
+ parent
245
+ .command("pstrmgov-cancel-chunk-v2 <id> [reason]")
246
+ .description("Cancel chunk")
247
+ .action(async (id, reason) => {
248
+ console.log(
249
+ JSON.stringify((await L()).cancelPstrmgovChunkV2(id, reason), null, 2),
250
+ );
251
+ });
252
+ parent
253
+ .command("pstrmgov-get-chunk-v2 <id>")
254
+ .description("Get chunk")
255
+ .action(async (id) => {
256
+ console.log(JSON.stringify((await L()).getPstrmgovChunkV2(id), null, 2));
257
+ });
258
+ parent
259
+ .command("pstrmgov-list-chunks-v2")
260
+ .description("List chunks")
261
+ .action(async () => {
262
+ console.log(JSON.stringify((await L()).listPstrmgovChunksV2(), null, 2));
263
+ });
264
+ parent
265
+ .command("pstrmgov-auto-stale-idle-v2")
266
+ .description("Auto-stale idle")
267
+ .action(async () => {
268
+ console.log(
269
+ JSON.stringify((await L()).autoStaleIdlePstrmgovProfilesV2(), null, 2),
270
+ );
271
+ });
272
+ parent
273
+ .command("pstrmgov-auto-fail-stuck-v2")
274
+ .description("Auto-fail stuck chunks")
275
+ .action(async () => {
276
+ console.log(
277
+ JSON.stringify((await L()).autoFailStuckPstrmgovChunksV2(), null, 2),
278
+ );
279
+ });
280
+ parent
281
+ .command("pstrmgov-gov-stats-v2")
282
+ .description("V2 gov stats")
283
+ .action(async () => {
284
+ console.log(
285
+ JSON.stringify((await L()).getProviderStreamGovStatsV2(), null, 2),
286
+ );
287
+ });
288
+ }