@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
@@ -12,6 +12,7 @@ const ansi_1 = require("../../../util/text/ansi");
12
12
  const time_1 = require("../../../util/text/time");
13
13
  const retriever_1 = require("../../../r-bridge/retriever");
14
14
  const assert_1 = require("../../../util/assert");
15
+ const linter_output_1 = require("../../../linter/linter-output");
15
16
  function rulesFromInput(output, rulesPart) {
16
17
  return rulesPart
17
18
  .reduce((acc, ruleName) => {
@@ -26,37 +27,45 @@ function rulesFromInput(output, rulesPart) {
26
27
  }, { valid: [], invalid: [] });
27
28
  }
28
29
  const rulesPrefix = 'rules:';
30
+ const formatPrefix = 'format:';
31
+ /** the {@link LinterOutputFormat} of a `format:` argument, warning about an unknown one instead of ignoring it */
32
+ function formatFromInput(output, argument) {
33
+ const wanted = argument.slice(formatPrefix.length).trim();
34
+ const format = Object.values(linter_output_1.LinterOutputFormat).find(f => f === wanted);
35
+ if (format === undefined) {
36
+ output.stderr(`Invalid linting format ${(0, ansi_1.bold)(wanted, output.formatter)}, expected one of `
37
+ + Object.values(linter_output_1.LinterOutputFormat).map(f => (0, ansi_1.bold)(f, output.formatter)).join(', '));
38
+ }
39
+ return format;
40
+ }
29
41
  function linterQueryLineParser(output, line, _config) {
30
42
  let rules = undefined;
31
- let input = undefined;
32
- if (line.length > 0 && line[0].startsWith(rulesPrefix)) {
33
- const rulesPart = line[0].slice(rulesPrefix.length).split(',');
34
- const parseResult = rulesFromInput(output, rulesPart);
43
+ let format = undefined;
44
+ const rest = [...line];
45
+ while (rest.length > 0 && (rest[0].startsWith(rulesPrefix) || rest[0].startsWith(formatPrefix))) {
46
+ const argument = rest.shift();
47
+ if (argument.startsWith(formatPrefix)) {
48
+ format = formatFromInput(output, argument);
49
+ continue;
50
+ }
51
+ const parseResult = rulesFromInput(output, argument.slice(rulesPrefix.length).split(','));
35
52
  if (parseResult.invalid.length > 0) {
36
53
  output.stderr(`Invalid linting rule name(s): ${parseResult.invalid.map(r => (0, ansi_1.bold)(r, output.formatter)).join(', ')}`
37
54
  + `\nValid rule names are: ${Object.keys(linter_rules_1.LintingRules).map(r => (0, ansi_1.bold)(r, output.formatter)).join(', ')}`);
38
55
  }
39
56
  rules = parseResult.valid;
40
- input = line[1];
41
- }
42
- else if (line.length > 0) {
43
- input = line[0];
44
57
  }
45
- return { query: [{ type: 'linter', rules: rules }], rCode: input };
58
+ /* an absent format must not show up as a key, a query is compared by its fingerprint */
59
+ return { query: [{ type: 'linter', rules, ...(format ? { format } : {}) }], rCode: rest.join(' ').trim() || undefined };
46
60
  }
47
61
  function linterQueryCompleter(line, startingNewArg, _config) {
48
- const rulesPrefixNotPresent = line.length == 0 || (line.length == 1 && line[0].length < rulesPrefix.length);
49
- const rulesNotFinished = line.length == 1 && line[0].startsWith(rulesPrefix) && !startingNewArg;
50
- const endOfRules = line.length == 1 && startingNewArg || line.length == 2;
51
- if (rulesPrefixNotPresent) {
52
- return { completions: [`${rulesPrefix}`] };
62
+ const current = startingNewArg ? '' : line[line.length - 1] ?? '';
63
+ if (current.startsWith(formatPrefix)) {
64
+ const wanted = current.slice(formatPrefix.length);
65
+ return { completions: Object.values(linter_output_1.LinterOutputFormat).filter(f => f !== wanted), argumentPart: wanted };
53
66
  }
54
- else if (endOfRules) {
55
- return { completions: [retriever_1.fileProtocol] };
56
- }
57
- else if (rulesNotFinished) {
58
- const rulesWithoutPrefix = line[0].slice(rulesPrefix.length);
59
- const usedRules = rulesWithoutPrefix.split(',').map(r => r.trim());
67
+ else if (current.startsWith(rulesPrefix)) {
68
+ const usedRules = current.slice(rulesPrefix.length).split(',').map(r => r.trim());
60
69
  const allRules = Object.keys(linter_rules_1.LintingRules);
61
70
  const unusedRules = allRules.filter(r => !usedRules.includes(r));
62
71
  const lastRule = usedRules[usedRules.length - 1];
@@ -74,12 +83,24 @@ function linterQueryCompleter(line, startingNewArg, _config) {
74
83
  return { completions: [' '], argumentPart: '' };
75
84
  }
76
85
  }
77
- return { completions: [] };
86
+ /* both are optional and may come in any order, so offer whatever is not given yet */
87
+ const given = startingNewArg ? line : line.slice(0, -1);
88
+ return { completions: [
89
+ ...given.some(a => a.startsWith(rulesPrefix)) ? [] : [rulesPrefix],
90
+ ...given.some(a => a.startsWith(formatPrefix)) ? [] : [formatPrefix],
91
+ retriever_1.fileProtocol
92
+ ] };
78
93
  }
79
94
  exports.LinterQueryDefinition = {
95
+ title: 'Linter Query',
80
96
  executor: linter_query_executor_1.executeLinterQuery,
81
97
  asciiSummarizer: (formatter, analyzer, queryResults, result) => {
82
98
  const out = queryResults;
99
+ /* a machine-readable format is the whole output: a consumer must not have to strip a summary around it */
100
+ if (out.formatted !== undefined) {
101
+ result.push(out.formatted);
102
+ return true;
103
+ }
83
104
  result.push(`Query: ${(0, ansi_1.bold)('linter', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
84
105
  const allDidFail = Object.values(out.results).every(linter_format_1.LintingResults.isError);
85
106
  if (allDidFail) {
@@ -106,8 +127,10 @@ exports.LinterQueryDefinition = {
106
127
  },
107
128
  completer: linterQueryCompleter,
108
129
  fromLine: linterQueryLineParser,
130
+ syntax: '@linter [rules:<r1>,<r2>,...] [format:<fmt>] <code | file://path>',
109
131
  schema: joi_1.default.object({
110
132
  type: joi_1.default.string().valid('linter').required().description('The type of the query.'),
133
+ format: joi_1.default.string().valid(...Object.values(linter_output_1.LinterOutputFormat)).optional().description('Print the findings in a machine-readable format instead of the human-readable summary.'),
111
134
  rules: joi_1.default.array().items(joi_1.default.string().valid(...Object.keys(linter_rules_1.LintingRules)), joi_1.default.object({
112
135
  name: joi_1.default.string().valid(...Object.keys(linter_rules_1.LintingRules)).required(),
113
136
  config: joi_1.default.object()
@@ -28,10 +28,12 @@ export interface LocationMapQueryResult extends BaseQueryResult {
28
28
  }
29
29
  declare function locationMapLineParser(_output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'location-map'>;
30
30
  export declare const LocationMapQueryDefinition: {
31
+ readonly title: "Location Map Query";
31
32
  readonly executor: typeof executeLocationMapQuery;
32
33
  readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[]) => true;
33
34
  readonly fromLine: typeof locationMapLineParser;
34
35
  readonly completer: typeof criteriaQueryCompleter;
36
+ readonly syntax: "@location-map [(<crit>;...)] <code | file://path>";
35
37
  readonly schema: Joi.ObjectSchema<any>;
36
38
  readonly flattenInvolvedNodes: () => never[];
37
39
  };
@@ -21,6 +21,7 @@ function locationMapLineParser(_output, line, _config) {
21
21
  };
22
22
  }
23
23
  exports.LocationMapQueryDefinition = {
24
+ title: 'Location Map Query',
24
25
  executor: location_map_query_executor_1.executeLocationMapQuery,
25
26
  asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
26
27
  const out = queryResults;
@@ -34,6 +35,7 @@ exports.LocationMapQueryDefinition = {
34
35
  },
35
36
  fromLine: locationMapLineParser,
36
37
  completer: slice_query_parser_1.criteriaQueryCompleter,
38
+ syntax: '@location-map [(<crit>;...)] <code | file://path>',
37
39
  schema: joi_1.default.object({
38
40
  type: joi_1.default.string().valid('location-map').required().description('The type of the query.'),
39
41
  ids: joi_1.default.array().items(joi_1.default.string()).optional().description('Optional list of ids to filter the results by.')
@@ -12,6 +12,7 @@ export interface NormalizedAstQueryResult extends BaseQueryResult {
12
12
  readonly normalized: NormalizedAst;
13
13
  }
14
14
  export declare const NormalizedAstQueryDefinition: {
15
+ readonly title: "Normalized AST Query";
15
16
  readonly executor: typeof executeNormalizedAstQuery;
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>;
@@ -10,6 +10,7 @@ const time_1 = require("../../../util/text/time");
10
10
  const ast_1 = require("../../../util/mermaid/ast");
11
11
  const joi_1 = __importDefault(require("joi"));
12
12
  exports.NormalizedAstQueryDefinition = {
13
+ title: 'Normalized AST Query',
13
14
  executor: normalized_ast_query_executor_1.executeNormalizedAstQuery,
14
15
  asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
15
16
  const out = queryResults;
@@ -18,10 +18,12 @@ export interface OriginQueryResult extends BaseQueryResult {
18
18
  }
19
19
  declare function originQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'origin'>;
20
20
  export declare const OriginQueryDefinition: {
21
+ readonly title: "Origin Query";
21
22
  readonly executor: typeof executeResolveValueQuery;
22
23
  readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
23
24
  readonly fromLine: typeof originQueryLineParser;
24
25
  readonly completer: typeof criteriaQueryCompleter;
26
+ readonly syntax: "@origin (<criterion>) <code | file://path>";
25
27
  readonly schema: Joi.ObjectSchema<any>;
26
28
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
27
29
  };
@@ -24,6 +24,7 @@ function originQueryLineParser(output, line, _config) {
24
24
  };
25
25
  }
26
26
  exports.OriginQueryDefinition = {
27
+ title: 'Origin Query',
27
28
  executor: origin_query_executor_1.executeResolveValueQuery,
28
29
  asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
29
30
  const out = queryResults;
@@ -36,6 +37,7 @@ exports.OriginQueryDefinition = {
36
37
  },
37
38
  fromLine: originQueryLineParser,
38
39
  completer: slice_query_parser_1.criteriaQueryCompleter,
40
+ syntax: '@origin (<criterion>) <code | file://path>',
39
41
  schema: joi_1.default.object({
40
42
  type: joi_1.default.string().valid('origin').required().description('The type of the query.'),
41
43
  criterion: joi_1.default.string().required().description('The slicing criteria to use'),
@@ -1,20 +1,5 @@
1
1
  import type { ProjectQuery, ProjectQueryResult } from './project-query-format';
2
- import { ProjectKind } from './project-query-format';
3
2
  import type { BasicQueryData } from '../../base-query-format';
4
- import type { ReadOnlyFlowrAnalyzerFilesContext } from '../../../project/context/flowr-analyzer-files-context';
5
- /**
6
- * Classifies the {@link ProjectKind} of the given files context.
7
- *
8
- * A `DESCRIPTION` file unambiguously marks an R {@link ProjectKind.Package | package} and is available as soon
9
- * as the project is loaded. The finer distinctions ({@link ProjectKind.ShinyApp | shiny app},
10
- * {@link ProjectKind.Notebook | notebook}, {@link ProjectKind.Script | script} vs.
11
- * {@link ProjectKind.Project | multi-file project}) rely on the project's source files, which are only known
12
- * once the dataflow analysis has run; before that a non-package project reports {@link ProjectKind.Unknown}.
13
- *
14
- * This is a pure inspection of the files context and can be used standalone, independently of the project query.
15
- * @param files - the (read-only) files context of an analyzer to classify
16
- */
17
- export declare function classifyProject(files: ReadOnlyFlowrAnalyzerFilesContext): ProjectKind;
18
3
  /**
19
4
  * Executes the given project queries.
20
5
  */
@@ -1,27 +1,21 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.classifyProject = classifyProject;
7
3
  exports.executeProjectQuery = executeProjectQuery;
8
4
  const log_1 = require("../../../util/log");
9
- const project_query_format_1 = require("./project-query-format");
10
5
  const flowr_file_1 = require("../../../project/context/flowr-file");
11
6
  const r_base_packages_1 = require("../../../util/r-base-packages");
12
- const path_1 = __importDefault(require("path"));
13
7
  /**
14
- * Collects dependency statistics from the project's `DESCRIPTION` file, cross-referenced with the
15
- * loaded package database(s) to report how many dependencies we can cover.
8
+ * Collects dependency statistics from what the project declares, cross-referenced with the
9
+ * loaded signature database(s) to report how many dependencies we can cover.
16
10
  */
17
- function collectDependencyStats(desc, deps, basePackages) {
18
- const imports = desc.imports() ?? [];
19
- const dependsAll = desc.depends() ?? [];
11
+ function collectDependencyStats(declared, deps, basePackages) {
12
+ const imports = declared.imports ?? [];
13
+ const dependsAll = declared.depends ?? [];
20
14
  const rEntry = dependsAll.find(d => d.name === 'R');
21
15
  const rVersion = rEntry?.derivedVersion?.raw;
22
16
  const depends = dependsAll.filter(d => d.name !== 'R');
23
- const suggests = desc.suggests() ?? [];
24
- const linkingTo = desc.linkingTo() ?? [];
17
+ const suggests = declared.suggests ?? [];
18
+ const linkingTo = declared.linkingTo ?? [];
25
19
  const runtime = new Set([...imports, ...depends, ...linkingTo].map(p => p.name));
26
20
  let base = 0;
27
21
  let covered = 0;
@@ -51,46 +45,6 @@ function collectDependencyStats(desc, deps, basePackages) {
51
45
  rVersion: rVersion && /\d/.test(rVersion) ? rVersion : undefined
52
46
  };
53
47
  }
54
- const notebookExtension = /\.(ipynb|rmd|qmd|rnw)$/;
55
- /**
56
- * Classifies the {@link ProjectKind} of the given files context.
57
- *
58
- * A `DESCRIPTION` file unambiguously marks an R {@link ProjectKind.Package | package} and is available as soon
59
- * as the project is loaded. The finer distinctions ({@link ProjectKind.ShinyApp | shiny app},
60
- * {@link ProjectKind.Notebook | notebook}, {@link ProjectKind.Script | script} vs.
61
- * {@link ProjectKind.Project | multi-file project}) rely on the project's source files, which are only known
62
- * once the dataflow analysis has run; before that a non-package project reports {@link ProjectKind.Unknown}.
63
- *
64
- * This is a pure inspection of the files context and can be used standalone, independently of the project query.
65
- * @param files - the (read-only) files context of an analyzer to classify
66
- */
67
- function classifyProject(files) {
68
- if (files.getFilesByRole(flowr_file_1.FileRole.Description).length > 0) {
69
- return project_query_format_1.ProjectKind.Package;
70
- }
71
- const names = new Set([
72
- ...files.getAllFiles().map(f => path_1.default.basename(f.path()).toLowerCase()),
73
- ...files.consideredFilesList().map(p => path_1.default.basename(p).toLowerCase())
74
- ]);
75
- if (names.size === 0) {
76
- return project_query_format_1.ProjectKind.Unknown;
77
- }
78
- if (names.has('app.r') || (names.has('ui.r') && names.has('server.r'))) {
79
- return project_query_format_1.ProjectKind.ShinyApp;
80
- }
81
- for (const name of names) {
82
- if (notebookExtension.test(name)) {
83
- return project_query_format_1.ProjectKind.Notebook;
84
- }
85
- }
86
- let rSources = 0;
87
- for (const name of names) {
88
- if (name.endsWith('.r')) {
89
- rSources++;
90
- }
91
- }
92
- return rSources <= 1 ? project_query_format_1.ProjectKind.Script : project_query_format_1.ProjectKind.Project;
93
- }
94
48
  /**
95
49
  * Executes the given project queries.
96
50
  */
@@ -106,25 +60,28 @@ async function executeProjectQuery({ analyzer }, queries) {
106
60
  }
107
61
  const ctx = analyzer.inspectContext();
108
62
  const basePackages = new Set(ctx.config.project.basePackages ?? (0, r_base_packages_1.baseRPackages)(ctx.resolvedRVersion));
109
- const descFile = ctx.files.getFilesByRole(flowr_file_1.FileRole.Description);
110
- const desc = descFile[0];
111
63
  const roleCounts = {};
112
64
  for (const file of Object.values(flowr_file_1.FileRole)) {
113
65
  roleCounts[file] = ctx.files.getFilesByRole(file).length;
114
66
  }
67
+ // whichever plugin read the metadata (DESCRIPTION, rproject.toml, a lockfile) contributed it to the context,
68
+ // so nothing here has to know which file the project happens to use
69
+ const declared = ctx.meta.getDeclaredPackages();
70
+ const hasDeclarations = Object.values(declared).some(g => g !== undefined);
115
71
  return {
116
72
  '.meta': {
117
73
  timing: Date.now() - startTime
118
74
  },
119
- name: desc?.content().get('Package')?.[0] ?? desc?.content()?.get('Title')?.[0],
75
+ name: ctx.meta.getProjectName() ?? ctx.meta.getProjectTitle(),
120
76
  files: Array.from(ctx.files.consideredFilesList()),
121
- authors: desc?.authors(),
122
- encoding: desc?.content().get('Encoding')?.[0],
123
- version: desc?.content().get('Version')?.[0],
124
- licenses: desc?.license(),
77
+ authors: ctx.meta.getAuthors(),
78
+ encoding: ctx.meta.getEncoding(),
79
+ version: ctx.meta.getProjectVersion()?.str,
80
+ rVersion: ctx.meta.getRVersion(),
81
+ licenses: ctx.meta.getLicenses(),
125
82
  roleCounts: roleCounts,
126
- kind: classifyProject(ctx.files),
127
- dependencies: desc ? collectDependencyStats(desc, ctx.deps, basePackages) : undefined
83
+ kind: ctx.projectKind(),
84
+ dependencies: hasDeclarations ? collectDependencyStats(declared, ctx.deps, basePackages) : undefined
128
85
  };
129
86
  }
130
87
  //# sourceMappingURL=project-query-executor.js.map
@@ -4,27 +4,13 @@ import Joi from 'joi';
4
4
  import type { RAuthorInfo } from '../../../util/r-author';
5
5
  import type { RLicenseElementInfo } from '../../../util/r-license';
6
6
  import type { FileRole } from '../../../project/context/flowr-file';
7
+ import type { ProjectKind } from '../../../project/context/project-kind';
7
8
  export interface ProjectQuery extends BaseQueryFormat {
8
9
  readonly type: 'project';
9
10
  /** Whether to include Dataflow information in the result. */
10
11
  readonly withDf?: boolean;
11
12
  }
12
- /** The kind of project that flowR is analyzing. */
13
- export declare enum ProjectKind {
14
- /** An R package (has a `DESCRIPTION` file). */
15
- Package = "package",
16
- /** A single R script. */
17
- Script = "script",
18
- /** A Shiny application (`app.R`, or `ui.R` together with `server.R`). */
19
- ShinyApp = "shiny-app",
20
- /** A notebook or literate document (`.ipynb`, `.Rmd`, `.qmd`, `.rnw`). */
21
- Notebook = "notebook",
22
- /** A multi-file project that is not a package. */
23
- Project = "project",
24
- /** The kind could not be determined (e.g. before the files are known). */
25
- Unknown = "unknown"
26
- }
27
- /** Statistics on the project's declared dependencies, cross-referenced with the package database. */
13
+ /** Statistics on the project's declared dependencies, cross-referenced with the signature database. */
28
14
  export interface ProjectDependencyStats {
29
15
  /** Number of packages in the `Imports` field. */
30
16
  readonly imports: number;
@@ -38,9 +24,9 @@ export interface ProjectDependencyStats {
38
24
  readonly runtime: number;
39
25
  /** How many of the runtime dependencies are base or recommended R packages. */
40
26
  readonly base: number;
41
- /** How many of the non-base runtime dependencies are covered by the loaded package database(s). */
27
+ /** How many of the non-base runtime dependencies are covered by the loaded signature database(s). */
42
28
  readonly covered: number;
43
- /** The first few runtime dependencies with the version the package database resolved them to, if any. */
29
+ /** The first few runtime dependencies with the version the signature database resolved them to, if any. */
44
30
  readonly first: {
45
31
  name: string;
46
32
  base: boolean;
@@ -64,12 +50,15 @@ export interface ProjectQueryResult extends BaseQueryResult {
64
50
  readonly encoding?: string;
65
51
  /** The version of the project, if available. */
66
52
  readonly version?: string;
53
+ /** The R version the project targets, e.g. the `r_version` of an `rproject.toml`. */
54
+ readonly rVersion?: string;
67
55
  /** The classified kind of the project (e.g. package, script, shiny app). */
68
56
  readonly kind?: ProjectKind;
69
57
  /** Statistics on the project's declared dependencies, if a `DESCRIPTION` file is available. */
70
58
  readonly dependencies?: ProjectDependencyStats;
71
59
  }
72
60
  export declare const ProjectQueryDefinition: {
61
+ readonly title: "Project Query";
73
62
  readonly executor: typeof executeProjectQuery;
74
63
  readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
75
64
  readonly schema: Joi.ObjectSchema<any>;
@@ -3,33 +3,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ProjectQueryDefinition = exports.ProjectKind = void 0;
6
+ exports.ProjectQueryDefinition = void 0;
7
7
  const project_query_executor_1 = require("./project-query-executor");
8
8
  const ansi_1 = require("../../../util/text/ansi");
9
9
  const time_1 = require("../../../util/text/time");
10
10
  const joi_1 = __importDefault(require("joi"));
11
11
  const r_author_1 = require("../../../util/r-author");
12
12
  const r_license_1 = require("../../../util/r-license");
13
- /** The kind of project that flowR is analyzing. */
14
- var ProjectKind;
15
- (function (ProjectKind) {
16
- /** An R package (has a `DESCRIPTION` file). */
17
- ProjectKind["Package"] = "package";
18
- /** A single R script. */
19
- ProjectKind["Script"] = "script";
20
- /** A Shiny application (`app.R`, or `ui.R` together with `server.R`). */
21
- ProjectKind["ShinyApp"] = "shiny-app";
22
- /** A notebook or literate document (`.ipynb`, `.Rmd`, `.qmd`, `.rnw`). */
23
- ProjectKind["Notebook"] = "notebook";
24
- /** A multi-file project that is not a package. */
25
- ProjectKind["Project"] = "project";
26
- /** The kind could not be determined (e.g. before the files are known). */
27
- ProjectKind["Unknown"] = "unknown";
28
- })(ProjectKind || (exports.ProjectKind = ProjectKind = {}));
29
13
  function addSuffix(count, singular = '', plural = 's') {
30
14
  return `${count === 1 ? singular : plural}`;
31
15
  }
32
16
  exports.ProjectQueryDefinition = {
17
+ title: 'Project Query',
33
18
  executor: project_query_executor_1.executeProjectQuery,
34
19
  asciiSummarizer: (formatter, analyzer, queryResults, result) => {
35
20
  const out = queryResults;
@@ -75,7 +60,7 @@ exports.ProjectQueryDefinition = {
75
60
  if (out.dependencies) {
76
61
  const d = out.dependencies;
77
62
  result.push(` ╰ Dependencies: ${d.runtime} runtime (${d.imports} imports, ${d.depends} depends, ${d.linkingTo} linkingTo), ${d.suggests} suggested`);
78
- result.push(` ╰ ${d.base} base/recommended, ${d.covered}/${Math.max(d.runtime - d.base, 0)} non-base covered by the package database`);
63
+ result.push(` ╰ ${d.base} base/recommended, ${d.covered}/${Math.max(d.runtime - d.base, 0)} non-base covered by the signature database`);
79
64
  if (d.first.length > 0) {
80
65
  const names = d.first.map(f => f.dbVersion ? `${f.name}@${f.dbVersion}` : f.name).join(', ');
81
66
  result.push(` ╰ e.g. ${names}${d.runtime > d.first.length ? ', ...' : ''}`);
@@ -27,10 +27,12 @@ export interface ProvenanceQueryResult extends BaseQueryResult {
27
27
  export declare function fdefBoundaryParser(argument: string): boolean;
28
28
  declare function provenanceQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'provenance'>;
29
29
  export declare const ProvenanceQueryDefinition: {
30
+ readonly title: "Provenance Query";
30
31
  readonly executor: typeof executeProvenanceQuery;
31
32
  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>;
32
33
  readonly fromLine: typeof provenanceQueryLineParser;
33
34
  readonly completer: typeof criteriaQueryCompleter;
35
+ readonly syntax: "@provenance (<criterion>)[f] <code | file://path>";
34
36
  readonly schema: Joi.ObjectSchema<any>;
35
37
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
36
38
  };
@@ -32,6 +32,7 @@ function provenanceQueryLineParser(output, line, _config) {
32
32
  }], rCode: line[1] };
33
33
  }
34
34
  exports.ProvenanceQueryDefinition = {
35
+ title: 'Provenance Query',
35
36
  executor: provenance_query_executor_1.executeProvenanceQuery,
36
37
  asciiSummarizer: async (formatter, analyzer, queryResults, result) => {
37
38
  const out = queryResults;
@@ -46,6 +47,7 @@ exports.ProvenanceQueryDefinition = {
46
47
  },
47
48
  fromLine: provenanceQueryLineParser,
48
49
  completer: slice_query_parser_1.criteriaQueryCompleter,
50
+ syntax: '@provenance (<criterion>)[f] <code | file://path>',
49
51
  schema: joi_1.default.object({
50
52
  type: joi_1.default.string().valid('provenance').required().description('The type of the query.'),
51
53
  criterion: joi_1.default.string().required().description('The slicing criterion to use.'),
@@ -19,10 +19,12 @@ export interface ResolveValueQueryResult extends BaseQueryResult {
19
19
  }
20
20
  declare function resolveValueLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'resolve-value'>;
21
21
  export declare const ResolveValueQueryDefinition: {
22
+ readonly title: "Resolve Value Query";
22
23
  readonly executor: typeof executeResolveValueQuery;
23
24
  readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
24
25
  readonly fromLine: typeof resolveValueLineParser;
25
26
  readonly completer: typeof criteriaQueryCompleter;
27
+ readonly syntax: "@resolve-value (<crit>;...) <code | file://path>";
26
28
  readonly schema: Joi.ObjectSchema<any>;
27
29
  readonly flattenInvolvedNodes: () => never[];
28
30
  };
@@ -27,6 +27,7 @@ function resolveValueLineParser(output, line, _config) {
27
27
  };
28
28
  }
29
29
  exports.ResolveValueQueryDefinition = {
30
+ title: 'Resolve Value Query',
30
31
  executor: resolve_value_query_executor_1.executeResolveValueQuery,
31
32
  asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
32
33
  const out = queryResults;
@@ -44,6 +45,7 @@ exports.ResolveValueQueryDefinition = {
44
45
  },
45
46
  fromLine: resolveValueLineParser,
46
47
  completer: slice_query_parser_1.criteriaQueryCompleter,
48
+ syntax: '@resolve-value (<crit>;...) <code | file://path>',
47
49
  schema: joi_1.default.object({
48
50
  type: joi_1.default.string().valid('resolve-value').required().description('The type of the query.'),
49
51
  criteria: joi_1.default.array().items(joi_1.default.string()).min(1).required().description('The slicing criteria to use.'),
@@ -14,6 +14,7 @@ export interface SearchQueryResult extends BaseQueryResult {
14
14
  }[];
15
15
  }
16
16
  export declare const SearchQueryDefinition: {
17
+ readonly title: "Search Query";
17
18
  readonly executor: typeof executeSearch;
18
19
  readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
19
20
  readonly schema: Joi.ObjectSchema<any>;
@@ -12,6 +12,7 @@ const search_query_executor_1 = require("./search-query-executor");
12
12
  const flowr_search_printer_1 = require("../../../search/flowr-search-printer");
13
13
  const mermaid_1 = require("../../../util/mermaid/mermaid");
14
14
  exports.SearchQueryDefinition = {
15
+ title: 'Search Query',
15
16
  executor: search_query_executor_1.executeSearch,
16
17
  asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
17
18
  const out = queryResults;
@@ -6,6 +6,11 @@ import type { CommandCompletions } from '../../../cli/repl/core';
6
6
  export declare function cranPageUrl(pkg: string): string;
7
7
  /** deep-link a definition into the CRAN mirror at the package's version tag (falling back to `HEAD`) */
8
8
  export declare function cranMirrorSourceUrl(pkg: string, version: string | undefined, file: string, line?: number): string;
9
+ /** best-effort rdrr.io documentation link: `/r/<pkg>/<fn>` for base R, `/cran/<pkg>/man/<fn>` for CRAN */
10
+ export declare function rdrrDocUrl(pkg: string, fn: string, opts: {
11
+ base: boolean;
12
+ cran: boolean;
13
+ }): string | undefined;
9
14
  /**
10
15
  * The detailed view of a single function within a package: its signature (parameters, forced/optional,
11
16
  * defaults), properties, definition location, call graph, and -- for a CRAN package -- a deep link into the