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
@@ -658,3 +658,202 @@ function _registerPipelineV2Commands(parent) {
658
658
  );
659
659
  });
660
660
  }
661
+
662
+ // === Iter28 V2 governance overlay: Pipogov ===
663
+ export function registerPipoV2Commands(program) {
664
+ const parent = program.commands.find((c) => c.name() === "pipeline");
665
+ if (!parent) return;
666
+ const L = async () => await import("../lib/pipeline-orchestrator.js");
667
+ parent
668
+ .command("pipogov-enums-v2")
669
+ .description("Show V2 enums")
670
+ .action(async () => {
671
+ const m = await L();
672
+ console.log(
673
+ JSON.stringify(
674
+ {
675
+ profileMaturity: m.PIPOGOV_PROFILE_MATURITY_V2,
676
+ runLifecycle: m.PIPOGOV_RUN_LIFECYCLE_V2,
677
+ },
678
+ null,
679
+ 2,
680
+ ),
681
+ );
682
+ });
683
+ parent
684
+ .command("pipogov-config-v2")
685
+ .description("Show V2 config")
686
+ .action(async () => {
687
+ const m = await L();
688
+ console.log(
689
+ JSON.stringify(
690
+ {
691
+ maxActive: m.getMaxActivePipoProfilesPerOwnerV2(),
692
+ maxPending: m.getMaxPendingPipoRunsPerProfileV2(),
693
+ idleMs: m.getPipoProfileIdleMsV2(),
694
+ stuckMs: m.getPipoRunStuckMsV2(),
695
+ },
696
+ null,
697
+ 2,
698
+ ),
699
+ );
700
+ });
701
+ parent
702
+ .command("pipogov-set-max-active-v2 <n>")
703
+ .description("Set max active")
704
+ .action(async (n) => {
705
+ (await L()).setMaxActivePipoProfilesPerOwnerV2(Number(n));
706
+ console.log("ok");
707
+ });
708
+ parent
709
+ .command("pipogov-set-max-pending-v2 <n>")
710
+ .description("Set max pending")
711
+ .action(async (n) => {
712
+ (await L()).setMaxPendingPipoRunsPerProfileV2(Number(n));
713
+ console.log("ok");
714
+ });
715
+ parent
716
+ .command("pipogov-set-idle-ms-v2 <n>")
717
+ .description("Set idle threshold ms")
718
+ .action(async (n) => {
719
+ (await L()).setPipoProfileIdleMsV2(Number(n));
720
+ console.log("ok");
721
+ });
722
+ parent
723
+ .command("pipogov-set-stuck-ms-v2 <n>")
724
+ .description("Set stuck threshold ms")
725
+ .action(async (n) => {
726
+ (await L()).setPipoRunStuckMsV2(Number(n));
727
+ console.log("ok");
728
+ });
729
+ parent
730
+ .command("pipogov-register-v2 <id> <owner>")
731
+ .description("Register V2 profile")
732
+ .option("--pipeline <v>", "pipeline")
733
+ .action(async (id, owner, o) => {
734
+ const m = await L();
735
+ console.log(
736
+ JSON.stringify(
737
+ m.registerPipoProfileV2({ id, owner, pipeline: o.pipeline }),
738
+ null,
739
+ 2,
740
+ ),
741
+ );
742
+ });
743
+ parent
744
+ .command("pipogov-activate-v2 <id>")
745
+ .description("Activate profile")
746
+ .action(async (id) => {
747
+ console.log(
748
+ JSON.stringify((await L()).activatePipoProfileV2(id), null, 2),
749
+ );
750
+ });
751
+ parent
752
+ .command("pipogov-paused-v2 <id>")
753
+ .description("Paused profile")
754
+ .action(async (id) => {
755
+ console.log(JSON.stringify((await L()).pausedPipoProfileV2(id), null, 2));
756
+ });
757
+ parent
758
+ .command("pipogov-archive-v2 <id>")
759
+ .description("Archive profile")
760
+ .action(async (id) => {
761
+ console.log(
762
+ JSON.stringify((await L()).archivePipoProfileV2(id), null, 2),
763
+ );
764
+ });
765
+ parent
766
+ .command("pipogov-touch-v2 <id>")
767
+ .description("Touch profile")
768
+ .action(async (id) => {
769
+ console.log(JSON.stringify((await L()).touchPipoProfileV2(id), null, 2));
770
+ });
771
+ parent
772
+ .command("pipogov-get-v2 <id>")
773
+ .description("Get profile")
774
+ .action(async (id) => {
775
+ console.log(JSON.stringify((await L()).getPipoProfileV2(id), null, 2));
776
+ });
777
+ parent
778
+ .command("pipogov-list-v2")
779
+ .description("List profiles")
780
+ .action(async () => {
781
+ console.log(JSON.stringify((await L()).listPipoProfilesV2(), null, 2));
782
+ });
783
+ parent
784
+ .command("pipogov-create-run-v2 <id> <profileId>")
785
+ .description("Create run")
786
+ .option("--runId <v>", "runId")
787
+ .action(async (id, profileId, o) => {
788
+ const m = await L();
789
+ console.log(
790
+ JSON.stringify(
791
+ m.createPipoRunV2({ id, profileId, runId: o.runId }),
792
+ null,
793
+ 2,
794
+ ),
795
+ );
796
+ });
797
+ parent
798
+ .command("pipogov-running-run-v2 <id>")
799
+ .description("Mark run as running")
800
+ .action(async (id) => {
801
+ console.log(JSON.stringify((await L()).runningPipoRunV2(id), null, 2));
802
+ });
803
+ parent
804
+ .command("pipogov-complete-run-v2 <id>")
805
+ .description("Complete run")
806
+ .action(async (id) => {
807
+ console.log(JSON.stringify((await L()).completeRunPipoV2(id), null, 2));
808
+ });
809
+ parent
810
+ .command("pipogov-fail-run-v2 <id> [reason]")
811
+ .description("Fail run")
812
+ .action(async (id, reason) => {
813
+ console.log(
814
+ JSON.stringify((await L()).failPipoRunV2(id, reason), null, 2),
815
+ );
816
+ });
817
+ parent
818
+ .command("pipogov-cancel-run-v2 <id> [reason]")
819
+ .description("Cancel run")
820
+ .action(async (id, reason) => {
821
+ console.log(
822
+ JSON.stringify((await L()).cancelPipoRunV2(id, reason), null, 2),
823
+ );
824
+ });
825
+ parent
826
+ .command("pipogov-get-run-v2 <id>")
827
+ .description("Get run")
828
+ .action(async (id) => {
829
+ console.log(JSON.stringify((await L()).getPipoRunV2(id), null, 2));
830
+ });
831
+ parent
832
+ .command("pipogov-list-runs-v2")
833
+ .description("List runs")
834
+ .action(async () => {
835
+ console.log(JSON.stringify((await L()).listPipoRunsV2(), null, 2));
836
+ });
837
+ parent
838
+ .command("pipogov-auto-paused-idle-v2")
839
+ .description("Auto-paused idle")
840
+ .action(async () => {
841
+ console.log(
842
+ JSON.stringify((await L()).autoPausedIdlePipoProfilesV2(), null, 2),
843
+ );
844
+ });
845
+ parent
846
+ .command("pipogov-auto-fail-stuck-v2")
847
+ .description("Auto-fail stuck runs")
848
+ .action(async () => {
849
+ console.log(
850
+ JSON.stringify((await L()).autoFailStuckPipoRunsV2(), null, 2),
851
+ );
852
+ });
853
+ parent
854
+ .command("pipogov-gov-stats-v2")
855
+ .description("V2 gov stats")
856
+ .action(async () => {
857
+ console.log(JSON.stringify((await L()).getPipogovStatsV2(), null, 2));
858
+ });
859
+ }
@@ -152,3 +152,429 @@ export function registerPlanModeCommand(program) {
152
152
  console.log(JSON.stringify({ ok: true }, null, 2));
153
153
  });
154
154
  }
155
+
156
+ // === Iter26 V2 governance overlay ===
157
+ export function registerPlannergovV2Commands(program) {
158
+ const parent = program.commands.find((c) => c.name() === "planmode");
159
+ if (!parent) return;
160
+ const L = async () => await import("../lib/interactive-planner.js");
161
+ parent
162
+ .command("plannergov-enums-v2")
163
+ .description("Show V2 enums")
164
+ .action(async () => {
165
+ const m = await L();
166
+ console.log(
167
+ JSON.stringify(
168
+ {
169
+ profileMaturity: m.PLANNERGOV_PROFILE_MATURITY_V2,
170
+ promptLifecycle: m.PLANNERGOV_PROMPT_LIFECYCLE_V2,
171
+ },
172
+ null,
173
+ 2,
174
+ ),
175
+ );
176
+ });
177
+ parent
178
+ .command("plannergov-config-v2")
179
+ .description("Show V2 config")
180
+ .action(async () => {
181
+ const m = await L();
182
+ console.log(
183
+ JSON.stringify(
184
+ {
185
+ maxActive: m.getMaxActivePlannergovProfilesPerOwnerV2(),
186
+ maxPending: m.getMaxPendingPlannergovPromptsPerProfileV2(),
187
+ idleMs: m.getPlannergovProfileIdleMsV2(),
188
+ stuckMs: m.getPlannergovPromptStuckMsV2(),
189
+ },
190
+ null,
191
+ 2,
192
+ ),
193
+ );
194
+ });
195
+ parent
196
+ .command("plannergov-set-max-active-v2 <n>")
197
+ .description("Set max active")
198
+ .action(async (n) => {
199
+ (await L()).setMaxActivePlannergovProfilesPerOwnerV2(Number(n));
200
+ console.log("ok");
201
+ });
202
+ parent
203
+ .command("plannergov-set-max-pending-v2 <n>")
204
+ .description("Set max pending")
205
+ .action(async (n) => {
206
+ (await L()).setMaxPendingPlannergovPromptsPerProfileV2(Number(n));
207
+ console.log("ok");
208
+ });
209
+ parent
210
+ .command("plannergov-set-idle-ms-v2 <n>")
211
+ .description("Set idle threshold ms")
212
+ .action(async (n) => {
213
+ (await L()).setPlannergovProfileIdleMsV2(Number(n));
214
+ console.log("ok");
215
+ });
216
+ parent
217
+ .command("plannergov-set-stuck-ms-v2 <n>")
218
+ .description("Set stuck threshold ms")
219
+ .action(async (n) => {
220
+ (await L()).setPlannergovPromptStuckMsV2(Number(n));
221
+ console.log("ok");
222
+ });
223
+ parent
224
+ .command("plannergov-register-v2 <id> <owner>")
225
+ .description("Register V2 profile")
226
+ .option("--persona <v>", "persona")
227
+ .action(async (id, owner, o) => {
228
+ const m = await L();
229
+ console.log(
230
+ JSON.stringify(
231
+ m.registerPlannergovProfileV2({ id, owner, persona: o.persona }),
232
+ null,
233
+ 2,
234
+ ),
235
+ );
236
+ });
237
+ parent
238
+ .command("plannergov-activate-v2 <id>")
239
+ .description("Activate profile")
240
+ .action(async (id) => {
241
+ console.log(
242
+ JSON.stringify((await L()).activatePlannergovProfileV2(id), null, 2),
243
+ );
244
+ });
245
+ parent
246
+ .command("plannergov-pause-v2 <id>")
247
+ .description("Pause profile")
248
+ .action(async (id) => {
249
+ console.log(
250
+ JSON.stringify((await L()).pausePlannergovProfileV2(id), null, 2),
251
+ );
252
+ });
253
+ parent
254
+ .command("plannergov-archive-v2 <id>")
255
+ .description("Archive profile")
256
+ .action(async (id) => {
257
+ console.log(
258
+ JSON.stringify((await L()).archivePlannergovProfileV2(id), null, 2),
259
+ );
260
+ });
261
+ parent
262
+ .command("plannergov-touch-v2 <id>")
263
+ .description("Touch profile")
264
+ .action(async (id) => {
265
+ console.log(
266
+ JSON.stringify((await L()).touchPlannergovProfileV2(id), null, 2),
267
+ );
268
+ });
269
+ parent
270
+ .command("plannergov-get-v2 <id>")
271
+ .description("Get profile")
272
+ .action(async (id) => {
273
+ console.log(
274
+ JSON.stringify((await L()).getPlannergovProfileV2(id), null, 2),
275
+ );
276
+ });
277
+ parent
278
+ .command("plannergov-list-v2")
279
+ .description("List profiles")
280
+ .action(async () => {
281
+ console.log(
282
+ JSON.stringify((await L()).listPlannergovProfilesV2(), null, 2),
283
+ );
284
+ });
285
+ parent
286
+ .command("plannergov-create-prompt-v2 <id> <profileId>")
287
+ .description("Create prompt")
288
+ .option("--question <v>", "question")
289
+ .action(async (id, profileId, o) => {
290
+ const m = await L();
291
+ console.log(
292
+ JSON.stringify(
293
+ m.createPlannergovPromptV2({ id, profileId, question: o.question }),
294
+ null,
295
+ 2,
296
+ ),
297
+ );
298
+ });
299
+ parent
300
+ .command("plannergov-asking-prompt-v2 <id>")
301
+ .description("Mark prompt as asking")
302
+ .action(async (id) => {
303
+ console.log(
304
+ JSON.stringify((await L()).askingPlannergovPromptV2(id), null, 2),
305
+ );
306
+ });
307
+ parent
308
+ .command("plannergov-complete-prompt-v2 <id>")
309
+ .description("Complete prompt")
310
+ .action(async (id) => {
311
+ console.log(
312
+ JSON.stringify((await L()).completePromptPlannergovV2(id), null, 2),
313
+ );
314
+ });
315
+ parent
316
+ .command("plannergov-fail-prompt-v2 <id> [reason]")
317
+ .description("Fail prompt")
318
+ .action(async (id, reason) => {
319
+ console.log(
320
+ JSON.stringify((await L()).failPlannergovPromptV2(id, reason), null, 2),
321
+ );
322
+ });
323
+ parent
324
+ .command("plannergov-cancel-prompt-v2 <id> [reason]")
325
+ .description("Cancel prompt")
326
+ .action(async (id, reason) => {
327
+ console.log(
328
+ JSON.stringify(
329
+ (await L()).cancelPlannergovPromptV2(id, reason),
330
+ null,
331
+ 2,
332
+ ),
333
+ );
334
+ });
335
+ parent
336
+ .command("plannergov-get-prompt-v2 <id>")
337
+ .description("Get prompt")
338
+ .action(async (id) => {
339
+ console.log(
340
+ JSON.stringify((await L()).getPlannergovPromptV2(id), null, 2),
341
+ );
342
+ });
343
+ parent
344
+ .command("plannergov-list-prompts-v2")
345
+ .description("List prompts")
346
+ .action(async () => {
347
+ console.log(
348
+ JSON.stringify((await L()).listPlannergovPromptsV2(), null, 2),
349
+ );
350
+ });
351
+ parent
352
+ .command("plannergov-auto-pause-idle-v2")
353
+ .description("Auto-pause idle")
354
+ .action(async () => {
355
+ console.log(
356
+ JSON.stringify(
357
+ (await L()).autoPauseIdlePlannergovProfilesV2(),
358
+ null,
359
+ 2,
360
+ ),
361
+ );
362
+ });
363
+ parent
364
+ .command("plannergov-auto-fail-stuck-v2")
365
+ .description("Auto-fail stuck prompts")
366
+ .action(async () => {
367
+ console.log(
368
+ JSON.stringify((await L()).autoFailStuckPlannergovPromptsV2(), null, 2),
369
+ );
370
+ });
371
+ parent
372
+ .command("plannergov-gov-stats-v2")
373
+ .description("V2 gov stats")
374
+ .action(async () => {
375
+ console.log(
376
+ JSON.stringify((await L()).getInteractivePlannerGovStatsV2(), null, 2),
377
+ );
378
+ });
379
+ }
380
+
381
+ // === Iter28 V2 governance overlay: Pmodegov ===
382
+ export function registerPmodeV2Commands(program) {
383
+ const parent = program.commands.find((c) => c.name() === "planmode");
384
+ if (!parent) return;
385
+ const L = async () => await import("../lib/plan-mode.js");
386
+ parent
387
+ .command("pmodegov-enums-v2")
388
+ .description("Show V2 enums")
389
+ .action(async () => {
390
+ const m = await L();
391
+ console.log(
392
+ JSON.stringify(
393
+ {
394
+ profileMaturity: m.PMODEGOV_PROFILE_MATURITY_V2,
395
+ planLifecycle: m.PMODEGOV_PLAN_LIFECYCLE_V2,
396
+ },
397
+ null,
398
+ 2,
399
+ ),
400
+ );
401
+ });
402
+ parent
403
+ .command("pmodegov-config-v2")
404
+ .description("Show V2 config")
405
+ .action(async () => {
406
+ const m = await L();
407
+ console.log(
408
+ JSON.stringify(
409
+ {
410
+ maxActive: m.getMaxActivePmodeProfilesPerOwnerV2(),
411
+ maxPending: m.getMaxPendingPmodePlansPerProfileV2(),
412
+ idleMs: m.getPmodeProfileIdleMsV2(),
413
+ stuckMs: m.getPmodePlanStuckMsV2(),
414
+ },
415
+ null,
416
+ 2,
417
+ ),
418
+ );
419
+ });
420
+ parent
421
+ .command("pmodegov-set-max-active-v2 <n>")
422
+ .description("Set max active")
423
+ .action(async (n) => {
424
+ (await L()).setMaxActivePmodeProfilesPerOwnerV2(Number(n));
425
+ console.log("ok");
426
+ });
427
+ parent
428
+ .command("pmodegov-set-max-pending-v2 <n>")
429
+ .description("Set max pending")
430
+ .action(async (n) => {
431
+ (await L()).setMaxPendingPmodePlansPerProfileV2(Number(n));
432
+ console.log("ok");
433
+ });
434
+ parent
435
+ .command("pmodegov-set-idle-ms-v2 <n>")
436
+ .description("Set idle threshold ms")
437
+ .action(async (n) => {
438
+ (await L()).setPmodeProfileIdleMsV2(Number(n));
439
+ console.log("ok");
440
+ });
441
+ parent
442
+ .command("pmodegov-set-stuck-ms-v2 <n>")
443
+ .description("Set stuck threshold ms")
444
+ .action(async (n) => {
445
+ (await L()).setPmodePlanStuckMsV2(Number(n));
446
+ console.log("ok");
447
+ });
448
+ parent
449
+ .command("pmodegov-register-v2 <id> <owner>")
450
+ .description("Register V2 profile")
451
+ .option("--template <v>", "template")
452
+ .action(async (id, owner, o) => {
453
+ const m = await L();
454
+ console.log(
455
+ JSON.stringify(
456
+ m.registerPmodeProfileV2({ id, owner, template: o.template }),
457
+ null,
458
+ 2,
459
+ ),
460
+ );
461
+ });
462
+ parent
463
+ .command("pmodegov-activate-v2 <id>")
464
+ .description("Activate profile")
465
+ .action(async (id) => {
466
+ console.log(
467
+ JSON.stringify((await L()).activatePmodeProfileV2(id), null, 2),
468
+ );
469
+ });
470
+ parent
471
+ .command("pmodegov-paused-v2 <id>")
472
+ .description("Paused profile")
473
+ .action(async (id) => {
474
+ console.log(
475
+ JSON.stringify((await L()).pausedPmodeProfileV2(id), null, 2),
476
+ );
477
+ });
478
+ parent
479
+ .command("pmodegov-archive-v2 <id>")
480
+ .description("Archive profile")
481
+ .action(async (id) => {
482
+ console.log(
483
+ JSON.stringify((await L()).archivePmodeProfileV2(id), null, 2),
484
+ );
485
+ });
486
+ parent
487
+ .command("pmodegov-touch-v2 <id>")
488
+ .description("Touch profile")
489
+ .action(async (id) => {
490
+ console.log(JSON.stringify((await L()).touchPmodeProfileV2(id), null, 2));
491
+ });
492
+ parent
493
+ .command("pmodegov-get-v2 <id>")
494
+ .description("Get profile")
495
+ .action(async (id) => {
496
+ console.log(JSON.stringify((await L()).getPmodeProfileV2(id), null, 2));
497
+ });
498
+ parent
499
+ .command("pmodegov-list-v2")
500
+ .description("List profiles")
501
+ .action(async () => {
502
+ console.log(JSON.stringify((await L()).listPmodeProfilesV2(), null, 2));
503
+ });
504
+ parent
505
+ .command("pmodegov-create-plan-v2 <id> <profileId>")
506
+ .description("Create plan")
507
+ .option("--planId <v>", "planId")
508
+ .action(async (id, profileId, o) => {
509
+ const m = await L();
510
+ console.log(
511
+ JSON.stringify(
512
+ m.createPmodePlanV2({ id, profileId, planId: o.planId }),
513
+ null,
514
+ 2,
515
+ ),
516
+ );
517
+ });
518
+ parent
519
+ .command("pmodegov-planning-plan-v2 <id>")
520
+ .description("Mark plan as planning")
521
+ .action(async (id) => {
522
+ console.log(JSON.stringify((await L()).planningPmodePlanV2(id), null, 2));
523
+ });
524
+ parent
525
+ .command("pmodegov-complete-plan-v2 <id>")
526
+ .description("Complete plan")
527
+ .action(async (id) => {
528
+ console.log(JSON.stringify((await L()).completePlanPmodeV2(id), null, 2));
529
+ });
530
+ parent
531
+ .command("pmodegov-fail-plan-v2 <id> [reason]")
532
+ .description("Fail plan")
533
+ .action(async (id, reason) => {
534
+ console.log(
535
+ JSON.stringify((await L()).failPmodePlanV2(id, reason), null, 2),
536
+ );
537
+ });
538
+ parent
539
+ .command("pmodegov-cancel-plan-v2 <id> [reason]")
540
+ .description("Cancel plan")
541
+ .action(async (id, reason) => {
542
+ console.log(
543
+ JSON.stringify((await L()).cancelPmodePlanV2(id, reason), null, 2),
544
+ );
545
+ });
546
+ parent
547
+ .command("pmodegov-get-plan-v2 <id>")
548
+ .description("Get plan")
549
+ .action(async (id) => {
550
+ console.log(JSON.stringify((await L()).getPmodePlanV2(id), null, 2));
551
+ });
552
+ parent
553
+ .command("pmodegov-list-plans-v2")
554
+ .description("List plans")
555
+ .action(async () => {
556
+ console.log(JSON.stringify((await L()).listPmodePlansV2(), null, 2));
557
+ });
558
+ parent
559
+ .command("pmodegov-auto-paused-idle-v2")
560
+ .description("Auto-paused idle")
561
+ .action(async () => {
562
+ console.log(
563
+ JSON.stringify((await L()).autoPausedIdlePmodeProfilesV2(), null, 2),
564
+ );
565
+ });
566
+ parent
567
+ .command("pmodegov-auto-fail-stuck-v2")
568
+ .description("Auto-fail stuck plans")
569
+ .action(async () => {
570
+ console.log(
571
+ JSON.stringify((await L()).autoFailStuckPmodePlansV2(), null, 2),
572
+ );
573
+ });
574
+ parent
575
+ .command("pmodegov-gov-stats-v2")
576
+ .description("V2 gov stats")
577
+ .action(async () => {
578
+ console.log(JSON.stringify((await L()).getPmodegovStatsV2(), null, 2));
579
+ });
580
+ }