@eagleoutice/flowr 2.12.3 → 2.13.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 (321) hide show
  1. package/README.md +42 -95
  2. package/abstract-interpretation/data-frame/dataframe-domain.d.ts +3 -3
  3. package/abstract-interpretation/data-frame/dataframe-domain.js +14 -6
  4. package/abstract-interpretation/data-frame/semantics.js +12 -16
  5. package/abstract-interpretation/domains/abstract-domain.d.ts +46 -44
  6. package/abstract-interpretation/domains/abstract-domain.js +146 -6
  7. package/abstract-interpretation/domains/bounded-set-domain.d.ts +16 -25
  8. package/abstract-interpretation/domains/bounded-set-domain.js +22 -69
  9. package/abstract-interpretation/domains/interval-domain.d.ts +27 -36
  10. package/abstract-interpretation/domains/interval-domain.js +111 -146
  11. package/abstract-interpretation/domains/lattice.d.ts +3 -3
  12. package/abstract-interpretation/domains/multi-value-state-domain.js +3 -3
  13. package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -19
  14. package/abstract-interpretation/domains/partial-product-domain.js +21 -54
  15. package/abstract-interpretation/domains/positive-interval-domain.d.ts +8 -12
  16. package/abstract-interpretation/domains/positive-interval-domain.js +21 -50
  17. package/abstract-interpretation/domains/product-domain.d.ts +1 -1
  18. package/abstract-interpretation/domains/product-domain.js +4 -4
  19. package/abstract-interpretation/domains/set-range-domain.d.ts +60 -56
  20. package/abstract-interpretation/domains/set-range-domain.js +141 -200
  21. package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +17 -23
  22. package/abstract-interpretation/domains/set-upper-bound-domain.js +59 -103
  23. package/abstract-interpretation/domains/singleton-domain.d.ts +15 -18
  24. package/abstract-interpretation/domains/singleton-domain.js +33 -72
  25. package/abstract-interpretation/domains/state-abstract-domain.d.ts +12 -16
  26. package/abstract-interpretation/domains/state-abstract-domain.js +36 -126
  27. package/abstract-interpretation/domains/state-domain-like.d.ts +2 -2
  28. package/abstract-interpretation/domains/value-abstract-domain.d.ts +120 -0
  29. package/abstract-interpretation/domains/{satisfiable-domain.js → value-abstract-domain.js} +14 -2
  30. package/benchmark/slicer.d.ts +2 -2
  31. package/benchmark/slicer.js +6 -5
  32. package/cli/common/options.d.ts +20 -0
  33. package/cli/common/options.js +4 -0
  34. package/cli/common/scripts-info.d.ts +20 -0
  35. package/cli/flowr-main-options.d.ts +4 -0
  36. package/cli/flowr-main-options.js +5 -0
  37. package/cli/flowr.d.ts +5 -0
  38. package/cli/flowr.js +15 -7
  39. package/cli/repl/commands/repl-commands.d.ts +8 -0
  40. package/cli/repl/commands/repl-commands.js +16 -3
  41. package/cli/repl/commands/repl-query.js +50 -20
  42. package/cli/repl/commands/repl-signature.js +2 -2
  43. package/cli/repl/core.d.ts +14 -5
  44. package/cli/repl/core.js +32 -17
  45. package/cli/repl/parser/slice-query-parser.d.ts +69 -8
  46. package/cli/repl/parser/slice-query-parser.js +82 -13
  47. package/cli/repl/path-input.d.ts +6 -0
  48. package/cli/repl/path-input.js +41 -0
  49. package/cli/repl/print-version.js +3 -5
  50. package/cli/slicer-app.d.ts +4 -0
  51. package/cli/slicer-app.js +4 -2
  52. package/config.d.ts +56 -6
  53. package/config.js +134 -12
  54. package/control-flow/control-flow-graph.d.ts +3 -2
  55. package/control-flow/control-flow-graph.js +34 -14
  56. package/control-flow/semantic-cfg-guided-visitor.d.ts +3 -0
  57. package/control-flow/semantic-cfg-guided-visitor.js +3 -0
  58. package/core/steps/all/static-slicing/10-reconstruct.d.ts +6 -0
  59. package/core/steps/all/static-slicing/10-reconstruct.js +3 -1
  60. package/data/r-base-packages.generated.d.ts +1 -1
  61. package/data/r-base-packages.generated.js +3 -3
  62. package/data/sigdb/sigdb.remote.json +53 -53
  63. package/dataflow/environments/built-in-proc-name.d.ts +2 -0
  64. package/dataflow/environments/built-in-proc-name.js +2 -0
  65. package/dataflow/environments/built-in.d.ts +2 -0
  66. package/dataflow/environments/built-in.js +2 -0
  67. package/dataflow/environments/default-builtin-config.d.ts +3 -5
  68. package/dataflow/environments/default-builtin-config.js +2 -2
  69. package/dataflow/environments/environment.d.ts +9 -0
  70. package/dataflow/environments/environment.js +28 -7
  71. package/dataflow/environments/identifier.d.ts +1 -2
  72. package/dataflow/environments/identifier.js +1 -5
  73. package/dataflow/extractor.js +1 -2
  74. package/dataflow/graph/dataflowgraph-builder.js +42 -3
  75. package/dataflow/graph/df-helper.d.ts +15 -0
  76. package/dataflow/graph/df-helper.js +20 -0
  77. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +4 -4
  78. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +7 -0
  79. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +13 -0
  80. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +4 -0
  81. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +57 -11
  82. package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +12 -0
  83. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +233 -0
  84. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +2 -1
  85. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +5 -3
  86. package/documentation/data/faq/faqs.js +12 -1
  87. package/documentation/doc-readme.js +1 -1
  88. package/documentation/doc-util/doc-files.d.ts +2 -2
  89. package/documentation/doc-util/doc-files.js +4 -7
  90. package/documentation/doc-util/doc-query.d.ts +12 -9
  91. package/documentation/doc-util/doc-query.js +63 -28
  92. package/documentation/wiki-absint.js +1 -4
  93. package/documentation/wiki-analyzer.js +8 -3
  94. package/documentation/wiki-cfg.js +3 -2
  95. package/documentation/wiki-dataflow-graph.js +14 -4
  96. package/documentation/wiki-interface.js +30 -16
  97. package/documentation/wiki-mk/doc-maker.js +1 -1
  98. package/documentation/wiki-query.js +190 -30
  99. package/documentation/wiki-signature-database.d.ts +1 -1
  100. package/documentation/wiki-signature-database.js +53 -27
  101. package/linter/linter-output.d.ts +24 -0
  102. package/linter/linter-output.js +117 -0
  103. package/linter/linter-rules.d.ts +2 -4
  104. package/linter/rules/dataframe-access-validation.js +4 -4
  105. package/linter/rules/deprecated-functions.d.ts +2 -4
  106. package/linter/rules/deprecated-functions.js +58 -3
  107. package/linter/rules/undefined-symbol.js +18 -10
  108. package/linter/rules/unused-definition.js +24 -0
  109. package/package.json +5 -2
  110. package/project/context/flowr-analyzer-context.d.ts +61 -1
  111. package/project/context/flowr-analyzer-context.js +124 -3
  112. package/project/context/flowr-analyzer-dependencies-context.d.ts +32 -7
  113. package/project/context/flowr-analyzer-dependencies-context.js +33 -3
  114. package/project/context/flowr-analyzer-files-context.d.ts +40 -0
  115. package/project/context/flowr-analyzer-files-context.js +171 -14
  116. package/project/context/flowr-analyzer-loading-order-context.d.ts +6 -0
  117. package/project/context/flowr-analyzer-loading-order-context.js +20 -0
  118. package/project/context/flowr-analyzer-meta-context.d.ts +92 -10
  119. package/project/context/flowr-analyzer-meta-context.js +64 -23
  120. package/project/context/flowr-file.d.ts +7 -0
  121. package/project/context/flowr-file.js +7 -0
  122. package/project/context/project-kind.d.ts +22 -0
  123. package/project/context/project-kind.js +27 -0
  124. package/project/dependency-version-space.d.ts +168 -0
  125. package/project/dependency-version-space.js +570 -0
  126. package/project/flowr-analyzer-builder.js +1 -1
  127. package/project/flowr-analyzer.d.ts +7 -0
  128. package/project/flowr-analyzer.js +9 -0
  129. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +4 -0
  130. package/project/plugins/file-plugins/files/flowr-description-file.js +7 -0
  131. package/project/plugins/file-plugins/files/flowr-namespace-file.js +5 -1
  132. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +739 -0
  133. package/project/plugins/file-plugins/files/flowr-rda-file.js +2407 -0
  134. package/project/plugins/file-plugins/files/flowr-rproject-file.d.ts +31 -0
  135. package/project/plugins/file-plugins/files/flowr-rproject-file.js +66 -0
  136. package/project/plugins/file-plugins/files/r-fun-tab.d.ts +828 -0
  137. package/project/plugins/file-plugins/files/r-fun-tab.js +1039 -0
  138. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +1 -1
  139. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +1 -1
  140. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +1 -1
  141. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +1 -1
  142. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +1 -1
  143. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +1 -1
  144. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +1 -1
  145. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +1 -1
  146. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +1 -1
  147. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +1 -1
  148. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +1 -1
  149. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +26 -0
  150. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +38 -0
  151. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +17 -0
  152. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +30 -0
  153. package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.d.ts +22 -0
  154. package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.js +36 -0
  155. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +1 -1
  156. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +1 -1
  157. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +1 -1
  158. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +1 -1
  159. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +3 -4
  160. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +5 -6
  161. package/project/plugins/flowr-analyzer-plugin.js +5 -0
  162. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +1 -1
  163. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
  164. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.d.ts +14 -0
  165. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.js +53 -0
  166. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +1 -1
  167. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.d.ts +15 -0
  168. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.js +33 -0
  169. package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.d.ts +1 -1
  170. package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +18 -13
  171. package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.d.ts +13 -0
  172. package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.js +32 -0
  173. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +1 -1
  174. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
  175. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +8 -1
  176. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +70 -7
  177. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.d.ts +1 -1
  178. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +1 -1
  179. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +1 -1
  180. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.d.ts +18 -0
  181. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +62 -0
  182. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +4 -1
  183. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +5 -13
  184. package/project/plugins/package-version-plugins/package.d.ts +4 -1
  185. package/project/plugins/package-version-plugins/package.js +8 -5
  186. package/project/plugins/plugin-registry.d.ts +11 -3
  187. package/project/plugins/plugin-registry.js +24 -5
  188. package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.d.ts +51 -0
  189. package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.js +101 -0
  190. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +10 -5
  191. package/project/sigdb/build.js +12 -2
  192. package/project/sigdb/decode.d.ts +7 -0
  193. package/project/sigdb/decode.js +35 -4
  194. package/project/sigdb/decompress.d.ts +2 -0
  195. package/project/sigdb/decompress.js +5 -0
  196. package/project/sigdb/manifest.d.ts +5 -0
  197. package/project/sigdb/manifest.js +37 -6
  198. package/project/sigdb/reader.d.ts +82 -2
  199. package/project/sigdb/reader.js +226 -14
  200. package/project/sigdb/schema.d.ts +31 -5
  201. package/project/sigdb/schema.js +7 -3
  202. package/project/sigdb/{version.d.ts → sigdb-version.d.ts} +21 -1
  203. package/project/sigdb/sigdb-version.js +119 -0
  204. package/queries/catalog/absint-query/absint-query-format.d.ts +2 -0
  205. package/queries/catalog/absint-query/absint-query-format.js +2 -0
  206. package/queries/catalog/call-context-query/call-context-query-executor.js +30 -3
  207. package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -0
  208. package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
  209. package/queries/catalog/call-graph-query/call-graph-query-executor.js +3 -1
  210. package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +6 -0
  211. package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -0
  212. package/queries/catalog/call-graph-query/expand-library-internals.d.ts +19 -0
  213. package/queries/catalog/call-graph-query/expand-library-internals.js +59 -0
  214. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -0
  215. package/queries/catalog/cluster-query/cluster-query-format.js +1 -0
  216. package/queries/catalog/config-query/config-query-executor.js +17 -5
  217. package/queries/catalog/config-query/config-query-format.d.ts +19 -3
  218. package/queries/catalog/config-query/config-query-format.js +258 -98
  219. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -0
  220. package/queries/catalog/control-flow-query/control-flow-query-format.js +1 -0
  221. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -0
  222. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -0
  223. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -0
  224. package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -0
  225. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -7
  226. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +13 -1
  227. package/queries/catalog/dependencies-query/dependencies-query-format.js +117 -17
  228. package/queries/catalog/dice-query/dice-query-executor.js +6 -9
  229. package/queries/catalog/dice-query/dice-query-format.d.ts +4 -5
  230. package/queries/catalog/dice-query/dice-query-format.js +10 -6
  231. package/queries/catalog/does-call-query/does-call-query-executor.js +15 -2
  232. package/queries/catalog/does-call-query/does-call-query-format.d.ts +8 -0
  233. package/queries/catalog/does-call-query/does-call-query-format.js +4 -1
  234. package/queries/catalog/files-query/files-query-format.d.ts +2 -0
  235. package/queries/catalog/files-query/files-query-format.js +2 -0
  236. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.d.ts +6 -0
  237. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +293 -0
  238. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +121 -0
  239. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +345 -0
  240. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -0
  241. package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -0
  242. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -0
  243. package/queries/catalog/id-map-query/id-map-query-format.js +1 -0
  244. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -0
  245. package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -0
  246. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -0
  247. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -0
  248. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -0
  249. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -0
  250. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -0
  251. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -0
  252. package/queries/catalog/linter-query/linter-query-executor.js +11 -2
  253. package/queries/catalog/linter-query/linter-query-format.d.ts +9 -4
  254. package/queries/catalog/linter-query/linter-query-format.js +44 -21
  255. package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -0
  256. package/queries/catalog/location-map-query/location-map-query-format.js +2 -0
  257. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -0
  258. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -0
  259. package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
  260. package/queries/catalog/origin-query/origin-query-format.js +2 -0
  261. package/queries/catalog/project-query/project-query-executor.d.ts +0 -15
  262. package/queries/catalog/project-query/project-query-executor.js +19 -62
  263. package/queries/catalog/project-query/project-query-format.d.ts +7 -18
  264. package/queries/catalog/project-query/project-query-format.js +3 -18
  265. package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
  266. package/queries/catalog/provenance-query/provenance-query-format.js +2 -0
  267. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -0
  268. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -0
  269. package/queries/catalog/search-query/search-query-format.d.ts +1 -0
  270. package/queries/catalog/search-query/search-query-format.js +1 -0
  271. package/queries/catalog/signature-query/signature-query-executor.d.ts +5 -0
  272. package/queries/catalog/signature-query/signature-query-executor.js +267 -57
  273. package/queries/catalog/signature-query/signature-query-format.d.ts +37 -6
  274. package/queries/catalog/signature-query/signature-query-format.js +41 -5
  275. package/queries/catalog/signature-query/signature-query-render.js +48 -6
  276. package/queries/catalog/slice-query-options.d.ts +49 -0
  277. package/queries/catalog/slice-query-options.js +50 -0
  278. package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -12
  279. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -15
  280. package/queries/catalog/static-slice-query/static-slice-query-format.js +9 -10
  281. package/queries/query-print.js +3 -1
  282. package/queries/query.d.ts +62 -2
  283. package/queries/query.js +9 -2
  284. package/r-bridge/data/data.d.ts +16 -0
  285. package/r-bridge/data/data.js +20 -0
  286. package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -0
  287. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
  288. package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
  289. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +19 -16
  290. package/reconstruct/reconstruct.d.ts +18 -1
  291. package/reconstruct/reconstruct.js +42 -19
  292. package/slicing/criterion/parse.d.ts +4 -0
  293. package/slicing/criterion/parse.js +4 -0
  294. package/slicing/static/slice-call.js +17 -9
  295. package/slicing/static/static-slicer.d.ts +1 -1
  296. package/slicing/static/static-slicer.js +5 -4
  297. package/util/files.d.ts +19 -1
  298. package/util/files.js +45 -3
  299. package/util/glob.d.ts +19 -0
  300. package/util/glob.js +67 -0
  301. package/util/log.d.ts +12 -0
  302. package/util/log.js +17 -1
  303. package/util/logic.d.ts +6 -0
  304. package/util/logic.js +31 -1
  305. package/util/mermaid/dfg.js +17 -12
  306. package/util/mermaid/mermaid.js +2 -2
  307. package/util/objects.d.ts +5 -0
  308. package/util/objects.js +8 -0
  309. package/util/r-version.d.ts +9 -1
  310. package/util/r-version.js +27 -2
  311. package/util/schema.d.ts +18 -0
  312. package/util/schema.js +102 -4
  313. package/util/text/ansi.d.ts +4 -0
  314. package/util/text/ansi.js +27 -3
  315. package/util/text/strings.d.ts +9 -0
  316. package/util/text/strings.js +29 -0
  317. package/util/version.js +79 -6
  318. package/abstract-interpretation/domains/satisfiable-domain.d.ts +0 -29
  319. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +0 -22
  320. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +0 -52
  321. package/project/sigdb/version.js +0 -55
@@ -0,0 +1,345 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.GuessDepVersionsQueryDefinition = exports.DefaultCandidateCap = void 0;
7
+ const joi_1 = __importDefault(require("joi"));
8
+ const ansi_1 = require("../../../util/text/ansi");
9
+ const time_1 = require("../../../util/text/time");
10
+ const r_version_1 = require("../../../util/r-version");
11
+ const arrays_1 = require("../../../util/collections/arrays");
12
+ const identifier_1 = require("../../../dataflow/environments/identifier");
13
+ const signature_query_executor_1 = require("../signature-query/signature-query-executor");
14
+ const config_1 = require("../../../config");
15
+ const guess_dep_versions_query_executor_1 = require("./guess-dep-versions-query-executor");
16
+ /** the default cap on how many surviving candidate versions are listed per dependency */
17
+ exports.DefaultCandidateCap = 16;
18
+ /** parse a repl line: `[(clean[:<=YYYY])] [pkg ...] [--date YYYY.MM.DD] [--max N] [--iterations N] [--disabled <letters>] [--explode [--oldest] [--limit N] [--prefer pkg=ver ...]]` */
19
+ function guessDepVersionsLineParser(_output, line, _config) {
20
+ const packages = [];
21
+ const codeParts = [];
22
+ let date;
23
+ let maxCandidates;
24
+ let maxIterations;
25
+ let clean = false;
26
+ let explode = false;
27
+ let order;
28
+ let limit;
29
+ const prefer = {};
30
+ const disabled = new Set();
31
+ // an optional parenthesised clause `(clean)`, `(<=2025)`, or `(clean:<=2025)`: `clean` drops declared constraints, a (`<=`-prefixed) date caps the window
32
+ const tokens = [...line];
33
+ const open = tokens.findIndex(t => t.startsWith('('));
34
+ const close = open < 0 ? -1 : tokens.findIndex((t, i) => i >= open && t.endsWith(')'));
35
+ if (open >= 0 && close >= open) {
36
+ const clause = tokens.slice(open, close + 1).join(' ').replace(/^\(|\)$/g, '');
37
+ for (const part of clause.split(/[:,]/).map(s => s.trim()).filter(s => s.length > 0)) {
38
+ if (part === 'clean') {
39
+ clean = true;
40
+ }
41
+ else {
42
+ date = part.replace(/^<=/, '').trim(); // `<=2025` or a bare `2025`/`2025.06` cap
43
+ }
44
+ }
45
+ tokens.splice(open, close - open + 1);
46
+ }
47
+ for (let i = 0; i < tokens.length; i++) {
48
+ const tok = tokens[i];
49
+ if (tok.length === 0) {
50
+ continue;
51
+ }
52
+ if (tok === '--date') {
53
+ date = tokens[++i];
54
+ }
55
+ else if (tok === '--max') {
56
+ maxCandidates = Number(tokens[++i]);
57
+ }
58
+ else if (tok === '--iterations' || tok === '--iter') {
59
+ maxIterations = Number(tokens[++i]);
60
+ }
61
+ else if (tok === '--explode') {
62
+ explode = true;
63
+ }
64
+ else if (tok === '--oldest') {
65
+ order = 'oldest';
66
+ }
67
+ else if (tok === '--newest') {
68
+ order = 'newest';
69
+ }
70
+ else if (tok === '--limit') {
71
+ limit = Number(tokens[++i]);
72
+ }
73
+ else if (tok === '--prefer') {
74
+ const [pkg, ver] = (tokens[++i] ?? '').split('=');
75
+ if (pkg && ver) {
76
+ prefer[pkg] = ver;
77
+ }
78
+ }
79
+ else if (tok === '--only') {
80
+ packages.push(...(tokens[++i] ?? '').split(',').map(s => s.trim()).filter(s => s.length > 0));
81
+ }
82
+ else if (tok === '--disabled') {
83
+ for (const ch of tokens[++i] ?? '') {
84
+ const source = letterToSource[ch];
85
+ if (source) {
86
+ disabled.add(source);
87
+ }
88
+ }
89
+ }
90
+ else if (!tok.startsWith('--')) {
91
+ // every bare token is the code to analyse (a `file://`/`watch://` target, a bare path -- auto-prepended to
92
+ // `file://` by the repl -- or inline R code); package filters are the explicit `--only` flag, so nothing is guessed
93
+ codeParts.push(tok);
94
+ }
95
+ }
96
+ const explodeOpts = explode ? {
97
+ explode: {
98
+ ...(order ? { order } : {}),
99
+ ...(limit !== undefined && !Number.isNaN(limit) ? { limit } : {}),
100
+ ...(Object.keys(prefer).length > 0 ? { prefer } : {})
101
+ }
102
+ } : {};
103
+ return {
104
+ rCode: codeParts.length > 0 ? codeParts.join(' ') : undefined,
105
+ query: [{
106
+ type: 'guess-dep-versions',
107
+ ...(packages.length > 0 ? { packages } : {}),
108
+ ...(date ? { date } : {}),
109
+ ...(maxCandidates !== undefined && !Number.isNaN(maxCandidates) ? { maxCandidates } : {}),
110
+ ...(maxIterations !== undefined && !Number.isNaN(maxIterations) ? { maxIterations } : {}),
111
+ ...(clean ? { clean } : {}),
112
+ ...(disabled.size > 0 ? { disabled: [...disabled] } : {}),
113
+ ...explodeOpts
114
+ }]
115
+ };
116
+ }
117
+ const evidenceColor = {
118
+ declared: 6 /* Colors.Cyan */,
119
+ transitive: 4 /* Colors.Blue */,
120
+ signature: 5 /* Colors.Magenta */,
121
+ date: 3 /* Colors.Yellow */,
122
+ 'base-r': 2 /* Colors.Green */,
123
+ available: 7 /* Colors.White */,
124
+ indirect: 1 /* Colors.Red */
125
+ };
126
+ /** priority when several sources state the same bound: the lowest-ranked stays active, the rest gray out */
127
+ const sourceRank = {
128
+ declared: 0,
129
+ transitive: 1,
130
+ indirect: 2,
131
+ 'base-r': 3,
132
+ date: 4,
133
+ signature: 5,
134
+ available: 6
135
+ };
136
+ /** a one-letter marker per evidence source (shown instead of a bullet, so the source is legible without color) */
137
+ const evidenceLetter = {
138
+ declared: 'd',
139
+ transitive: 't',
140
+ signature: 's',
141
+ date: 'D',
142
+ 'base-r': 'b',
143
+ available: '#',
144
+ indirect: 'i'
145
+ };
146
+ /** inverse of {@link evidenceLetter}, decoding a `--disabled` flag's letters back to sources */
147
+ const letterToSource = Object.fromEntries(Object.entries(evidenceLetter).map(([source, letter]) => [letter, source]));
148
+ /** the tightest bound among a function's signature constraints for the given operator: highest `>=` or lowest `<=` */
149
+ function tightestBound(evs, op) {
150
+ let best, bestVer;
151
+ for (const e of evs) {
152
+ if (!e.bound?.startsWith(op)) {
153
+ continue;
154
+ }
155
+ const ver = e.bound.slice(op.length).trim();
156
+ if (bestVer === undefined || (op === '>=' ? r_version_1.RVersion.compare(ver, bestVer) > 0 : r_version_1.RVersion.compare(ver, bestVer) < 0)) {
157
+ bestVer = ver;
158
+ best = e.bound;
159
+ }
160
+ }
161
+ return best;
162
+ }
163
+ /** a version-valued bound like `>=1.2.0` or `>= 3.1.0` (space-tolerant) split into operator and version (dates such as `<=2021-05-31` are not version bounds) */
164
+ function versionBound(bound) {
165
+ const m = /^(>=|<=)\s*(\d[\w.-]*)$/.exec(bound ?? '');
166
+ if (!m || !r_version_1.RVersion.parse(m[2])) {
167
+ return undefined;
168
+ }
169
+ return { op: m[1] === '>=' ? '>=' : '<=', ver: m[2] };
170
+ }
171
+ /** whether a dependency's version is actually narrowed (not every database version survives); a fully redundant one is unconstrained */
172
+ function isConstrained(dep) {
173
+ return dep.totalVersions !== undefined && dep.candidateCount !== dep.totalVersions;
174
+ }
175
+ /** a version-combination count with thousands separators (exponential only past a trillion, where digits stop being useful) */
176
+ function formatCombinations(n) {
177
+ return n >= 1e12 ? n.toExponential(1) : String(Math.round(n)).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
178
+ }
179
+ /** a parameter list, truncated with `...` once it gets long so a many-argument function stays on one readable line */
180
+ function formatParams(params) {
181
+ const shown = 4;
182
+ return params.length > shown ? `${params.slice(0, shown).join(', ')} (+${params.length - shown})` : params.join(', ');
183
+ }
184
+ /** a short, readable phrase for one non-signature bound, its origin(s) folded in (so several packages sharing a bound collapse to one line) */
185
+ function nonSignaturePhrase(source, bound, origins) {
186
+ const b = bound ? bound.replace(/([<>]=?)\s+/g, '$1') + ' ' : '';
187
+ switch (source) {
188
+ case 'declared': return `${b}declared`;
189
+ case 'transitive': return `${b}required by ${origins.join(', ')}`;
190
+ case 'date': return `releases up to ${origins[0]}`;
191
+ case 'base-r': return `${b}bounded by ${origins[0]}`;
192
+ case 'available': return `${b}available in database`;
193
+ case 'indirect': return `${b}via ${origins.join(', ')}`;
194
+ default: return b.trim();
195
+ }
196
+ }
197
+ /** a version bound is dominated when a strictly tighter same-direction bound exists (a redundant `>=`/`<=`) */
198
+ function isDominated(bound, tightestGe, tightestLe) {
199
+ const b = versionBound(bound);
200
+ if (!b) {
201
+ return false;
202
+ }
203
+ return b.op === '>=' ? tightestGe !== undefined && r_version_1.RVersion.compare(b.ver, tightestGe) < 0
204
+ : tightestLe !== undefined && r_version_1.RVersion.compare(b.ver, tightestLe) > 0;
205
+ }
206
+ exports.GuessDepVersionsQueryDefinition = {
207
+ title: 'Guess Dependency Versions Query',
208
+ executor: guess_dep_versions_query_executor_1.executeGuessDepVersionsQuery,
209
+ asciiSummarizer: (formatter, _analyzer, queryResults, result, _query) => {
210
+ const out = queryResults;
211
+ result.push(`Query: ${(0, ansi_1.bold)('guess-dep-versions', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
212
+ if (out.dateCutoff) {
213
+ result.push(` ╰ up to ${(0, ansi_1.italic)(out.dateCutoff, formatter)}${out.rVersion ? `, R ${(0, ansi_1.italic)(out.rVersion, formatter)}` : ''}`);
214
+ }
215
+ else if (out.rVersion) {
216
+ result.push(` ╰ R ${(0, ansi_1.italic)(out.rVersion, formatter)}`);
217
+ }
218
+ if (out.dependencies.some(d => d.evidence.length > 0)) {
219
+ const legend = Object.keys(evidenceLetter).map(s => `${(0, ansi_1.color)(evidenceLetter[s], evidenceColor[s], formatter)} ${s}`).join(' ');
220
+ result.push(` ${(0, ansi_1.italic)('evidence', formatter)}: ${legend}`);
221
+ }
222
+ if (out.message) {
223
+ result.push(` ╰ ${(0, ansi_1.color)(out.message, 1 /* Colors.Red */, formatter)}`);
224
+ }
225
+ const resolvable = out.dependencies.filter(d => d.totalVersions !== undefined && d.totalVersions > 0);
226
+ // the sample illustrates the configured selection policy: the oldest satisfying version, else the newest
227
+ const selection = out.versionSelection ?? config_1.VersionSelection.Newest;
228
+ const pick = (d) => selection === config_1.VersionSelection.Oldest ? d.minVersion : d.maxVersion;
229
+ const sample = resolvable.filter(d => pick(d)).map(d => `${d.package}@${pick(d)}`);
230
+ if (sample.length > 0) {
231
+ // only the newest-selection sample can claim "works with all newest versions"; the reference "newest" is the
232
+ // newest release the date window allows (== each pick when a date cutoff is set), else the database's latest
233
+ const latestChecks = selection !== config_1.VersionSelection.Newest ? [] : out.dependencies
234
+ .map(d => ({ name: d.package, max: d.maxVersion, newest: out.dateCutoff !== undefined ? d.maxVersion : versionBound(tightestBound(d.evidence.filter(e => e.source === 'available'), '<='))?.ver }))
235
+ .filter((c) => c.max !== undefined && c.newest !== undefined);
236
+ const staleLatest = latestChecks.filter(c => c.max !== c.newest);
237
+ const latestSuffix = latestChecks.length === 0 ? ''
238
+ : staleLatest.length === 0
239
+ ? ' ' + (0, ansi_1.color)('(works with all newest versions)', 2 /* Colors.Green */, formatter)
240
+ : ' ' + (0, ansi_1.faint)(`(newest excluded: ${staleLatest.map(c => `${c.name} ${c.newest}, use ${c.max}`).join('; ')})`, formatter);
241
+ result.push(` ${(0, ansi_1.color)('▶', 2 /* Colors.Green */, formatter)} ${(0, ansi_1.bold)('sample', formatter)} ${(0, ansi_1.faint)(`(${selection})`, formatter)}: ${sample.join(', ')}${latestSuffix}`);
242
+ const runnable = out.runnableCombinations, possible = out.possibleCombinations;
243
+ if (runnable !== undefined && possible !== undefined && possible > 0) {
244
+ const pct = runnable / possible * 100;
245
+ result.push(` ${(0, ansi_1.italic)('runnable combinations', formatter)}: ${(0, ansi_1.bold)(formatCombinations(runnable), formatter)} ${(0, ansi_1.faint)(`(${pct < 10 ? pct.toFixed(1) : Math.round(pct)}%)`, formatter)}`);
246
+ }
247
+ }
248
+ // the packages locked to one shared version
249
+ for (const group of out.linkedGroups ?? []) {
250
+ const rep = out.dependencies.find(d => group.includes(d.package) && d.maxVersion !== undefined);
251
+ result.push(` ${(0, ansi_1.italic)('linked', formatter)}: ${group.join(' + ')}${rep?.maxVersion ? (0, ansi_1.faint)(' @ ' + rep.maxVersion, formatter) : ''}`);
252
+ }
253
+ for (const dep of out.dependencies) {
254
+ const groupTag = dep.base ? ' ' + (0, ansi_1.italic)('[base]', formatter)
255
+ : dep.linkedWith ? ' ' + (0, ansi_1.italic)(`[linked: ${dep.linkedWith.join(', ')}]`, formatter) : '';
256
+ const note = dep.base ? '' : dep.used === false ? ' ' + (0, ansi_1.faint)('(not called)', formatter) : !isConstrained(dep) && dep.totalVersions ? ' ' + (0, ansi_1.faint)('(any version)', formatter) : '';
257
+ const tag = groupTag + note;
258
+ const range = dep.unsatisfiable ? (0, ansi_1.color)('unsatisfiable', 1 /* Colors.Red */, formatter) : (0, ansi_1.bold)(dep.range, formatter);
259
+ const count = dep.totalVersions !== undefined ? `${dep.candidateCount}/${dep.totalVersions} versions` : `${dep.candidateCount} candidate${dep.candidateCount === 1 ? '' : 's'}`;
260
+ const avail = dep.evidence.filter(e => e.source === 'available');
261
+ const dbGe = versionBound(tightestBound(avail, '>='))?.ver, dbLe = versionBound(tightestBound(avail, '<='))?.ver;
262
+ const dbRange = dbGe !== undefined && dbLe !== undefined ? `, db ${dbGe} - ${dbLe}` : '';
263
+ result.push(` ${(0, ansi_1.bold)('━ ' + dep.package, formatter)}${tag} ${range} ${(0, ansi_1.faint)('(' + count + dbRange + ')', formatter)}`);
264
+ const tightestGe = versionBound(tightestBound(dep.evidence, '>='))?.ver;
265
+ const tightestLe = versionBound(tightestBound(dep.evidence.filter(e => versionBound(e.bound)), '<='))?.ver;
266
+ const active = [], dominated = [];
267
+ const nonSig = [...(0, arrays_1.arraysGroupBy)(dep.evidence.filter(e => e.source !== 'signature' && e.source !== 'available'), e => `${e.source}|${e.bound ?? ''}`)]
268
+ .map(([, evs]) => ({ ev: evs[0], origins: [...new Set(evs.map(e => e.origin))] }));
269
+ const bestRankByBound = new Map();
270
+ for (const { ev } of nonSig) {
271
+ const vb = versionBound(ev.bound);
272
+ if (vb === undefined || isDominated(ev.bound, tightestGe, tightestLe)) {
273
+ continue;
274
+ }
275
+ const key = vb.op + vb.ver, rank = sourceRank[ev.source];
276
+ const prev = bestRankByBound.get(key);
277
+ if (prev === undefined || rank < prev) {
278
+ bestRankByBound.set(key, rank);
279
+ }
280
+ }
281
+ for (const { ev, origins } of nonSig) {
282
+ const phrase = nonSignaturePhrase(ev.source, ev.bound, origins);
283
+ const vb = versionBound(ev.bound);
284
+ const best = vb === undefined ? undefined : bestRankByBound.get(vb.op + vb.ver);
285
+ const redundant = best !== undefined && sourceRank[ev.source] > best;
286
+ if (isDominated(ev.bound, tightestGe, tightestLe) || redundant) {
287
+ dominated.push(` ${(0, ansi_1.faint)(evidenceLetter[ev.source] + ' ' + phrase, formatter)}`);
288
+ }
289
+ else {
290
+ active.push(` ${(0, ansi_1.color)(evidenceLetter[ev.source], evidenceColor[ev.source], formatter)} ${phrase}`);
291
+ }
292
+ }
293
+ // signature evidence: bare names, grouped by bound, tightest first; non-tightest bounds are redundant (grayed)
294
+ const sigMarker = (0, ansi_1.color)(evidenceLetter.signature, evidenceColor.signature, formatter);
295
+ const sigRecords = [...(0, arrays_1.arraysGroupBy)(dep.evidence.filter(e => e.source === 'signature'), e => e.function ?? e.origin)].map(([fn, evs]) => {
296
+ const ge = tightestBound(evs, '>='), le = tightestBound(evs, '<=');
297
+ const geVer = versionBound(ge)?.ver, leVer = versionBound(le)?.ver;
298
+ const params = [...new Set(evs.map(e => e.parameter).filter((pm) => pm !== undefined))];
299
+ const reasons = [evs.some(e => !e.parameter) ? 'new' : undefined, params.length > 0 ? `params: [${formatParams(params)}]` : undefined].filter(Boolean).join(', ');
300
+ const name = identifier_1.Identifier.getName(identifier_1.Identifier.parse(fn));
301
+ const url = (0, signature_query_executor_1.rdrrDocUrl)(dep.package, name, { base: dep.base, cran: !dep.base });
302
+ const label = (url ? formatter.hyperlink(name, url) : name) + (reasons ? ` (${reasons})` : '');
303
+ const redundant = !(geVer !== undefined && geVer === tightestGe) && !(leVer !== undefined && leVer === tightestLe);
304
+ return { bounds: [ge, le].filter(Boolean).join(' '), label, redundant, geVer, leVer };
305
+ }).sort((a, b) => r_version_1.RVersion.compare(b.geVer, a.geVer) || r_version_1.RVersion.compare(b.leVer, a.leVer));
306
+ for (const [bounds, recs] of (0, arrays_1.arraysGroupBy)(sigRecords, r => r.bounds)) {
307
+ const body = `${bounds ? bounds + ' ' : ''}${recs.map(r => r.label).join(', ')}`;
308
+ if (recs[0].redundant) {
309
+ dominated.push(` ${(0, ansi_1.faint)(evidenceLetter.signature + ' ' + body, formatter)}`);
310
+ }
311
+ else {
312
+ active.push(` ${sigMarker} ${body}`);
313
+ }
314
+ }
315
+ result.push(...active, ...dominated);
316
+ }
317
+ if (out.assignments) {
318
+ result.push(` ${(0, ansi_1.bold)('assignments', formatter)}: ${out.assignments.length}`);
319
+ const first = out.assignments[0];
320
+ if (first) {
321
+ result.push(` ${(0, ansi_1.italic)('preferred', formatter)}: ${Object.entries(first.versions).map(([p, v]) => `${p}@${v}`).join(', ')}`);
322
+ }
323
+ }
324
+ return true;
325
+ },
326
+ fromLine: guessDepVersionsLineParser,
327
+ syntax: '@guess-dep-versions [<pkg> ...] [(clean | <=YYYY.MM.DD)] [--date YYYY.MM.DD] [--max <n>] [--iterations <n>] [--disabled <letters>] [--explode [--oldest] [--limit <n>] [--prefer <pkg>=<ver>]] <code | file://path>',
328
+ schema: joi_1.default.object({
329
+ type: joi_1.default.string().valid('guess-dep-versions').required().description('The type of the query.'),
330
+ packages: joi_1.default.array().items(joi_1.default.string()).optional().description('Restrict the guess to these packages; omit to guess for every declared and used dependency.'),
331
+ date: joi_1.default.string().optional().description('Only consider versions released on or before this day, written YYYY.MM.DD (also YYYY or YYYY.MM).'),
332
+ maxCandidates: joi_1.default.number().integer().min(0).optional().description('Cap the number of candidate versions listed per dependency.'),
333
+ maxIterations: joi_1.default.number().integer().min(0).optional().description('Bound both fixpoint loops (mutual transitive refinement and arc consistency).'),
334
+ clean: joi_1.default.boolean().optional().description('Ignore the project declared constraints (DESCRIPTION/lockfile/transitive); guess purely from code usage and the date/R bounds.'),
335
+ disabled: joi_1.default.array().items(joi_1.default.string().valid('declared', 'transitive', 'signature', 'date', 'base-r', 'available', 'indirect')).optional()
336
+ .description('Exclude these evidence sources from consideration entirely (repl: --disabled followed by their one-letter codes, e.g. --disabled ds for declared+signature).'),
337
+ explode: joi_1.default.object({
338
+ order: joi_1.default.string().valid('newest', 'oldest').optional().description('Iterate each dependency newest-first (default) or oldest-first.'),
339
+ prefer: joi_1.default.object().pattern(joi_1.default.string(), joi_1.default.string()).optional().description('A version to prefer per dependency when it survives the constraints.'),
340
+ limit: joi_1.default.number().integer().min(0).optional().description('Cap the number of concrete assignments produced.')
341
+ }).optional().description('Also explode the guessed space into concrete per-dependency version assignments.')
342
+ }).description('Guesses the possible version range of every dependency from declared constraints and signature-database usage.'),
343
+ flattenInvolvedNodes: () => []
344
+ };
345
+ //# sourceMappingURL=guess-dep-versions-query-format.js.map
@@ -12,6 +12,7 @@ export interface HappensBeforeQueryResult extends BaseQueryResult {
12
12
  readonly results: Record<string, Ternary>;
13
13
  }
14
14
  export declare const HappensBeforeQueryDefinition: {
15
+ readonly title: "Happens-Before Query";
15
16
  readonly executor: typeof executeHappensBefore;
16
17
  readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
17
18
  readonly schema: Joi.ObjectSchema<any>;
@@ -9,6 +9,7 @@ const time_1 = require("../../../util/text/time");
9
9
  const joi_1 = __importDefault(require("joi"));
10
10
  const happens_before_query_executor_1 = require("./happens-before-query-executor");
11
11
  exports.HappensBeforeQueryDefinition = {
12
+ title: 'Happens-Before Query',
12
13
  executor: happens_before_query_executor_1.executeHappensBefore,
13
14
  asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
14
15
  const out = queryResults;
@@ -9,6 +9,7 @@ export interface IdMapQueryResult extends BaseQueryResult {
9
9
  readonly idMap: AstIdMap;
10
10
  }
11
11
  export declare const IdMapQueryDefinition: {
12
+ readonly title: "Id-Map Query";
12
13
  readonly executor: typeof executeIdMapQuery;
13
14
  readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
14
15
  readonly schema: Joi.ObjectSchema<any>;
@@ -10,6 +10,7 @@ const time_1 = require("../../../util/text/time");
10
10
  const joi_1 = __importDefault(require("joi"));
11
11
  const query_print_1 = require("../../query-print");
12
12
  exports.IdMapQueryDefinition = {
13
+ title: 'Id-Map Query',
13
14
  executor: id_map_query_executor_1.executeIdMapQuery,
14
15
  asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
15
16
  const out = queryResults;
@@ -31,10 +31,12 @@ export interface InputSourcesQueryResult extends BaseQueryResult {
31
31
  }
32
32
  declare function inputSourcesQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'input-sources'>;
33
33
  export declare const InputSourcesDefinition: {
34
+ readonly title: "Input Sources Query";
34
35
  readonly executor: typeof executeInputSourcesQuery;
35
36
  readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
36
37
  readonly fromLine: typeof inputSourcesQueryLineParser;
37
38
  readonly completer: typeof criteriaQueryCompleter;
39
+ readonly syntax: "@input-sources (<criterion>) <code | file://path>";
38
40
  readonly schema: Joi.ObjectSchema<any>;
39
41
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
40
42
  };
@@ -39,6 +39,7 @@ function inputSourcesQueryLineParser(output, line, _config) {
39
39
  }], rCode: line[1] };
40
40
  }
41
41
  exports.InputSourcesDefinition = {
42
+ title: 'Input Sources Query',
42
43
  executor: input_sources_query_executor_1.executeInputSourcesQuery,
43
44
  asciiSummarizer: async (formatter, analyzer, queryResults, result) => {
44
45
  const out = queryResults;
@@ -58,6 +59,7 @@ exports.InputSourcesDefinition = {
58
59
  },
59
60
  fromLine: inputSourcesQueryLineParser,
60
61
  completer: slice_query_parser_1.criteriaQueryCompleter,
62
+ syntax: '@input-sources (<criterion>) <code | file://path>',
61
63
  schema: joi_1.default.object({
62
64
  type: joi_1.default.string().valid('input-sources').required().description('The type of the query.'),
63
65
  criterion: joi_1.default.alternatives(joi_1.default.string(), joi_1.default.array().items(joi_1.default.string())).required().description('The slicing criterion or array of criteria to use.'),
@@ -26,10 +26,12 @@ export interface InspectExceptionQueryResult extends BaseQueryResult {
26
26
  }
27
27
  declare function inspectExceptionLineParser(_output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'inspect-exception'>;
28
28
  export declare const InspectExceptionQueryDefinition: {
29
+ readonly title: "Inspect Exceptions of Functions Query";
29
30
  readonly executor: typeof executeExceptionQuery;
30
31
  readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
31
32
  readonly fromLine: typeof inspectExceptionLineParser;
32
33
  readonly completer: typeof criteriaQueryCompleter;
34
+ readonly syntax: "@inspect-exception [(<crit>;...)] <code | file://path>";
33
35
  readonly schema: Joi.ObjectSchema<any>;
34
36
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
35
37
  };
@@ -22,6 +22,7 @@ function inspectExceptionLineParser(_output, line, _config) {
22
22
  };
23
23
  }
24
24
  exports.InspectExceptionQueryDefinition = {
25
+ title: 'Inspect Exceptions of Functions Query',
25
26
  executor: inspect_exception_query_executor_1.executeExceptionQuery,
26
27
  asciiSummarizer: async (formatter, processed, queryResults, result) => {
27
28
  const out = queryResults;
@@ -44,6 +45,7 @@ exports.InspectExceptionQueryDefinition = {
44
45
  },
45
46
  fromLine: inspectExceptionLineParser,
46
47
  completer: slice_query_parser_1.criteriaQueryCompleter,
48
+ syntax: '@inspect-exception [(<crit>;...)] <code | file://path>',
47
49
  schema: joi_1.default.object({
48
50
  type: joi_1.default.string().valid('inspect-exception').required().description('The type of the query.'),
49
51
  filter: joi_1.default.array().items(joi_1.default.string().required()).optional().description('If given, only function definitions that match one of the given slicing criteria are considered. Each criterion can be either `line:column`, `line@variable-name`, or `$id`, where the latter directly specifies the node id of the function definition to be considered.'),
@@ -20,10 +20,12 @@ export interface InspectHigherOrderQueryResult extends BaseQueryResult {
20
20
  }
21
21
  declare function inspectHoLineParser(_output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'inspect-higher-order'>;
22
22
  export declare const InspectHigherOrderQueryDefinition: {
23
+ readonly title: "Inspect Higher-Order Functions Query";
23
24
  readonly executor: typeof executeHigherOrderQuery;
24
25
  readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
25
26
  readonly fromLine: typeof inspectHoLineParser;
26
27
  readonly completer: typeof criteriaQueryCompleter;
28
+ readonly syntax: "@inspect-higher-order [(<crit>;...)] <code | file://path>";
27
29
  readonly schema: Joi.ObjectSchema<any>;
28
30
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
29
31
  };
@@ -21,6 +21,7 @@ function inspectHoLineParser(_output, line, _config) {
21
21
  };
22
22
  }
23
23
  exports.InspectHigherOrderQueryDefinition = {
24
+ title: 'Inspect Higher-Order Functions Query',
24
25
  executor: inspect_higher_order_query_executor_1.executeHigherOrderQuery,
25
26
  asciiSummarizer: async (formatter, processed, queryResults, result) => {
26
27
  const out = queryResults;
@@ -34,6 +35,7 @@ exports.InspectHigherOrderQueryDefinition = {
34
35
  },
35
36
  fromLine: inspectHoLineParser,
36
37
  completer: slice_query_parser_1.criteriaQueryCompleter,
38
+ syntax: '@inspect-higher-order [(<crit>;...)] <code | file://path>',
37
39
  schema: joi_1.default.object({
38
40
  type: joi_1.default.string().valid('inspect-higher-order').required().description('The type of the query.'),
39
41
  filter: joi_1.default.array().items(joi_1.default.string().required()).optional().description('If given, only function definitions that match one of the given slicing criteria are considered. Each criterion can be either `line:column`, `line@variable-name`, or `$id`, where the latter directly specifies the node id of the function definition to be considered.')
@@ -19,9 +19,11 @@ export interface InspectRecursionQueryResult extends BaseQueryResult {
19
19
  }
20
20
  declare function inspectRecLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'inspect-recursion'>;
21
21
  export declare const InspectRecursionQueryDefinition: {
22
+ readonly title: "Inspect Recursive Functions Query";
22
23
  readonly executor: typeof executeRecursionQuery;
23
24
  readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
24
25
  readonly fromLine: typeof inspectRecLineParser;
26
+ readonly syntax: "@inspect-recursion [(<crit>;...)] <code | file://path>";
25
27
  readonly schema: Joi.ObjectSchema<any>;
26
28
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
27
29
  };
@@ -21,6 +21,7 @@ function inspectRecLineParser(output, line, _config) {
21
21
  };
22
22
  }
23
23
  exports.InspectRecursionQueryDefinition = {
24
+ title: 'Inspect Recursive Functions Query',
24
25
  executor: inspect_recursion_query_executor_1.executeRecursionQuery,
25
26
  asciiSummarizer: async (formatter, processed, queryResults, result) => {
26
27
  const out = queryResults;
@@ -33,6 +34,7 @@ exports.InspectRecursionQueryDefinition = {
33
34
  return true;
34
35
  },
35
36
  fromLine: inspectRecLineParser,
37
+ syntax: '@inspect-recursion [(<crit>;...)] <code | file://path>',
36
38
  schema: joi_1.default.object({
37
39
  type: joi_1.default.string().valid('inspect-recursion').required().description('The type of the query.'),
38
40
  filter: joi_1.default.array().items(joi_1.default.string().required()).optional().description('If given, only function definitions that match one of the given slicing criteria are considered. Each criterion can be either `line:column`, `line@variable-name`, or `$id`, where the latter directly specifies the node id of the function definition to be considered.')
@@ -5,6 +5,9 @@ const linter_rules_1 = require("../../../linter/linter-rules");
5
5
  const log_1 = require("../../../util/log");
6
6
  const linter_executor_1 = require("../../../linter/linter-executor");
7
7
  const gas_1 = require("../../../gas");
8
+ const linter_output_1 = require("../../../linter/linter-output");
9
+ const version_1 = require("../../../util/version");
10
+ const assert_1 = require("../../../util/assert");
8
11
  /**
9
12
  * Executes the given linter queries using the provided analyzer.
10
13
  * A query without an explicit rule list runs only the rules that are active by default.
@@ -12,9 +15,11 @@ const gas_1 = require("../../../gas");
12
15
  * @see {@link LinterRuleInformation#activeByDefault} - opts a rule out of the default rule set
13
16
  */
14
17
  async function executeLinterQuery({ analyzer }, queries) {
15
- // no explicit rules: run only the rules that opt in via activeByDefault (default true)
18
+ // no explicit rules: run the rules that opt in via activeByDefault (default true), minus those the (project-kind
19
+ // specialized) config disables -- e.g. software-has-license/-tests are off for a lone script or a notebook
20
+ const disabled = new Set(analyzer.flowrConfig.linter.disabledRules);
16
21
  const defaultRules = Object.keys(linter_rules_1.LintingRules)
17
- .filter((name) => linter_rules_1.LintingRules[name].info.activeByDefault !== false);
22
+ .filter((name) => linter_rules_1.LintingRules[name].info.activeByDefault !== false && !disabled.has(name));
18
23
  const flattened = queries.flatMap(q => q.rules ?? defaultRules);
19
24
  const distinct = new Set(flattened);
20
25
  if (distinct.size !== flattened.length) {
@@ -34,8 +39,12 @@ async function executeLinterQuery({ analyzer }, queries) {
34
39
  }
35
40
  results.results[ruleName] = await (0, linter_executor_1.executeLintingRule)(ruleName, analyzer, entry?.config);
36
41
  }
42
+ /* rendered here, not when printing, so an api client gets it too */
43
+ const format = queries.map(q => q.format).find(assert_1.isNotUndefined);
44
+ const formatted = format ? (0, linter_output_1.formatLints)(results.results, format, (0, version_1.flowrVersion)().toString()) : undefined;
37
45
  return {
38
46
  ...results,
47
+ ...(formatted ? { formatted } : {}),
39
48
  '.meta': {
40
49
  timing: Date.now() - start
41
50
  }
@@ -3,11 +3,12 @@ import type { ParsedQueryLine } from '../../query';
3
3
  import Joi from 'joi';
4
4
  import { executeLinterQuery } from './linter-query-executor';
5
5
  import { type LintingRuleNames } from '../../../linter/linter-rules';
6
- import { type ConfiguredLintingRule, LintingResultCertainty, LintingResults } from '../../../linter/linter-format';
6
+ import { type ConfiguredLintingRule, LintingResultCertainty } from '../../../linter/linter-format';
7
7
  import { type OutputFormatter } from '../../../util/text/ansi';
8
8
  import type { FlowrConfig } from '../../../config';
9
9
  import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
10
10
  import type { CommandCompletions } from '../../../cli/repl/core';
11
+ import { type LintResultsByRule, LinterOutputFormat } from '../../../linter/linter-output';
11
12
  export interface LinterQuery extends BaseQueryFormat {
12
13
  readonly type: 'linter';
13
14
  /**
@@ -15,22 +16,26 @@ export interface LinterQuery extends BaseQueryFormat {
15
16
  * Optionally, a {@link ConfiguredLintingRule} can be provided, which additionally includes custom user-supplied values for the linting rules' configurations.
16
17
  */
17
18
  readonly rules?: (LintingRuleNames | ConfiguredLintingRule)[];
19
+ /** Print the findings in a machine-readable {@link LinterOutputFormat|format} instead of the human-readable summary. */
20
+ readonly format?: LinterOutputFormat;
18
21
  }
19
22
  export interface LinterQueryResult extends BaseQueryResult {
20
23
  /**
21
24
  * The results of the linter query, which returns a set of linting results for each rule that was executed.
22
25
  */
23
- readonly results: {
24
- [L in LintingRuleNames]?: LintingResults<L>;
25
- };
26
+ readonly results: LintResultsByRule;
27
+ /** The findings rendered in the requested {@link LinterQuery#format|format}, if one was requested. */
28
+ readonly formatted?: string;
26
29
  }
27
30
  declare function linterQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'linter'>;
28
31
  declare function linterQueryCompleter(line: readonly string[], startingNewArg: boolean, _config: FlowrConfig): CommandCompletions;
29
32
  export declare const LinterQueryDefinition: {
33
+ readonly title: "Linter Query";
30
34
  readonly executor: typeof executeLinterQuery;
31
35
  readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
32
36
  readonly completer: typeof linterQueryCompleter;
33
37
  readonly fromLine: typeof linterQueryLineParser;
38
+ readonly syntax: "@linter [rules:<r1>,<r2>,...] [format:<fmt>] <code | file://path>";
34
39
  readonly schema: Joi.ObjectSchema<any>;
35
40
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult, _queries: readonly import("../../query").Query[], certainty: LintingResultCertainty | undefined) => ((string & {
36
41
  __brand?: "node-id";