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
@@ -185,7 +185,6 @@ export function registerBrowseCommand(program) {
185
185
  registerBrowseV2Command(browse);
186
186
  }
187
187
 
188
-
189
188
  import {
190
189
  BROWSE_TARGET_MATURITY_V2,
191
190
  BROWSE_ACTION_LIFECYCLE_V2,
@@ -217,32 +216,407 @@ import {
217
216
  } from "../lib/browser-automation.js";
218
217
 
219
218
  export function registerBrowseV2Command(browse) {
220
- browse.command("enums-v2").description("Show V2 enums").action(() => {
221
- console.log(JSON.stringify({ BROWSE_TARGET_MATURITY_V2, BROWSE_ACTION_LIFECYCLE_V2 }, null, 2));
222
- });
223
- browse.command("register-target-v2").description("Register a browse target (pending)")
224
- .requiredOption("--id <id>").requiredOption("--owner <owner>").option("--url <url>")
225
- .action((o) => { console.log(JSON.stringify(registerBrowseTargetV2(o), null, 2)); });
226
- browse.command("activate-target-v2 <id>").description("Activate target").action((id) => { console.log(JSON.stringify(activateBrowseTargetV2(id), null, 2)); });
227
- browse.command("degrade-target-v2 <id>").description("Degrade target").action((id) => { console.log(JSON.stringify(degradeBrowseTargetV2(id), null, 2)); });
228
- browse.command("retire-target-v2 <id>").description("Retire target (terminal)").action((id) => { console.log(JSON.stringify(retireBrowseTargetV2(id), null, 2)); });
229
- browse.command("touch-target-v2 <id>").description("Refresh lastTouchedAt").action((id) => { console.log(JSON.stringify(touchBrowseTargetV2(id), null, 2)); });
230
- browse.command("get-target-v2 <id>").description("Get a target").action((id) => { console.log(JSON.stringify(getBrowseTargetV2(id), null, 2)); });
231
- browse.command("list-targets-v2").description("List targets").action(() => { console.log(JSON.stringify(listBrowseTargetsV2(), null, 2)); });
232
- browse.command("create-action-v2").description("Create a browse action (queued)")
233
- .requiredOption("--id <id>").requiredOption("--target-id <targetId>").option("--kind <kind>", "fetch/scrape/screenshot", "fetch")
234
- .action((o) => { console.log(JSON.stringify(createBrowseActionV2({ id: o.id, targetId: o.targetId, kind: o.kind }), null, 2)); });
235
- browse.command("start-action-v2 <id>").description("Start action").action((id) => { console.log(JSON.stringify(startBrowseActionV2(id), null, 2)); });
236
- browse.command("complete-action-v2 <id>").description("Complete action").action((id) => { console.log(JSON.stringify(completeBrowseActionV2(id), null, 2)); });
237
- browse.command("fail-action-v2 <id>").description("Fail action").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(failBrowseActionV2(id, o.reason), null, 2)); });
238
- browse.command("cancel-action-v2 <id>").description("Cancel action").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(cancelBrowseActionV2(id, o.reason), null, 2)); });
239
- browse.command("get-action-v2 <id>").description("Get action").action((id) => { console.log(JSON.stringify(getBrowseActionV2(id), null, 2)); });
240
- browse.command("list-actions-v2").description("List actions").action(() => { console.log(JSON.stringify(listBrowseActionsV2(), null, 2)); });
241
- browse.command("set-max-active-targets-v2 <n>").description("Set per-owner active cap").action((n) => { setMaxActiveBrowseTargetsPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveBrowseTargetsPerOwner: getMaxActiveBrowseTargetsPerOwnerV2() }, null, 2)); });
242
- browse.command("set-max-pending-actions-v2 <n>").description("Set per-target pending cap").action((n) => { setMaxPendingBrowseActionsPerTargetV2(Number(n)); console.log(JSON.stringify({ maxPendingBrowseActionsPerTarget: getMaxPendingBrowseActionsPerTargetV2() }, null, 2)); });
243
- browse.command("set-target-idle-ms-v2 <n>").description("Set idle threshold").action((n) => { setBrowseTargetIdleMsV2(Number(n)); console.log(JSON.stringify({ browseTargetIdleMs: getBrowseTargetIdleMsV2() }, null, 2)); });
244
- browse.command("set-action-stuck-ms-v2 <n>").description("Set stuck threshold").action((n) => { setBrowseActionStuckMsV2(Number(n)); console.log(JSON.stringify({ browseActionStuckMs: getBrowseActionStuckMsV2() }, null, 2)); });
245
- browse.command("auto-degrade-idle-targets-v2").description("Auto-degrade idle targets").action(() => { console.log(JSON.stringify(autoDegradeIdleBrowseTargetsV2(), null, 2)); });
246
- browse.command("auto-fail-stuck-actions-v2").description("Auto-fail stuck actions").action(() => { console.log(JSON.stringify(autoFailStuckBrowseActionsV2(), null, 2)); });
247
- browse.command("stats-v2").description("V2 aggregate stats").action(() => { console.log(JSON.stringify(getBrowserAutomationStatsV2(), null, 2)); });
219
+ browse
220
+ .command("enums-v2")
221
+ .description("Show V2 enums")
222
+ .action(() => {
223
+ console.log(
224
+ JSON.stringify(
225
+ { BROWSE_TARGET_MATURITY_V2, BROWSE_ACTION_LIFECYCLE_V2 },
226
+ null,
227
+ 2,
228
+ ),
229
+ );
230
+ });
231
+ browse
232
+ .command("register-target-v2")
233
+ .description("Register a browse target (pending)")
234
+ .requiredOption("--id <id>")
235
+ .requiredOption("--owner <owner>")
236
+ .option("--url <url>")
237
+ .action((o) => {
238
+ console.log(JSON.stringify(registerBrowseTargetV2(o), null, 2));
239
+ });
240
+ browse
241
+ .command("activate-target-v2 <id>")
242
+ .description("Activate target")
243
+ .action((id) => {
244
+ console.log(JSON.stringify(activateBrowseTargetV2(id), null, 2));
245
+ });
246
+ browse
247
+ .command("degrade-target-v2 <id>")
248
+ .description("Degrade target")
249
+ .action((id) => {
250
+ console.log(JSON.stringify(degradeBrowseTargetV2(id), null, 2));
251
+ });
252
+ browse
253
+ .command("retire-target-v2 <id>")
254
+ .description("Retire target (terminal)")
255
+ .action((id) => {
256
+ console.log(JSON.stringify(retireBrowseTargetV2(id), null, 2));
257
+ });
258
+ browse
259
+ .command("touch-target-v2 <id>")
260
+ .description("Refresh lastTouchedAt")
261
+ .action((id) => {
262
+ console.log(JSON.stringify(touchBrowseTargetV2(id), null, 2));
263
+ });
264
+ browse
265
+ .command("get-target-v2 <id>")
266
+ .description("Get a target")
267
+ .action((id) => {
268
+ console.log(JSON.stringify(getBrowseTargetV2(id), null, 2));
269
+ });
270
+ browse
271
+ .command("list-targets-v2")
272
+ .description("List targets")
273
+ .action(() => {
274
+ console.log(JSON.stringify(listBrowseTargetsV2(), null, 2));
275
+ });
276
+ browse
277
+ .command("create-action-v2")
278
+ .description("Create a browse action (queued)")
279
+ .requiredOption("--id <id>")
280
+ .requiredOption("--target-id <targetId>")
281
+ .option("--kind <kind>", "fetch/scrape/screenshot", "fetch")
282
+ .action((o) => {
283
+ console.log(
284
+ JSON.stringify(
285
+ createBrowseActionV2({
286
+ id: o.id,
287
+ targetId: o.targetId,
288
+ kind: o.kind,
289
+ }),
290
+ null,
291
+ 2,
292
+ ),
293
+ );
294
+ });
295
+ browse
296
+ .command("start-action-v2 <id>")
297
+ .description("Start action")
298
+ .action((id) => {
299
+ console.log(JSON.stringify(startBrowseActionV2(id), null, 2));
300
+ });
301
+ browse
302
+ .command("complete-action-v2 <id>")
303
+ .description("Complete action")
304
+ .action((id) => {
305
+ console.log(JSON.stringify(completeBrowseActionV2(id), null, 2));
306
+ });
307
+ browse
308
+ .command("fail-action-v2 <id>")
309
+ .description("Fail action")
310
+ .option("--reason <r>")
311
+ .action((id, o) => {
312
+ console.log(JSON.stringify(failBrowseActionV2(id, o.reason), null, 2));
313
+ });
314
+ browse
315
+ .command("cancel-action-v2 <id>")
316
+ .description("Cancel action")
317
+ .option("--reason <r>")
318
+ .action((id, o) => {
319
+ console.log(JSON.stringify(cancelBrowseActionV2(id, o.reason), null, 2));
320
+ });
321
+ browse
322
+ .command("get-action-v2 <id>")
323
+ .description("Get action")
324
+ .action((id) => {
325
+ console.log(JSON.stringify(getBrowseActionV2(id), null, 2));
326
+ });
327
+ browse
328
+ .command("list-actions-v2")
329
+ .description("List actions")
330
+ .action(() => {
331
+ console.log(JSON.stringify(listBrowseActionsV2(), null, 2));
332
+ });
333
+ browse
334
+ .command("set-max-active-targets-v2 <n>")
335
+ .description("Set per-owner active cap")
336
+ .action((n) => {
337
+ setMaxActiveBrowseTargetsPerOwnerV2(Number(n));
338
+ console.log(
339
+ JSON.stringify(
340
+ {
341
+ maxActiveBrowseTargetsPerOwner:
342
+ getMaxActiveBrowseTargetsPerOwnerV2(),
343
+ },
344
+ null,
345
+ 2,
346
+ ),
347
+ );
348
+ });
349
+ browse
350
+ .command("set-max-pending-actions-v2 <n>")
351
+ .description("Set per-target pending cap")
352
+ .action((n) => {
353
+ setMaxPendingBrowseActionsPerTargetV2(Number(n));
354
+ console.log(
355
+ JSON.stringify(
356
+ {
357
+ maxPendingBrowseActionsPerTarget:
358
+ getMaxPendingBrowseActionsPerTargetV2(),
359
+ },
360
+ null,
361
+ 2,
362
+ ),
363
+ );
364
+ });
365
+ browse
366
+ .command("set-target-idle-ms-v2 <n>")
367
+ .description("Set idle threshold")
368
+ .action((n) => {
369
+ setBrowseTargetIdleMsV2(Number(n));
370
+ console.log(
371
+ JSON.stringify(
372
+ { browseTargetIdleMs: getBrowseTargetIdleMsV2() },
373
+ null,
374
+ 2,
375
+ ),
376
+ );
377
+ });
378
+ browse
379
+ .command("set-action-stuck-ms-v2 <n>")
380
+ .description("Set stuck threshold")
381
+ .action((n) => {
382
+ setBrowseActionStuckMsV2(Number(n));
383
+ console.log(
384
+ JSON.stringify(
385
+ { browseActionStuckMs: getBrowseActionStuckMsV2() },
386
+ null,
387
+ 2,
388
+ ),
389
+ );
390
+ });
391
+ browse
392
+ .command("auto-degrade-idle-targets-v2")
393
+ .description("Auto-degrade idle targets")
394
+ .action(() => {
395
+ console.log(JSON.stringify(autoDegradeIdleBrowseTargetsV2(), null, 2));
396
+ });
397
+ browse
398
+ .command("auto-fail-stuck-actions-v2")
399
+ .description("Auto-fail stuck actions")
400
+ .action(() => {
401
+ console.log(JSON.stringify(autoFailStuckBrowseActionsV2(), null, 2));
402
+ });
403
+ browse
404
+ .command("stats-v2")
405
+ .description("V2 aggregate stats")
406
+ .action(() => {
407
+ console.log(JSON.stringify(getBrowserAutomationStatsV2(), null, 2));
408
+ });
409
+ }
410
+
411
+ // === Iter20 V2 governance overlay ===
412
+ export function registerBagovV2Commands(program) {
413
+ const parent = program.commands.find((c) => c.name() === "browse");
414
+ if (!parent) return;
415
+ const L = async () => await import("../lib/browser-automation.js");
416
+ parent
417
+ .command("bagov-enums-v2")
418
+ .description("Show V2 enums")
419
+ .action(async () => {
420
+ const m = await L();
421
+ console.log(
422
+ JSON.stringify(
423
+ {
424
+ profileMaturity: m.BAGOV_PROFILE_MATURITY_V2,
425
+ navigationLifecycle: m.BAGOV_NAVIGATION_LIFECYCLE_V2,
426
+ },
427
+ null,
428
+ 2,
429
+ ),
430
+ );
431
+ });
432
+ parent
433
+ .command("bagov-config-v2")
434
+ .description("Show V2 config")
435
+ .action(async () => {
436
+ const m = await L();
437
+ console.log(
438
+ JSON.stringify(
439
+ {
440
+ maxActive: m.getMaxActiveBagovProfilesPerOwnerV2(),
441
+ maxPending: m.getMaxPendingBagovNavigationsPerProfileV2(),
442
+ idleMs: m.getBagovProfileIdleMsV2(),
443
+ stuckMs: m.getBagovNavigationStuckMsV2(),
444
+ },
445
+ null,
446
+ 2,
447
+ ),
448
+ );
449
+ });
450
+ parent
451
+ .command("bagov-set-max-active-v2 <n>")
452
+ .description("Set max active")
453
+ .action(async (n) => {
454
+ (await L()).setMaxActiveBagovProfilesPerOwnerV2(Number(n));
455
+ console.log("ok");
456
+ });
457
+ parent
458
+ .command("bagov-set-max-pending-v2 <n>")
459
+ .description("Set max pending")
460
+ .action(async (n) => {
461
+ (await L()).setMaxPendingBagovNavigationsPerProfileV2(Number(n));
462
+ console.log("ok");
463
+ });
464
+ parent
465
+ .command("bagov-set-idle-ms-v2 <n>")
466
+ .description("Set idle threshold ms")
467
+ .action(async (n) => {
468
+ (await L()).setBagovProfileIdleMsV2(Number(n));
469
+ console.log("ok");
470
+ });
471
+ parent
472
+ .command("bagov-set-stuck-ms-v2 <n>")
473
+ .description("Set stuck threshold ms")
474
+ .action(async (n) => {
475
+ (await L()).setBagovNavigationStuckMsV2(Number(n));
476
+ console.log("ok");
477
+ });
478
+ parent
479
+ .command("bagov-register-v2 <id> <owner>")
480
+ .description("Register V2 profile")
481
+ .option("--engine <v>", "engine")
482
+ .action(async (id, owner, o) => {
483
+ const m = await L();
484
+ console.log(
485
+ JSON.stringify(
486
+ m.registerBagovProfileV2({ id, owner, engine: o.engine }),
487
+ null,
488
+ 2,
489
+ ),
490
+ );
491
+ });
492
+ parent
493
+ .command("bagov-activate-v2 <id>")
494
+ .description("Activate profile")
495
+ .action(async (id) => {
496
+ console.log(
497
+ JSON.stringify((await L()).activateBagovProfileV2(id), null, 2),
498
+ );
499
+ });
500
+ parent
501
+ .command("bagov-stale-v2 <id>")
502
+ .description("Stale profile")
503
+ .action(async (id) => {
504
+ console.log(JSON.stringify((await L()).staleBagovProfileV2(id), null, 2));
505
+ });
506
+ parent
507
+ .command("bagov-archive-v2 <id>")
508
+ .description("Archive profile")
509
+ .action(async (id) => {
510
+ console.log(
511
+ JSON.stringify((await L()).archiveBagovProfileV2(id), null, 2),
512
+ );
513
+ });
514
+ parent
515
+ .command("bagov-touch-v2 <id>")
516
+ .description("Touch profile")
517
+ .action(async (id) => {
518
+ console.log(JSON.stringify((await L()).touchBagovProfileV2(id), null, 2));
519
+ });
520
+ parent
521
+ .command("bagov-get-v2 <id>")
522
+ .description("Get profile")
523
+ .action(async (id) => {
524
+ console.log(JSON.stringify((await L()).getBagovProfileV2(id), null, 2));
525
+ });
526
+ parent
527
+ .command("bagov-list-v2")
528
+ .description("List profiles")
529
+ .action(async () => {
530
+ console.log(JSON.stringify((await L()).listBagovProfilesV2(), null, 2));
531
+ });
532
+ parent
533
+ .command("bagov-create-navigation-v2 <id> <profileId>")
534
+ .description("Create navigation")
535
+ .option("--url <v>", "url")
536
+ .action(async (id, profileId, o) => {
537
+ const m = await L();
538
+ console.log(
539
+ JSON.stringify(
540
+ m.createBagovNavigationV2({ id, profileId, url: o.url }),
541
+ null,
542
+ 2,
543
+ ),
544
+ );
545
+ });
546
+ parent
547
+ .command("bagov-navigating-navigation-v2 <id>")
548
+ .description("Mark navigation as navigating")
549
+ .action(async (id) => {
550
+ console.log(
551
+ JSON.stringify((await L()).navigatingBagovNavigationV2(id), null, 2),
552
+ );
553
+ });
554
+ parent
555
+ .command("bagov-complete-navigation-v2 <id>")
556
+ .description("Complete navigation")
557
+ .action(async (id) => {
558
+ console.log(
559
+ JSON.stringify((await L()).completeNavigationBagovV2(id), null, 2),
560
+ );
561
+ });
562
+ parent
563
+ .command("bagov-fail-navigation-v2 <id> [reason]")
564
+ .description("Fail navigation")
565
+ .action(async (id, reason) => {
566
+ console.log(
567
+ JSON.stringify((await L()).failBagovNavigationV2(id, reason), null, 2),
568
+ );
569
+ });
570
+ parent
571
+ .command("bagov-cancel-navigation-v2 <id> [reason]")
572
+ .description("Cancel navigation")
573
+ .action(async (id, reason) => {
574
+ console.log(
575
+ JSON.stringify(
576
+ (await L()).cancelBagovNavigationV2(id, reason),
577
+ null,
578
+ 2,
579
+ ),
580
+ );
581
+ });
582
+ parent
583
+ .command("bagov-get-navigation-v2 <id>")
584
+ .description("Get navigation")
585
+ .action(async (id) => {
586
+ console.log(
587
+ JSON.stringify((await L()).getBagovNavigationV2(id), null, 2),
588
+ );
589
+ });
590
+ parent
591
+ .command("bagov-list-navigations-v2")
592
+ .description("List navigations")
593
+ .action(async () => {
594
+ console.log(
595
+ JSON.stringify((await L()).listBagovNavigationsV2(), null, 2),
596
+ );
597
+ });
598
+ parent
599
+ .command("bagov-auto-stale-idle-v2")
600
+ .description("Auto-stale idle")
601
+ .action(async () => {
602
+ console.log(
603
+ JSON.stringify((await L()).autoStaleIdleBagovProfilesV2(), null, 2),
604
+ );
605
+ });
606
+ parent
607
+ .command("bagov-auto-fail-stuck-v2")
608
+ .description("Auto-fail stuck navigations")
609
+ .action(async () => {
610
+ console.log(
611
+ JSON.stringify((await L()).autoFailStuckBagovNavigationsV2(), null, 2),
612
+ );
613
+ });
614
+ parent
615
+ .command("bagov-gov-stats-v2")
616
+ .description("V2 gov stats")
617
+ .action(async () => {
618
+ console.log(
619
+ JSON.stringify((await L()).getBrowserAutomationGovStatsV2(), null, 2),
620
+ );
621
+ });
248
622
  }
@@ -37,42 +37,142 @@ export function registerCcronCommand(program) {
37
37
  .command("ccron")
38
38
  .description("Cowork Cron V2 governance (in-memory, CLI v0.143.0)");
39
39
 
40
- c.command("enums-v2").action(() => console.log(JSON.stringify({ CCRON_PROFILE_MATURITY_V2, CCRON_TICK_LIFECYCLE_V2 }, null, 2)));
40
+ c.command("enums-v2").action(() =>
41
+ console.log(
42
+ JSON.stringify(
43
+ { CCRON_PROFILE_MATURITY_V2, CCRON_TICK_LIFECYCLE_V2 },
44
+ null,
45
+ 2,
46
+ ),
47
+ ),
48
+ );
41
49
  c.command("register-profile-v2")
42
50
  .requiredOption("--id <id>")
43
51
  .requiredOption("--owner <owner>")
44
52
  .option("--expr <expr>", "cron expression", "0 0 * * *")
45
- .action((o) => console.log(JSON.stringify(registerCcronProfileV2(o), null, 2)));
46
- c.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activateCcronProfileV2(id), null, 2)));
47
- c.command("pause-profile-v2 <id>").action((id) => console.log(JSON.stringify(pauseCcronProfileV2(id), null, 2)));
48
- c.command("archive-profile-v2 <id>").action((id) => console.log(JSON.stringify(archiveCcronProfileV2(id), null, 2)));
49
- c.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchCcronProfileV2(id), null, 2)));
50
- c.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getCcronProfileV2(id), null, 2)));
51
- c.command("list-profiles-v2").action(() => console.log(JSON.stringify(listCcronProfilesV2(), null, 2)));
53
+ .action((o) =>
54
+ console.log(JSON.stringify(registerCcronProfileV2(o), null, 2)),
55
+ );
56
+ c.command("activate-profile-v2 <id>").action((id) =>
57
+ console.log(JSON.stringify(activateCcronProfileV2(id), null, 2)),
58
+ );
59
+ c.command("pause-profile-v2 <id>").action((id) =>
60
+ console.log(JSON.stringify(pauseCcronProfileV2(id), null, 2)),
61
+ );
62
+ c.command("archive-profile-v2 <id>").action((id) =>
63
+ console.log(JSON.stringify(archiveCcronProfileV2(id), null, 2)),
64
+ );
65
+ c.command("touch-profile-v2 <id>").action((id) =>
66
+ console.log(JSON.stringify(touchCcronProfileV2(id), null, 2)),
67
+ );
68
+ c.command("get-profile-v2 <id>").action((id) =>
69
+ console.log(JSON.stringify(getCcronProfileV2(id), null, 2)),
70
+ );
71
+ c.command("list-profiles-v2").action(() =>
72
+ console.log(JSON.stringify(listCcronProfilesV2(), null, 2)),
73
+ );
52
74
 
53
75
  c.command("create-tick-v2")
54
76
  .requiredOption("--id <id>")
55
77
  .requiredOption("--profile-id <profileId>")
56
78
  .option("--tick-at <ts>", "tick timestamp", "")
57
- .action((o) => console.log(JSON.stringify(createCcronTickV2({ id: o.id, profileId: o.profileId, tickAt: o.tickAt }), null, 2)));
58
- c.command("running-tick-v2 <id>").action((id) => console.log(JSON.stringify(runningCcronTickV2(id), null, 2)));
59
- c.command("complete-tick-v2 <id>").action((id) => console.log(JSON.stringify(completeCcronTickV2(id), null, 2)));
60
- c.command("fail-tick-v2 <id>").option("--reason <r>").action((id, o) => console.log(JSON.stringify(failCcronTickV2(id, o.reason), null, 2)));
61
- c.command("cancel-tick-v2 <id>").option("--reason <r>").action((id, o) => console.log(JSON.stringify(cancelCcronTickV2(id, o.reason), null, 2)));
62
- c.command("get-tick-v2 <id>").action((id) => console.log(JSON.stringify(getCcronTickV2(id), null, 2)));
63
- c.command("list-ticks-v2").action(() => console.log(JSON.stringify(listCcronTicksV2(), null, 2)));
79
+ .action((o) =>
80
+ console.log(
81
+ JSON.stringify(
82
+ createCcronTickV2({
83
+ id: o.id,
84
+ profileId: o.profileId,
85
+ tickAt: o.tickAt,
86
+ }),
87
+ null,
88
+ 2,
89
+ ),
90
+ ),
91
+ );
92
+ c.command("running-tick-v2 <id>").action((id) =>
93
+ console.log(JSON.stringify(runningCcronTickV2(id), null, 2)),
94
+ );
95
+ c.command("complete-tick-v2 <id>").action((id) =>
96
+ console.log(JSON.stringify(completeCcronTickV2(id), null, 2)),
97
+ );
98
+ c.command("fail-tick-v2 <id>")
99
+ .option("--reason <r>")
100
+ .action((id, o) =>
101
+ console.log(JSON.stringify(failCcronTickV2(id, o.reason), null, 2)),
102
+ );
103
+ c.command("cancel-tick-v2 <id>")
104
+ .option("--reason <r>")
105
+ .action((id, o) =>
106
+ console.log(JSON.stringify(cancelCcronTickV2(id, o.reason), null, 2)),
107
+ );
108
+ c.command("get-tick-v2 <id>").action((id) =>
109
+ console.log(JSON.stringify(getCcronTickV2(id), null, 2)),
110
+ );
111
+ c.command("list-ticks-v2").action(() =>
112
+ console.log(JSON.stringify(listCcronTicksV2(), null, 2)),
113
+ );
64
114
 
65
- c.command("config-v2").action(() => console.log(JSON.stringify({
66
- maxActiveCcronProfilesPerOwner: getMaxActiveCcronProfilesPerOwnerV2(),
67
- maxPendingCcronTicksPerProfile: getMaxPendingCcronTicksPerProfileV2(),
68
- ccronProfileIdleMs: getCcronProfileIdleMsV2(),
69
- ccronTickStuckMs: getCcronTickStuckMsV2(),
70
- }, null, 2)));
71
- c.command("set-max-active-profiles-v2 <n>").action((n) => { setMaxActiveCcronProfilesPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveCcronProfilesPerOwner: getMaxActiveCcronProfilesPerOwnerV2() }, null, 2)); });
72
- c.command("set-max-pending-ticks-v2 <n>").action((n) => { setMaxPendingCcronTicksPerProfileV2(Number(n)); console.log(JSON.stringify({ maxPendingCcronTicksPerProfile: getMaxPendingCcronTicksPerProfileV2() }, null, 2)); });
73
- c.command("set-profile-idle-ms-v2 <ms>").action((ms) => { setCcronProfileIdleMsV2(Number(ms)); console.log(JSON.stringify({ ccronProfileIdleMs: getCcronProfileIdleMsV2() }, null, 2)); });
74
- c.command("set-tick-stuck-ms-v2 <ms>").action((ms) => { setCcronTickStuckMsV2(Number(ms)); console.log(JSON.stringify({ ccronTickStuckMs: getCcronTickStuckMsV2() }, null, 2)); });
75
- c.command("auto-pause-idle-v2").action(() => console.log(JSON.stringify(autoPauseIdleCcronProfilesV2(), null, 2)));
76
- c.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckCcronTicksV2(), null, 2)));
77
- c.command("gov-stats-v2").action(() => console.log(JSON.stringify(getCoworkCronGovStatsV2(), null, 2)));
115
+ c.command("config-v2").action(() =>
116
+ console.log(
117
+ JSON.stringify(
118
+ {
119
+ maxActiveCcronProfilesPerOwner: getMaxActiveCcronProfilesPerOwnerV2(),
120
+ maxPendingCcronTicksPerProfile: getMaxPendingCcronTicksPerProfileV2(),
121
+ ccronProfileIdleMs: getCcronProfileIdleMsV2(),
122
+ ccronTickStuckMs: getCcronTickStuckMsV2(),
123
+ },
124
+ null,
125
+ 2,
126
+ ),
127
+ ),
128
+ );
129
+ c.command("set-max-active-profiles-v2 <n>").action((n) => {
130
+ setMaxActiveCcronProfilesPerOwnerV2(Number(n));
131
+ console.log(
132
+ JSON.stringify(
133
+ {
134
+ maxActiveCcronProfilesPerOwner: getMaxActiveCcronProfilesPerOwnerV2(),
135
+ },
136
+ null,
137
+ 2,
138
+ ),
139
+ );
140
+ });
141
+ c.command("set-max-pending-ticks-v2 <n>").action((n) => {
142
+ setMaxPendingCcronTicksPerProfileV2(Number(n));
143
+ console.log(
144
+ JSON.stringify(
145
+ {
146
+ maxPendingCcronTicksPerProfile: getMaxPendingCcronTicksPerProfileV2(),
147
+ },
148
+ null,
149
+ 2,
150
+ ),
151
+ );
152
+ });
153
+ c.command("set-profile-idle-ms-v2 <ms>").action((ms) => {
154
+ setCcronProfileIdleMsV2(Number(ms));
155
+ console.log(
156
+ JSON.stringify(
157
+ { ccronProfileIdleMs: getCcronProfileIdleMsV2() },
158
+ null,
159
+ 2,
160
+ ),
161
+ );
162
+ });
163
+ c.command("set-tick-stuck-ms-v2 <ms>").action((ms) => {
164
+ setCcronTickStuckMsV2(Number(ms));
165
+ console.log(
166
+ JSON.stringify({ ccronTickStuckMs: getCcronTickStuckMsV2() }, null, 2),
167
+ );
168
+ });
169
+ c.command("auto-pause-idle-v2").action(() =>
170
+ console.log(JSON.stringify(autoPauseIdleCcronProfilesV2(), null, 2)),
171
+ );
172
+ c.command("auto-fail-stuck-v2").action(() =>
173
+ console.log(JSON.stringify(autoFailStuckCcronTicksV2(), null, 2)),
174
+ );
175
+ c.command("gov-stats-v2").action(() =>
176
+ console.log(JSON.stringify(getCoworkCronGovStatsV2(), null, 2)),
177
+ );
78
178
  }