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
@@ -55,119 +55,603 @@ export function registerAgentCommand(program) {
55
55
  });
56
56
  }
57
57
 
58
-
59
58
  export function registerSubAgentV2Command(program) {
60
- const sa = program.command("subagent").description("Sub-agent registry V2 governance");
61
- sa.command("maturities-v2").action(async () => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.SUBAGENT_PROFILE_MATURITY_V2, null, 2)); });
62
- sa.command("task-lifecycle-v2").action(async () => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.SUBAGENT_TASK_LIFECYCLE_V2, null, 2)); });
63
- sa.command("stats-v2").action(async () => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.getSubAgentRegistryStatsV2(), null, 2)); });
64
- sa.command("config-v2").action(async () => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify({ maxActiveSubagentsPerOwner: m.getMaxActiveSubagentsPerOwnerV2(), maxPendingTasksPerSubagent: m.getMaxPendingTasksPerSubagentV2(), subagentIdleMs: m.getSubagentIdleMsV2(), subagentTaskStuckMs: m.getSubagentTaskStuckMsV2() }, null, 2)); });
65
- sa.command("register-profile-v2 <id> <owner> [role]").action(async (id, owner, role) => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.registerSubagentProfileV2({ id, owner, role }), null, 2)); });
66
- sa.command("activate-profile-v2 <id>").action(async (id) => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.activateSubagentProfileV2(id), null, 2)); });
67
- sa.command("pause-profile-v2 <id>").action(async (id) => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.pauseSubagentProfileV2(id), null, 2)); });
68
- sa.command("retire-profile-v2 <id>").action(async (id) => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.retireSubagentProfileV2(id), null, 2)); });
69
- sa.command("touch-profile-v2 <id>").action(async (id) => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.touchSubagentProfileV2(id), null, 2)); });
70
- sa.command("get-profile-v2 <id>").action(async (id) => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.getSubagentProfileV2(id), null, 2)); });
71
- sa.command("list-profiles-v2").action(async () => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.listSubagentProfilesV2(), null, 2)); });
72
- sa.command("create-task-v2 <id> <profileId> [desc]").action(async (id, profileId, desc) => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.createSubagentTaskV2({ id, profileId, description: desc }), null, 2)); });
73
- sa.command("start-task-v2 <id>").action(async (id) => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.startSubagentTaskV2(id), null, 2)); });
74
- sa.command("complete-task-v2 <id>").action(async (id) => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.completeSubagentTaskV2(id), null, 2)); });
75
- sa.command("fail-task-v2 <id> [reason]").action(async (id, reason) => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.failSubagentTaskV2(id, reason), null, 2)); });
76
- sa.command("cancel-task-v2 <id> [reason]").action(async (id, reason) => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.cancelSubagentTaskV2(id, reason), null, 2)); });
77
- sa.command("get-task-v2 <id>").action(async (id) => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.getSubagentTaskV2(id), null, 2)); });
78
- sa.command("list-tasks-v2").action(async () => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.listSubagentTasksV2(), null, 2)); });
79
- sa.command("auto-pause-idle-v2").action(async () => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.autoPauseIdleSubagentsV2(), null, 2)); });
80
- sa.command("auto-fail-stuck-v2").action(async () => { const m = await import("../lib/sub-agent-registry.js"); console.log(JSON.stringify(m.autoFailStuckSubagentTasksV2(), null, 2)); });
81
- sa.command("set-max-active-v2 <n>").action(async (n) => { const m = await import("../lib/sub-agent-registry.js"); m.setMaxActiveSubagentsPerOwnerV2(parseInt(n, 10)); console.log(JSON.stringify({ maxActiveSubagentsPerOwner: m.getMaxActiveSubagentsPerOwnerV2() }, null, 2)); });
82
- sa.command("set-max-pending-v2 <n>").action(async (n) => { const m = await import("../lib/sub-agent-registry.js"); m.setMaxPendingTasksPerSubagentV2(parseInt(n, 10)); console.log(JSON.stringify({ maxPendingTasksPerSubagent: m.getMaxPendingTasksPerSubagentV2() }, null, 2)); });
83
- sa.command("set-idle-ms-v2 <n>").action(async (n) => { const m = await import("../lib/sub-agent-registry.js"); m.setSubagentIdleMsV2(parseInt(n, 10)); console.log(JSON.stringify({ subagentIdleMs: m.getSubagentIdleMsV2() }, null, 2)); });
84
- sa.command("set-stuck-ms-v2 <n>").action(async (n) => { const m = await import("../lib/sub-agent-registry.js"); m.setSubagentTaskStuckMsV2(parseInt(n, 10)); console.log(JSON.stringify({ subagentTaskStuckMs: m.getSubagentTaskStuckMsV2() }, null, 2)); });
85
- sa.command("reset-state-v2").action(async () => { const m = await import("../lib/sub-agent-registry.js"); m._resetStateSubAgentRegistryV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
59
+ const sa = program
60
+ .command("subagent")
61
+ .description("Sub-agent registry V2 governance");
62
+ sa.command("maturities-v2").action(async () => {
63
+ const m = await import("../lib/sub-agent-registry.js");
64
+ console.log(JSON.stringify(m.SUBAGENT_PROFILE_MATURITY_V2, null, 2));
65
+ });
66
+ sa.command("task-lifecycle-v2").action(async () => {
67
+ const m = await import("../lib/sub-agent-registry.js");
68
+ console.log(JSON.stringify(m.SUBAGENT_TASK_LIFECYCLE_V2, null, 2));
69
+ });
70
+ sa.command("stats-v2").action(async () => {
71
+ const m = await import("../lib/sub-agent-registry.js");
72
+ console.log(JSON.stringify(m.getSubAgentRegistryStatsV2(), null, 2));
73
+ });
74
+ sa.command("config-v2").action(async () => {
75
+ const m = await import("../lib/sub-agent-registry.js");
76
+ console.log(
77
+ JSON.stringify(
78
+ {
79
+ maxActiveSubagentsPerOwner: m.getMaxActiveSubagentsPerOwnerV2(),
80
+ maxPendingTasksPerSubagent: m.getMaxPendingTasksPerSubagentV2(),
81
+ subagentIdleMs: m.getSubagentIdleMsV2(),
82
+ subagentTaskStuckMs: m.getSubagentTaskStuckMsV2(),
83
+ },
84
+ null,
85
+ 2,
86
+ ),
87
+ );
88
+ });
89
+ sa.command("register-profile-v2 <id> <owner> [role]").action(
90
+ async (id, owner, role) => {
91
+ const m = await import("../lib/sub-agent-registry.js");
92
+ console.log(
93
+ JSON.stringify(
94
+ m.registerSubagentProfileV2({ id, owner, role }),
95
+ null,
96
+ 2,
97
+ ),
98
+ );
99
+ },
100
+ );
101
+ sa.command("activate-profile-v2 <id>").action(async (id) => {
102
+ const m = await import("../lib/sub-agent-registry.js");
103
+ console.log(JSON.stringify(m.activateSubagentProfileV2(id), null, 2));
104
+ });
105
+ sa.command("pause-profile-v2 <id>").action(async (id) => {
106
+ const m = await import("../lib/sub-agent-registry.js");
107
+ console.log(JSON.stringify(m.pauseSubagentProfileV2(id), null, 2));
108
+ });
109
+ sa.command("retire-profile-v2 <id>").action(async (id) => {
110
+ const m = await import("../lib/sub-agent-registry.js");
111
+ console.log(JSON.stringify(m.retireSubagentProfileV2(id), null, 2));
112
+ });
113
+ sa.command("touch-profile-v2 <id>").action(async (id) => {
114
+ const m = await import("../lib/sub-agent-registry.js");
115
+ console.log(JSON.stringify(m.touchSubagentProfileV2(id), null, 2));
116
+ });
117
+ sa.command("get-profile-v2 <id>").action(async (id) => {
118
+ const m = await import("../lib/sub-agent-registry.js");
119
+ console.log(JSON.stringify(m.getSubagentProfileV2(id), null, 2));
120
+ });
121
+ sa.command("list-profiles-v2").action(async () => {
122
+ const m = await import("../lib/sub-agent-registry.js");
123
+ console.log(JSON.stringify(m.listSubagentProfilesV2(), null, 2));
124
+ });
125
+ sa.command("create-task-v2 <id> <profileId> [desc]").action(
126
+ async (id, profileId, desc) => {
127
+ const m = await import("../lib/sub-agent-registry.js");
128
+ console.log(
129
+ JSON.stringify(
130
+ m.createSubagentTaskV2({ id, profileId, description: desc }),
131
+ null,
132
+ 2,
133
+ ),
134
+ );
135
+ },
136
+ );
137
+ sa.command("start-task-v2 <id>").action(async (id) => {
138
+ const m = await import("../lib/sub-agent-registry.js");
139
+ console.log(JSON.stringify(m.startSubagentTaskV2(id), null, 2));
140
+ });
141
+ sa.command("complete-task-v2 <id>").action(async (id) => {
142
+ const m = await import("../lib/sub-agent-registry.js");
143
+ console.log(JSON.stringify(m.completeSubagentTaskV2(id), null, 2));
144
+ });
145
+ sa.command("fail-task-v2 <id> [reason]").action(async (id, reason) => {
146
+ const m = await import("../lib/sub-agent-registry.js");
147
+ console.log(JSON.stringify(m.failSubagentTaskV2(id, reason), null, 2));
148
+ });
149
+ sa.command("cancel-task-v2 <id> [reason]").action(async (id, reason) => {
150
+ const m = await import("../lib/sub-agent-registry.js");
151
+ console.log(JSON.stringify(m.cancelSubagentTaskV2(id, reason), null, 2));
152
+ });
153
+ sa.command("get-task-v2 <id>").action(async (id) => {
154
+ const m = await import("../lib/sub-agent-registry.js");
155
+ console.log(JSON.stringify(m.getSubagentTaskV2(id), null, 2));
156
+ });
157
+ sa.command("list-tasks-v2").action(async () => {
158
+ const m = await import("../lib/sub-agent-registry.js");
159
+ console.log(JSON.stringify(m.listSubagentTasksV2(), null, 2));
160
+ });
161
+ sa.command("auto-pause-idle-v2").action(async () => {
162
+ const m = await import("../lib/sub-agent-registry.js");
163
+ console.log(JSON.stringify(m.autoPauseIdleSubagentsV2(), null, 2));
164
+ });
165
+ sa.command("auto-fail-stuck-v2").action(async () => {
166
+ const m = await import("../lib/sub-agent-registry.js");
167
+ console.log(JSON.stringify(m.autoFailStuckSubagentTasksV2(), null, 2));
168
+ });
169
+ sa.command("set-max-active-v2 <n>").action(async (n) => {
170
+ const m = await import("../lib/sub-agent-registry.js");
171
+ m.setMaxActiveSubagentsPerOwnerV2(parseInt(n, 10));
172
+ console.log(
173
+ JSON.stringify(
174
+ { maxActiveSubagentsPerOwner: m.getMaxActiveSubagentsPerOwnerV2() },
175
+ null,
176
+ 2,
177
+ ),
178
+ );
179
+ });
180
+ sa.command("set-max-pending-v2 <n>").action(async (n) => {
181
+ const m = await import("../lib/sub-agent-registry.js");
182
+ m.setMaxPendingTasksPerSubagentV2(parseInt(n, 10));
183
+ console.log(
184
+ JSON.stringify(
185
+ { maxPendingTasksPerSubagent: m.getMaxPendingTasksPerSubagentV2() },
186
+ null,
187
+ 2,
188
+ ),
189
+ );
190
+ });
191
+ sa.command("set-idle-ms-v2 <n>").action(async (n) => {
192
+ const m = await import("../lib/sub-agent-registry.js");
193
+ m.setSubagentIdleMsV2(parseInt(n, 10));
194
+ console.log(
195
+ JSON.stringify({ subagentIdleMs: m.getSubagentIdleMsV2() }, null, 2),
196
+ );
197
+ });
198
+ sa.command("set-stuck-ms-v2 <n>").action(async (n) => {
199
+ const m = await import("../lib/sub-agent-registry.js");
200
+ m.setSubagentTaskStuckMsV2(parseInt(n, 10));
201
+ console.log(
202
+ JSON.stringify(
203
+ { subagentTaskStuckMs: m.getSubagentTaskStuckMsV2() },
204
+ null,
205
+ 2,
206
+ ),
207
+ );
208
+ });
209
+ sa.command("reset-state-v2").action(async () => {
210
+ const m = await import("../lib/sub-agent-registry.js");
211
+ m._resetStateSubAgentRegistryV2();
212
+ console.log(JSON.stringify({ ok: true }, null, 2));
213
+ });
86
214
  }
87
215
 
88
216
  export function registerExecBackendV2Command(program) {
89
- const eb = program.command("execbe").description("Execution backend V2 governance");
90
- eb.command("maturities-v2").action(async () => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.EXECBE_BACKEND_MATURITY_V2, null, 2)); });
91
- eb.command("job-lifecycle-v2").action(async () => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.EXECBE_JOB_LIFECYCLE_V2, null, 2)); });
92
- eb.command("stats-v2").action(async () => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.getExecutionBackendStatsV2(), null, 2)); });
93
- eb.command("config-v2").action(async () => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify({ maxActiveBackendsPerOwner: m.getMaxActiveBackendsPerOwnerV2(), maxPendingJobsPerBackend: m.getMaxPendingJobsPerBackendV2(), backendIdleMs: m.getBackendIdleMsV2(), execJobStuckMs: m.getExecJobStuckMsV2() }, null, 2)); });
94
- eb.command("register-backend-v2 <id> <owner> [kind]").action(async (id, owner, kind) => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.registerBackendV2({ id, owner, kind }), null, 2)); });
95
- eb.command("activate-backend-v2 <id>").action(async (id) => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.activateBackendV2(id), null, 2)); });
96
- eb.command("degrade-backend-v2 <id>").action(async (id) => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.degradeBackendV2(id), null, 2)); });
97
- eb.command("retire-backend-v2 <id>").action(async (id) => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.retireBackendV2(id), null, 2)); });
98
- eb.command("touch-backend-v2 <id>").action(async (id) => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.touchBackendV2(id), null, 2)); });
99
- eb.command("get-backend-v2 <id>").action(async (id) => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.getBackendV2(id), null, 2)); });
100
- eb.command("list-backends-v2").action(async () => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.listBackendsV2(), null, 2)); });
101
- eb.command("create-job-v2 <id> <backendId> [cmd]").action(async (id, backendId, cmd) => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.createExecJobV2({ id, backendId, command: cmd }), null, 2)); });
102
- eb.command("start-job-v2 <id>").action(async (id) => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.startExecJobV2(id), null, 2)); });
103
- eb.command("succeed-job-v2 <id>").action(async (id) => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.succeedExecJobV2(id), null, 2)); });
104
- eb.command("fail-job-v2 <id> [reason]").action(async (id, reason) => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.failExecJobV2(id, reason), null, 2)); });
105
- eb.command("cancel-job-v2 <id> [reason]").action(async (id, reason) => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.cancelExecJobV2(id, reason), null, 2)); });
106
- eb.command("get-job-v2 <id>").action(async (id) => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.getExecJobV2(id), null, 2)); });
107
- eb.command("list-jobs-v2").action(async () => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.listExecJobsV2(), null, 2)); });
108
- eb.command("auto-degrade-idle-v2").action(async () => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.autoDegradeIdleBackendsV2(), null, 2)); });
109
- eb.command("auto-fail-stuck-v2").action(async () => { const m = await import("../lib/execution-backend.js"); console.log(JSON.stringify(m.autoFailStuckExecJobsV2(), null, 2)); });
110
- eb.command("set-max-active-v2 <n>").action(async (n) => { const m = await import("../lib/execution-backend.js"); m.setMaxActiveBackendsPerOwnerV2(parseInt(n, 10)); console.log(JSON.stringify({ maxActiveBackendsPerOwner: m.getMaxActiveBackendsPerOwnerV2() }, null, 2)); });
111
- eb.command("set-max-pending-v2 <n>").action(async (n) => { const m = await import("../lib/execution-backend.js"); m.setMaxPendingJobsPerBackendV2(parseInt(n, 10)); console.log(JSON.stringify({ maxPendingJobsPerBackend: m.getMaxPendingJobsPerBackendV2() }, null, 2)); });
112
- eb.command("set-idle-ms-v2 <n>").action(async (n) => { const m = await import("../lib/execution-backend.js"); m.setBackendIdleMsV2(parseInt(n, 10)); console.log(JSON.stringify({ backendIdleMs: m.getBackendIdleMsV2() }, null, 2)); });
113
- eb.command("set-stuck-ms-v2 <n>").action(async (n) => { const m = await import("../lib/execution-backend.js"); m.setExecJobStuckMsV2(parseInt(n, 10)); console.log(JSON.stringify({ execJobStuckMs: m.getExecJobStuckMsV2() }, null, 2)); });
114
- eb.command("reset-state-v2").action(async () => { const m = await import("../lib/execution-backend.js"); m._resetStateExecutionBackendV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
217
+ const eb = program
218
+ .command("execbe")
219
+ .description("Execution backend V2 governance");
220
+ eb.command("maturities-v2").action(async () => {
221
+ const m = await import("../lib/execution-backend.js");
222
+ console.log(JSON.stringify(m.EXECBE_BACKEND_MATURITY_V2, null, 2));
223
+ });
224
+ eb.command("job-lifecycle-v2").action(async () => {
225
+ const m = await import("../lib/execution-backend.js");
226
+ console.log(JSON.stringify(m.EXECBE_JOB_LIFECYCLE_V2, null, 2));
227
+ });
228
+ eb.command("stats-v2").action(async () => {
229
+ const m = await import("../lib/execution-backend.js");
230
+ console.log(JSON.stringify(m.getExecutionBackendStatsV2(), null, 2));
231
+ });
232
+ eb.command("config-v2").action(async () => {
233
+ const m = await import("../lib/execution-backend.js");
234
+ console.log(
235
+ JSON.stringify(
236
+ {
237
+ maxActiveBackendsPerOwner: m.getMaxActiveBackendsPerOwnerV2(),
238
+ maxPendingJobsPerBackend: m.getMaxPendingJobsPerBackendV2(),
239
+ backendIdleMs: m.getBackendIdleMsV2(),
240
+ execJobStuckMs: m.getExecJobStuckMsV2(),
241
+ },
242
+ null,
243
+ 2,
244
+ ),
245
+ );
246
+ });
247
+ eb.command("register-backend-v2 <id> <owner> [kind]").action(
248
+ async (id, owner, kind) => {
249
+ const m = await import("../lib/execution-backend.js");
250
+ console.log(
251
+ JSON.stringify(m.registerBackendV2({ id, owner, kind }), null, 2),
252
+ );
253
+ },
254
+ );
255
+ eb.command("activate-backend-v2 <id>").action(async (id) => {
256
+ const m = await import("../lib/execution-backend.js");
257
+ console.log(JSON.stringify(m.activateBackendV2(id), null, 2));
258
+ });
259
+ eb.command("degrade-backend-v2 <id>").action(async (id) => {
260
+ const m = await import("../lib/execution-backend.js");
261
+ console.log(JSON.stringify(m.degradeBackendV2(id), null, 2));
262
+ });
263
+ eb.command("retire-backend-v2 <id>").action(async (id) => {
264
+ const m = await import("../lib/execution-backend.js");
265
+ console.log(JSON.stringify(m.retireBackendV2(id), null, 2));
266
+ });
267
+ eb.command("touch-backend-v2 <id>").action(async (id) => {
268
+ const m = await import("../lib/execution-backend.js");
269
+ console.log(JSON.stringify(m.touchBackendV2(id), null, 2));
270
+ });
271
+ eb.command("get-backend-v2 <id>").action(async (id) => {
272
+ const m = await import("../lib/execution-backend.js");
273
+ console.log(JSON.stringify(m.getBackendV2(id), null, 2));
274
+ });
275
+ eb.command("list-backends-v2").action(async () => {
276
+ const m = await import("../lib/execution-backend.js");
277
+ console.log(JSON.stringify(m.listBackendsV2(), null, 2));
278
+ });
279
+ eb.command("create-job-v2 <id> <backendId> [cmd]").action(
280
+ async (id, backendId, cmd) => {
281
+ const m = await import("../lib/execution-backend.js");
282
+ console.log(
283
+ JSON.stringify(
284
+ m.createExecJobV2({ id, backendId, command: cmd }),
285
+ null,
286
+ 2,
287
+ ),
288
+ );
289
+ },
290
+ );
291
+ eb.command("start-job-v2 <id>").action(async (id) => {
292
+ const m = await import("../lib/execution-backend.js");
293
+ console.log(JSON.stringify(m.startExecJobV2(id), null, 2));
294
+ });
295
+ eb.command("succeed-job-v2 <id>").action(async (id) => {
296
+ const m = await import("../lib/execution-backend.js");
297
+ console.log(JSON.stringify(m.succeedExecJobV2(id), null, 2));
298
+ });
299
+ eb.command("fail-job-v2 <id> [reason]").action(async (id, reason) => {
300
+ const m = await import("../lib/execution-backend.js");
301
+ console.log(JSON.stringify(m.failExecJobV2(id, reason), null, 2));
302
+ });
303
+ eb.command("cancel-job-v2 <id> [reason]").action(async (id, reason) => {
304
+ const m = await import("../lib/execution-backend.js");
305
+ console.log(JSON.stringify(m.cancelExecJobV2(id, reason), null, 2));
306
+ });
307
+ eb.command("get-job-v2 <id>").action(async (id) => {
308
+ const m = await import("../lib/execution-backend.js");
309
+ console.log(JSON.stringify(m.getExecJobV2(id), null, 2));
310
+ });
311
+ eb.command("list-jobs-v2").action(async () => {
312
+ const m = await import("../lib/execution-backend.js");
313
+ console.log(JSON.stringify(m.listExecJobsV2(), null, 2));
314
+ });
315
+ eb.command("auto-degrade-idle-v2").action(async () => {
316
+ const m = await import("../lib/execution-backend.js");
317
+ console.log(JSON.stringify(m.autoDegradeIdleBackendsV2(), null, 2));
318
+ });
319
+ eb.command("auto-fail-stuck-v2").action(async () => {
320
+ const m = await import("../lib/execution-backend.js");
321
+ console.log(JSON.stringify(m.autoFailStuckExecJobsV2(), null, 2));
322
+ });
323
+ eb.command("set-max-active-v2 <n>").action(async (n) => {
324
+ const m = await import("../lib/execution-backend.js");
325
+ m.setMaxActiveBackendsPerOwnerV2(parseInt(n, 10));
326
+ console.log(
327
+ JSON.stringify(
328
+ { maxActiveBackendsPerOwner: m.getMaxActiveBackendsPerOwnerV2() },
329
+ null,
330
+ 2,
331
+ ),
332
+ );
333
+ });
334
+ eb.command("set-max-pending-v2 <n>").action(async (n) => {
335
+ const m = await import("../lib/execution-backend.js");
336
+ m.setMaxPendingJobsPerBackendV2(parseInt(n, 10));
337
+ console.log(
338
+ JSON.stringify(
339
+ { maxPendingJobsPerBackend: m.getMaxPendingJobsPerBackendV2() },
340
+ null,
341
+ 2,
342
+ ),
343
+ );
344
+ });
345
+ eb.command("set-idle-ms-v2 <n>").action(async (n) => {
346
+ const m = await import("../lib/execution-backend.js");
347
+ m.setBackendIdleMsV2(parseInt(n, 10));
348
+ console.log(
349
+ JSON.stringify({ backendIdleMs: m.getBackendIdleMsV2() }, null, 2),
350
+ );
351
+ });
352
+ eb.command("set-stuck-ms-v2 <n>").action(async (n) => {
353
+ const m = await import("../lib/execution-backend.js");
354
+ m.setExecJobStuckMsV2(parseInt(n, 10));
355
+ console.log(
356
+ JSON.stringify({ execJobStuckMs: m.getExecJobStuckMsV2() }, null, 2),
357
+ );
358
+ });
359
+ eb.command("reset-state-v2").action(async () => {
360
+ const m = await import("../lib/execution-backend.js");
361
+ m._resetStateExecutionBackendV2();
362
+ console.log(JSON.stringify({ ok: true }, null, 2));
363
+ });
115
364
  }
116
365
 
117
366
  export function registerTodoV2Command(program) {
118
367
  const td = program.command("todo").description("Todo manager V2 governance");
119
- td.command("maturities-v2").action(async () => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.TODO_LIST_MATURITY_V2, null, 2)); });
120
- td.command("item-lifecycle-v2").action(async () => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.TODO_ITEM_LIFECYCLE_V2, null, 2)); });
121
- td.command("stats-v2").action(async () => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.getTodoManagerStatsV2(), null, 2)); });
122
- td.command("config-v2").action(async () => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify({ maxActiveTodoListsPerOwner: m.getMaxActiveTodoListsPerOwnerV2(), maxPendingItemsPerTodoList: m.getMaxPendingItemsPerTodoListV2(), todoListIdleMs: m.getTodoListIdleMsV2(), todoItemStuckMs: m.getTodoItemStuckMsV2() }, null, 2)); });
123
- td.command("register-list-v2 <id> <owner> [title]").action(async (id, owner, title) => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.registerTodoListV2({ id, owner, title }), null, 2)); });
124
- td.command("activate-list-v2 <id>").action(async (id) => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.activateTodoListV2(id), null, 2)); });
125
- td.command("pause-list-v2 <id>").action(async (id) => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.pauseTodoListV2(id), null, 2)); });
126
- td.command("archive-list-v2 <id>").action(async (id) => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.archiveTodoListV2(id), null, 2)); });
127
- td.command("touch-list-v2 <id>").action(async (id) => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.touchTodoListV2(id), null, 2)); });
128
- td.command("get-list-v2 <id>").action(async (id) => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.getTodoListV2(id), null, 2)); });
129
- td.command("list-lists-v2").action(async () => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.listTodoListsV2(), null, 2)); });
130
- td.command("create-item-v2 <id> <listId> [desc]").action(async (id, listId, desc) => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.createTodoItemV2({ id, listId, description: desc }), null, 2)); });
131
- td.command("start-item-v2 <id>").action(async (id) => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.startTodoItemV2(id), null, 2)); });
132
- td.command("complete-item-v2 <id>").action(async (id) => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.completeTodoItemV2(id), null, 2)); });
133
- td.command("fail-item-v2 <id> [reason]").action(async (id, reason) => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.failTodoItemV2(id, reason), null, 2)); });
134
- td.command("cancel-item-v2 <id> [reason]").action(async (id, reason) => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.cancelTodoItemV2(id, reason), null, 2)); });
135
- td.command("get-item-v2 <id>").action(async (id) => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.getTodoItemV2(id), null, 2)); });
136
- td.command("list-items-v2").action(async () => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.listTodoItemsV2(), null, 2)); });
137
- td.command("auto-pause-idle-v2").action(async () => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.autoPauseIdleTodoListsV2(), null, 2)); });
138
- td.command("auto-fail-stuck-v2").action(async () => { const m = await import("../lib/todo-manager.js"); console.log(JSON.stringify(m.autoFailStuckTodoItemsV2(), null, 2)); });
139
- td.command("set-max-active-v2 <n>").action(async (n) => { const m = await import("../lib/todo-manager.js"); m.setMaxActiveTodoListsPerOwnerV2(parseInt(n, 10)); console.log(JSON.stringify({ maxActiveTodoListsPerOwner: m.getMaxActiveTodoListsPerOwnerV2() }, null, 2)); });
140
- td.command("set-max-pending-v2 <n>").action(async (n) => { const m = await import("../lib/todo-manager.js"); m.setMaxPendingItemsPerTodoListV2(parseInt(n, 10)); console.log(JSON.stringify({ maxPendingItemsPerTodoList: m.getMaxPendingItemsPerTodoListV2() }, null, 2)); });
141
- td.command("set-idle-ms-v2 <n>").action(async (n) => { const m = await import("../lib/todo-manager.js"); m.setTodoListIdleMsV2(parseInt(n, 10)); console.log(JSON.stringify({ todoListIdleMs: m.getTodoListIdleMsV2() }, null, 2)); });
142
- td.command("set-stuck-ms-v2 <n>").action(async (n) => { const m = await import("../lib/todo-manager.js"); m.setTodoItemStuckMsV2(parseInt(n, 10)); console.log(JSON.stringify({ todoItemStuckMs: m.getTodoItemStuckMsV2() }, null, 2)); });
143
- td.command("reset-state-v2").action(async () => { const m = await import("../lib/todo-manager.js"); m._resetStateTodoManagerV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
368
+ td.command("maturities-v2").action(async () => {
369
+ const m = await import("../lib/todo-manager.js");
370
+ console.log(JSON.stringify(m.TODO_LIST_MATURITY_V2, null, 2));
371
+ });
372
+ td.command("item-lifecycle-v2").action(async () => {
373
+ const m = await import("../lib/todo-manager.js");
374
+ console.log(JSON.stringify(m.TODO_ITEM_LIFECYCLE_V2, null, 2));
375
+ });
376
+ td.command("stats-v2").action(async () => {
377
+ const m = await import("../lib/todo-manager.js");
378
+ console.log(JSON.stringify(m.getTodoManagerStatsV2(), null, 2));
379
+ });
380
+ td.command("config-v2").action(async () => {
381
+ const m = await import("../lib/todo-manager.js");
382
+ console.log(
383
+ JSON.stringify(
384
+ {
385
+ maxActiveTodoListsPerOwner: m.getMaxActiveTodoListsPerOwnerV2(),
386
+ maxPendingItemsPerTodoList: m.getMaxPendingItemsPerTodoListV2(),
387
+ todoListIdleMs: m.getTodoListIdleMsV2(),
388
+ todoItemStuckMs: m.getTodoItemStuckMsV2(),
389
+ },
390
+ null,
391
+ 2,
392
+ ),
393
+ );
394
+ });
395
+ td.command("register-list-v2 <id> <owner> [title]").action(
396
+ async (id, owner, title) => {
397
+ const m = await import("../lib/todo-manager.js");
398
+ console.log(
399
+ JSON.stringify(m.registerTodoListV2({ id, owner, title }), null, 2),
400
+ );
401
+ },
402
+ );
403
+ td.command("activate-list-v2 <id>").action(async (id) => {
404
+ const m = await import("../lib/todo-manager.js");
405
+ console.log(JSON.stringify(m.activateTodoListV2(id), null, 2));
406
+ });
407
+ td.command("pause-list-v2 <id>").action(async (id) => {
408
+ const m = await import("../lib/todo-manager.js");
409
+ console.log(JSON.stringify(m.pauseTodoListV2(id), null, 2));
410
+ });
411
+ td.command("archive-list-v2 <id>").action(async (id) => {
412
+ const m = await import("../lib/todo-manager.js");
413
+ console.log(JSON.stringify(m.archiveTodoListV2(id), null, 2));
414
+ });
415
+ td.command("touch-list-v2 <id>").action(async (id) => {
416
+ const m = await import("../lib/todo-manager.js");
417
+ console.log(JSON.stringify(m.touchTodoListV2(id), null, 2));
418
+ });
419
+ td.command("get-list-v2 <id>").action(async (id) => {
420
+ const m = await import("../lib/todo-manager.js");
421
+ console.log(JSON.stringify(m.getTodoListV2(id), null, 2));
422
+ });
423
+ td.command("list-lists-v2").action(async () => {
424
+ const m = await import("../lib/todo-manager.js");
425
+ console.log(JSON.stringify(m.listTodoListsV2(), null, 2));
426
+ });
427
+ td.command("create-item-v2 <id> <listId> [desc]").action(
428
+ async (id, listId, desc) => {
429
+ const m = await import("../lib/todo-manager.js");
430
+ console.log(
431
+ JSON.stringify(
432
+ m.createTodoItemV2({ id, listId, description: desc }),
433
+ null,
434
+ 2,
435
+ ),
436
+ );
437
+ },
438
+ );
439
+ td.command("start-item-v2 <id>").action(async (id) => {
440
+ const m = await import("../lib/todo-manager.js");
441
+ console.log(JSON.stringify(m.startTodoItemV2(id), null, 2));
442
+ });
443
+ td.command("complete-item-v2 <id>").action(async (id) => {
444
+ const m = await import("../lib/todo-manager.js");
445
+ console.log(JSON.stringify(m.completeTodoItemV2(id), null, 2));
446
+ });
447
+ td.command("fail-item-v2 <id> [reason]").action(async (id, reason) => {
448
+ const m = await import("../lib/todo-manager.js");
449
+ console.log(JSON.stringify(m.failTodoItemV2(id, reason), null, 2));
450
+ });
451
+ td.command("cancel-item-v2 <id> [reason]").action(async (id, reason) => {
452
+ const m = await import("../lib/todo-manager.js");
453
+ console.log(JSON.stringify(m.cancelTodoItemV2(id, reason), null, 2));
454
+ });
455
+ td.command("get-item-v2 <id>").action(async (id) => {
456
+ const m = await import("../lib/todo-manager.js");
457
+ console.log(JSON.stringify(m.getTodoItemV2(id), null, 2));
458
+ });
459
+ td.command("list-items-v2").action(async () => {
460
+ const m = await import("../lib/todo-manager.js");
461
+ console.log(JSON.stringify(m.listTodoItemsV2(), null, 2));
462
+ });
463
+ td.command("auto-pause-idle-v2").action(async () => {
464
+ const m = await import("../lib/todo-manager.js");
465
+ console.log(JSON.stringify(m.autoPauseIdleTodoListsV2(), null, 2));
466
+ });
467
+ td.command("auto-fail-stuck-v2").action(async () => {
468
+ const m = await import("../lib/todo-manager.js");
469
+ console.log(JSON.stringify(m.autoFailStuckTodoItemsV2(), null, 2));
470
+ });
471
+ td.command("set-max-active-v2 <n>").action(async (n) => {
472
+ const m = await import("../lib/todo-manager.js");
473
+ m.setMaxActiveTodoListsPerOwnerV2(parseInt(n, 10));
474
+ console.log(
475
+ JSON.stringify(
476
+ { maxActiveTodoListsPerOwner: m.getMaxActiveTodoListsPerOwnerV2() },
477
+ null,
478
+ 2,
479
+ ),
480
+ );
481
+ });
482
+ td.command("set-max-pending-v2 <n>").action(async (n) => {
483
+ const m = await import("../lib/todo-manager.js");
484
+ m.setMaxPendingItemsPerTodoListV2(parseInt(n, 10));
485
+ console.log(
486
+ JSON.stringify(
487
+ { maxPendingItemsPerTodoList: m.getMaxPendingItemsPerTodoListV2() },
488
+ null,
489
+ 2,
490
+ ),
491
+ );
492
+ });
493
+ td.command("set-idle-ms-v2 <n>").action(async (n) => {
494
+ const m = await import("../lib/todo-manager.js");
495
+ m.setTodoListIdleMsV2(parseInt(n, 10));
496
+ console.log(
497
+ JSON.stringify({ todoListIdleMs: m.getTodoListIdleMsV2() }, null, 2),
498
+ );
499
+ });
500
+ td.command("set-stuck-ms-v2 <n>").action(async (n) => {
501
+ const m = await import("../lib/todo-manager.js");
502
+ m.setTodoItemStuckMsV2(parseInt(n, 10));
503
+ console.log(
504
+ JSON.stringify({ todoItemStuckMs: m.getTodoItemStuckMsV2() }, null, 2),
505
+ );
506
+ });
507
+ td.command("reset-state-v2").action(async () => {
508
+ const m = await import("../lib/todo-manager.js");
509
+ m._resetStateTodoManagerV2();
510
+ console.log(JSON.stringify({ ok: true }, null, 2));
511
+ });
144
512
  }
145
513
 
146
514
  export function registerAutoAgentV2Command(program) {
147
- const aa = program.command("autoagent").description("Autonomous agent V2 governance");
515
+ const aa = program
516
+ .command("autoagent")
517
+ .description("Autonomous agent V2 governance");
148
518
  const L = async () => await import("../lib/autonomous-agent.js");
149
- aa.command("enums-v2").action(async () => { const m = await L(); console.log(JSON.stringify({ agentMaturity: m.AUTOAGENT_MATURITY_V2, runLifecycle: m.AUTOAGENT_RUN_LIFECYCLE_V2 }, null, 2)); });
150
- aa.command("config-v2").action(async () => { const m = await L(); console.log(JSON.stringify({ maxActiveAutoAgentsPerOwner: m.getMaxActiveAutoAgentsPerOwnerV2(), maxPendingAutoAgentRunsPerAgent: m.getMaxPendingAutoAgentRunsPerAgentV2(), autoAgentIdleMs: m.getAutoAgentIdleMsV2(), autoAgentRunStuckMs: m.getAutoAgentRunStuckMsV2() }, null, 2)); });
151
- aa.command("set-max-active-v2 <n>").action(async (n) => { const m = await L(); m.setMaxActiveAutoAgentsPerOwnerV2(Number(n)); console.log("ok"); });
152
- aa.command("set-max-pending-v2 <n>").action(async (n) => { const m = await L(); m.setMaxPendingAutoAgentRunsPerAgentV2(Number(n)); console.log("ok"); });
153
- aa.command("set-idle-ms-v2 <n>").action(async (n) => { const m = await L(); m.setAutoAgentIdleMsV2(Number(n)); console.log("ok"); });
154
- aa.command("set-stuck-ms-v2 <n>").action(async (n) => { const m = await L(); m.setAutoAgentRunStuckMsV2(Number(n)); console.log("ok"); });
155
- aa.command("register-agent-v2 <id> <owner>").option("--goal <g>", "Goal").action(async (id, owner, o) => { const m = await L(); console.log(JSON.stringify(m.registerAutoAgentV2({ id, owner, goal: o.goal }), null, 2)); });
156
- aa.command("activate-agent-v2 <id>").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.activateAutoAgentV2(id), null, 2)); });
157
- aa.command("pause-agent-v2 <id>").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.pauseAutoAgentV2(id), null, 2)); });
158
- aa.command("archive-agent-v2 <id>").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.archiveAutoAgentV2(id), null, 2)); });
159
- aa.command("touch-agent-v2 <id>").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.touchAutoAgentV2(id), null, 2)); });
160
- aa.command("get-agent-v2 <id>").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.getAutoAgentV2(id), null, 2)); });
161
- aa.command("list-agents-v2").action(async () => { const m = await L(); console.log(JSON.stringify(m.listAutoAgentsV2(), null, 2)); });
162
- aa.command("create-run-v2 <id> <agentId>").option("--prompt <p>", "Prompt").action(async (id, agentId, o) => { const m = await L(); console.log(JSON.stringify(m.createAutoAgentRunV2({ id, agentId, prompt: o.prompt }), null, 2)); });
163
- aa.command("start-run-v2 <id>").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.startAutoAgentRunV2(id), null, 2)); });
164
- aa.command("complete-run-v2 <id>").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.completeAutoAgentRunV2(id), null, 2)); });
165
- aa.command("fail-run-v2 <id> [reason]").action(async (id, reason) => { const m = await L(); console.log(JSON.stringify(m.failAutoAgentRunV2(id, reason), null, 2)); });
166
- aa.command("cancel-run-v2 <id> [reason]").action(async (id, reason) => { const m = await L(); console.log(JSON.stringify(m.cancelAutoAgentRunV2(id, reason), null, 2)); });
167
- aa.command("get-run-v2 <id>").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.getAutoAgentRunV2(id), null, 2)); });
168
- aa.command("list-runs-v2").action(async () => { const m = await L(); console.log(JSON.stringify(m.listAutoAgentRunsV2(), null, 2)); });
169
- aa.command("auto-pause-idle-v2").action(async () => { const m = await L(); console.log(JSON.stringify(m.autoPauseIdleAutoAgentsV2(), null, 2)); });
170
- aa.command("auto-fail-stuck-v2").action(async () => { const m = await L(); console.log(JSON.stringify(m.autoFailStuckAutoAgentRunsV2(), null, 2)); });
171
- aa.command("gov-stats-v2").action(async () => { const m = await L(); console.log(JSON.stringify(m.getAutonomousAgentGovStatsV2(), null, 2)); });
172
- aa.command("reset-state-v2").action(async () => { const m = await L(); m._resetStateAutonomousAgentV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
519
+ aa.command("enums-v2").action(async () => {
520
+ const m = await L();
521
+ console.log(
522
+ JSON.stringify(
523
+ {
524
+ agentMaturity: m.AUTOAGENT_MATURITY_V2,
525
+ runLifecycle: m.AUTOAGENT_RUN_LIFECYCLE_V2,
526
+ },
527
+ null,
528
+ 2,
529
+ ),
530
+ );
531
+ });
532
+ aa.command("config-v2").action(async () => {
533
+ const m = await L();
534
+ console.log(
535
+ JSON.stringify(
536
+ {
537
+ maxActiveAutoAgentsPerOwner: m.getMaxActiveAutoAgentsPerOwnerV2(),
538
+ maxPendingAutoAgentRunsPerAgent:
539
+ m.getMaxPendingAutoAgentRunsPerAgentV2(),
540
+ autoAgentIdleMs: m.getAutoAgentIdleMsV2(),
541
+ autoAgentRunStuckMs: m.getAutoAgentRunStuckMsV2(),
542
+ },
543
+ null,
544
+ 2,
545
+ ),
546
+ );
547
+ });
548
+ aa.command("set-max-active-v2 <n>").action(async (n) => {
549
+ const m = await L();
550
+ m.setMaxActiveAutoAgentsPerOwnerV2(Number(n));
551
+ console.log("ok");
552
+ });
553
+ aa.command("set-max-pending-v2 <n>").action(async (n) => {
554
+ const m = await L();
555
+ m.setMaxPendingAutoAgentRunsPerAgentV2(Number(n));
556
+ console.log("ok");
557
+ });
558
+ aa.command("set-idle-ms-v2 <n>").action(async (n) => {
559
+ const m = await L();
560
+ m.setAutoAgentIdleMsV2(Number(n));
561
+ console.log("ok");
562
+ });
563
+ aa.command("set-stuck-ms-v2 <n>").action(async (n) => {
564
+ const m = await L();
565
+ m.setAutoAgentRunStuckMsV2(Number(n));
566
+ console.log("ok");
567
+ });
568
+ aa.command("register-agent-v2 <id> <owner>")
569
+ .option("--goal <g>", "Goal")
570
+ .action(async (id, owner, o) => {
571
+ const m = await L();
572
+ console.log(
573
+ JSON.stringify(
574
+ m.registerAutoAgentV2({ id, owner, goal: o.goal }),
575
+ null,
576
+ 2,
577
+ ),
578
+ );
579
+ });
580
+ aa.command("activate-agent-v2 <id>").action(async (id) => {
581
+ const m = await L();
582
+ console.log(JSON.stringify(m.activateAutoAgentV2(id), null, 2));
583
+ });
584
+ aa.command("pause-agent-v2 <id>").action(async (id) => {
585
+ const m = await L();
586
+ console.log(JSON.stringify(m.pauseAutoAgentV2(id), null, 2));
587
+ });
588
+ aa.command("archive-agent-v2 <id>").action(async (id) => {
589
+ const m = await L();
590
+ console.log(JSON.stringify(m.archiveAutoAgentV2(id), null, 2));
591
+ });
592
+ aa.command("touch-agent-v2 <id>").action(async (id) => {
593
+ const m = await L();
594
+ console.log(JSON.stringify(m.touchAutoAgentV2(id), null, 2));
595
+ });
596
+ aa.command("get-agent-v2 <id>").action(async (id) => {
597
+ const m = await L();
598
+ console.log(JSON.stringify(m.getAutoAgentV2(id), null, 2));
599
+ });
600
+ aa.command("list-agents-v2").action(async () => {
601
+ const m = await L();
602
+ console.log(JSON.stringify(m.listAutoAgentsV2(), null, 2));
603
+ });
604
+ aa.command("create-run-v2 <id> <agentId>")
605
+ .option("--prompt <p>", "Prompt")
606
+ .action(async (id, agentId, o) => {
607
+ const m = await L();
608
+ console.log(
609
+ JSON.stringify(
610
+ m.createAutoAgentRunV2({ id, agentId, prompt: o.prompt }),
611
+ null,
612
+ 2,
613
+ ),
614
+ );
615
+ });
616
+ aa.command("start-run-v2 <id>").action(async (id) => {
617
+ const m = await L();
618
+ console.log(JSON.stringify(m.startAutoAgentRunV2(id), null, 2));
619
+ });
620
+ aa.command("complete-run-v2 <id>").action(async (id) => {
621
+ const m = await L();
622
+ console.log(JSON.stringify(m.completeAutoAgentRunV2(id), null, 2));
623
+ });
624
+ aa.command("fail-run-v2 <id> [reason]").action(async (id, reason) => {
625
+ const m = await L();
626
+ console.log(JSON.stringify(m.failAutoAgentRunV2(id, reason), null, 2));
627
+ });
628
+ aa.command("cancel-run-v2 <id> [reason]").action(async (id, reason) => {
629
+ const m = await L();
630
+ console.log(JSON.stringify(m.cancelAutoAgentRunV2(id, reason), null, 2));
631
+ });
632
+ aa.command("get-run-v2 <id>").action(async (id) => {
633
+ const m = await L();
634
+ console.log(JSON.stringify(m.getAutoAgentRunV2(id), null, 2));
635
+ });
636
+ aa.command("list-runs-v2").action(async () => {
637
+ const m = await L();
638
+ console.log(JSON.stringify(m.listAutoAgentRunsV2(), null, 2));
639
+ });
640
+ aa.command("auto-pause-idle-v2").action(async () => {
641
+ const m = await L();
642
+ console.log(JSON.stringify(m.autoPauseIdleAutoAgentsV2(), null, 2));
643
+ });
644
+ aa.command("auto-fail-stuck-v2").action(async () => {
645
+ const m = await L();
646
+ console.log(JSON.stringify(m.autoFailStuckAutoAgentRunsV2(), null, 2));
647
+ });
648
+ aa.command("gov-stats-v2").action(async () => {
649
+ const m = await L();
650
+ console.log(JSON.stringify(m.getAutonomousAgentGovStatsV2(), null, 2));
651
+ });
652
+ aa.command("reset-state-v2").action(async () => {
653
+ const m = await L();
654
+ m._resetStateAutonomousAgentV2();
655
+ console.log(JSON.stringify({ ok: true }, null, 2));
656
+ });
173
657
  }