@opensip-cli/core 0.1.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 (604) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +31 -0
  4. package/dist/__tests__/config-resolution.test.d.ts +2 -0
  5. package/dist/__tests__/config-resolution.test.d.ts.map +1 -0
  6. package/dist/__tests__/config-resolution.test.js +94 -0
  7. package/dist/__tests__/config-resolution.test.js.map +1 -0
  8. package/dist/__tests__/public-api.test.d.ts +16 -0
  9. package/dist/__tests__/public-api.test.d.ts.map +1 -0
  10. package/dist/__tests__/public-api.test.js +209 -0
  11. package/dist/__tests__/public-api.test.js.map +1 -0
  12. package/dist/__tests__/signal-batch.test.d.ts +2 -0
  13. package/dist/__tests__/signal-batch.test.d.ts.map +1 -0
  14. package/dist/__tests__/signal-batch.test.js +39 -0
  15. package/dist/__tests__/signal-batch.test.js.map +1 -0
  16. package/dist/__tests__/signal-sink.test.d.ts +2 -0
  17. package/dist/__tests__/signal-sink.test.d.ts.map +1 -0
  18. package/dist/__tests__/signal-sink.test.js +25 -0
  19. package/dist/__tests__/signal-sink.test.js.map +1 -0
  20. package/dist/__tests__/strip-utils.test.d.ts +2 -0
  21. package/dist/__tests__/strip-utils.test.d.ts.map +1 -0
  22. package/dist/__tests__/strip-utils.test.js +397 -0
  23. package/dist/__tests__/strip-utils.test.js.map +1 -0
  24. package/dist/__tests__/text-tree.test.d.ts +2 -0
  25. package/dist/__tests__/text-tree.test.d.ts.map +1 -0
  26. package/dist/__tests__/text-tree.test.js +31 -0
  27. package/dist/__tests__/text-tree.test.js.map +1 -0
  28. package/dist/baseline/__tests__/fingerprint-strategy.test.d.ts +2 -0
  29. package/dist/baseline/__tests__/fingerprint-strategy.test.d.ts.map +1 -0
  30. package/dist/baseline/__tests__/fingerprint-strategy.test.js +69 -0
  31. package/dist/baseline/__tests__/fingerprint-strategy.test.js.map +1 -0
  32. package/dist/baseline/fingerprint-strategy.d.ts +70 -0
  33. package/dist/baseline/fingerprint-strategy.d.ts.map +1 -0
  34. package/dist/baseline/fingerprint-strategy.js +90 -0
  35. package/dist/baseline/fingerprint-strategy.js.map +1 -0
  36. package/dist/config-resolution.d.ts +27 -0
  37. package/dist/config-resolution.d.ts.map +1 -0
  38. package/dist/config-resolution.js +92 -0
  39. package/dist/config-resolution.js.map +1 -0
  40. package/dist/index.d.ts +81 -0
  41. package/dist/index.d.ts.map +1 -0
  42. package/dist/index.js +165 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/languages/__tests__/content-filter-dispatch.test.d.ts +2 -0
  45. package/dist/languages/__tests__/content-filter-dispatch.test.d.ts.map +1 -0
  46. package/dist/languages/__tests__/content-filter-dispatch.test.js +87 -0
  47. package/dist/languages/__tests__/content-filter-dispatch.test.js.map +1 -0
  48. package/dist/languages/__tests__/non-code-formats.test.d.ts +2 -0
  49. package/dist/languages/__tests__/non-code-formats.test.d.ts.map +1 -0
  50. package/dist/languages/__tests__/non-code-formats.test.js +31 -0
  51. package/dist/languages/__tests__/non-code-formats.test.js.map +1 -0
  52. package/dist/languages/__tests__/parse-cache.test.d.ts +2 -0
  53. package/dist/languages/__tests__/parse-cache.test.d.ts.map +1 -0
  54. package/dist/languages/__tests__/parse-cache.test.js +228 -0
  55. package/dist/languages/__tests__/parse-cache.test.js.map +1 -0
  56. package/dist/languages/__tests__/registry.test.d.ts +2 -0
  57. package/dist/languages/__tests__/registry.test.d.ts.map +1 -0
  58. package/dist/languages/__tests__/registry.test.js +193 -0
  59. package/dist/languages/__tests__/registry.test.js.map +1 -0
  60. package/dist/languages/__tests__/workspace-unit-contract.test.d.ts +2 -0
  61. package/dist/languages/__tests__/workspace-unit-contract.test.d.ts.map +1 -0
  62. package/dist/languages/__tests__/workspace-unit-contract.test.js +66 -0
  63. package/dist/languages/__tests__/workspace-unit-contract.test.js.map +1 -0
  64. package/dist/languages/adapter.d.ts +66 -0
  65. package/dist/languages/adapter.d.ts.map +1 -0
  66. package/dist/languages/adapter.js +2 -0
  67. package/dist/languages/adapter.js.map +1 -0
  68. package/dist/languages/content-filter-dispatch.d.ts +36 -0
  69. package/dist/languages/content-filter-dispatch.d.ts.map +1 -0
  70. package/dist/languages/content-filter-dispatch.js +75 -0
  71. package/dist/languages/content-filter-dispatch.js.map +1 -0
  72. package/dist/languages/generic-types.d.ts +22 -0
  73. package/dist/languages/generic-types.d.ts.map +1 -0
  74. package/dist/languages/generic-types.js +3 -0
  75. package/dist/languages/generic-types.js.map +1 -0
  76. package/dist/languages/index.d.ts +12 -0
  77. package/dist/languages/index.d.ts.map +1 -0
  78. package/dist/languages/index.js +7 -0
  79. package/dist/languages/index.js.map +1 -0
  80. package/dist/languages/non-code-formats.d.ts +37 -0
  81. package/dist/languages/non-code-formats.d.ts.map +1 -0
  82. package/dist/languages/non-code-formats.js +45 -0
  83. package/dist/languages/non-code-formats.js.map +1 -0
  84. package/dist/languages/parse-cache-class.d.ts +69 -0
  85. package/dist/languages/parse-cache-class.d.ts.map +1 -0
  86. package/dist/languages/parse-cache-class.js +135 -0
  87. package/dist/languages/parse-cache-class.js.map +1 -0
  88. package/dist/languages/parse-cache.d.ts +54 -0
  89. package/dist/languages/parse-cache.d.ts.map +1 -0
  90. package/dist/languages/parse-cache.js +88 -0
  91. package/dist/languages/parse-cache.js.map +1 -0
  92. package/dist/languages/registry.d.ts +35 -0
  93. package/dist/languages/registry.d.ts.map +1 -0
  94. package/dist/languages/registry.js +123 -0
  95. package/dist/languages/registry.js.map +1 -0
  96. package/dist/languages/strip-scanners.d.ts +170 -0
  97. package/dist/languages/strip-scanners.d.ts.map +1 -0
  98. package/dist/languages/strip-scanners.js +233 -0
  99. package/dist/languages/strip-scanners.js.map +1 -0
  100. package/dist/languages/strip-utils.d.ts +66 -0
  101. package/dist/languages/strip-utils.d.ts.map +1 -0
  102. package/dist/languages/strip-utils.js +88 -0
  103. package/dist/languages/strip-utils.js.map +1 -0
  104. package/dist/languages/text-tree.d.ts +44 -0
  105. package/dist/languages/text-tree.d.ts.map +1 -0
  106. package/dist/languages/text-tree.js +34 -0
  107. package/dist/languages/text-tree.js.map +1 -0
  108. package/dist/languages/workspace-unit.d.ts +18 -0
  109. package/dist/languages/workspace-unit.d.ts.map +1 -0
  110. package/dist/languages/workspace-unit.js +2 -0
  111. package/dist/languages/workspace-unit.js.map +1 -0
  112. package/dist/lib/__tests__/config-version.test.d.ts +12 -0
  113. package/dist/lib/__tests__/config-version.test.d.ts.map +1 -0
  114. package/dist/lib/__tests__/config-version.test.js +92 -0
  115. package/dist/lib/__tests__/config-version.test.js.map +1 -0
  116. package/dist/lib/__tests__/diagnostics-bus.test.d.ts +7 -0
  117. package/dist/lib/__tests__/diagnostics-bus.test.d.ts.map +1 -0
  118. package/dist/lib/__tests__/diagnostics-bus.test.js +44 -0
  119. package/dist/lib/__tests__/diagnostics-bus.test.js.map +1 -0
  120. package/dist/lib/__tests__/env-registry.test.d.ts +7 -0
  121. package/dist/lib/__tests__/env-registry.test.d.ts.map +1 -0
  122. package/dist/lib/__tests__/env-registry.test.js +82 -0
  123. package/dist/lib/__tests__/env-registry.test.js.map +1 -0
  124. package/dist/lib/__tests__/errors.test.d.ts +2 -0
  125. package/dist/lib/__tests__/errors.test.d.ts.map +1 -0
  126. package/dist/lib/__tests__/errors.test.js +218 -0
  127. package/dist/lib/__tests__/errors.test.js.map +1 -0
  128. package/dist/lib/__tests__/format.test.d.ts +2 -0
  129. package/dist/lib/__tests__/format.test.d.ts.map +1 -0
  130. package/dist/lib/__tests__/format.test.js +23 -0
  131. package/dist/lib/__tests__/format.test.js.map +1 -0
  132. package/dist/lib/__tests__/ids.test.d.ts +2 -0
  133. package/dist/lib/__tests__/ids.test.d.ts.map +1 -0
  134. package/dist/lib/__tests__/ids.test.js +80 -0
  135. package/dist/lib/__tests__/ids.test.js.map +1 -0
  136. package/dist/lib/__tests__/logger.test.d.ts +2 -0
  137. package/dist/lib/__tests__/logger.test.d.ts.map +1 -0
  138. package/dist/lib/__tests__/logger.test.js +284 -0
  139. package/dist/lib/__tests__/logger.test.js.map +1 -0
  140. package/dist/lib/__tests__/package-version.test.d.ts +2 -0
  141. package/dist/lib/__tests__/package-version.test.d.ts.map +1 -0
  142. package/dist/lib/__tests__/package-version.test.js +47 -0
  143. package/dist/lib/__tests__/package-version.test.js.map +1 -0
  144. package/dist/lib/__tests__/paths.test.d.ts +5 -0
  145. package/dist/lib/__tests__/paths.test.d.ts.map +1 -0
  146. package/dist/lib/__tests__/paths.test.js +59 -0
  147. package/dist/lib/__tests__/paths.test.js.map +1 -0
  148. package/dist/lib/__tests__/payload-version.test.d.ts +2 -0
  149. package/dist/lib/__tests__/payload-version.test.d.ts.map +1 -0
  150. package/dist/lib/__tests__/payload-version.test.js +35 -0
  151. package/dist/lib/__tests__/payload-version.test.js.map +1 -0
  152. package/dist/lib/__tests__/phantom-detect.test.d.ts +10 -0
  153. package/dist/lib/__tests__/phantom-detect.test.d.ts.map +1 -0
  154. package/dist/lib/__tests__/phantom-detect.test.js +84 -0
  155. package/dist/lib/__tests__/phantom-detect.test.js.map +1 -0
  156. package/dist/lib/__tests__/project-context.test.d.ts +10 -0
  157. package/dist/lib/__tests__/project-context.test.d.ts.map +1 -0
  158. package/dist/lib/__tests__/project-context.test.js +240 -0
  159. package/dist/lib/__tests__/project-context.test.js.map +1 -0
  160. package/dist/lib/__tests__/registry.test.d.ts +2 -0
  161. package/dist/lib/__tests__/registry.test.d.ts.map +1 -0
  162. package/dist/lib/__tests__/registry.test.js +333 -0
  163. package/dist/lib/__tests__/registry.test.js.map +1 -0
  164. package/dist/lib/__tests__/retry.test.d.ts +2 -0
  165. package/dist/lib/__tests__/retry.test.d.ts.map +1 -0
  166. package/dist/lib/__tests__/retry.test.js +71 -0
  167. package/dist/lib/__tests__/retry.test.js.map +1 -0
  168. package/dist/lib/__tests__/run-diagnostics.test.d.ts +9 -0
  169. package/dist/lib/__tests__/run-diagnostics.test.d.ts.map +1 -0
  170. package/dist/lib/__tests__/run-diagnostics.test.js +61 -0
  171. package/dist/lib/__tests__/run-diagnostics.test.js.map +1 -0
  172. package/dist/lib/__tests__/run-scope.test.d.ts +2 -0
  173. package/dist/lib/__tests__/run-scope.test.d.ts.map +1 -0
  174. package/dist/lib/__tests__/run-scope.test.js +202 -0
  175. package/dist/lib/__tests__/run-scope.test.js.map +1 -0
  176. package/dist/lib/__tests__/run-timer.test.d.ts +2 -0
  177. package/dist/lib/__tests__/run-timer.test.d.ts.map +1 -0
  178. package/dist/lib/__tests__/run-timer.test.js +152 -0
  179. package/dist/lib/__tests__/run-timer.test.js.map +1 -0
  180. package/dist/lib/__tests__/severity-policy.test.d.ts +6 -0
  181. package/dist/lib/__tests__/severity-policy.test.d.ts.map +1 -0
  182. package/dist/lib/__tests__/severity-policy.test.js +47 -0
  183. package/dist/lib/__tests__/severity-policy.test.js.map +1 -0
  184. package/dist/lib/__tests__/telemetry.test.d.ts +2 -0
  185. package/dist/lib/__tests__/telemetry.test.d.ts.map +1 -0
  186. package/dist/lib/__tests__/telemetry.test.js +212 -0
  187. package/dist/lib/__tests__/telemetry.test.js.map +1 -0
  188. package/dist/lib/__tests__/verdict-policy.test.d.ts +7 -0
  189. package/dist/lib/__tests__/verdict-policy.test.d.ts.map +1 -0
  190. package/dist/lib/__tests__/verdict-policy.test.js +91 -0
  191. package/dist/lib/__tests__/verdict-policy.test.js.map +1 -0
  192. package/dist/lib/__tests__/yaml.test.d.ts +6 -0
  193. package/dist/lib/__tests__/yaml.test.d.ts.map +1 -0
  194. package/dist/lib/__tests__/yaml.test.js +79 -0
  195. package/dist/lib/__tests__/yaml.test.js.map +1 -0
  196. package/dist/lib/config-version.d.ts +49 -0
  197. package/dist/lib/config-version.d.ts.map +1 -0
  198. package/dist/lib/config-version.js +56 -0
  199. package/dist/lib/config-version.js.map +1 -0
  200. package/dist/lib/diagnostics-bus.d.ts +48 -0
  201. package/dist/lib/diagnostics-bus.d.ts.map +1 -0
  202. package/dist/lib/diagnostics-bus.js +74 -0
  203. package/dist/lib/diagnostics-bus.js.map +1 -0
  204. package/dist/lib/env-registry.d.ts +108 -0
  205. package/dist/lib/env-registry.d.ts.map +1 -0
  206. package/dist/lib/env-registry.js +92 -0
  207. package/dist/lib/env-registry.js.map +1 -0
  208. package/dist/lib/errors.d.ts +132 -0
  209. package/dist/lib/errors.d.ts.map +1 -0
  210. package/dist/lib/errors.js +160 -0
  211. package/dist/lib/errors.js.map +1 -0
  212. package/dist/lib/execution/__tests__/execution.test.d.ts +7 -0
  213. package/dist/lib/execution/__tests__/execution.test.d.ts.map +1 -0
  214. package/dist/lib/execution/__tests__/execution.test.js +254 -0
  215. package/dist/lib/execution/__tests__/execution.test.js.map +1 -0
  216. package/dist/lib/execution/index.d.ts +15 -0
  217. package/dist/lib/execution/index.d.ts.map +1 -0
  218. package/dist/lib/execution/index.js +10 -0
  219. package/dist/lib/execution/index.js.map +1 -0
  220. package/dist/lib/execution/options.d.ts +32 -0
  221. package/dist/lib/execution/options.d.ts.map +1 -0
  222. package/dist/lib/execution/options.js +15 -0
  223. package/dist/lib/execution/options.js.map +1 -0
  224. package/dist/lib/execution/pipeline.d.ts +36 -0
  225. package/dist/lib/execution/pipeline.d.ts.map +1 -0
  226. package/dist/lib/execution/pipeline.js +38 -0
  227. package/dist/lib/execution/pipeline.js.map +1 -0
  228. package/dist/lib/execution/retry.d.ts +38 -0
  229. package/dist/lib/execution/retry.d.ts.map +1 -0
  230. package/dist/lib/execution/retry.js +56 -0
  231. package/dist/lib/execution/retry.js.map +1 -0
  232. package/dist/lib/execution/run-with-timeout.d.ts +46 -0
  233. package/dist/lib/execution/run-with-timeout.d.ts.map +1 -0
  234. package/dist/lib/execution/run-with-timeout.js +86 -0
  235. package/dist/lib/execution/run-with-timeout.js.map +1 -0
  236. package/dist/lib/execution/schedule.d.ts +62 -0
  237. package/dist/lib/execution/schedule.d.ts.map +1 -0
  238. package/dist/lib/execution/schedule.js +130 -0
  239. package/dist/lib/execution/schedule.js.map +1 -0
  240. package/dist/lib/format.d.ts +17 -0
  241. package/dist/lib/format.d.ts.map +1 -0
  242. package/dist/lib/format.js +26 -0
  243. package/dist/lib/format.js.map +1 -0
  244. package/dist/lib/ids.d.ts +13 -0
  245. package/dist/lib/ids.d.ts.map +1 -0
  246. package/dist/lib/ids.js +48 -0
  247. package/dist/lib/ids.js.map +1 -0
  248. package/dist/lib/logger.d.ts +166 -0
  249. package/dist/lib/logger.d.ts.map +1 -0
  250. package/dist/lib/logger.js +283 -0
  251. package/dist/lib/logger.js.map +1 -0
  252. package/dist/lib/package-version.d.ts +17 -0
  253. package/dist/lib/package-version.d.ts.map +1 -0
  254. package/dist/lib/package-version.js +52 -0
  255. package/dist/lib/package-version.js.map +1 -0
  256. package/dist/lib/paths.d.ts +139 -0
  257. package/dist/lib/paths.d.ts.map +1 -0
  258. package/dist/lib/paths.js +105 -0
  259. package/dist/lib/paths.js.map +1 -0
  260. package/dist/lib/payload-version.d.ts +15 -0
  261. package/dist/lib/payload-version.d.ts.map +1 -0
  262. package/dist/lib/payload-version.js +24 -0
  263. package/dist/lib/payload-version.js.map +1 -0
  264. package/dist/lib/phantom-detect.d.ts +21 -0
  265. package/dist/lib/phantom-detect.d.ts.map +1 -0
  266. package/dist/lib/phantom-detect.js +76 -0
  267. package/dist/lib/phantom-detect.js.map +1 -0
  268. package/dist/lib/project-context.d.ts +66 -0
  269. package/dist/lib/project-context.d.ts.map +1 -0
  270. package/dist/lib/project-context.js +112 -0
  271. package/dist/lib/project-context.js.map +1 -0
  272. package/dist/lib/recipe-id.d.ts +13 -0
  273. package/dist/lib/recipe-id.d.ts.map +1 -0
  274. package/dist/lib/recipe-id.js +15 -0
  275. package/dist/lib/recipe-id.js.map +1 -0
  276. package/dist/lib/registry.d.ts +98 -0
  277. package/dist/lib/registry.d.ts.map +1 -0
  278. package/dist/lib/registry.js +152 -0
  279. package/dist/lib/registry.js.map +1 -0
  280. package/dist/lib/retry.d.ts +26 -0
  281. package/dist/lib/retry.d.ts.map +1 -0
  282. package/dist/lib/retry.js +48 -0
  283. package/dist/lib/retry.js.map +1 -0
  284. package/dist/lib/run-diagnostics.d.ts +64 -0
  285. package/dist/lib/run-diagnostics.d.ts.map +1 -0
  286. package/dist/lib/run-diagnostics.js +25 -0
  287. package/dist/lib/run-diagnostics.js.map +1 -0
  288. package/dist/lib/run-scope.d.ts +167 -0
  289. package/dist/lib/run-scope.d.ts.map +1 -0
  290. package/dist/lib/run-scope.js +176 -0
  291. package/dist/lib/run-scope.js.map +1 -0
  292. package/dist/lib/run-timer.d.ts +82 -0
  293. package/dist/lib/run-timer.d.ts.map +1 -0
  294. package/dist/lib/run-timer.js +79 -0
  295. package/dist/lib/run-timer.js.map +1 -0
  296. package/dist/lib/scope-types.d.ts +172 -0
  297. package/dist/lib/scope-types.d.ts.map +1 -0
  298. package/dist/lib/scope-types.js +27 -0
  299. package/dist/lib/scope-types.js.map +1 -0
  300. package/dist/lib/severity-policy.d.ts +38 -0
  301. package/dist/lib/severity-policy.d.ts.map +1 -0
  302. package/dist/lib/severity-policy.js +44 -0
  303. package/dist/lib/severity-policy.js.map +1 -0
  304. package/dist/lib/telemetry.d.ts +93 -0
  305. package/dist/lib/telemetry.d.ts.map +1 -0
  306. package/dist/lib/telemetry.js +144 -0
  307. package/dist/lib/telemetry.js.map +1 -0
  308. package/dist/lib/ui-context.d.ts +34 -0
  309. package/dist/lib/ui-context.d.ts.map +1 -0
  310. package/dist/lib/ui-context.js +16 -0
  311. package/dist/lib/ui-context.js.map +1 -0
  312. package/dist/lib/verdict-policy.d.ts +71 -0
  313. package/dist/lib/verdict-policy.d.ts.map +1 -0
  314. package/dist/lib/verdict-policy.js +82 -0
  315. package/dist/lib/verdict-policy.js.map +1 -0
  316. package/dist/lib/yaml.d.ts +74 -0
  317. package/dist/lib/yaml.d.ts.map +1 -0
  318. package/dist/lib/yaml.js +118 -0
  319. package/dist/lib/yaml.js.map +1 -0
  320. package/dist/plugins/__tests__/as-if-external.test.d.ts +18 -0
  321. package/dist/plugins/__tests__/as-if-external.test.d.ts.map +1 -0
  322. package/dist/plugins/__tests__/as-if-external.test.js +159 -0
  323. package/dist/plugins/__tests__/as-if-external.test.js.map +1 -0
  324. package/dist/plugins/__tests__/authored-tool-discovery.test.d.ts +8 -0
  325. package/dist/plugins/__tests__/authored-tool-discovery.test.d.ts.map +1 -0
  326. package/dist/plugins/__tests__/authored-tool-discovery.test.js +97 -0
  327. package/dist/plugins/__tests__/authored-tool-discovery.test.js.map +1 -0
  328. package/dist/plugins/__tests__/capability-discovery.test.d.ts +2 -0
  329. package/dist/plugins/__tests__/capability-discovery.test.d.ts.map +1 -0
  330. package/dist/plugins/__tests__/capability-discovery.test.js +349 -0
  331. package/dist/plugins/__tests__/capability-discovery.test.js.map +1 -0
  332. package/dist/plugins/__tests__/capability-from-manifest.test.d.ts +2 -0
  333. package/dist/plugins/__tests__/capability-from-manifest.test.d.ts.map +1 -0
  334. package/dist/plugins/__tests__/capability-from-manifest.test.js +172 -0
  335. package/dist/plugins/__tests__/capability-from-manifest.test.js.map +1 -0
  336. package/dist/plugins/__tests__/capability-loader.test.d.ts +2 -0
  337. package/dist/plugins/__tests__/capability-loader.test.d.ts.map +1 -0
  338. package/dist/plugins/__tests__/capability-loader.test.js +122 -0
  339. package/dist/plugins/__tests__/capability-loader.test.js.map +1 -0
  340. package/dist/plugins/__tests__/capability-registry.test.d.ts +2 -0
  341. package/dist/plugins/__tests__/capability-registry.test.d.ts.map +1 -0
  342. package/dist/plugins/__tests__/capability-registry.test.js +185 -0
  343. package/dist/plugins/__tests__/capability-registry.test.js.map +1 -0
  344. package/dist/plugins/__tests__/discover.test.d.ts +2 -0
  345. package/dist/plugins/__tests__/discover.test.d.ts.map +1 -0
  346. package/dist/plugins/__tests__/discover.test.js +311 -0
  347. package/dist/plugins/__tests__/discover.test.js.map +1 -0
  348. package/dist/plugins/__tests__/loader.test.d.ts +2 -0
  349. package/dist/plugins/__tests__/loader.test.d.ts.map +1 -0
  350. package/dist/plugins/__tests__/loader.test.js +191 -0
  351. package/dist/plugins/__tests__/loader.test.js.map +1 -0
  352. package/dist/plugins/__tests__/manifest-discovery.test.d.ts +2 -0
  353. package/dist/plugins/__tests__/manifest-discovery.test.d.ts.map +1 -0
  354. package/dist/plugins/__tests__/manifest-discovery.test.js +132 -0
  355. package/dist/plugins/__tests__/manifest-discovery.test.js.map +1 -0
  356. package/dist/plugins/__tests__/manifest-loader.test.d.ts +2 -0
  357. package/dist/plugins/__tests__/manifest-loader.test.d.ts.map +1 -0
  358. package/dist/plugins/__tests__/manifest-loader.test.js +434 -0
  359. package/dist/plugins/__tests__/manifest-loader.test.js.map +1 -0
  360. package/dist/plugins/__tests__/marker-discovery.test.d.ts +2 -0
  361. package/dist/plugins/__tests__/marker-discovery.test.d.ts.map +1 -0
  362. package/dist/plugins/__tests__/marker-discovery.test.js +164 -0
  363. package/dist/plugins/__tests__/marker-discovery.test.js.map +1 -0
  364. package/dist/plugins/__tests__/node-modules-walk.test.d.ts +2 -0
  365. package/dist/plugins/__tests__/node-modules-walk.test.d.ts.map +1 -0
  366. package/dist/plugins/__tests__/node-modules-walk.test.js +76 -0
  367. package/dist/plugins/__tests__/node-modules-walk.test.js.map +1 -0
  368. package/dist/plugins/__tests__/package-entry.test.d.ts +9 -0
  369. package/dist/plugins/__tests__/package-entry.test.d.ts.map +1 -0
  370. package/dist/plugins/__tests__/package-entry.test.js +117 -0
  371. package/dist/plugins/__tests__/package-entry.test.js.map +1 -0
  372. package/dist/plugins/__tests__/recipe-loader.test.d.ts +2 -0
  373. package/dist/plugins/__tests__/recipe-loader.test.d.ts.map +1 -0
  374. package/dist/plugins/__tests__/recipe-loader.test.js +130 -0
  375. package/dist/plugins/__tests__/recipe-loader.test.js.map +1 -0
  376. package/dist/plugins/__tests__/scope-validation.test.d.ts +2 -0
  377. package/dist/plugins/__tests__/scope-validation.test.d.ts.map +1 -0
  378. package/dist/plugins/__tests__/scope-validation.test.js +68 -0
  379. package/dist/plugins/__tests__/scope-validation.test.js.map +1 -0
  380. package/dist/plugins/__tests__/single-core-guard.test.d.ts +10 -0
  381. package/dist/plugins/__tests__/single-core-guard.test.d.ts.map +1 -0
  382. package/dist/plugins/__tests__/single-core-guard.test.js +89 -0
  383. package/dist/plugins/__tests__/single-core-guard.test.js.map +1 -0
  384. package/dist/plugins/__tests__/tool-package-discovery.test.d.ts +2 -0
  385. package/dist/plugins/__tests__/tool-package-discovery.test.d.ts.map +1 -0
  386. package/dist/plugins/__tests__/tool-package-discovery.test.js +215 -0
  387. package/dist/plugins/__tests__/tool-package-discovery.test.js.map +1 -0
  388. package/dist/plugins/authored-tool-discovery.d.ts +45 -0
  389. package/dist/plugins/authored-tool-discovery.d.ts.map +1 -0
  390. package/dist/plugins/authored-tool-discovery.js +61 -0
  391. package/dist/plugins/authored-tool-discovery.js.map +1 -0
  392. package/dist/plugins/capability-discovery.d.ts +80 -0
  393. package/dist/plugins/capability-discovery.d.ts.map +1 -0
  394. package/dist/plugins/capability-discovery.js +278 -0
  395. package/dist/plugins/capability-discovery.js.map +1 -0
  396. package/dist/plugins/capability-loader.d.ts +50 -0
  397. package/dist/plugins/capability-loader.d.ts.map +1 -0
  398. package/dist/plugins/capability-loader.js +85 -0
  399. package/dist/plugins/capability-loader.js.map +1 -0
  400. package/dist/plugins/capability-registry.d.ts +169 -0
  401. package/dist/plugins/capability-registry.d.ts.map +1 -0
  402. package/dist/plugins/capability-registry.js +319 -0
  403. package/dist/plugins/capability-registry.js.map +1 -0
  404. package/dist/plugins/discover.d.ts +64 -0
  405. package/dist/plugins/discover.d.ts.map +1 -0
  406. package/dist/plugins/discover.js +303 -0
  407. package/dist/plugins/discover.js.map +1 -0
  408. package/dist/plugins/index.d.ts +37 -0
  409. package/dist/plugins/index.d.ts.map +1 -0
  410. package/dist/plugins/index.js +40 -0
  411. package/dist/plugins/index.js.map +1 -0
  412. package/dist/plugins/json-guards.d.ts +11 -0
  413. package/dist/plugins/json-guards.d.ts.map +1 -0
  414. package/dist/plugins/json-guards.js +15 -0
  415. package/dist/plugins/json-guards.js.map +1 -0
  416. package/dist/plugins/loader.d.ts +67 -0
  417. package/dist/plugins/loader.d.ts.map +1 -0
  418. package/dist/plugins/loader.js +137 -0
  419. package/dist/plugins/loader.js.map +1 -0
  420. package/dist/plugins/manifest-discovery.d.ts +28 -0
  421. package/dist/plugins/manifest-discovery.d.ts.map +1 -0
  422. package/dist/plugins/manifest-discovery.js +103 -0
  423. package/dist/plugins/manifest-discovery.js.map +1 -0
  424. package/dist/plugins/manifest-loader.d.ts +120 -0
  425. package/dist/plugins/manifest-loader.d.ts.map +1 -0
  426. package/dist/plugins/manifest-loader.js +410 -0
  427. package/dist/plugins/manifest-loader.js.map +1 -0
  428. package/dist/plugins/marker-discovery.d.ts +115 -0
  429. package/dist/plugins/marker-discovery.d.ts.map +1 -0
  430. package/dist/plugins/marker-discovery.js +172 -0
  431. package/dist/plugins/marker-discovery.js.map +1 -0
  432. package/dist/plugins/node-modules-walk.d.ts +61 -0
  433. package/dist/plugins/node-modules-walk.d.ts.map +1 -0
  434. package/dist/plugins/node-modules-walk.js +99 -0
  435. package/dist/plugins/node-modules-walk.js.map +1 -0
  436. package/dist/plugins/package-entry.d.ts +38 -0
  437. package/dist/plugins/package-entry.d.ts.map +1 -0
  438. package/dist/plugins/package-entry.js +86 -0
  439. package/dist/plugins/package-entry.js.map +1 -0
  440. package/dist/plugins/recipe-loader.d.ts +63 -0
  441. package/dist/plugins/recipe-loader.d.ts.map +1 -0
  442. package/dist/plugins/recipe-loader.js +67 -0
  443. package/dist/plugins/recipe-loader.js.map +1 -0
  444. package/dist/plugins/scope-validation.d.ts +35 -0
  445. package/dist/plugins/scope-validation.d.ts.map +1 -0
  446. package/dist/plugins/scope-validation.js +55 -0
  447. package/dist/plugins/scope-validation.js.map +1 -0
  448. package/dist/plugins/single-core-guard.d.ts +28 -0
  449. package/dist/plugins/single-core-guard.d.ts.map +1 -0
  450. package/dist/plugins/single-core-guard.js +69 -0
  451. package/dist/plugins/single-core-guard.js.map +1 -0
  452. package/dist/plugins/tool-package-discovery.d.ts +93 -0
  453. package/dist/plugins/tool-package-discovery.d.ts.map +1 -0
  454. package/dist/plugins/tool-package-discovery.js +118 -0
  455. package/dist/plugins/tool-package-discovery.js.map +1 -0
  456. package/dist/plugins/types.d.ts +78 -0
  457. package/dist/plugins/types.d.ts.map +1 -0
  458. package/dist/plugins/types.js +15 -0
  459. package/dist/plugins/types.js.map +1 -0
  460. package/dist/recipes/__tests__/registry.test.d.ts +2 -0
  461. package/dist/recipes/__tests__/registry.test.d.ts.map +1 -0
  462. package/dist/recipes/__tests__/registry.test.js +170 -0
  463. package/dist/recipes/__tests__/registry.test.js.map +1 -0
  464. package/dist/recipes/__tests__/selector.test.d.ts +20 -0
  465. package/dist/recipes/__tests__/selector.test.d.ts.map +1 -0
  466. package/dist/recipes/__tests__/selector.test.js +173 -0
  467. package/dist/recipes/__tests__/selector.test.js.map +1 -0
  468. package/dist/recipes/__tests__/unit-config.test.d.ts +7 -0
  469. package/dist/recipes/__tests__/unit-config.test.d.ts.map +1 -0
  470. package/dist/recipes/__tests__/unit-config.test.js +52 -0
  471. package/dist/recipes/__tests__/unit-config.test.js.map +1 -0
  472. package/dist/recipes/registry.d.ts +105 -0
  473. package/dist/recipes/registry.d.ts.map +1 -0
  474. package/dist/recipes/registry.js +141 -0
  475. package/dist/recipes/registry.js.map +1 -0
  476. package/dist/recipes/selector.d.ts +112 -0
  477. package/dist/recipes/selector.d.ts.map +1 -0
  478. package/dist/recipes/selector.js +134 -0
  479. package/dist/recipes/selector.js.map +1 -0
  480. package/dist/recipes/unit-config.d.ts +63 -0
  481. package/dist/recipes/unit-config.d.ts.map +1 -0
  482. package/dist/recipes/unit-config.js +68 -0
  483. package/dist/recipes/unit-config.js.map +1 -0
  484. package/dist/runtime/__tests__/in-process-transport.test.d.ts +6 -0
  485. package/dist/runtime/__tests__/in-process-transport.test.d.ts.map +1 -0
  486. package/dist/runtime/__tests__/in-process-transport.test.js +73 -0
  487. package/dist/runtime/__tests__/in-process-transport.test.js.map +1 -0
  488. package/dist/runtime/__tests__/subprocess-transport.test.d.ts +11 -0
  489. package/dist/runtime/__tests__/subprocess-transport.test.d.ts.map +1 -0
  490. package/dist/runtime/__tests__/subprocess-transport.test.js +118 -0
  491. package/dist/runtime/__tests__/subprocess-transport.test.js.map +1 -0
  492. package/dist/runtime/in-process-transport.d.ts +20 -0
  493. package/dist/runtime/in-process-transport.d.ts.map +1 -0
  494. package/dist/runtime/in-process-transport.js +49 -0
  495. package/dist/runtime/in-process-transport.js.map +1 -0
  496. package/dist/runtime/progress-transport.d.ts +73 -0
  497. package/dist/runtime/progress-transport.d.ts.map +1 -0
  498. package/dist/runtime/progress-transport.js +17 -0
  499. package/dist/runtime/progress-transport.js.map +1 -0
  500. package/dist/runtime/subprocess-transport.d.ts +43 -0
  501. package/dist/runtime/subprocess-transport.d.ts.map +1 -0
  502. package/dist/runtime/subprocess-transport.js +134 -0
  503. package/dist/runtime/subprocess-transport.js.map +1 -0
  504. package/dist/signals/comment-openers.d.ts +29 -0
  505. package/dist/signals/comment-openers.d.ts.map +1 -0
  506. package/dist/signals/comment-openers.js +41 -0
  507. package/dist/signals/comment-openers.js.map +1 -0
  508. package/dist/signals/comment-openers.test.d.ts +7 -0
  509. package/dist/signals/comment-openers.test.d.ts.map +1 -0
  510. package/dist/signals/comment-openers.test.js +41 -0
  511. package/dist/signals/comment-openers.test.js.map +1 -0
  512. package/dist/signals/create-signal-from-violation.d.ts +29 -0
  513. package/dist/signals/create-signal-from-violation.d.ts.map +1 -0
  514. package/dist/signals/create-signal-from-violation.js +29 -0
  515. package/dist/signals/create-signal-from-violation.js.map +1 -0
  516. package/dist/signals/signal-sink.d.ts +49 -0
  517. package/dist/signals/signal-sink.d.ts.map +1 -0
  518. package/dist/signals/signal-sink.js +6 -0
  519. package/dist/signals/signal-sink.js.map +1 -0
  520. package/dist/signals/suppress.d.ts +102 -0
  521. package/dist/signals/suppress.d.ts.map +1 -0
  522. package/dist/signals/suppress.js +325 -0
  523. package/dist/signals/suppress.js.map +1 -0
  524. package/dist/signals/suppress.test.d.ts +2 -0
  525. package/dist/signals/suppress.test.d.ts.map +1 -0
  526. package/dist/signals/suppress.test.js +213 -0
  527. package/dist/signals/suppress.test.js.map +1 -0
  528. package/dist/tools/__tests__/command-spec.test.d.ts +2 -0
  529. package/dist/tools/__tests__/command-spec.test.d.ts.map +1 -0
  530. package/dist/tools/__tests__/command-spec.test.js +191 -0
  531. package/dist/tools/__tests__/command-spec.test.js.map +1 -0
  532. package/dist/tools/__tests__/compatibility.test.d.ts +5 -0
  533. package/dist/tools/__tests__/compatibility.test.d.ts.map +1 -0
  534. package/dist/tools/__tests__/compatibility.test.js +41 -0
  535. package/dist/tools/__tests__/compatibility.test.js.map +1 -0
  536. package/dist/tools/__tests__/ids.test.d.ts +5 -0
  537. package/dist/tools/__tests__/ids.test.d.ts.map +1 -0
  538. package/dist/tools/__tests__/ids.test.js +56 -0
  539. package/dist/tools/__tests__/ids.test.js.map +1 -0
  540. package/dist/tools/__tests__/manifest-assert.test.d.ts +5 -0
  541. package/dist/tools/__tests__/manifest-assert.test.d.ts.map +1 -0
  542. package/dist/tools/__tests__/manifest-assert.test.js +66 -0
  543. package/dist/tools/__tests__/manifest-assert.test.js.map +1 -0
  544. package/dist/tools/__tests__/registry.test.d.ts +2 -0
  545. package/dist/tools/__tests__/registry.test.d.ts.map +1 -0
  546. package/dist/tools/__tests__/registry.test.js +93 -0
  547. package/dist/tools/__tests__/registry.test.js.map +1 -0
  548. package/dist/tools/__tests__/types.test.d.ts +2 -0
  549. package/dist/tools/__tests__/types.test.d.ts.map +1 -0
  550. package/dist/tools/__tests__/types.test.js +51 -0
  551. package/dist/tools/__tests__/types.test.js.map +1 -0
  552. package/dist/tools/capability.d.ts +257 -0
  553. package/dist/tools/capability.d.ts.map +1 -0
  554. package/dist/tools/capability.js +46 -0
  555. package/dist/tools/capability.js.map +1 -0
  556. package/dist/tools/command-spec.d.ts +211 -0
  557. package/dist/tools/command-spec.d.ts.map +1 -0
  558. package/dist/tools/command-spec.js +110 -0
  559. package/dist/tools/command-spec.js.map +1 -0
  560. package/dist/tools/compatibility.d.ts +45 -0
  561. package/dist/tools/compatibility.d.ts.map +1 -0
  562. package/dist/tools/compatibility.js +49 -0
  563. package/dist/tools/compatibility.js.map +1 -0
  564. package/dist/tools/ids.d.ts +61 -0
  565. package/dist/tools/ids.d.ts.map +1 -0
  566. package/dist/tools/ids.js +61 -0
  567. package/dist/tools/ids.js.map +1 -0
  568. package/dist/tools/index.d.ts +22 -0
  569. package/dist/tools/index.d.ts.map +1 -0
  570. package/dist/tools/index.js +28 -0
  571. package/dist/tools/index.js.map +1 -0
  572. package/dist/tools/manifest-assert.d.ts +35 -0
  573. package/dist/tools/manifest-assert.d.ts.map +1 -0
  574. package/dist/tools/manifest-assert.js +67 -0
  575. package/dist/tools/manifest-assert.js.map +1 -0
  576. package/dist/tools/manifest.d.ts +178 -0
  577. package/dist/tools/manifest.d.ts.map +1 -0
  578. package/dist/tools/manifest.js +35 -0
  579. package/dist/tools/manifest.js.map +1 -0
  580. package/dist/tools/registry.d.ts +37 -0
  581. package/dist/tools/registry.d.ts.map +1 -0
  582. package/dist/tools/registry.js +49 -0
  583. package/dist/tools/registry.js.map +1 -0
  584. package/dist/tools/types.d.ts +1021 -0
  585. package/dist/tools/types.d.ts.map +1 -0
  586. package/dist/tools/types.js +77 -0
  587. package/dist/tools/types.js.map +1 -0
  588. package/dist/types/__tests__/signal.test.d.ts +2 -0
  589. package/dist/types/__tests__/signal.test.d.ts.map +1 -0
  590. package/dist/types/__tests__/signal.test.js +111 -0
  591. package/dist/types/__tests__/signal.test.js.map +1 -0
  592. package/dist/types/index.d.ts +5 -0
  593. package/dist/types/index.d.ts.map +1 -0
  594. package/dist/types/index.js +3 -0
  595. package/dist/types/index.js.map +1 -0
  596. package/dist/types/signal-batch.d.ts +56 -0
  597. package/dist/types/signal-batch.d.ts.map +1 -0
  598. package/dist/types/signal-batch.js +54 -0
  599. package/dist/types/signal-batch.js.map +1 -0
  600. package/dist/types/signal.d.ts +77 -0
  601. package/dist/types/signal.d.ts.map +1 -0
  602. package/dist/types/signal.js +42 -0
  603. package/dist/types/signal.js.map +1 -0
  604. package/package.json +57 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-cache-class.js","sourceRoot":"","sources":["../../src/languages/parse-cache-class.ts"],"names":[],"mappings":"AAAA,gJAAgJ;AAChJ;;;;;;;;;GASG;AAIH,oEAAoE;AACpE,sEAAsE;AACtE,sEAAsE;AACtE,qEAAqE;AACrE,8DAA8D;AAC9D,MAAM,aAAa,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAErC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,+EAA+E;IAC/E,uDAAuD;IACvD,MAAM,UAAU,GAAG,mBAA0B,CAAC;IAC9C,MAAM,SAAS,GAAG,cAAmB,CAAC;IAEtC,IAAI,IAAI,GAAG,UAAU,CAAC;IACtB,6EAA6E;IAC7E,2EAA2E;IAC3E,oFAAoF;IACpF,2EAA2E;IAC3E,6EAA6E;IAC7E,8BAA8B;IAC9B,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC;QACnB,IAAI,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,mBAA0B,CAAC,CAAC,kBAAkB;IAC5E,CAAC;IACD,0EAA0E;IAC1E,8EAA8E;IAC9E,4EAA4E;IAC5E,OAAO,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;AAC9D,CAAC;AAED;;;;;;;;;;;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K;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;IAED;;;;;OAKG;IACH,OAAO;QACL,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAClC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @fileoverview Language-aware parse cache — scope-owned helpers.
3
+ *
4
+ * The `LanguageParseCache` class definition lives in `parse-cache-class.ts`
5
+ * so `RunScope` (which holds a `LanguageParseCache` field) and this module
6
+ * (which reads `currentScope()`) don't form an import cycle.
7
+ *
8
+ * The `initParseCache` / `clearParseCache` / `getParseTree` helpers operate on
9
+ * the CURRENT RunScope's `parseCache` (`currentScope().parseCache`), NOT a
10
+ * module-level singleton. This is the scope-isolation fix (audit F2): two
11
+ * concurrent fit runs (different scopes) carry independent parse caches, and no
12
+ * process-global cache leaks state between runs or survives a run's teardown.
13
+ * Outside a `RunScope`, `initParseCache`/`clearParseCache` are no-ops and
14
+ * `getParseTree` falls back to a direct, uncached parse (single-check mode).
15
+ *
16
+ * The `LanguageParseCache` class is still exported for `RunScope` (which
17
+ * constructs the per-run instance) and for tests/tools that want an isolated
18
+ * cache.
19
+ */
20
+ import type { LanguageAdapter } from './adapter.js';
21
+ export { LanguageParseCache } from './parse-cache-class.js';
22
+ /**
23
+ * Called by FitnessRecipeService before check execution. Clears any stale
24
+ * entries on the current scope's parse cache and arms its auto-clear timer.
25
+ * No-op outside a RunScope.
26
+ */
27
+ export declare function initParseCache(): void;
28
+ /**
29
+ * Called by FitnessRecipeService after check execution completes. Clears the
30
+ * current scope's parse cache and stops its auto-clear timer. No-op outside a
31
+ * RunScope — the scope itself disposes its cache on teardown.
32
+ */
33
+ export declare function clearParseCache(): void;
34
+ /**
35
+ * Get or parse the file under the given adapter, using the CURRENT scope's
36
+ * parse cache. Falls back to a direct (uncached) parse when there is no active
37
+ * scope (single-check mode).
38
+ *
39
+ * Generic over TTree so call sites that already know the language (e.g.
40
+ * lang-typescript callers passing the TS adapter) get back ts.SourceFile
41
+ * rather than unknown.
42
+ */
43
+ export declare function getParseTree<TTree>(adapter: LanguageAdapter<TTree>, filePath: string, content: string): TTree | null;
44
+ /**
45
+ * Convenience: resolve the adapter for the file via the current scope's
46
+ * language registry, then parse. Returns null when no adapter is
47
+ * registered for the extension. Throws when called outside runWithScope —
48
+ * engine work must run inside a RunScope so adapters resolve via
49
+ * cli.scope.languages.
50
+ *
51
+ * @throws {Error} When called outside a `runWithScope(...)` block (no current scope).
52
+ */
53
+ export declare function getParseTreeForFile(filePath: string, content: string): unknown;
54
+ //# sourceMappingURL=parse-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-cache.d.ts","sourceRoot":"","sources":["../../src/languages/parse-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAM5D;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAKrC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAChC,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,KAAK,GAAG,IAAI,CAMd;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAkB9E"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * @fileoverview Language-aware parse cache — scope-owned helpers.
3
+ *
4
+ * The `LanguageParseCache` class definition lives in `parse-cache-class.ts`
5
+ * so `RunScope` (which holds a `LanguageParseCache` field) and this module
6
+ * (which reads `currentScope()`) don't form an import cycle.
7
+ *
8
+ * The `initParseCache` / `clearParseCache` / `getParseTree` helpers operate on
9
+ * the CURRENT RunScope's `parseCache` (`currentScope().parseCache`), NOT a
10
+ * module-level singleton. This is the scope-isolation fix (audit F2): two
11
+ * concurrent fit runs (different scopes) carry independent parse caches, and no
12
+ * process-global cache leaks state between runs or survives a run's teardown.
13
+ * Outside a `RunScope`, `initParseCache`/`clearParseCache` are no-ops and
14
+ * `getParseTree` falls back to a direct, uncached parse (single-check mode).
15
+ *
16
+ * The `LanguageParseCache` class is still exported for `RunScope` (which
17
+ * constructs the per-run instance) and for tests/tools that want an isolated
18
+ * cache.
19
+ */
20
+ import { logger } from '../lib/logger.js';
21
+ import { currentScope } from '../lib/run-scope.js';
22
+ export { LanguageParseCache } from './parse-cache-class.js';
23
+ // =============================================================================
24
+ // SCOPE-OWNED PARSE-CACHE HELPERS
25
+ // =============================================================================
26
+ /**
27
+ * Called by FitnessRecipeService before check execution. Clears any stale
28
+ * entries on the current scope's parse cache and arms its auto-clear timer.
29
+ * No-op outside a RunScope.
30
+ */
31
+ export function initParseCache() {
32
+ const cache = currentScope()?.parseCache;
33
+ if (!cache)
34
+ return;
35
+ cache.clear();
36
+ cache.startAutoClear();
37
+ }
38
+ /**
39
+ * Called by FitnessRecipeService after check execution completes. Clears the
40
+ * current scope's parse cache and stops its auto-clear timer. No-op outside a
41
+ * RunScope — the scope itself disposes its cache on teardown.
42
+ */
43
+ export function clearParseCache() {
44
+ currentScope()?.parseCache.dispose();
45
+ }
46
+ /**
47
+ * Get or parse the file under the given adapter, using the CURRENT scope's
48
+ * parse cache. Falls back to a direct (uncached) parse when there is no active
49
+ * scope (single-check mode).
50
+ *
51
+ * Generic over TTree so call sites that already know the language (e.g.
52
+ * lang-typescript callers passing the TS adapter) get back ts.SourceFile
53
+ * rather than unknown.
54
+ */
55
+ export function getParseTree(adapter, filePath, content) {
56
+ const cache = currentScope()?.parseCache;
57
+ if (cache) {
58
+ return cache.getOrParse(adapter, filePath, content);
59
+ }
60
+ return adapter.parse(content, filePath);
61
+ }
62
+ /**
63
+ * Convenience: resolve the adapter for the file via the current scope's
64
+ * language registry, then parse. Returns null when no adapter is
65
+ * registered for the extension. Throws when called outside runWithScope —
66
+ * engine work must run inside a RunScope so adapters resolve via
67
+ * cli.scope.languages.
68
+ *
69
+ * @throws {Error} When called outside a `runWithScope(...)` block (no current scope).
70
+ */
71
+ export function getParseTreeForFile(filePath, content) {
72
+ const scope = currentScope();
73
+ if (!scope) {
74
+ throw new Error('getParseTreeForFile() called outside runWithScope. ' +
75
+ 'Engine work must run inside a RunScope so language adapters resolve via cli.scope.languages.');
76
+ }
77
+ const adapter = scope.languages.forFile(filePath);
78
+ if (!adapter) {
79
+ logger.debug({
80
+ evt: 'lang.parse.no-adapter',
81
+ module: 'core:languages',
82
+ filePath,
83
+ });
84
+ return null;
85
+ }
86
+ return getParseTree(adapter, filePath, content);
87
+ }
88
+ //# sourceMappingURL=parse-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-cache.js","sourceRoot":"","sources":["../../src/languages/parse-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,gFAAgF;AAChF,kCAAkC;AAClC,gFAAgF;AAEhF;;;;GAIG;AACH,M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apter } from './adapter.js';
2
+ /** Per-run registry of language adapters, indexed by id and file extension. */
3
+ export declare class LanguageRegistry {
4
+ private readonly inner;
5
+ private readonly byExtension;
6
+ /**
7
+ * Alias → canonical id index. Populated alongside the inner registry
8
+ * during `register`. Lets `canonicalize` map an alias like `'c'` or
9
+ * `'rs'` back to the registered adapter id (`'cpp'`, `'rust'`).
10
+ */
11
+ private readonly aliasIndex;
12
+ register(adapter: LanguageAdapter): void;
13
+ private indexExtensions;
14
+ private indexAliases;
15
+ get(id: string): LanguageAdapter | undefined;
16
+ forFile(filePath: string): LanguageAdapter | undefined;
17
+ /**
18
+ * Resolve a language id or alias to its canonical adapter id.
19
+ *
20
+ * - For a registered canonical id (e.g. `'cpp'`), returns the same id.
21
+ * - For a registered alias (e.g. `'c'`, `'rs'`, `'golang'`, `'py'`),
22
+ * returns the canonical id (`'cpp'`, `'rust'`, `'go'`, `'python'`).
23
+ * - Returns `undefined` for unknown languages.
24
+ *
25
+ * Use this anywhere two pieces of code compare language strings —
26
+ * scope-matching, target-language sets — so a config written with
27
+ * `languages: ['c']` matches a check scoped to `cpp`.
28
+ */
29
+ canonicalize(idOrAlias: string): string | undefined;
30
+ list(): readonly LanguageAdapter[];
31
+ has(id: string): boolean;
32
+ get size(): number;
33
+ clear(): void;
34
+ }
35
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/languages/registry.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAoBpD,+EAA+E;AAC/E,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAInB;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IAExD,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAUxC,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,YAAY;IAkCpB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAI5C,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAMtD;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAMnD,IAAI,IAAI,SAAS,eAAe,EAAE;IAIlC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,KAAK,IAAI,IAAI;CAKd"}
@@ -0,0 +1,123 @@
1
+ // @fitness-ignore-file batch-operation-limits -- iterates bounded collections (registered language adapters and the small file-extension lookup map)
2
+ import { extname } from 'node:path';
3
+ import { logger } from '../lib/logger.js';
4
+ import { Registry } from '../lib/registry.js';
5
+ /** Per-run registry of language adapters, indexed by id and file extension. */
6
+ export class LanguageRegistry {
7
+ inner = new Registry({
8
+ module: 'core:languages',
9
+ duplicatePolicy: 'warn-first-wins',
10
+ evtPrefix: 'lang.registry',
11
+ });
12
+ byExtension = new Map();
13
+ /**
14
+ * Alias → canonical id index. Populated alongside the inner registry
15
+ * during `register`. Lets `canonicalize` map an alias like `'c'` or
16
+ * `'rs'` back to the registered adapter id (`'cpp'`, `'rust'`).
17
+ */
18
+ aliasIndex = new Map();
19
+ register(adapter) {
20
+ const isDuplicate = this.inner.getById(adapter.id) !== undefined;
21
+ // Inner registry emits the structured warn event on duplicate;
22
+ // it returns silently after the warn (warn-first-wins policy).
23
+ this.inner.register({ id: adapter.id, name: adapter.id, adapter });
24
+ if (isDuplicate)
25
+ return;
26
+ this.indexExtensions(adapter);
27
+ this.indexAliases(adapter);
28
+ }
29
+ indexExtensions(adapter) {
30
+ for (const ext of adapter.fileExtensions) {
31
+ const normalized = ext.toLowerCase();
32
+ const existing = this.byExtension.get(normalized);
33
+ if (existing && existing.id !== adapter.id) {
34
+ logger.warn({
35
+ evt: 'lang.registry.extension.collision',
36
+ module: 'core:languages',
37
+ extension: normalized,
38
+ incumbent: existing.id,
39
+ challenger: adapter.id,
40
+ msg: `Extension ${normalized} already claimed by ${existing.id} — keeping incumbent`,
41
+ });
42
+ continue;
43
+ }
44
+ this.byExtension.set(normalized, adapter);
45
+ }
46
+ }
47
+ indexAliases(adapter) {
48
+ if (!adapter.aliases)
49
+ return;
50
+ for (const alias of adapter.aliases) {
51
+ const normalized = alias.toLowerCase();
52
+ // An alias that collides with another adapter's canonical id is
53
+ // ignored — the canonical id always wins. Same for an alias
54
+ // already claimed by a previously-registered adapter.
55
+ if (this.inner.getById(normalized) && normalized !== adapter.id) {
56
+ logger.warn({
57
+ evt: 'lang.registry.alias.collision',
58
+ module: 'core:languages',
59
+ alias: normalized,
60
+ incumbent: normalized,
61
+ challenger: adapter.id,
62
+ msg: `Alias ${normalized} already used as a canonical id — ignoring on ${adapter.id}`,
63
+ });
64
+ continue;
65
+ }
66
+ const existing = this.aliasIndex.get(normalized);
67
+ if (existing && existing !== adapter.id) {
68
+ logger.warn({
69
+ evt: 'lang.registry.alias.collision',
70
+ module: 'core:languages',
71
+ alias: normalized,
72
+ incumbent: existing,
73
+ challenger: adapter.id,
74
+ msg: `Alias ${normalized} already claimed by ${existing} — keeping incumbent`,
75
+ });
76
+ continue;
77
+ }
78
+ this.aliasIndex.set(normalized, adapter.id);
79
+ }
80
+ }
81
+ get(id) {
82
+ return this.inner.getById(id)?.adapter;
83
+ }
84
+ forFile(filePath) {
85
+ const ext = extname(filePath).toLowerCase();
86
+ if (!ext)
87
+ return undefined;
88
+ return this.byExtension.get(ext);
89
+ }
90
+ /**
91
+ * Resolve a language id or alias to its canonical adapter id.
92
+ *
93
+ * - For a registered canonical id (e.g. `'cpp'`), returns the same id.
94
+ * - For a registered alias (e.g. `'c'`, `'rs'`, `'golang'`, `'py'`),
95
+ * returns the canonical id (`'cpp'`, `'rust'`, `'go'`, `'python'`).
96
+ * - Returns `undefined` for unknown languages.
97
+ *
98
+ * Use this anywhere two pieces of code compare language strings —
99
+ * scope-matching, target-language sets — so a config written with
100
+ * `languages: ['c']` matches a check scoped to `cpp`.
101
+ */
102
+ canonicalize(idOrAlias) {
103
+ const normalized = idOrAlias.toLowerCase();
104
+ if (this.inner.getById(normalized))
105
+ return normalized;
106
+ return this.aliasIndex.get(normalized);
107
+ }
108
+ list() {
109
+ return this.inner.getAll().map((r) => r.adapter);
110
+ }
111
+ has(id) {
112
+ return this.inner.getById(id) !== undefined;
113
+ }
114
+ get size() {
115
+ return this.inner.size;
116
+ }
117
+ clear() {
118
+ this.inner.clear();
119
+ this.byExtension.clear();
120
+ this.aliasIndex.clear();
121
+ }
122
+ }
123
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/languages/registry.ts"],"names":[],"mappings":"AAAA,qJAAqJ;AACrJ,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AAsBjE,+EAA+E;AAC/E,MAAM,OAAO,gBAAgB;IACV,KAAK,GAAG,IAAI,QAAQ,CAA8B;QACjE,MAAM,EAAE,gBAAgB;QACxB,eAAe,EAAE,iBAAiB;QAClC,SAAS,EAAE,eAAe;KAC3B,CAAC,CAAC;IACc,WAAW,GAAG,IAAI,GAAG,EAA2B,CAAC;IAClE;;;;OAIG;IACc,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;IAExD,QAAQ,CAAC,OAAwB;QAC/B,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC;QACjE,+DAA+D;QAC/D,+DAA+D;QAC/D,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,O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,UAAU,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;QAC3C,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;YAAE,OAAO,UAAU,CAAC;QACtD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC;IAC9C,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;CACF"}
@@ -0,0 +1,170 @@
1
+ /**
2
+ * @fileoverview Language-agnostic scanner primitives for source-stripping
3
+ * lexers — the lower half of the strip toolkit.
4
+ *
5
+ * Every `packages/languages/lang-*` strip.ts composes these primitives into a
6
+ * language-specific `scan`, which `makeStripper` (in `strip-utils.ts`) turns
7
+ * into the `{ stripStrings, stripComments }` pair. Each scanner recognizes one
8
+ * lexical shape (regular string, line/block comment, char literal) and emits
9
+ * the half-open `Region`s to replace; `applyRegions` overlays them with spaces
10
+ * while preserving line/column offsets.
11
+ *
12
+ * Split out of `strip-utils.ts` so neither file exceeds the file-length limit;
13
+ * `strip-utils.ts` re-exports everything here, so consumers still import these
14
+ * from `@opensip-cli/core` (or `strip-utils.js`) unchanged.
15
+ */
16
+ /** Half-open region `[start, end)` for region-overlay strippers. */
17
+ export interface Region {
18
+ readonly start: number;
19
+ readonly end: number;
20
+ }
21
+ /** Result of `scanRegularString`. */
22
+ export interface RegStrResult {
23
+ /** Index of the closing `"` (or EOF / newline position for unterminated). */
24
+ readonly contentEnd: number;
25
+ /** Index after the closing quote — where the outer scanner resumes. */
26
+ readonly next: number;
27
+ }
28
+ /** Options for `scanRegularString`. */
29
+ export interface ScanRegularStringOptions {
30
+ /**
31
+ * When `true`, `\n` is treated as part of the body — the scanner
32
+ * traverses newlines and only stops at the closing quote or EOF.
33
+ * Used by Rust regular strings (which can span multiple lines).
34
+ * Defaults to `false` (matches Java/Go/C++ semantics).
35
+ */
36
+ readonly allowMultiline?: boolean;
37
+ }
38
+ /**
39
+ * Scan a regular double-quoted string starting at `openQuotePos`
40
+ * (which must reference the opening `"`). Returns the position of the
41
+ * closing quote and the resume index. Honors backslash escapes (`\"`,
42
+ * `\\`, `\n`, etc. by simply advancing 2). By default, stops at
43
+ * unescaped newlines (Java/Go/C++ semantics); pass
44
+ * `{ allowMultiline: true }` for Rust-style strings that may span
45
+ * lines.
46
+ *
47
+ * If the string is unterminated (no closing quote before newline or
48
+ * EOF), returns the unterminated position rather than throwing —
49
+ * callers decide how to handle that case.
50
+ */
51
+ export declare function scanRegularString(src: string, openQuotePos: number, options?: ScanRegularStringOptions): RegStrResult;
52
+ /** Result of `scanLineComment` and `scanBlockCommentNonNesting`. */
53
+ export interface ScanCommentResult {
54
+ /**
55
+ * Index just past the end of the comment region (i.e. the position
56
+ * where the outer scanner resumes). For line comments without line
57
+ * continuation this is the position of the terminating newline (or
58
+ * EOF); for block comments this is the position immediately after
59
+ * the closing delimiter.
60
+ */
61
+ readonly end: number;
62
+ }
63
+ /** Options for `scanLineComment`. */
64
+ export interface ScanLineCommentOptions {
65
+ /**
66
+ * When `true`, a `\<newline>` (backslash immediately before a
67
+ * newline) is a phase-2 line splice — the comment continues onto
68
+ * the next physical line. Used by C/C++. Defaults to `false`
69
+ * (matches Java/Go semantics).
70
+ */
71
+ readonly allowLineContinuation?: boolean;
72
+ }
73
+ /**
74
+ * Scan a `//` line comment starting at `start` (which must reference
75
+ * the first `/` of the opener). Returns the index of the next `\n`
76
+ * (or EOF) — i.e. where the outer scanner resumes. The returned index
77
+ * does not include the `\n` itself.
78
+ *
79
+ * Pass `{ allowLineContinuation: true }` for C/C++-style line splices:
80
+ * a `\<newline>` continues the comment onto the next physical line
81
+ * (per C/C++ phase-2 translation). Defaults to `false`; Java and Go
82
+ * comments have no such behavior.
83
+ *
84
+ * Used by lang-cpp (with `allowLineContinuation: true`), lang-java,
85
+ * lang-go, lang-rust.
86
+ */
87
+ export declare function scanLineComment(src: string, start: number, options?: ScanLineCommentOptions): ScanCommentResult;
88
+ /**
89
+ * Scan a non-nesting block comment starting at `start` (which must
90
+ * reference the opening slash). Returns the index just past the
91
+ * closing delimiter — i.e. where the outer scanner resumes. If the
92
+ * comment is unterminated, returns the EOF position.
93
+ *
94
+ * Used by lang-cpp, lang-java, lang-go.
95
+ */
96
+ export declare function scanBlockCommentNonNesting(src: string, start: number): ScanCommentResult;
97
+ /** Result of `scanBlockCommentNesting`. */
98
+ export interface ScanNestingBlockCommentResult {
99
+ /** Index just past the closing delimiter (or EOF if unterminated). */
100
+ readonly end: number;
101
+ /**
102
+ * Final depth at scan completion. `0` indicates a balanced (well-
103
+ * terminated) comment. A positive value indicates an unterminated
104
+ * comment — `depth` openers were unmatched at EOF.
105
+ */
106
+ readonly depth: number;
107
+ }
108
+ /**
109
+ * Scan a Rust-style nested block comment starting at `start` (which
110
+ * must reference the opening slash). Each nested opener increments
111
+ * the depth counter; each closer decrements it. The scan returns when
112
+ * the depth hits zero (balanced) or when EOF is reached (unterminated
113
+ * — `depth > 0`).
114
+ *
115
+ * Used by lang-rust.
116
+ */
117
+ export declare function scanBlockCommentNesting(src: string, start: number): ScanNestingBlockCommentResult;
118
+ /** Result of `scanCharLiteral`. */
119
+ export interface ScanCharLiteralResult {
120
+ /**
121
+ * Index just past the char literal — i.e. where the outer scanner
122
+ * resumes. If the close-quote is found within the bound, this is
123
+ * one past the closing apostrophe. If the literal is unterminated
124
+ * (overflow or newline), this is one past the opening apostrophe
125
+ * (the apostrophe is treated as code rather than committing the run
126
+ * as a literal — see lang-java F2 / lang-cpp F5b).
127
+ */
128
+ readonly end: number;
129
+ }
130
+ /** Options for `scanCharLiteral`. */
131
+ export interface ScanCharLiteralOptions {
132
+ /**
133
+ * Maximum number of source positions to scan from the opening
134
+ * quote, inclusive of the close. Defaults to `8` — matches the
135
+ * lang-java / lang-rust heuristic. lang-cpp overrides this to `12`
136
+ * to accommodate unicode escapes such as `'\u{1F600}'` (10 chars
137
+ * including quotes); other C-family adopters should override
138
+ * similarly when their language permits longer escape sequences.
139
+ * The scan-cap is permissive: on overflow it recovers by treating
140
+ * the apostrophe as code.
141
+ */
142
+ readonly maxScan?: number;
143
+ }
144
+ /**
145
+ * Scan a char literal starting at `start` (which must reference the
146
+ * opening apostrophe). Returns the index just past the literal — or,
147
+ * if the literal does not close within the scan bound, the index
148
+ * immediately after the opening apostrophe (the apostrophe is treated
149
+ * as code rather than committing the consumed run).
150
+ *
151
+ * Branch ordering is load-bearing: the escape-sequence advance MUST
152
+ * run before the close-quote check so escaped-apostrophe char
153
+ * literals do not terminate at the second apostrophe. See lang-java
154
+ * F6.
155
+ *
156
+ * Used by lang-cpp, lang-java (with prefix-stripping at the call
157
+ * site), lang-rust (with the lifetime-vs-literal heuristic at the
158
+ * call site).
159
+ */
160
+ export declare function scanCharLiteral(src: string, start: number, options?: ScanCharLiteralOptions): ScanCharLiteralResult;
161
+ /**
162
+ * Replace each region with spaces, preserving newlines and overall
163
+ * length. Indexes into `src` and out remain identical, so any
164
+ * line/column derived from the original string is still valid.
165
+ *
166
+ * The `Region[]` is treated as readonly; callers may pass either
167
+ * regions from a comment scan or regions from a string scan (or both).
168
+ */
169
+ export declare function applyRegions(src: string, regions: readonly Region[]): string;
170
+ //# sourceMappingURL=strip-scanners.d.ts.map
@@ -0,0 +1 @@
1
+ {"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