dart-decimate 0.0.1

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 (188) hide show
  1. package/Cargo.lock +572 -0
  2. package/Cargo.toml +41 -0
  3. package/LICENSE +21 -0
  4. package/README.md +617 -0
  5. package/assets/dart-decimate-banner.png +0 -0
  6. package/npm/bin/dart-decimate-mcp.js +48 -0
  7. package/npm/bin/dart-decimate.js +48 -0
  8. package/npm/scripts/postinstall.js +46 -0
  9. package/npm/scripts/test-npx-local.js +54 -0
  10. package/npm/scripts/test-npx-mcp-local.js +56 -0
  11. package/package.json +45 -0
  12. package/src/baseline.rs +643 -0
  13. package/src/bin/dart-decimate-mcp.rs +11 -0
  14. package/src/boundaries/tests.rs +60 -0
  15. package/src/boundaries.rs +317 -0
  16. package/src/changed_scope.rs +117 -0
  17. package/src/ci_template.rs +399 -0
  18. package/src/cli/analyze.rs +462 -0
  19. package/src/cli/analyzer_options.rs +82 -0
  20. package/src/cli/audit_run.rs +327 -0
  21. package/src/cli/boundary_args.rs +44 -0
  22. package/src/cli/ci_template_run.rs +196 -0
  23. package/src/cli/command_name.rs +20 -0
  24. package/src/cli/common_args.rs +167 -0
  25. package/src/cli/config_run.rs +78 -0
  26. package/src/cli/coverage_run.rs +393 -0
  27. package/src/cli/decision_surface_run.rs +99 -0
  28. package/src/cli/default_command.rs +69 -0
  29. package/src/cli/dupes_args.rs +150 -0
  30. package/src/cli/entry_points.rs +121 -0
  31. package/src/cli/error.rs +149 -0
  32. package/src/cli/error_output.rs +68 -0
  33. package/src/cli/explain_run.rs +72 -0
  34. package/src/cli/fix_run.rs +162 -0
  35. package/src/cli/flags_args.rs +23 -0
  36. package/src/cli/health_args.rs +200 -0
  37. package/src/cli/hooks_run.rs +191 -0
  38. package/src/cli/impact_run.rs +95 -0
  39. package/src/cli/init_run.rs +49 -0
  40. package/src/cli/inspect_args.rs +20 -0
  41. package/src/cli/inspect_run.rs +66 -0
  42. package/src/cli/issue_filter_args.rs +240 -0
  43. package/src/cli/list_run.rs +311 -0
  44. package/src/cli/mode_args.rs +72 -0
  45. package/src/cli/output_format.rs +62 -0
  46. package/src/cli/regression_args.rs +156 -0
  47. package/src/cli/request_args.rs +175 -0
  48. package/src/cli/schema_commands.rs +72 -0
  49. package/src/cli/scope_args.rs +174 -0
  50. package/src/cli/security_args.rs +175 -0
  51. package/src/cli/security_gate_run.rs +66 -0
  52. package/src/cli/security_summary_run.rs +43 -0
  53. package/src/cli/summary_args.rs +12 -0
  54. package/src/cli/tests.rs +516 -0
  55. package/src/cli/trace_args.rs +67 -0
  56. package/src/cli/trace_run.rs +131 -0
  57. package/src/cli/trace_tests.rs +235 -0
  58. package/src/cli/unsupported_run.rs +116 -0
  59. package/src/cli/watch_run.rs +153 -0
  60. package/src/cli.rs +603 -0
  61. package/src/config/boundary_config.rs +235 -0
  62. package/src/config/cache.rs +25 -0
  63. package/src/config/dependencies.rs +114 -0
  64. package/src/config/health.rs +237 -0
  65. package/src/config/jsonc.rs +66 -0
  66. package/src/config/policy.rs +91 -0
  67. package/src/config/rule_aliases.rs +487 -0
  68. package/src/config/rules.rs +339 -0
  69. package/src/config.rs +635 -0
  70. package/src/coverage.rs +469 -0
  71. package/src/dart_parser.rs +673 -0
  72. package/src/decision_surface.rs +405 -0
  73. package/src/dependencies/analyze.rs +218 -0
  74. package/src/dependencies/codegen.rs +118 -0
  75. package/src/dependencies/discovery.rs +60 -0
  76. package/src/dependencies/overrides.rs +76 -0
  77. package/src/dependencies/private_src_imports.rs +32 -0
  78. package/src/dependencies/pubspec_document.rs +86 -0
  79. package/src/dependencies/pubspec_entry.rs +96 -0
  80. package/src/dependencies/tests.rs +544 -0
  81. package/src/dependencies/usage.rs +33 -0
  82. package/src/dependencies.rs +553 -0
  83. package/src/dependency_scripts.rs +91 -0
  84. package/src/dupes/lex.rs +236 -0
  85. package/src/dupes/tests.rs +119 -0
  86. package/src/dupes.rs +625 -0
  87. package/src/explain.rs +692 -0
  88. package/src/extract/directives.rs +252 -0
  89. package/src/extract/error_tests.rs +25 -0
  90. package/src/extract/members.rs +210 -0
  91. package/src/extract/primary_constructors.rs +421 -0
  92. package/src/extract/references.rs +151 -0
  93. package/src/extract/routes.rs +691 -0
  94. package/src/extract/signatures.rs +266 -0
  95. package/src/extract/string_tests.rs +18 -0
  96. package/src/extract/strings.rs +107 -0
  97. package/src/extract/tests.rs +697 -0
  98. package/src/extract.rs +680 -0
  99. package/src/feature_flags/tests.rs +76 -0
  100. package/src/feature_flags.rs +453 -0
  101. package/src/finding_identity.rs +60 -0
  102. package/src/fix.rs +551 -0
  103. package/src/generated.rs +53 -0
  104. package/src/graph/augment_tests.rs +212 -0
  105. package/src/graph/conditionals.rs +74 -0
  106. package/src/graph/package_config_tests.rs +100 -0
  107. package/src/graph/parts.rs +248 -0
  108. package/src/graph/pubspec_tests.rs +119 -0
  109. package/src/graph/tests.rs +837 -0
  110. package/src/graph/uri_tests.rs +102 -0
  111. package/src/graph.rs +644 -0
  112. package/src/health/coverage.rs +309 -0
  113. package/src/health/ownership.rs +175 -0
  114. package/src/health/runtime_coverage.rs +616 -0
  115. package/src/health/runtime_intelligence.rs +511 -0
  116. package/src/health/scores.rs +296 -0
  117. package/src/health/tests.rs +240 -0
  118. package/src/health/threshold_types.rs +163 -0
  119. package/src/health/thresholds.rs +229 -0
  120. package/src/health/types.rs +636 -0
  121. package/src/health.rs +597 -0
  122. package/src/hooks/agent_settings.rs +175 -0
  123. package/src/hooks/templates.rs +51 -0
  124. package/src/hooks.rs +569 -0
  125. package/src/impact.rs +287 -0
  126. package/src/init.rs +237 -0
  127. package/src/inspect.rs +142 -0
  128. package/src/intelligence/tests.rs +232 -0
  129. package/src/intelligence.rs +305 -0
  130. package/src/lib.rs +198 -0
  131. package/src/main.rs +5 -0
  132. package/src/manifest/mcp.rs +565 -0
  133. package/src/manifest.rs +552 -0
  134. package/src/mcp/cli_args/value_args.rs +175 -0
  135. package/src/mcp/cli_args.rs +658 -0
  136. package/src/mcp/cli_args_tests.rs +522 -0
  137. package/src/mcp/code_execute.rs +671 -0
  138. package/src/mcp/tools.rs +660 -0
  139. package/src/mcp.rs +325 -0
  140. package/src/output/audit_risk.rs +135 -0
  141. package/src/output/dependency_findings.rs +327 -0
  142. package/src/output/duplication_findings.rs +114 -0
  143. package/src/output/feature_flag_findings.rs +122 -0
  144. package/src/output/format.rs +31 -0
  145. package/src/output/graph_findings.rs +461 -0
  146. package/src/output/health_findings.rs +612 -0
  147. package/src/output/human.rs +27 -0
  148. package/src/output/next_steps.rs +92 -0
  149. package/src/output/route_findings.rs +76 -0
  150. package/src/output/runtime_coverage.rs +515 -0
  151. package/src/output/scope.rs +183 -0
  152. package/src/output/security_findings.rs +390 -0
  153. package/src/output/security_sarif.rs +150 -0
  154. package/src/output/suppressions.rs +323 -0
  155. package/src/output/symbol_findings.rs +257 -0
  156. package/src/output/tests.rs +114 -0
  157. package/src/output/types.rs +604 -0
  158. package/src/output/widget_findings.rs +213 -0
  159. package/src/output.rs +682 -0
  160. package/src/package_map.rs +495 -0
  161. package/src/policy/packs.rs +232 -0
  162. package/src/policy/tests.rs +134 -0
  163. package/src/policy.rs +640 -0
  164. package/src/project_list.rs +376 -0
  165. package/src/report_schema/inventory.rs +418 -0
  166. package/src/report_schema.rs +488 -0
  167. package/src/routes.rs +354 -0
  168. package/src/scan/tests.rs +250 -0
  169. package/src/scan.rs +275 -0
  170. package/src/security/detect.rs +639 -0
  171. package/src/security/tests.rs +178 -0
  172. package/src/security.rs +373 -0
  173. package/src/security_gate.rs +555 -0
  174. package/src/symbols/path_filters.rs +27 -0
  175. package/src/symbols/private_type_leaks.rs +125 -0
  176. package/src/symbols/riverpod.rs +113 -0
  177. package/src/symbols/tests.rs +692 -0
  178. package/src/symbols.rs +693 -0
  179. package/src/trace/tests.rs +225 -0
  180. package/src/trace.rs +690 -0
  181. package/src/unsupported.rs +47 -0
  182. package/src/widgets/lifecycle.rs +484 -0
  183. package/src/widgets/params.rs +236 -0
  184. package/src/widgets/tests.rs +430 -0
  185. package/src/widgets/top_level.rs +110 -0
  186. package/src/widgets/unrendered.rs +374 -0
  187. package/src/widgets.rs +590 -0
  188. package/src/workspace_scope.rs +358 -0
@@ -0,0 +1,565 @@
1
+ use serde_json::{Value, json};
2
+
3
+ use crate::coverage::COVERAGE_ANALYSIS_SCHEMA_VERSION;
4
+ use crate::decision_surface::DECISION_SURFACE_SCHEMA_VERSION;
5
+ use crate::explain::EXPLAIN_SCHEMA_VERSION;
6
+ use crate::fix::FIX_SCHEMA_VERSION;
7
+ use crate::impact::IMPACT_SCHEMA_VERSION;
8
+ use crate::inspect::INSPECT_SCHEMA_VERSION;
9
+ use crate::mcp::code_execute::CODE_EXECUTE_SCHEMA_VERSION;
10
+ use crate::output::{SCHEMA_VERSION, TRACE_SCHEMA_VERSION};
11
+ use crate::project_list::PROJECT_LIST_SCHEMA_VERSION;
12
+
13
+ pub(super) fn mcp_tools() -> Value {
14
+ json!({
15
+ "server": "dart-decimate-mcp",
16
+ "note": "Agent tool contracts backed by existing Dart Decimate CLI commands. fix_apply is mutating and requires yes: true.",
17
+ "tools": mcp_tool_list()
18
+ })
19
+ }
20
+
21
+ fn mcp_tool_list() -> Vec<Value> {
22
+ let mut tools = Vec::new();
23
+ tools.extend(mcp_overview_tools());
24
+ tools.extend(mcp_trace_tools());
25
+ tools.extend(mcp_analysis_tools());
26
+ tools.extend(mcp_change_tools());
27
+ tools
28
+ }
29
+
30
+ fn mcp_overview_tools() -> Vec<Value> {
31
+ vec![
32
+ mcp_tool(
33
+ "code_execute",
34
+ "dart-decimate-mcp code_execute",
35
+ CODE_EXECUTE_SCHEMA_VERSION,
36
+ &["code", "max_steps", "max_tool_calls", "max_result_bytes"],
37
+ ),
38
+ analyze_mcp_tool(),
39
+ mcp_tool(
40
+ "check_changed",
41
+ "dart-decimate check --format json --changed-since",
42
+ SCHEMA_VERSION,
43
+ &[
44
+ "root",
45
+ "config",
46
+ "since",
47
+ "changed_since",
48
+ "baseline",
49
+ "regression_baseline",
50
+ "fail_on_regression",
51
+ "tolerance",
52
+ "production",
53
+ ],
54
+ ),
55
+ mcp_tool(
56
+ "project_info",
57
+ "dart-decimate list --format json",
58
+ PROJECT_LIST_SCHEMA_VERSION,
59
+ &[
60
+ "root",
61
+ "config",
62
+ "files",
63
+ "entry_points",
64
+ "plugins",
65
+ "boundaries",
66
+ "workspaces",
67
+ "entry",
68
+ "dart_platform",
69
+ "file",
70
+ "workspace",
71
+ "changed_workspaces",
72
+ "production",
73
+ ],
74
+ ),
75
+ mcp_tool(
76
+ "list_boundaries",
77
+ "dart-decimate list --format json --boundaries",
78
+ PROJECT_LIST_SCHEMA_VERSION,
79
+ &[
80
+ "root",
81
+ "config",
82
+ "entry",
83
+ "dart_platform",
84
+ "file",
85
+ "workspace",
86
+ "changed_workspaces",
87
+ "production",
88
+ ],
89
+ ),
90
+ mcp_tool(
91
+ "inspect_target",
92
+ "dart-decimate inspect --format json",
93
+ INSPECT_SCHEMA_VERSION,
94
+ &["root", "config", "target", "file", "symbol", "production"],
95
+ ),
96
+ ]
97
+ }
98
+
99
+ fn mcp_trace_tools() -> Vec<Value> {
100
+ vec![
101
+ mcp_tool(
102
+ "trace_file",
103
+ "dart-decimate trace-file --format json",
104
+ TRACE_SCHEMA_VERSION,
105
+ &["root", "config", "file"],
106
+ ),
107
+ mcp_tool(
108
+ "trace_export",
109
+ "dart-decimate trace-symbol --format json",
110
+ TRACE_SCHEMA_VERSION,
111
+ &["root", "config", "file", "symbol", "export_name"],
112
+ ),
113
+ mcp_tool(
114
+ "trace_dependency",
115
+ "dart-decimate trace-dependency --format json",
116
+ TRACE_SCHEMA_VERSION,
117
+ &["root", "config", "dependency", "package_name"],
118
+ ),
119
+ mcp_tool(
120
+ "trace_clone",
121
+ "dart-decimate trace-clone --format json",
122
+ TRACE_SCHEMA_VERSION,
123
+ &[
124
+ "root",
125
+ "config",
126
+ "fingerprint",
127
+ "file",
128
+ "line",
129
+ "mode",
130
+ "min_tokens",
131
+ "min_lines",
132
+ "min_occurrences",
133
+ "top",
134
+ "threshold",
135
+ "cross_language",
136
+ "skip_local",
137
+ "ignore_imports",
138
+ "no_ignore_imports",
139
+ ],
140
+ ),
141
+ ]
142
+ }
143
+
144
+ fn analyze_mcp_tool() -> Value {
145
+ mcp_tool(
146
+ "analyze",
147
+ "dart-decimate check --format json",
148
+ SCHEMA_VERSION,
149
+ &[
150
+ "root",
151
+ "config",
152
+ "issue_types",
153
+ "entry",
154
+ "dart_platform",
155
+ "file",
156
+ "workspace",
157
+ "changed_workspaces",
158
+ "changed_since",
159
+ "baseline",
160
+ "regression_baseline",
161
+ "fail_on_regression",
162
+ "tolerance",
163
+ "include_entry_exports",
164
+ "private_type_leaks",
165
+ "boundary",
166
+ "boundary_coverage",
167
+ "boundary_call",
168
+ "policy_pack",
169
+ "policy_violations",
170
+ "mode",
171
+ "min_tokens",
172
+ "min_lines",
173
+ "min_occurrences",
174
+ "top",
175
+ "threshold",
176
+ "cross_language",
177
+ "skip_local",
178
+ "ignore_imports",
179
+ "no_ignore_imports",
180
+ "max_cyclomatic",
181
+ "max_cognitive",
182
+ "max_crap",
183
+ "coverage",
184
+ "runtime_coverage",
185
+ "min_invocations_hot",
186
+ "min_observation_volume",
187
+ "low_traffic_threshold",
188
+ "coverage_gaps",
189
+ "file_scores",
190
+ "hotspots",
191
+ "targets",
192
+ "ownership",
193
+ "complexity_breakdown",
194
+ "min_score",
195
+ "production",
196
+ ],
197
+ )
198
+ }
199
+
200
+ fn mcp_analysis_tools() -> Vec<Value> {
201
+ let mut tools = vec![dupes_mcp_tool(), health_mcp_tool()];
202
+ tools.extend(runtime_mcp_tools());
203
+ tools.extend([
204
+ security_mcp_tool(),
205
+ feature_flags_mcp_tool(),
206
+ mcp_tool(
207
+ "impact",
208
+ "dart-decimate impact --format json --quiet",
209
+ IMPACT_SCHEMA_VERSION,
210
+ &["root"],
211
+ ),
212
+ mcp_tool(
213
+ "impact_all",
214
+ "dart-decimate impact --format json --quiet --all",
215
+ IMPACT_SCHEMA_VERSION,
216
+ &["sort", "limit"],
217
+ ),
218
+ ]);
219
+ tools
220
+ }
221
+
222
+ fn dupes_mcp_tool() -> Value {
223
+ mcp_tool(
224
+ "find_dupes",
225
+ "dart-decimate dupes --format json",
226
+ SCHEMA_VERSION,
227
+ &[
228
+ "root",
229
+ "config",
230
+ "entry",
231
+ "dart_platform",
232
+ "file",
233
+ "workspace",
234
+ "changed_workspaces",
235
+ "changed_since",
236
+ "baseline",
237
+ "regression_baseline",
238
+ "fail_on_regression",
239
+ "tolerance",
240
+ "production",
241
+ "mode",
242
+ "min_tokens",
243
+ "min_lines",
244
+ "min_occurrences",
245
+ "top",
246
+ "threshold",
247
+ "cross_language",
248
+ "skip_local",
249
+ "ignore_imports",
250
+ "no_ignore_imports",
251
+ ],
252
+ )
253
+ }
254
+
255
+ fn health_mcp_tool() -> Value {
256
+ mcp_tool(
257
+ "check_health",
258
+ "dart-decimate health --format json",
259
+ SCHEMA_VERSION,
260
+ &[
261
+ "root",
262
+ "config",
263
+ "entry",
264
+ "dart_platform",
265
+ "file",
266
+ "workspace",
267
+ "changed_workspaces",
268
+ "changed_since",
269
+ "baseline",
270
+ "regression_baseline",
271
+ "fail_on_regression",
272
+ "tolerance",
273
+ "production",
274
+ "max_cyclomatic",
275
+ "max_cognitive",
276
+ "max_crap",
277
+ "coverage",
278
+ "runtime_coverage",
279
+ "min_invocations_hot",
280
+ "min_observation_volume",
281
+ "low_traffic_threshold",
282
+ "coverage_gaps",
283
+ "file_scores",
284
+ "hotspots",
285
+ "targets",
286
+ "ownership",
287
+ "complexity_breakdown",
288
+ "min_score",
289
+ "top",
290
+ ],
291
+ )
292
+ }
293
+
294
+ fn runtime_mcp_tools() -> Vec<Value> {
295
+ vec![
296
+ runtime_mcp_tool(
297
+ "check_runtime_coverage",
298
+ &[
299
+ "root",
300
+ "config",
301
+ "coverage",
302
+ "min_invocations_hot",
303
+ "min_observation_volume",
304
+ "low_traffic_threshold",
305
+ "top",
306
+ "repo",
307
+ ],
308
+ ),
309
+ runtime_mcp_tool(
310
+ "get_hot_paths",
311
+ &["root", "config", "coverage", "min_invocations_hot", "top"],
312
+ ),
313
+ runtime_mcp_tool(
314
+ "get_blast_radius",
315
+ &[
316
+ "root",
317
+ "config",
318
+ "coverage",
319
+ "min_invocations_hot",
320
+ "min_observation_volume",
321
+ "low_traffic_threshold",
322
+ "top",
323
+ ],
324
+ ),
325
+ runtime_mcp_tool(
326
+ "get_importance",
327
+ &[
328
+ "root",
329
+ "config",
330
+ "coverage",
331
+ "min_invocations_hot",
332
+ "min_observation_volume",
333
+ "low_traffic_threshold",
334
+ "top",
335
+ ],
336
+ ),
337
+ runtime_mcp_tool(
338
+ "get_cleanup_candidates",
339
+ &[
340
+ "root",
341
+ "config",
342
+ "coverage",
343
+ "min_invocations_hot",
344
+ "min_observation_volume",
345
+ "low_traffic_threshold",
346
+ "top",
347
+ ],
348
+ ),
349
+ ]
350
+ }
351
+
352
+ fn security_mcp_tool() -> Value {
353
+ mcp_tool(
354
+ "security_candidates",
355
+ "dart-decimate security --format json",
356
+ SCHEMA_VERSION,
357
+ &[
358
+ "root",
359
+ "config",
360
+ "entry",
361
+ "dart_platform",
362
+ "file",
363
+ "workspace",
364
+ "changed_workspaces",
365
+ "changed_since",
366
+ "baseline",
367
+ "regression_baseline",
368
+ "fail_on_regression",
369
+ "tolerance",
370
+ "top",
371
+ "surface",
372
+ "production",
373
+ "gate",
374
+ "paths",
375
+ "diff_file",
376
+ "ci",
377
+ "fail_on_issues",
378
+ "summary",
379
+ ],
380
+ )
381
+ }
382
+
383
+ fn feature_flags_mcp_tool() -> Value {
384
+ mcp_tool(
385
+ "feature_flags",
386
+ "dart-decimate flags --format json",
387
+ SCHEMA_VERSION,
388
+ &[
389
+ "root",
390
+ "config",
391
+ "entry",
392
+ "dart_platform",
393
+ "file",
394
+ "workspace",
395
+ "changed_workspaces",
396
+ "changed_since",
397
+ "baseline",
398
+ "regression_baseline",
399
+ "fail_on_regression",
400
+ "tolerance",
401
+ "production",
402
+ "top",
403
+ ],
404
+ )
405
+ }
406
+
407
+ fn mcp_change_tools() -> Vec<Value> {
408
+ vec![
409
+ fix_preview_mcp_tool(),
410
+ fix_apply_mcp_tool(),
411
+ audit_mcp_tool(),
412
+ mcp_tool(
413
+ "decision_surface",
414
+ "dart-decimate decision-surface --format json",
415
+ DECISION_SURFACE_SCHEMA_VERSION,
416
+ &["root", "config", "base", "max_decisions"],
417
+ ),
418
+ mcp_tool(
419
+ "dart_decimate_explain",
420
+ "dart-decimate explain --format json",
421
+ EXPLAIN_SCHEMA_VERSION,
422
+ &["issue_type", "rule_id"],
423
+ ),
424
+ mcp_tool(
425
+ "fallow_explain",
426
+ "dart-decimate explain --format json",
427
+ EXPLAIN_SCHEMA_VERSION,
428
+ &["issue_type", "rule_id"],
429
+ ),
430
+ ]
431
+ }
432
+
433
+ fn fix_preview_mcp_tool() -> Value {
434
+ mcp_tool(
435
+ "fix_preview",
436
+ "dart-decimate fix --format json --dry-run",
437
+ FIX_SCHEMA_VERSION,
438
+ &[
439
+ "root",
440
+ "config",
441
+ "entry",
442
+ "dart_platform",
443
+ "file",
444
+ "workspace",
445
+ "changed_workspaces",
446
+ "changed_since",
447
+ "production",
448
+ "action",
449
+ "no_create_config",
450
+ ],
451
+ )
452
+ }
453
+
454
+ fn fix_apply_mcp_tool() -> Value {
455
+ mcp_write_tool(
456
+ "fix_apply",
457
+ "dart-decimate fix --format json --yes",
458
+ FIX_SCHEMA_VERSION,
459
+ &[
460
+ "root",
461
+ "config",
462
+ "entry",
463
+ "dart_platform",
464
+ "file",
465
+ "workspace",
466
+ "changed_workspaces",
467
+ "changed_since",
468
+ "production",
469
+ "action",
470
+ "no_create_config",
471
+ "yes",
472
+ ],
473
+ )
474
+ }
475
+
476
+ fn audit_mcp_tool() -> Value {
477
+ mcp_tool(
478
+ "audit",
479
+ "dart-decimate audit --format json",
480
+ SCHEMA_VERSION,
481
+ &[
482
+ "root",
483
+ "config",
484
+ "base",
485
+ "gate",
486
+ "entry",
487
+ "dart_platform",
488
+ "file",
489
+ "workspace",
490
+ "changed_workspaces",
491
+ "changed_since",
492
+ "include_entry_exports",
493
+ "private_type_leaks",
494
+ "boundary",
495
+ "boundary_coverage",
496
+ "boundary_call",
497
+ "policy_pack",
498
+ "policy_violations",
499
+ "mode",
500
+ "min_tokens",
501
+ "min_lines",
502
+ "min_occurrences",
503
+ "top",
504
+ "threshold",
505
+ "cross_language",
506
+ "skip_local",
507
+ "ignore_imports",
508
+ "no_ignore_imports",
509
+ "max_cyclomatic",
510
+ "max_cognitive",
511
+ "max_crap",
512
+ "coverage",
513
+ "runtime_coverage",
514
+ "min_invocations_hot",
515
+ "min_observation_volume",
516
+ "low_traffic_threshold",
517
+ "coverage_gaps",
518
+ "file_scores",
519
+ "hotspots",
520
+ "targets",
521
+ "ownership",
522
+ "complexity_breakdown",
523
+ "min_score",
524
+ "dead_code_baseline",
525
+ "health_baseline",
526
+ "dupes_baseline",
527
+ "production",
528
+ "brief",
529
+ "max_decisions",
530
+ ],
531
+ )
532
+ }
533
+
534
+ fn runtime_mcp_tool(name: &str, key_params: &[&str]) -> Value {
535
+ mcp_tool(
536
+ name,
537
+ "dart-decimate coverage analyze --format json",
538
+ COVERAGE_ANALYSIS_SCHEMA_VERSION,
539
+ key_params,
540
+ )
541
+ }
542
+
543
+ fn mcp_tool(name: &str, command: &str, schema: &str, key_params: &[&str]) -> Value {
544
+ mcp_tool_with_access(name, command, schema, key_params, true)
545
+ }
546
+
547
+ fn mcp_write_tool(name: &str, command: &str, schema: &str, key_params: &[&str]) -> Value {
548
+ mcp_tool_with_access(name, command, schema, key_params, false)
549
+ }
550
+
551
+ fn mcp_tool_with_access(
552
+ name: &str,
553
+ command: &str,
554
+ schema: &str,
555
+ key_params: &[&str],
556
+ read_only: bool,
557
+ ) -> Value {
558
+ json!({
559
+ "name": name,
560
+ "read_only": read_only,
561
+ "command": command,
562
+ "schema": schema,
563
+ "key_params": key_params
564
+ })
565
+ }