chainlesschain 0.132.0 → 0.143.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 (106) hide show
  1. package/package.json +1 -1
  2. package/src/commands/a2a.js +62 -0
  3. package/src/commands/activitypub.js +61 -0
  4. package/src/commands/agent.js +117 -0
  5. package/src/commands/bi.js +61 -0
  6. package/src/commands/bm25.js +78 -0
  7. package/src/commands/browse.js +64 -0
  8. package/src/commands/ccron.js +78 -0
  9. package/src/commands/compliance.js +40 -0
  10. package/src/commands/compt.js +78 -0
  11. package/src/commands/consol.js +231 -0
  12. package/src/commands/cowork.js +42 -0
  13. package/src/commands/crosschain.js +62 -0
  14. package/src/commands/dao.js +62 -0
  15. package/src/commands/dlp.js +61 -0
  16. package/src/commands/economy.js +56 -0
  17. package/src/commands/evolution.js +56 -0
  18. package/src/commands/evomap.js +61 -0
  19. package/src/commands/fflag.js +178 -0
  20. package/src/commands/git.js +45 -0
  21. package/src/commands/hmemory.js +56 -0
  22. package/src/commands/inference.js +42 -0
  23. package/src/commands/itbudget.js +45 -0
  24. package/src/commands/lowcode.js +44 -0
  25. package/src/commands/matrix.js +62 -0
  26. package/src/commands/mcpscaf.js +41 -0
  27. package/src/commands/meminj.js +41 -0
  28. package/src/commands/nostr.js +62 -0
  29. package/src/commands/orchgov.js +45 -0
  30. package/src/commands/pdfp.js +78 -0
  31. package/src/commands/perf.js +39 -0
  32. package/src/commands/perm.js +45 -0
  33. package/src/commands/pipeline.js +57 -1
  34. package/src/commands/planmode.js +45 -0
  35. package/src/commands/promcomp.js +82 -0
  36. package/src/commands/recommend.js +42 -0
  37. package/src/commands/seshhook.js +41 -0
  38. package/src/commands/seshsearch.js +41 -0
  39. package/src/commands/seshtail.js +41 -0
  40. package/src/commands/seshu.js +41 -0
  41. package/src/commands/sganal.js +78 -0
  42. package/src/commands/siem.js +40 -0
  43. package/src/commands/slotfill.js +41 -0
  44. package/src/commands/social.js +34 -0
  45. package/src/commands/svccont.js +45 -0
  46. package/src/commands/tms.js +45 -0
  47. package/src/commands/topiccls.js +45 -0
  48. package/src/commands/uprof.js +45 -0
  49. package/src/commands/vcheck.js +78 -0
  50. package/src/commands/webfetch.js +41 -0
  51. package/src/commands/zkp.js +62 -0
  52. package/src/harness/prompt-compressor.js +331 -0
  53. package/src/index.js +61 -1
  54. package/src/lib/a2a-protocol.js +105 -0
  55. package/src/lib/activitypub-bridge.js +105 -0
  56. package/src/lib/agent-economy.js +105 -0
  57. package/src/lib/app-builder.js +105 -0
  58. package/src/lib/autonomous-agent.js +105 -0
  59. package/src/lib/bi-engine.js +105 -0
  60. package/src/lib/bm25-search.js +81 -0
  61. package/src/lib/browser-automation.js +105 -0
  62. package/src/lib/compliance-framework-reporter.js +105 -0
  63. package/src/lib/compression-telemetry.js +81 -0
  64. package/src/lib/content-recommender.js +105 -0
  65. package/src/lib/cowork-cron.js +81 -0
  66. package/src/lib/cowork-task-runner.js +105 -0
  67. package/src/lib/cross-chain.js +105 -0
  68. package/src/lib/dao-governance.js +105 -0
  69. package/src/lib/dlp-engine.js +105 -0
  70. package/src/lib/evolution-system.js +105 -0
  71. package/src/lib/evomap-manager.js +105 -0
  72. package/src/lib/execution-backend.js +105 -0
  73. package/src/lib/feature-flags.js +85 -0
  74. package/src/lib/git-integration.js +105 -0
  75. package/src/lib/hierarchical-memory.js +105 -0
  76. package/src/lib/inference-network.js +105 -0
  77. package/src/lib/iteration-budget.js +105 -0
  78. package/src/lib/matrix-bridge.js +105 -0
  79. package/src/lib/mcp-scaffold.js +81 -0
  80. package/src/lib/memory-injection.js +81 -0
  81. package/src/lib/nostr-bridge.js +105 -0
  82. package/src/lib/orchestrator.js +105 -0
  83. package/src/lib/pdf-parser.js +81 -0
  84. package/src/lib/perf-tuning.js +105 -0
  85. package/src/lib/permission-engine.js +81 -0
  86. package/src/lib/pipeline-orchestrator.js +105 -0
  87. package/src/lib/plan-mode.js +81 -0
  88. package/src/lib/prompt-compressor.js +1 -10
  89. package/src/lib/service-container.js +81 -0
  90. package/src/lib/session-consolidator.js +105 -0
  91. package/src/lib/session-hooks.js +81 -0
  92. package/src/lib/session-search.js +81 -0
  93. package/src/lib/session-tail.js +81 -0
  94. package/src/lib/session-usage.js +83 -0
  95. package/src/lib/siem-exporter.js +105 -0
  96. package/src/lib/slot-filler.js +81 -0
  97. package/src/lib/social-graph-analytics.js +81 -0
  98. package/src/lib/social-graph.js +81 -0
  99. package/src/lib/sub-agent-registry.js +110 -0
  100. package/src/lib/task-model-selector.js +81 -0
  101. package/src/lib/todo-manager.js +105 -0
  102. package/src/lib/topic-classifier.js +105 -0
  103. package/src/lib/user-profile.js +81 -0
  104. package/src/lib/version-checker.js +81 -0
  105. package/src/lib/web-fetch.js +81 -0
  106. package/src/lib/zkp-engine.js +105 -0
@@ -1839,4 +1839,44 @@ export function registerComplianceCommand(program) {
1839
1839
  .action(() => {
1840
1840
  console.log(JSON.stringify(autoEscalateStuckInvestigationsV2(), null, 2));
1841
1841
  });
1842
+
1843
+ _registerComplianceFwReporterV2Commands(compliance);
1844
+ }
1845
+
1846
+ function _registerComplianceFwReporterV2Commands(parent) {
1847
+ const L = async () => await import("../lib/compliance-framework-reporter.js");
1848
+ parent.command("fwrep-enums-v2").description("Show V2 enums (fw maturity + report lifecycle)")
1849
+ .action(async () => { const m = await L(); console.log(JSON.stringify({ fwMaturity: m.COMPLIANCE_FW_MATURITY_V2, reportLifecycle: m.COMPLIANCE_FW_REPORT_LIFECYCLE_V2 }, null, 2)); });
1850
+ parent.command("fwrep-config-v2").description("Show V2 config thresholds")
1851
+ .action(async () => { const m = await L(); console.log(JSON.stringify({ maxActiveComplianceFwsPerOwner: m.getMaxActiveComplianceFwsPerOwnerV2(), maxPendingComplianceFwReportsPerFw: m.getMaxPendingComplianceFwReportsPerFwV2(), complianceFwIdleMs: m.getComplianceFwIdleMsV2(), complianceFwReportStuckMs: m.getComplianceFwReportStuckMsV2() }, null, 2)); });
1852
+ parent.command("fwrep-set-max-active-v2 <n>").description("Set max active fws per owner")
1853
+ .action(async (n) => { const m = await L(); m.setMaxActiveComplianceFwsPerOwnerV2(Number(n)); console.log("ok"); });
1854
+ parent.command("fwrep-set-max-pending-v2 <n>").description("Set max pending reports per fw")
1855
+ .action(async (n) => { const m = await L(); m.setMaxPendingComplianceFwReportsPerFwV2(Number(n)); console.log("ok"); });
1856
+ parent.command("fwrep-set-fw-idle-ms-v2 <n>").description("Set fw idle threshold (ms)")
1857
+ .action(async (n) => { const m = await L(); m.setComplianceFwIdleMsV2(Number(n)); console.log("ok"); });
1858
+ parent.command("fwrep-set-report-stuck-ms-v2 <n>").description("Set report stuck threshold (ms)")
1859
+ .action(async (n) => { const m = await L(); m.setComplianceFwReportStuckMsV2(Number(n)); console.log("ok"); });
1860
+ parent.command("fwrep-register-v2 <id> <owner>").description("Register V2 compliance framework")
1861
+ .option("--name <n>", "Framework name").action(async (id, owner, o) => { const m = await L(); console.log(JSON.stringify(m.registerComplianceFwV2({ id, owner, name: o.name }), null, 2)); });
1862
+ parent.command("fwrep-activate-v2 <id>").description("Activate framework").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.activateComplianceFwV2(id), null, 2)); });
1863
+ parent.command("fwrep-deprecate-v2 <id>").description("Deprecate framework").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.deprecateComplianceFwV2(id), null, 2)); });
1864
+ parent.command("fwrep-archive-v2 <id>").description("Archive framework (terminal)").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.archiveComplianceFwV2(id), null, 2)); });
1865
+ parent.command("fwrep-touch-v2 <id>").description("Touch framework").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.touchComplianceFwV2(id), null, 2)); });
1866
+ parent.command("fwrep-get-v2 <id>").description("Get V2 framework").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.getComplianceFwV2(id), null, 2)); });
1867
+ parent.command("fwrep-list-v2").description("List V2 frameworks").action(async () => { const m = await L(); console.log(JSON.stringify(m.listComplianceFwsV2(), null, 2)); });
1868
+ parent.command("fwrep-create-report-v2 <id> <frameworkId>").description("Create V2 report (queued)")
1869
+ .option("--format <f>", "Format", "markdown").action(async (id, frameworkId, o) => { const m = await L(); console.log(JSON.stringify(m.createComplianceFwReportV2({ id, frameworkId, format: o.format }), null, 2)); });
1870
+ parent.command("fwrep-start-report-v2 <id>").description("Start report").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.startComplianceFwReportV2(id), null, 2)); });
1871
+ parent.command("fwrep-complete-report-v2 <id>").description("Complete report").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.completeComplianceFwReportV2(id), null, 2)); });
1872
+ parent.command("fwrep-fail-report-v2 <id> [reason]").description("Fail report").action(async (id, reason) => { const m = await L(); console.log(JSON.stringify(m.failComplianceFwReportV2(id, reason), null, 2)); });
1873
+ parent.command("fwrep-cancel-report-v2 <id> [reason]").description("Cancel report").action(async (id, reason) => { const m = await L(); console.log(JSON.stringify(m.cancelComplianceFwReportV2(id, reason), null, 2)); });
1874
+ parent.command("fwrep-get-report-v2 <id>").description("Get V2 report").action(async (id) => { const m = await L(); console.log(JSON.stringify(m.getComplianceFwReportV2(id), null, 2)); });
1875
+ parent.command("fwrep-list-reports-v2").description("List V2 reports").action(async () => { const m = await L(); console.log(JSON.stringify(m.listComplianceFwReportsV2(), null, 2)); });
1876
+ parent.command("fwrep-auto-deprecate-idle-v2").description("Auto-deprecate idle fws")
1877
+ .action(async () => { const m = await L(); console.log(JSON.stringify(m.autoDeprecateIdleComplianceFwsV2(), null, 2)); });
1878
+ parent.command("fwrep-auto-fail-stuck-v2").description("Auto-fail stuck generating reports")
1879
+ .action(async () => { const m = await L(); console.log(JSON.stringify(m.autoFailStuckComplianceFwReportsV2(), null, 2)); });
1880
+ parent.command("fwrep-gov-stats-v2").description("V2 gov aggregate stats (fw reporter)")
1881
+ .action(async () => { const m = await L(); console.log(JSON.stringify(m.getComplianceFwReporterGovStatsV2(), null, 2)); });
1842
1882
  }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Compression Telemetry V2 governance commands — `cc compt ...`
3
+ * 在内存中治理 COMPT profile (pending/active/stale/archived) + sample 生命周期。
4
+ */
5
+ import {
6
+ COMPT_PROFILE_MATURITY_V2,
7
+ COMPT_SAMPLE_LIFECYCLE_V2,
8
+ registerComptProfileV2,
9
+ activateComptProfileV2,
10
+ staleComptProfileV2,
11
+ archiveComptProfileV2,
12
+ touchComptProfileV2,
13
+ getComptProfileV2,
14
+ listComptProfilesV2,
15
+ createComptSampleV2,
16
+ recordingComptSampleV2,
17
+ recordComptSampleV2,
18
+ failComptSampleV2,
19
+ cancelComptSampleV2,
20
+ getComptSampleV2,
21
+ listComptSamplesV2,
22
+ setMaxActiveComptProfilesPerOwnerV2,
23
+ getMaxActiveComptProfilesPerOwnerV2,
24
+ setMaxPendingComptSamplesPerProfileV2,
25
+ getMaxPendingComptSamplesPerProfileV2,
26
+ setComptProfileIdleMsV2,
27
+ getComptProfileIdleMsV2,
28
+ setComptSampleStuckMsV2,
29
+ getComptSampleStuckMsV2,
30
+ autoStaleIdleComptProfilesV2,
31
+ autoFailStuckComptSamplesV2,
32
+ getCompressionTelemetryGovStatsV2,
33
+ } from "../lib/compression-telemetry.js";
34
+
35
+ export function registerComptCommand(program) {
36
+ const c = program
37
+ .command("compt")
38
+ .description("Compression Telemetry V2 governance (in-memory, CLI v0.143.0)");
39
+
40
+ c.command("enums-v2").action(() => console.log(JSON.stringify({ COMPT_PROFILE_MATURITY_V2, COMPT_SAMPLE_LIFECYCLE_V2 }, null, 2)));
41
+ c.command("register-profile-v2")
42
+ .requiredOption("--id <id>")
43
+ .requiredOption("--owner <owner>")
44
+ .option("--kind <kind>", "telemetry kind", "default")
45
+ .action((o) => console.log(JSON.stringify(registerComptProfileV2(o), null, 2)));
46
+ c.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activateComptProfileV2(id), null, 2)));
47
+ c.command("stale-profile-v2 <id>").action((id) => console.log(JSON.stringify(staleComptProfileV2(id), null, 2)));
48
+ c.command("archive-profile-v2 <id>").action((id) => console.log(JSON.stringify(archiveComptProfileV2(id), null, 2)));
49
+ c.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchComptProfileV2(id), null, 2)));
50
+ c.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getComptProfileV2(id), null, 2)));
51
+ c.command("list-profiles-v2").action(() => console.log(JSON.stringify(listComptProfilesV2(), null, 2)));
52
+
53
+ c.command("create-sample-v2")
54
+ .requiredOption("--id <id>")
55
+ .requiredOption("--profile-id <profileId>")
56
+ .option("--metric <metric>", "metric name", "")
57
+ .action((o) => console.log(JSON.stringify(createComptSampleV2(o), null, 2)));
58
+ c.command("recording-sample-v2 <id>").action((id) => console.log(JSON.stringify(recordingComptSampleV2(id), null, 2)));
59
+ c.command("record-sample-v2 <id>").action((id) => console.log(JSON.stringify(recordComptSampleV2(id), null, 2)));
60
+ c.command("fail-sample-v2 <id>").option("--reason <r>").action((id, o) => console.log(JSON.stringify(failComptSampleV2(id, o.reason), null, 2)));
61
+ c.command("cancel-sample-v2 <id>").option("--reason <r>").action((id, o) => console.log(JSON.stringify(cancelComptSampleV2(id, o.reason), null, 2)));
62
+ c.command("get-sample-v2 <id>").action((id) => console.log(JSON.stringify(getComptSampleV2(id), null, 2)));
63
+ c.command("list-samples-v2").action(() => console.log(JSON.stringify(listComptSamplesV2(), null, 2)));
64
+
65
+ c.command("config-v2").action(() => console.log(JSON.stringify({
66
+ maxActiveComptProfilesPerOwner: getMaxActiveComptProfilesPerOwnerV2(),
67
+ maxPendingComptSamplesPerProfile: getMaxPendingComptSamplesPerProfileV2(),
68
+ comptProfileIdleMs: getComptProfileIdleMsV2(),
69
+ comptSampleStuckMs: getComptSampleStuckMsV2(),
70
+ }, null, 2)));
71
+ c.command("set-max-active-profiles-v2 <n>").action((n) => { setMaxActiveComptProfilesPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveComptProfilesPerOwner: getMaxActiveComptProfilesPerOwnerV2() }, null, 2)); });
72
+ c.command("set-max-pending-samples-v2 <n>").action((n) => { setMaxPendingComptSamplesPerProfileV2(Number(n)); console.log(JSON.stringify({ maxPendingComptSamplesPerProfile: getMaxPendingComptSamplesPerProfileV2() }, null, 2)); });
73
+ c.command("set-profile-idle-ms-v2 <ms>").action((ms) => { setComptProfileIdleMsV2(Number(ms)); console.log(JSON.stringify({ comptProfileIdleMs: getComptProfileIdleMsV2() }, null, 2)); });
74
+ c.command("set-sample-stuck-ms-v2 <ms>").action((ms) => { setComptSampleStuckMsV2(Number(ms)); console.log(JSON.stringify({ comptSampleStuckMs: getComptSampleStuckMsV2() }, null, 2)); });
75
+ c.command("auto-stale-idle-v2").action(() => console.log(JSON.stringify(autoStaleIdleComptProfilesV2(), null, 2)));
76
+ c.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckComptSamplesV2(), null, 2)));
77
+ c.command("gov-stats-v2").action(() => console.log(JSON.stringify(getCompressionTelemetryGovStatsV2(), null, 2)));
78
+ }
@@ -0,0 +1,231 @@
1
+ /**
2
+ * Session Consolidator V2 governance commands — `cc consol ...`
3
+ *
4
+ * V2 surface layered atop session-consolidator.js, independent of
5
+ * legacy `buildTraceStoreFromJsonl`/`consolidateJsonlSession` helpers.
6
+ */
7
+
8
+ import {
9
+ CONSOL_PROFILE_MATURITY_V2,
10
+ CONSOL_JOB_LIFECYCLE_V2,
11
+ registerConsolProfileV2,
12
+ activateConsolProfileV2,
13
+ pauseConsolProfileV2,
14
+ archiveConsolProfileV2,
15
+ touchConsolProfileV2,
16
+ getConsolProfileV2,
17
+ listConsolProfilesV2,
18
+ createConsolJobV2,
19
+ startConsolJobV2,
20
+ completeConsolJobV2,
21
+ failConsolJobV2,
22
+ cancelConsolJobV2,
23
+ getConsolJobV2,
24
+ listConsolJobsV2,
25
+ setMaxActiveConsolProfilesPerOwnerV2,
26
+ getMaxActiveConsolProfilesPerOwnerV2,
27
+ setMaxPendingConsolJobsPerProfileV2,
28
+ getMaxPendingConsolJobsPerProfileV2,
29
+ setConsolProfileIdleMsV2,
30
+ getConsolProfileIdleMsV2,
31
+ setConsolJobStuckMsV2,
32
+ getConsolJobStuckMsV2,
33
+ autoPauseIdleConsolProfilesV2,
34
+ autoFailStuckConsolJobsV2,
35
+ getSessionConsolidatorStatsV2,
36
+ } from "../lib/session-consolidator.js";
37
+
38
+ export function registerConsolCommand(program) {
39
+ const consol = program
40
+ .command("consol")
41
+ .description(
42
+ "Session Consolidator V2 governance (in-memory, CLI v0.134.0)",
43
+ );
44
+
45
+ consol
46
+ .command("enums-v2")
47
+ .description("Show V2 maturity + lifecycle enums")
48
+ .action(() => {
49
+ console.log(
50
+ JSON.stringify(
51
+ {
52
+ CONSOL_PROFILE_MATURITY_V2,
53
+ CONSOL_JOB_LIFECYCLE_V2,
54
+ },
55
+ null,
56
+ 2,
57
+ ),
58
+ );
59
+ });
60
+
61
+ consol
62
+ .command("register-profile-v2")
63
+ .description("Register a consolidation profile (pending)")
64
+ .requiredOption("--id <id>")
65
+ .requiredOption("--owner <owner>")
66
+ .option("--scope <scope>", "agent|session|global", "agent")
67
+ .action((o) => {
68
+ console.log(JSON.stringify(registerConsolProfileV2(o), null, 2));
69
+ });
70
+ consol
71
+ .command("activate-profile-v2 <id>")
72
+ .description("Transition profile to active")
73
+ .action((id) => {
74
+ console.log(JSON.stringify(activateConsolProfileV2(id), null, 2));
75
+ });
76
+ consol
77
+ .command("pause-profile-v2 <id>")
78
+ .description("Transition profile to paused")
79
+ .action((id) => {
80
+ console.log(JSON.stringify(pauseConsolProfileV2(id), null, 2));
81
+ });
82
+ consol
83
+ .command("archive-profile-v2 <id>")
84
+ .description("Transition profile to archived (terminal)")
85
+ .action((id) => {
86
+ console.log(JSON.stringify(archiveConsolProfileV2(id), null, 2));
87
+ });
88
+ consol
89
+ .command("touch-profile-v2 <id>")
90
+ .description("Refresh lastTouchedAt")
91
+ .action((id) => {
92
+ console.log(JSON.stringify(touchConsolProfileV2(id), null, 2));
93
+ });
94
+ consol
95
+ .command("get-profile-v2 <id>")
96
+ .description("Get a profile by id")
97
+ .action((id) => {
98
+ console.log(JSON.stringify(getConsolProfileV2(id), null, 2));
99
+ });
100
+ consol
101
+ .command("list-profiles-v2")
102
+ .description("List all profiles")
103
+ .action(() => {
104
+ console.log(JSON.stringify(listConsolProfilesV2(), null, 2));
105
+ });
106
+
107
+ consol
108
+ .command("create-job-v2")
109
+ .description("Create a consolidation job (queued)")
110
+ .requiredOption("--id <id>")
111
+ .requiredOption("--profile-id <profileId>")
112
+ .option("--session-id <sessionId>")
113
+ .action((o) => {
114
+ console.log(
115
+ JSON.stringify(
116
+ createConsolJobV2({
117
+ id: o.id,
118
+ profileId: o.profileId,
119
+ sessionId: o.sessionId,
120
+ }),
121
+ null,
122
+ 2,
123
+ ),
124
+ );
125
+ });
126
+ consol
127
+ .command("start-job-v2 <id>")
128
+ .description("Transition job to running")
129
+ .action((id) => {
130
+ console.log(JSON.stringify(startConsolJobV2(id), null, 2));
131
+ });
132
+ consol
133
+ .command("complete-job-v2 <id>")
134
+ .description("Transition job to completed")
135
+ .action((id) => {
136
+ console.log(JSON.stringify(completeConsolJobV2(id), null, 2));
137
+ });
138
+ consol
139
+ .command("fail-job-v2 <id>")
140
+ .description("Transition job to failed")
141
+ .option("--reason <reason>")
142
+ .action((id, o) => {
143
+ console.log(JSON.stringify(failConsolJobV2(id, o.reason), null, 2));
144
+ });
145
+ consol
146
+ .command("cancel-job-v2 <id>")
147
+ .description("Transition job to cancelled")
148
+ .option("--reason <reason>")
149
+ .action((id, o) => {
150
+ console.log(JSON.stringify(cancelConsolJobV2(id, o.reason), null, 2));
151
+ });
152
+ consol
153
+ .command("get-job-v2 <id>")
154
+ .description("Get a job by id")
155
+ .action((id) => {
156
+ console.log(JSON.stringify(getConsolJobV2(id), null, 2));
157
+ });
158
+ consol
159
+ .command("list-jobs-v2")
160
+ .description("List all jobs")
161
+ .action(() => {
162
+ console.log(JSON.stringify(listConsolJobsV2(), null, 2));
163
+ });
164
+
165
+ consol
166
+ .command("set-max-active-profiles-v2 <n>")
167
+ .description("Set per-owner active profile cap")
168
+ .action((n) => {
169
+ setMaxActiveConsolProfilesPerOwnerV2(Number(n));
170
+ console.log(
171
+ JSON.stringify(
172
+ { maxActiveConsolProfilesPerOwner: getMaxActiveConsolProfilesPerOwnerV2() },
173
+ null,
174
+ 2,
175
+ ),
176
+ );
177
+ });
178
+ consol
179
+ .command("set-max-pending-jobs-v2 <n>")
180
+ .description("Set per-profile pending job cap")
181
+ .action((n) => {
182
+ setMaxPendingConsolJobsPerProfileV2(Number(n));
183
+ console.log(
184
+ JSON.stringify(
185
+ { maxPendingConsolJobsPerProfile: getMaxPendingConsolJobsPerProfileV2() },
186
+ null,
187
+ 2,
188
+ ),
189
+ );
190
+ });
191
+ consol
192
+ .command("set-profile-idle-ms-v2 <n>")
193
+ .description("Set profile idle threshold (ms)")
194
+ .action((n) => {
195
+ setConsolProfileIdleMsV2(Number(n));
196
+ console.log(
197
+ JSON.stringify(
198
+ { consolProfileIdleMs: getConsolProfileIdleMsV2() },
199
+ null,
200
+ 2,
201
+ ),
202
+ );
203
+ });
204
+ consol
205
+ .command("set-job-stuck-ms-v2 <n>")
206
+ .description("Set job stuck threshold (ms)")
207
+ .action((n) => {
208
+ setConsolJobStuckMsV2(Number(n));
209
+ console.log(
210
+ JSON.stringify({ consolJobStuckMs: getConsolJobStuckMsV2() }, null, 2),
211
+ );
212
+ });
213
+ consol
214
+ .command("auto-pause-idle-profiles-v2")
215
+ .description("Auto-pause idle active profiles")
216
+ .action(() => {
217
+ console.log(JSON.stringify(autoPauseIdleConsolProfilesV2(), null, 2));
218
+ });
219
+ consol
220
+ .command("auto-fail-stuck-jobs-v2")
221
+ .description("Auto-fail stuck running jobs")
222
+ .action(() => {
223
+ console.log(JSON.stringify(autoFailStuckConsolJobsV2(), null, 2));
224
+ });
225
+ consol
226
+ .command("stats-v2")
227
+ .description("Show V2 aggregate stats")
228
+ .action(() => {
229
+ console.log(JSON.stringify(getSessionConsolidatorStatsV2(), null, 2));
230
+ });
231
+ }
@@ -1402,4 +1402,46 @@ export function registerCoworkCommand(program) {
1402
1402
  m._resetStateAgentCoordinatorV2();
1403
1403
  console.log(JSON.stringify({ ok: true }, null, 2));
1404
1404
  });
1405
+
1406
+ _registerCoworkRunnerV2(cowork);
1407
+ }
1408
+
1409
+
1410
+ import {
1411
+ RUNNER_PROFILE_MATURITY_V2, RUNNER_EXEC_LIFECYCLE_V2,
1412
+ setMaxActiveRunnerProfilesPerOwnerV2, setMaxPendingRunnerExecsPerProfileV2, setRunnerProfileIdleMsV2, setRunnerExecStuckMsV2,
1413
+ registerRunnerProfileV2, activateRunnerProfileV2, pauseRunnerProfileV2, retireRunnerProfileV2, touchRunnerProfileV2, getRunnerProfileV2, listRunnerProfilesV2,
1414
+ createRunnerExecV2, startRunnerExecV2, succeedRunnerExecV2, failRunnerExecV2, cancelRunnerExecV2, getRunnerExecV2, listRunnerExecsV2,
1415
+ autoPauseIdleRunnerProfilesV2, autoFailStuckRunnerExecsV2, getRunnerGovStatsV2,
1416
+ } from "../lib/cowork-task-runner.js";
1417
+
1418
+ function _registerCoworkRunnerV2(parent) {
1419
+ parent.command("runner-enums-v2").description("List Runner V2 enums").option("--json", "JSON").action((opts) => {
1420
+ const out = { profileMaturity: RUNNER_PROFILE_MATURITY_V2, execLifecycle: RUNNER_EXEC_LIFECYCLE_V2 };
1421
+ if (opts.json) console.log(JSON.stringify(out, null, 2)); else console.log(out);
1422
+ });
1423
+ parent.command("runner-config-set-v2").description("Set Runner V2 caps/thresholds").option("--max-active <n>", "max active per owner").option("--max-pending <n>", "max pending per profile").option("--idle-ms <n>", "profile idle ms").option("--stuck-ms <n>", "exec stuck ms").action((opts) => {
1424
+ if (opts.maxActive) setMaxActiveRunnerProfilesPerOwnerV2(parseInt(opts.maxActive, 10));
1425
+ if (opts.maxPending) setMaxPendingRunnerExecsPerProfileV2(parseInt(opts.maxPending, 10));
1426
+ if (opts.idleMs) setRunnerProfileIdleMsV2(parseInt(opts.idleMs, 10));
1427
+ if (opts.stuckMs) setRunnerExecStuckMsV2(parseInt(opts.stuckMs, 10));
1428
+ console.log("ok");
1429
+ });
1430
+ parent.command("runner-register-profile-v2 <id>").description("Register Runner V2 profile").requiredOption("--owner <owner>", "owner").option("--template <t>", "template").action((id, opts) => { console.log(registerRunnerProfileV2({ id, owner: opts.owner, template: opts.template })); });
1431
+ parent.command("runner-activate-profile-v2 <id>").description("Activate Runner V2 profile").action((id) => { console.log(activateRunnerProfileV2(id)); });
1432
+ parent.command("runner-pause-profile-v2 <id>").description("Pause Runner V2 profile").action((id) => { console.log(pauseRunnerProfileV2(id)); });
1433
+ parent.command("runner-retire-profile-v2 <id>").description("Retire Runner V2 profile").action((id) => { console.log(retireRunnerProfileV2(id)); });
1434
+ parent.command("runner-touch-profile-v2 <id>").description("Touch Runner V2 profile").action((id) => { console.log(touchRunnerProfileV2(id)); });
1435
+ parent.command("runner-get-profile-v2 <id>").description("Get Runner V2 profile").action((id) => { console.log(getRunnerProfileV2(id)); });
1436
+ parent.command("runner-list-profiles-v2").description("List Runner V2 profiles").action(() => { console.log(listRunnerProfilesV2()); });
1437
+ parent.command("runner-create-exec-v2 <id>").description("Create Runner V2 exec").requiredOption("--profile-id <pid>", "profile id").option("--task-input <t>", "task input").action((id, opts) => { console.log(createRunnerExecV2({ id, profileId: opts.profileId, taskInput: opts.taskInput })); });
1438
+ parent.command("runner-start-exec-v2 <id>").description("Start Runner V2 exec").action((id) => { console.log(startRunnerExecV2(id)); });
1439
+ parent.command("runner-succeed-exec-v2 <id>").description("Succeed Runner V2 exec").action((id) => { console.log(succeedRunnerExecV2(id)); });
1440
+ parent.command("runner-fail-exec-v2 <id>").description("Fail Runner V2 exec").option("--reason <r>", "reason").action((id, opts) => { console.log(failRunnerExecV2(id, opts.reason)); });
1441
+ parent.command("runner-cancel-exec-v2 <id>").description("Cancel Runner V2 exec").option("--reason <r>", "reason").action((id, opts) => { console.log(cancelRunnerExecV2(id, opts.reason)); });
1442
+ parent.command("runner-get-exec-v2 <id>").description("Get Runner V2 exec").action((id) => { console.log(getRunnerExecV2(id)); });
1443
+ parent.command("runner-list-execs-v2").description("List Runner V2 execs").action(() => { console.log(listRunnerExecsV2()); });
1444
+ parent.command("runner-auto-pause-profiles-v2").description("Auto-pause idle Runner V2 profiles").action(() => { console.log(autoPauseIdleRunnerProfilesV2()); });
1445
+ parent.command("runner-auto-fail-execs-v2").description("Auto-fail stuck Runner V2 execs").action(() => { console.log(autoFailStuckRunnerExecsV2()); });
1446
+ parent.command("runner-gov-stats-v2").description("Runner V2 governance stats").option("--json", "JSON").action((opts) => { const s = getRunnerGovStatsV2(); if (opts.json) console.log(JSON.stringify(s, null, 2)); else console.log(s); });
1405
1447
  }
@@ -597,4 +597,66 @@ export function registerCrossChainCommand(program) {
597
597
  });
598
598
 
599
599
  program.addCommand(cc);
600
+ registerCrossChainV2Command(cc);
600
601
  }
602
+
603
+
604
+ import {
605
+ XCHAIN_CHANNEL_MATURITY_V2,
606
+ XCHAIN_TRANSFER_LIFECYCLE_V2,
607
+ registerXchainChannelV2,
608
+ activateXchainChannelV2,
609
+ pauseXchainChannelV2,
610
+ decommissionXchainChannelV2,
611
+ touchXchainChannelV2,
612
+ getXchainChannelV2,
613
+ listXchainChannelsV2,
614
+ createXchainTransferV2,
615
+ startXchainTransferV2,
616
+ confirmXchainTransferV2,
617
+ failXchainTransferV2,
618
+ cancelXchainTransferV2,
619
+ getXchainTransferV2,
620
+ listXchainTransfersV2,
621
+ setMaxActiveXchainChannelsPerOwnerV2,
622
+ getMaxActiveXchainChannelsPerOwnerV2,
623
+ setMaxPendingXchainTransfersPerChannelV2,
624
+ getMaxPendingXchainTransfersPerChannelV2,
625
+ setXchainChannelIdleMsV2,
626
+ getXchainChannelIdleMsV2,
627
+ setXchainTransferStuckMsV2,
628
+ getXchainTransferStuckMsV2,
629
+ autoPauseIdleXchainChannelsV2,
630
+ autoFailStuckXchainTransfersV2,
631
+ getCrossChainGovStatsV2,
632
+ } from "../lib/cross-chain.js";
633
+
634
+ export function registerCrossChainV2Command(cc) {
635
+ cc.command("enums-v2").description("Show V2 governance enums").action(() => { console.log(JSON.stringify({ XCHAIN_CHANNEL_MATURITY_V2, XCHAIN_TRANSFER_LIFECYCLE_V2 }, null, 2)); });
636
+ cc.command("register-channel-v2").description("Register an xchain channel profile (pending)")
637
+ .requiredOption("--id <id>").requiredOption("--owner <owner>").option("--from-chain <fromChain>").option("--to-chain <toChain>")
638
+ .action((o) => { console.log(JSON.stringify(registerXchainChannelV2({ id: o.id, owner: o.owner, fromChain: o.fromChain, toChain: o.toChain }), null, 2)); });
639
+ cc.command("activate-channel-v2 <id>").description("Activate channel").action((id) => { console.log(JSON.stringify(activateXchainChannelV2(id), null, 2)); });
640
+ cc.command("pause-channel-v2 <id>").description("Pause channel").action((id) => { console.log(JSON.stringify(pauseXchainChannelV2(id), null, 2)); });
641
+ cc.command("decommission-channel-v2 <id>").description("Decommission channel (terminal)").action((id) => { console.log(JSON.stringify(decommissionXchainChannelV2(id), null, 2)); });
642
+ cc.command("touch-channel-v2 <id>").description("Refresh lastTouchedAt").action((id) => { console.log(JSON.stringify(touchXchainChannelV2(id), null, 2)); });
643
+ cc.command("get-channel-v2 <id>").description("Get channel").action((id) => { console.log(JSON.stringify(getXchainChannelV2(id), null, 2)); });
644
+ cc.command("list-channels-v2").description("List channels").action(() => { console.log(JSON.stringify(listXchainChannelsV2(), null, 2)); });
645
+ cc.command("create-transfer-v2").description("Create an xchain transfer (queued)")
646
+ .requiredOption("--id <id>").requiredOption("--channel-id <channelId>").option("--amount <amount>")
647
+ .action((o) => { console.log(JSON.stringify(createXchainTransferV2({ id: o.id, channelId: o.channelId, amount: o.amount }), null, 2)); });
648
+ cc.command("start-transfer-v2 <id>").description("Transition transfer to relaying").action((id) => { console.log(JSON.stringify(startXchainTransferV2(id), null, 2)); });
649
+ cc.command("confirm-transfer-v2 <id>").description("Transition transfer to confirmed").action((id) => { console.log(JSON.stringify(confirmXchainTransferV2(id), null, 2)); });
650
+ cc.command("fail-transfer-v2 <id>").description("Fail transfer").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(failXchainTransferV2(id, o.reason), null, 2)); });
651
+ cc.command("cancel-transfer-v2 <id>").description("Cancel transfer").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(cancelXchainTransferV2(id, o.reason), null, 2)); });
652
+ cc.command("get-transfer-v2 <id>").description("Get transfer").action((id) => { console.log(JSON.stringify(getXchainTransferV2(id), null, 2)); });
653
+ cc.command("list-transfers-v2").description("List transfers").action(() => { console.log(JSON.stringify(listXchainTransfersV2(), null, 2)); });
654
+ cc.command("set-max-active-channels-v2 <n>").description("Set per-owner active cap").action((n) => { setMaxActiveXchainChannelsPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveXchainChannelsPerOwner: getMaxActiveXchainChannelsPerOwnerV2() }, null, 2)); });
655
+ cc.command("set-max-pending-transfers-v2 <n>").description("Set per-channel pending cap").action((n) => { setMaxPendingXchainTransfersPerChannelV2(Number(n)); console.log(JSON.stringify({ maxPendingXchainTransfersPerChannel: getMaxPendingXchainTransfersPerChannelV2() }, null, 2)); });
656
+ cc.command("set-channel-idle-ms-v2 <n>").description("Set idle threshold").action((n) => { setXchainChannelIdleMsV2(Number(n)); console.log(JSON.stringify({ xchainChannelIdleMs: getXchainChannelIdleMsV2() }, null, 2)); });
657
+ cc.command("set-transfer-stuck-ms-v2 <n>").description("Set stuck threshold").action((n) => { setXchainTransferStuckMsV2(Number(n)); console.log(JSON.stringify({ xchainTransferStuckMs: getXchainTransferStuckMsV2() }, null, 2)); });
658
+ cc.command("auto-pause-idle-channels-v2").description("Auto-pause idle channels").action(() => { console.log(JSON.stringify(autoPauseIdleXchainChannelsV2(), null, 2)); });
659
+ cc.command("auto-fail-stuck-transfers-v2").description("Auto-fail stuck relaying transfers").action(() => { console.log(JSON.stringify(autoFailStuckXchainTransfersV2(), null, 2)); });
660
+ cc.command("gov-stats-v2").description("V2 governance aggregate stats").action(() => { console.log(JSON.stringify(getCrossChainGovStatsV2(), null, 2)); });
661
+ }
662
+
@@ -874,4 +874,66 @@ export function registerDaoCommand(program) {
874
874
  }
875
875
  }
876
876
  });
877
+ registerDaoV2Command(dao);
877
878
  }
879
+
880
+
881
+ import {
882
+ DAO_ORG_MATURITY_V2,
883
+ DAO_PROPOSAL_LIFECYCLE_V2,
884
+ registerDaoOrgV2,
885
+ activateDaoOrgV2,
886
+ pauseDaoOrgV2,
887
+ dissolveDaoOrgV2,
888
+ touchDaoOrgV2,
889
+ getDaoOrgV2,
890
+ listDaoOrgsV2,
891
+ createDaoProposalV2,
892
+ startDaoProposalV2,
893
+ passDaoProposalV2,
894
+ failDaoProposalV2,
895
+ cancelDaoProposalV2,
896
+ getDaoProposalV2,
897
+ listDaoProposalsV2,
898
+ setMaxActiveDaoOrgsPerOwnerV2,
899
+ getMaxActiveDaoOrgsPerOwnerV2,
900
+ setMaxPendingDaoProposalsPerOrgV2,
901
+ getMaxPendingDaoProposalsPerOrgV2,
902
+ setDaoOrgIdleMsV2,
903
+ getDaoOrgIdleMsV2,
904
+ setDaoProposalStuckMsV2,
905
+ getDaoProposalStuckMsV2,
906
+ autoPauseIdleDaoOrgsV2,
907
+ autoFailStuckDaoProposalsV2,
908
+ getDaoGovernanceGovStatsV2,
909
+ } from "../lib/dao-governance.js";
910
+
911
+ export function registerDaoV2Command(dao) {
912
+ dao.command("enums-v2").description("Show V2 governance enums").action(() => { console.log(JSON.stringify({ DAO_ORG_MATURITY_V2, DAO_PROPOSAL_LIFECYCLE_V2 }, null, 2)); });
913
+ dao.command("register-org-v2").description("Register a dao org profile (pending)")
914
+ .requiredOption("--id <id>").requiredOption("--owner <owner>").option("--name <name>")
915
+ .action((o) => { console.log(JSON.stringify(registerDaoOrgV2({ id: o.id, owner: o.owner, name: o.name }), null, 2)); });
916
+ dao.command("activate-org-v2 <id>").description("Activate org").action((id) => { console.log(JSON.stringify(activateDaoOrgV2(id), null, 2)); });
917
+ dao.command("pause-org-v2 <id>").description("Pause org").action((id) => { console.log(JSON.stringify(pauseDaoOrgV2(id), null, 2)); });
918
+ dao.command("dissolve-org-v2 <id>").description("Dissolve org (terminal)").action((id) => { console.log(JSON.stringify(dissolveDaoOrgV2(id), null, 2)); });
919
+ dao.command("touch-org-v2 <id>").description("Refresh lastTouchedAt").action((id) => { console.log(JSON.stringify(touchDaoOrgV2(id), null, 2)); });
920
+ dao.command("get-org-v2 <id>").description("Get org").action((id) => { console.log(JSON.stringify(getDaoOrgV2(id), null, 2)); });
921
+ dao.command("list-orgs-v2").description("List orgs").action(() => { console.log(JSON.stringify(listDaoOrgsV2(), null, 2)); });
922
+ dao.command("create-proposal-v2").description("Create a dao proposal (queued)")
923
+ .requiredOption("--id <id>").requiredOption("--org-id <orgId>").option("--title <title>")
924
+ .action((o) => { console.log(JSON.stringify(createDaoProposalV2({ id: o.id, orgId: o.orgId, title: o.title }), null, 2)); });
925
+ dao.command("start-proposal-v2 <id>").description("Transition proposal to voting").action((id) => { console.log(JSON.stringify(startDaoProposalV2(id), null, 2)); });
926
+ dao.command("pass-proposal-v2 <id>").description("Transition proposal to passed").action((id) => { console.log(JSON.stringify(passDaoProposalV2(id), null, 2)); });
927
+ dao.command("fail-proposal-v2 <id>").description("Fail proposal").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(failDaoProposalV2(id, o.reason), null, 2)); });
928
+ dao.command("cancel-proposal-v2 <id>").description("Cancel proposal").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(cancelDaoProposalV2(id, o.reason), null, 2)); });
929
+ dao.command("get-proposal-v2 <id>").description("Get proposal").action((id) => { console.log(JSON.stringify(getDaoProposalV2(id), null, 2)); });
930
+ dao.command("list-proposals-v2").description("List proposals").action(() => { console.log(JSON.stringify(listDaoProposalsV2(), null, 2)); });
931
+ dao.command("set-max-active-orgs-v2 <n>").description("Set per-owner active cap").action((n) => { setMaxActiveDaoOrgsPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveDaoOrgsPerOwner: getMaxActiveDaoOrgsPerOwnerV2() }, null, 2)); });
932
+ dao.command("set-max-pending-proposals-v2 <n>").description("Set per-org pending cap").action((n) => { setMaxPendingDaoProposalsPerOrgV2(Number(n)); console.log(JSON.stringify({ maxPendingDaoProposalsPerOrg: getMaxPendingDaoProposalsPerOrgV2() }, null, 2)); });
933
+ dao.command("set-org-idle-ms-v2 <n>").description("Set idle threshold").action((n) => { setDaoOrgIdleMsV2(Number(n)); console.log(JSON.stringify({ daoOrgIdleMs: getDaoOrgIdleMsV2() }, null, 2)); });
934
+ dao.command("set-proposal-stuck-ms-v2 <n>").description("Set stuck threshold").action((n) => { setDaoProposalStuckMsV2(Number(n)); console.log(JSON.stringify({ daoProposalStuckMs: getDaoProposalStuckMsV2() }, null, 2)); });
935
+ dao.command("auto-pause-idle-orgs-v2").description("Auto-pause idle orgs").action(() => { console.log(JSON.stringify(autoPauseIdleDaoOrgsV2(), null, 2)); });
936
+ dao.command("auto-fail-stuck-proposals-v2").description("Auto-fail stuck voting proposals").action(() => { console.log(JSON.stringify(autoFailStuckDaoProposalsV2(), null, 2)); });
937
+ dao.command("gov-stats-v2").description("V2 governance aggregate stats").action(() => { console.log(JSON.stringify(getDaoGovernanceGovStatsV2(), null, 2)); });
938
+ }
939
+
@@ -616,4 +616,65 @@ export function registerDlpCommand(program) {
616
616
  process.exit(1);
617
617
  }
618
618
  });
619
+ registerDlpV2Command(dlp);
620
+ }
621
+
622
+
623
+ import {
624
+ DLP_POLICY_MATURITY_V2,
625
+ DLP_SCAN_LIFECYCLE_V2,
626
+ registerDlpPolicyV2,
627
+ activateDlpPolicyV2,
628
+ suspendDlpPolicyV2,
629
+ retireDlpPolicyV2,
630
+ touchDlpPolicyV2,
631
+ getDlpPolicyV2,
632
+ listDlpPoliciesV2,
633
+ createDlpScanV2,
634
+ startDlpScanV2,
635
+ completeDlpScanV2,
636
+ failDlpScanV2,
637
+ cancelDlpScanV2,
638
+ getDlpScanV2,
639
+ listDlpScansV2,
640
+ setMaxActiveDlpPoliciesPerOwnerV2,
641
+ getMaxActiveDlpPoliciesPerOwnerV2,
642
+ setMaxPendingDlpScansPerPolicyV2,
643
+ getMaxPendingDlpScansPerPolicyV2,
644
+ setDlpPolicyIdleMsV2,
645
+ getDlpPolicyIdleMsV2,
646
+ setDlpScanStuckMsV2,
647
+ getDlpScanStuckMsV2,
648
+ autoSuspendIdleDlpPoliciesV2,
649
+ autoFailStuckDlpScansV2,
650
+ getDlpEngineStatsV2,
651
+ } from "../lib/dlp-engine.js";
652
+
653
+ export function registerDlpV2Command(dlp) {
654
+ dlp.command("enums-v2").description("Show V2 governance enums").action(() => { console.log(JSON.stringify({ DLP_POLICY_MATURITY_V2, DLP_SCAN_LIFECYCLE_V2 }, null, 2)); });
655
+ dlp.command("register-policy-v2").description("Register a DLP policy profile (pending)")
656
+ .requiredOption("--id <id>").requiredOption("--owner <owner>").option("--classification <c>")
657
+ .action((o) => { console.log(JSON.stringify(registerDlpPolicyV2(o), null, 2)); });
658
+ dlp.command("activate-policy-v2 <id>").description("Activate policy").action((id) => { console.log(JSON.stringify(activateDlpPolicyV2(id), null, 2)); });
659
+ dlp.command("suspend-policy-v2 <id>").description("Suspend policy").action((id) => { console.log(JSON.stringify(suspendDlpPolicyV2(id), null, 2)); });
660
+ dlp.command("retire-policy-v2 <id>").description("Retire policy (terminal)").action((id) => { console.log(JSON.stringify(retireDlpPolicyV2(id), null, 2)); });
661
+ dlp.command("touch-policy-v2 <id>").description("Refresh lastTouchedAt").action((id) => { console.log(JSON.stringify(touchDlpPolicyV2(id), null, 2)); });
662
+ dlp.command("get-policy-v2 <id>").description("Get policy").action((id) => { console.log(JSON.stringify(getDlpPolicyV2(id), null, 2)); });
663
+ dlp.command("list-policies-v2").description("List policies").action(() => { console.log(JSON.stringify(listDlpPoliciesV2(), null, 2)); });
664
+ dlp.command("create-scan-v2").description("Create a DLP scan (queued)")
665
+ .requiredOption("--id <id>").requiredOption("--policy-id <policyId>").option("--target <target>")
666
+ .action((o) => { console.log(JSON.stringify(createDlpScanV2({ id: o.id, policyId: o.policyId, target: o.target }), null, 2)); });
667
+ dlp.command("start-scan-v2 <id>").description("Transition scan to scanning").action((id) => { console.log(JSON.stringify(startDlpScanV2(id), null, 2)); });
668
+ dlp.command("complete-scan-v2 <id>").description("Transition scan to completed").action((id) => { console.log(JSON.stringify(completeDlpScanV2(id), null, 2)); });
669
+ dlp.command("fail-scan-v2 <id>").description("Fail scan").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(failDlpScanV2(id, o.reason), null, 2)); });
670
+ dlp.command("cancel-scan-v2 <id>").description("Cancel scan").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(cancelDlpScanV2(id, o.reason), null, 2)); });
671
+ dlp.command("get-scan-v2 <id>").description("Get scan").action((id) => { console.log(JSON.stringify(getDlpScanV2(id), null, 2)); });
672
+ dlp.command("list-scans-v2").description("List scans").action(() => { console.log(JSON.stringify(listDlpScansV2(), null, 2)); });
673
+ dlp.command("set-max-active-policies-v2 <n>").description("Set per-owner active cap").action((n) => { setMaxActiveDlpPoliciesPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveDlpPoliciesPerOwner: getMaxActiveDlpPoliciesPerOwnerV2() }, null, 2)); });
674
+ dlp.command("set-max-pending-scans-v2 <n>").description("Set per-policy pending cap").action((n) => { setMaxPendingDlpScansPerPolicyV2(Number(n)); console.log(JSON.stringify({ maxPendingDlpScansPerPolicy: getMaxPendingDlpScansPerPolicyV2() }, null, 2)); });
675
+ dlp.command("set-policy-idle-ms-v2 <n>").description("Set idle threshold").action((n) => { setDlpPolicyIdleMsV2(Number(n)); console.log(JSON.stringify({ dlpPolicyIdleMs: getDlpPolicyIdleMsV2() }, null, 2)); });
676
+ dlp.command("set-scan-stuck-ms-v2 <n>").description("Set stuck threshold").action((n) => { setDlpScanStuckMsV2(Number(n)); console.log(JSON.stringify({ dlpScanStuckMs: getDlpScanStuckMsV2() }, null, 2)); });
677
+ dlp.command("auto-suspend-idle-policies-v2").description("Auto-suspend idle policies").action(() => { console.log(JSON.stringify(autoSuspendIdleDlpPoliciesV2(), null, 2)); });
678
+ dlp.command("auto-fail-stuck-scans-v2").description("Auto-fail stuck scanning scans").action(() => { console.log(JSON.stringify(autoFailStuckDlpScansV2(), null, 2)); });
679
+ dlp.command("gov-stats-v2").description("V2 governance aggregate stats").action(() => { console.log(JSON.stringify(getDlpEngineStatsV2(), null, 2)); });
619
680
  }