@eagleoutice/flowr 2.12.3 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/README.md +38 -91
  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 +10 -0
  33. package/cli/common/options.js +2 -0
  34. package/cli/common/scripts-info.d.ts +10 -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-query.js +42 -20
  40. package/cli/repl/commands/repl-signature.js +2 -2
  41. package/cli/repl/core.d.ts +14 -5
  42. package/cli/repl/core.js +32 -17
  43. package/cli/repl/parser/slice-query-parser.d.ts +69 -8
  44. package/cli/repl/parser/slice-query-parser.js +82 -13
  45. package/cli/repl/path-input.d.ts +6 -0
  46. package/cli/repl/path-input.js +41 -0
  47. package/cli/repl/print-version.js +3 -5
  48. package/cli/slicer-app.d.ts +2 -0
  49. package/cli/slicer-app.js +2 -1
  50. package/config.d.ts +54 -6
  51. package/config.js +133 -12
  52. package/control-flow/control-flow-graph.d.ts +3 -2
  53. package/control-flow/control-flow-graph.js +34 -14
  54. package/control-flow/semantic-cfg-guided-visitor.d.ts +3 -0
  55. package/control-flow/semantic-cfg-guided-visitor.js +3 -0
  56. package/core/steps/all/static-slicing/10-reconstruct.d.ts +6 -0
  57. package/core/steps/all/static-slicing/10-reconstruct.js +3 -1
  58. package/data/r-base-packages.generated.d.ts +1 -1
  59. package/data/r-base-packages.generated.js +3 -3
  60. package/data/sigdb/sigdb.remote.json +53 -53
  61. package/dataflow/environments/built-in-proc-name.d.ts +2 -0
  62. package/dataflow/environments/built-in-proc-name.js +2 -0
  63. package/dataflow/environments/built-in.d.ts +2 -0
  64. package/dataflow/environments/built-in.js +2 -0
  65. package/dataflow/environments/default-builtin-config.d.ts +3 -5
  66. package/dataflow/environments/default-builtin-config.js +2 -2
  67. package/dataflow/environments/environment.d.ts +9 -0
  68. package/dataflow/environments/environment.js +28 -7
  69. package/dataflow/environments/identifier.d.ts +1 -2
  70. package/dataflow/environments/identifier.js +1 -5
  71. package/dataflow/extractor.js +1 -2
  72. package/dataflow/graph/dataflowgraph-builder.js +42 -3
  73. package/dataflow/graph/df-helper.d.ts +15 -0
  74. package/dataflow/graph/df-helper.js +20 -0
  75. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +4 -4
  76. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +7 -0
  77. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +13 -0
  78. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +4 -0
  79. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +57 -11
  80. package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +12 -0
  81. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +233 -0
  82. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +2 -1
  83. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +5 -3
  84. package/documentation/data/faq/faqs.js +12 -1
  85. package/documentation/doc-readme.js +1 -1
  86. package/documentation/doc-util/doc-files.d.ts +2 -2
  87. package/documentation/doc-util/doc-files.js +4 -7
  88. package/documentation/doc-util/doc-query.d.ts +12 -9
  89. package/documentation/doc-util/doc-query.js +63 -28
  90. package/documentation/wiki-absint.js +1 -4
  91. package/documentation/wiki-analyzer.js +8 -3
  92. package/documentation/wiki-cfg.js +3 -2
  93. package/documentation/wiki-dataflow-graph.js +14 -4
  94. package/documentation/wiki-interface.js +29 -16
  95. package/documentation/wiki-mk/doc-maker.js +1 -1
  96. package/documentation/wiki-query.js +189 -30
  97. package/documentation/wiki-signature-database.d.ts +1 -1
  98. package/documentation/wiki-signature-database.js +53 -27
  99. package/linter/linter-output.d.ts +24 -0
  100. package/linter/linter-output.js +117 -0
  101. package/linter/linter-rules.d.ts +2 -4
  102. package/linter/rules/dataframe-access-validation.js +4 -4
  103. package/linter/rules/deprecated-functions.d.ts +2 -4
  104. package/linter/rules/deprecated-functions.js +58 -3
  105. package/linter/rules/undefined-symbol.js +18 -10
  106. package/linter/rules/unused-definition.js +24 -0
  107. package/package.json +5 -2
  108. package/project/context/flowr-analyzer-context.d.ts +59 -1
  109. package/project/context/flowr-analyzer-context.js +118 -3
  110. package/project/context/flowr-analyzer-dependencies-context.d.ts +32 -7
  111. package/project/context/flowr-analyzer-dependencies-context.js +33 -3
  112. package/project/context/flowr-analyzer-files-context.d.ts +32 -0
  113. package/project/context/flowr-analyzer-files-context.js +132 -14
  114. package/project/context/flowr-analyzer-loading-order-context.d.ts +6 -0
  115. package/project/context/flowr-analyzer-loading-order-context.js +20 -0
  116. package/project/context/flowr-analyzer-meta-context.d.ts +92 -10
  117. package/project/context/flowr-analyzer-meta-context.js +64 -23
  118. package/project/context/flowr-file.d.ts +7 -0
  119. package/project/context/flowr-file.js +7 -0
  120. package/project/context/project-kind.d.ts +22 -0
  121. package/project/context/project-kind.js +27 -0
  122. package/project/dependency-version-space.d.ts +166 -0
  123. package/project/dependency-version-space.js +564 -0
  124. package/project/flowr-analyzer-builder.js +1 -1
  125. package/project/flowr-analyzer.d.ts +4 -0
  126. package/project/flowr-analyzer.js +5 -0
  127. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +4 -0
  128. package/project/plugins/file-plugins/files/flowr-description-file.js +7 -0
  129. package/project/plugins/file-plugins/files/flowr-namespace-file.js +5 -1
  130. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +739 -0
  131. package/project/plugins/file-plugins/files/flowr-rda-file.js +2407 -0
  132. package/project/plugins/file-plugins/files/flowr-rproject-file.d.ts +31 -0
  133. package/project/plugins/file-plugins/files/flowr-rproject-file.js +66 -0
  134. package/project/plugins/file-plugins/files/r-fun-tab.d.ts +828 -0
  135. package/project/plugins/file-plugins/files/r-fun-tab.js +1039 -0
  136. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +1 -1
  137. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +1 -1
  138. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +1 -1
  139. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +1 -1
  140. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +1 -1
  141. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +1 -1
  142. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +1 -1
  143. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +1 -1
  144. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +1 -1
  145. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +1 -1
  146. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +1 -1
  147. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +26 -0
  148. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +38 -0
  149. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +17 -0
  150. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +30 -0
  151. package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.d.ts +22 -0
  152. package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.js +36 -0
  153. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +1 -1
  154. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +1 -1
  155. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +1 -1
  156. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +1 -1
  157. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +3 -4
  158. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +5 -6
  159. package/project/plugins/flowr-analyzer-plugin.js +5 -0
  160. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +1 -1
  161. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
  162. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.d.ts +14 -0
  163. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.js +53 -0
  164. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +1 -1
  165. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.d.ts +15 -0
  166. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.js +33 -0
  167. package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.d.ts +1 -1
  168. package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +18 -13
  169. package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.d.ts +13 -0
  170. package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.js +32 -0
  171. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +1 -1
  172. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
  173. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +8 -1
  174. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +70 -7
  175. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.d.ts +1 -1
  176. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +1 -1
  177. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +1 -1
  178. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.d.ts +18 -0
  179. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +62 -0
  180. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +4 -1
  181. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +5 -13
  182. package/project/plugins/package-version-plugins/package.d.ts +4 -1
  183. package/project/plugins/package-version-plugins/package.js +8 -5
  184. package/project/plugins/plugin-registry.d.ts +11 -3
  185. package/project/plugins/plugin-registry.js +24 -5
  186. package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.d.ts +51 -0
  187. package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.js +101 -0
  188. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +10 -5
  189. package/project/sigdb/build.js +12 -2
  190. package/project/sigdb/decode.d.ts +7 -0
  191. package/project/sigdb/decode.js +35 -4
  192. package/project/sigdb/decompress.d.ts +2 -0
  193. package/project/sigdb/decompress.js +5 -0
  194. package/project/sigdb/manifest.d.ts +5 -0
  195. package/project/sigdb/manifest.js +37 -6
  196. package/project/sigdb/reader.d.ts +82 -2
  197. package/project/sigdb/reader.js +226 -14
  198. package/project/sigdb/schema.d.ts +31 -5
  199. package/project/sigdb/schema.js +7 -3
  200. package/project/sigdb/{version.d.ts → sigdb-version.d.ts} +21 -1
  201. package/project/sigdb/sigdb-version.js +119 -0
  202. package/queries/catalog/absint-query/absint-query-format.d.ts +2 -0
  203. package/queries/catalog/absint-query/absint-query-format.js +2 -0
  204. package/queries/catalog/call-context-query/call-context-query-executor.js +30 -3
  205. package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -0
  206. package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
  207. package/queries/catalog/call-graph-query/call-graph-query-executor.js +3 -1
  208. package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +6 -0
  209. package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -0
  210. package/queries/catalog/call-graph-query/expand-library-internals.d.ts +19 -0
  211. package/queries/catalog/call-graph-query/expand-library-internals.js +59 -0
  212. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -0
  213. package/queries/catalog/cluster-query/cluster-query-format.js +1 -0
  214. package/queries/catalog/config-query/config-query-executor.js +15 -6
  215. package/queries/catalog/config-query/config-query-format.d.ts +18 -4
  216. package/queries/catalog/config-query/config-query-format.js +246 -96
  217. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -0
  218. package/queries/catalog/control-flow-query/control-flow-query-format.js +1 -0
  219. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -0
  220. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -0
  221. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -0
  222. package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -0
  223. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -7
  224. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +13 -1
  225. package/queries/catalog/dependencies-query/dependencies-query-format.js +117 -17
  226. package/queries/catalog/dice-query/dice-query-executor.js +6 -9
  227. package/queries/catalog/dice-query/dice-query-format.d.ts +4 -5
  228. package/queries/catalog/dice-query/dice-query-format.js +10 -6
  229. package/queries/catalog/does-call-query/does-call-query-executor.js +15 -2
  230. package/queries/catalog/does-call-query/does-call-query-format.d.ts +8 -0
  231. package/queries/catalog/does-call-query/does-call-query-format.js +4 -1
  232. package/queries/catalog/files-query/files-query-format.d.ts +2 -0
  233. package/queries/catalog/files-query/files-query-format.js +2 -0
  234. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.d.ts +6 -0
  235. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +277 -0
  236. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +119 -0
  237. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +331 -0
  238. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -0
  239. package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -0
  240. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -0
  241. package/queries/catalog/id-map-query/id-map-query-format.js +1 -0
  242. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -0
  243. package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -0
  244. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -0
  245. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -0
  246. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -0
  247. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -0
  248. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -0
  249. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -0
  250. package/queries/catalog/linter-query/linter-query-executor.js +11 -2
  251. package/queries/catalog/linter-query/linter-query-format.d.ts +9 -4
  252. package/queries/catalog/linter-query/linter-query-format.js +44 -21
  253. package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -0
  254. package/queries/catalog/location-map-query/location-map-query-format.js +2 -0
  255. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -0
  256. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -0
  257. package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
  258. package/queries/catalog/origin-query/origin-query-format.js +2 -0
  259. package/queries/catalog/project-query/project-query-executor.d.ts +0 -15
  260. package/queries/catalog/project-query/project-query-executor.js +19 -62
  261. package/queries/catalog/project-query/project-query-format.d.ts +7 -18
  262. package/queries/catalog/project-query/project-query-format.js +3 -18
  263. package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
  264. package/queries/catalog/provenance-query/provenance-query-format.js +2 -0
  265. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -0
  266. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -0
  267. package/queries/catalog/search-query/search-query-format.d.ts +1 -0
  268. package/queries/catalog/search-query/search-query-format.js +1 -0
  269. package/queries/catalog/signature-query/signature-query-executor.d.ts +5 -0
  270. package/queries/catalog/signature-query/signature-query-executor.js +267 -57
  271. package/queries/catalog/signature-query/signature-query-format.d.ts +37 -6
  272. package/queries/catalog/signature-query/signature-query-format.js +41 -5
  273. package/queries/catalog/signature-query/signature-query-render.js +48 -6
  274. package/queries/catalog/slice-query-options.d.ts +49 -0
  275. package/queries/catalog/slice-query-options.js +50 -0
  276. package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -12
  277. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -15
  278. package/queries/catalog/static-slice-query/static-slice-query-format.js +9 -10
  279. package/queries/query-print.js +3 -1
  280. package/queries/query.d.ts +63 -3
  281. package/queries/query.js +9 -2
  282. package/r-bridge/data/data.d.ts +16 -0
  283. package/r-bridge/data/data.js +20 -0
  284. package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -0
  285. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
  286. package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
  287. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +19 -16
  288. package/reconstruct/reconstruct.d.ts +18 -1
  289. package/reconstruct/reconstruct.js +42 -19
  290. package/slicing/criterion/parse.d.ts +4 -0
  291. package/slicing/criterion/parse.js +4 -0
  292. package/slicing/static/slice-call.js +17 -9
  293. package/slicing/static/static-slicer.d.ts +1 -1
  294. package/slicing/static/static-slicer.js +5 -4
  295. package/util/files.d.ts +19 -1
  296. package/util/files.js +45 -3
  297. package/util/glob.d.ts +19 -0
  298. package/util/glob.js +67 -0
  299. package/util/log.d.ts +12 -0
  300. package/util/log.js +17 -1
  301. package/util/logic.d.ts +6 -0
  302. package/util/logic.js +31 -1
  303. package/util/mermaid/dfg.js +17 -12
  304. package/util/mermaid/mermaid.js +2 -2
  305. package/util/objects.d.ts +5 -0
  306. package/util/objects.js +8 -0
  307. package/util/r-version.d.ts +9 -1
  308. package/util/r-version.js +27 -2
  309. package/util/schema.d.ts +16 -0
  310. package/util/schema.js +89 -4
  311. package/util/text/ansi.d.ts +4 -0
  312. package/util/text/ansi.js +27 -3
  313. package/util/text/strings.d.ts +9 -0
  314. package/util/text/strings.js +29 -0
  315. package/util/version.js +79 -6
  316. package/abstract-interpretation/domains/satisfiable-domain.d.ts +0 -29
  317. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +0 -22
  318. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +0 -52
  319. package/project/sigdb/version.js +0 -55
@@ -4,119 +4,217 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ConfigQueryDefinition = void 0;
7
+ exports.validateConfigUpdate = validateConfigUpdate;
7
8
  const config_query_executor_1 = require("./config-query-executor");
8
9
  const ansi_1 = require("../../../util/text/ansi");
9
10
  const time_1 = require("../../../util/text/time");
10
11
  const joi_1 = __importDefault(require("joi"));
11
12
  const config_1 = require("../../../config");
12
13
  const json_1 = require("../../../util/json");
14
+ const core_1 = require("../../../cli/repl/core");
13
15
  const schema_1 = require("../../../util/schema");
14
- function configReplCompleter(partialLine, _startingNewArg, config) {
15
- if (partialLine.length === 0) {
16
- // `+` updates a field, `?` inspects (reads) one
17
- return { completions: ['+', '?'] };
18
- }
19
- else if (partialLine.length === 1 && (partialLine[0].startsWith('+') || partialLine[0].startsWith('?'))) {
20
- const inspect = partialLine[0].startsWith('?'); // a read: complete the key path, but never append `=`
21
- const raw = partialLine[0].slice(1);
22
- // once a value is being assigned (`key=...`), the path is fixed: complete the value (its type), not more keys
23
- if (raw.includes('=')) {
24
- if (inspect) {
25
- return { completions: [] }; // `?` reads a value, it never assigns one
26
- }
27
- const eq = raw.indexOf('=');
28
- const keyPath = raw.slice(0, eq).split('.').filter(p => p.length > 0);
29
- const valuePart = raw.slice(eq + 1);
30
- const prefix = `${partialLine[0].slice(0, 1)}${raw.slice(0, eq)}=`;
31
- const values = configValueHints(configSchemaInfo(keyPath)).filter(v => v.startsWith(valuePart) && v !== valuePart);
32
- return { completions: values.map(v => prefix + v) };
33
- }
34
- const path = raw.split('.').filter(p => p.length > 0);
35
- const fullPath = path.slice();
36
- const lastPath = partialLine[0].endsWith('.') ? '' : path.pop() ?? '';
37
- const subConfig = path.reduce((obj, key) => (obj && obj[key] !== undefined && typeof obj[key] === 'object') ? obj[key] : obj, config);
38
- if (subConfig && !(subConfig[lastPath] !== undefined && typeof subConfig[lastPath] !== 'object')) {
39
- const have = Object.keys(subConfig)
40
- .filter(k => k.startsWith(lastPath) && k !== lastPath)
41
- .map(k => `${partialLine[0].slice(0, 1)}${[...path, k].join('.')}`);
42
- if (have.length > 0) {
43
- return { completions: have };
44
- }
45
- else if (lastPath.length > 0) {
46
- return { completions: [`${partialLine[0].slice(0, 1)}${fullPath.join('.')}.`] };
47
- }
16
+ const strings_1 = require("../../../util/text/strings");
17
+ function configReplCompleter(partialLine, startingNewArg, config) {
18
+ // the config query is a single token
19
+ if (partialLine.length > 1 || (partialLine.length === 1 && startingNewArg)) {
20
+ return { completions: [] };
21
+ }
22
+ const token = partialLine[0] ?? '';
23
+ const update = token.startsWith('+');
24
+ const raw = update ? token.slice(1) : token;
25
+ const sigil = update ? '+' : '';
26
+ // on the empty token also offer `+` (writes a value) before the inspectable keys (which read); label it like the keys
27
+ const lead = token.length === 0 ? ['+'] : [];
28
+ const leadLabels = token.length === 0 ? [['+', (0, core_1.describeCompletion)('+', 'change config values')]] : [];
29
+ // once `+key=` is typed, complete the value (its type), not more keys
30
+ if (update && raw.includes('=')) {
31
+ const eq = raw.indexOf('=');
32
+ const keyPath = raw.slice(0, eq).split('.').filter(p => p.length > 0);
33
+ const valuePart = raw.slice(eq + 1);
34
+ const prefix = `+${raw.slice(0, eq)}=`;
35
+ const { concrete, placeholder } = splitValueHints(configSchemaInfo(keyPath));
36
+ const values = (0, strings_1.matchByPrefixOrSubsequence)(concrete, valuePart);
37
+ return {
38
+ completions: values.map(v => prefix + v),
39
+ labels: new Map(values.map(v => [prefix + v, v])),
40
+ hints: placeholder !== undefined && valuePart.length === 0 ? [prefix + placeholder] : undefined
41
+ };
42
+ }
43
+ // a glob reads several keys, so expand it to the paths it matches (the trailing segment completes as a prefix)
44
+ if (!update && raw.includes('*')) {
45
+ const matches = configGlobMatcher(raw.endsWith('*') ? raw : `${raw}*`);
46
+ const found = [...configPaths(config)].filter(matches).map(p => p.join('.')).sort();
47
+ return { completions: found, labels: new Map(found.map(p => [p, (0, core_1.describeCompletion)(p, configSchemaInfo(p.split('.')).type ?? '')])), preFiltered: true };
48
+ }
49
+ const path = raw.split('.').filter(p => p.length > 0);
50
+ const fullPath = path.slice();
51
+ const lastPath = token.endsWith('.') ? '' : path.pop() ?? '';
52
+ /* the schema knows every option, a value only those that are set */
53
+ const options = configSchemaKeys(path);
54
+ const atLeaf = lastPath.length > 0 && options.includes(lastPath) && configSchemaInfo([...path, lastPath]).type !== 'object';
55
+ if (!atLeaf) {
56
+ const offered = (0, strings_1.matchByPrefixOrSubsequence)(options, lastPath);
57
+ const have = offered.map(k => `${sigil}${[...path, k].join('.')}`);
58
+ if (have.length > 0) {
59
+ // label starts with the full completion (incl. sigil) so readline keeps the sigil on common-prefix insertion
60
+ return { completions: [...lead, ...have], labels: new Map([...leadLabels, ...have.map((c, i) => [c, (0, core_1.describeCompletion)(c, configSchemaInfo([...path, offered[i]]).type ?? '')])]) };
48
61
  }
49
- const leaf = `${partialLine[0].slice(0, 1)}${fullPath.join('.')}`;
50
- if (!inspect) {
51
- const values = configValueHints(configSchemaInfo(fullPath)); // a boolean/enum offers its values, others a `<type>` hint
52
- if (values.length > 0) {
53
- return { completions: values.map(v => `${leaf}=${v}`) };
54
- }
62
+ else if (lastPath.length > 0 && configSchemaKeys(fullPath).length > 0) {
63
+ return { completions: [`${sigil}${fullPath.join('.')}.`] };
55
64
  }
56
- return { completions: [`${leaf}${inspect ? '' : '='}`] };
57
65
  }
58
- return { completions: [] };
59
- }
60
- function configQueryLineParser(output, line, _config) {
61
- if (line.length > 0 && line[0].startsWith('?')) {
62
- // inspect a single key, e.g. `?solver.sigdb.enabled`
63
- const path = line[0].slice(1).split('.').filter(p => p.length > 0);
64
- if (path.length === 0) {
65
- output.stdout(`Invalid config inspect syntax, must be of the form ${(0, ansi_1.bold)('?path.to.field', output.formatter)}`);
66
+ const leafInfo = configSchemaInfo(fullPath);
67
+ if (leafInfo.type === undefined) {
68
+ return { completions: [] }; // not a real config key: offer nothing (in particular, never append `=`)
69
+ }
70
+ const leaf = `${sigil}${fullPath.join('.')}`;
71
+ if (update) {
72
+ const { concrete, placeholder } = splitValueHints(leafInfo);
73
+ if (concrete.length > 0) { // a boolean/enum offers its values to Tab
74
+ return { completions: concrete.map(v => `${leaf}=${v}`) };
66
75
  }
67
- else {
68
- return { query: [{ type: 'config', inspect: path }] };
76
+ if (placeholder !== undefined) { // a free type: complete up to `=` and only *show* the `<type>`, never insert it
77
+ return { completions: [`${leaf}=`], hints: [`${leaf}=${placeholder}`] };
69
78
  }
70
79
  }
71
- if (line.length > 0 && line[0].startsWith('+')) {
72
- const [pathPart, ...valueParts] = line[0].slice(1).split('=');
73
- // build the update object
74
- const path = pathPart.split('.').filter(p => p.length > 0);
75
- if (path.length === 0 || valueParts.length !== 1) {
76
- output.stdout(`Invalid config update syntax, must be of the form ${(0, ansi_1.bold)('+path.to.field=value', output.formatter)}`);
80
+ return { completions: [`${leaf}${update ? '=' : ''}`] };
81
+ }
82
+ /** every `.`-separated path in the config, intermediate objects included, for {@link configGlobMatcher} */
83
+ function* configPaths(node, prefix = []) {
84
+ if (prefix.length > 0) {
85
+ yield [...prefix];
86
+ }
87
+ if (node !== null && typeof node === 'object' && !Array.isArray(node)) {
88
+ for (const [key, value] of Object.entries(node)) {
89
+ yield* configPaths(value, [...prefix, key]);
90
+ }
91
+ }
92
+ }
93
+ /** matches a config path against a glob, `*` covering one segment and `**` any number (`**.enabled`, `solver.*`) */
94
+ function configGlobMatcher(pattern) {
95
+ const segments = pattern.split('.');
96
+ let regex = '^';
97
+ for (let i = 0; i < segments.length; i++) {
98
+ const last = i === segments.length - 1;
99
+ if (segments[i] === '**') {
100
+ regex += last ? '[^.]+(?:\\.[^.]+)*' : '(?:[^.]+\\.)*';
77
101
  }
78
102
  else {
79
- const update = {};
80
- const value = valueParts[0];
81
- let current = update;
82
- for (let i = 0; i < path.length; i++) {
83
- const key = path[i];
84
- if (i === path.length - 1) {
85
- // last part, set the value
86
- // try to parse as JSON first
87
- try {
88
- current[key] = JSON.parse(value);
89
- }
90
- catch {
91
- // fallback to string
92
- current[key] = value;
93
- }
94
- }
95
- else {
96
- current[key] = {};
97
- current = current[key];
98
- }
99
- }
100
- return { query: [{ type: 'config', update }]
101
- };
103
+ regex += segments[i].split('*').map(part => part.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('[^.]*') + (last ? '' : '\\.');
102
104
  }
103
105
  }
104
- return { query: [{ type: 'config' }]
105
- };
106
+ const matches = new RegExp(regex + '$');
107
+ return path => matches.test(path.join('.'));
108
+ }
109
+ /** an error message if `path` is not a key of the config schema (naming the first unknown segment and its real siblings), or `undefined` if it is a valid key */
110
+ function unknownConfigKey(path, formatter) {
111
+ configSchemaDescription ??= config_1.FlowrConfig.Schema.describe();
112
+ const unknown = (0, schema_1.firstUnknownSchemaSegment)(configSchemaDescription, path);
113
+ if (unknown === undefined) {
114
+ return undefined; // every segment is a known (or pattern-/free-form-accepted) key
115
+ }
116
+ if (unknown.segment.includes('=')) {
117
+ const full = path.join('.');
118
+ return `To set a value, prefix the key with ${(0, ansi_1.bold)('+', formatter)}: ${(0, ansi_1.bold)('+' + full, formatter)}. Without it ${(0, ansi_1.bold)(full, formatter)} is read as a key to inspect.`;
119
+ }
120
+ const where = unknown.at.length === 0 ? 'the top level' : (0, ansi_1.bold)(unknown.at.join('.'), formatter);
121
+ return `Unknown config key ${(0, ansi_1.bold)(path.join('.'), formatter)}: no ${(0, ansi_1.bold)(unknown.segment, formatter)} at ${where}. Available: ${[...unknown.available].join(', ') || '(none)'}`;
106
122
  }
107
- function collectKeysFromUpdate(update, prefix = '') {
108
- // only collect leaf keys
109
- const keys = [];
123
+ /** an error message if `value` does not fit the schema type at `path`, or `undefined` if it fits */
124
+ function badConfigValue(path, value, formatter) {
125
+ const info = configSchemaInfo(path);
126
+ const expected = (t) => `${(0, ansi_1.bold)(path.join('.'), formatter)} expects a ${t}, got ${(0, ansi_1.bold)(JSON.stringify(value), formatter)}`;
127
+ if (info.valids && info.valids.length > 0 && !info.valids.includes(value)) {
128
+ return expected(`one of ${info.valids.map(v => JSON.stringify(v)).join(', ')}`);
129
+ }
130
+ if (info.type === 'boolean' && typeof value !== 'boolean') {
131
+ return expected('boolean (true/false)');
132
+ }
133
+ if (info.type === 'number' && typeof value !== 'number') {
134
+ return expected('number');
135
+ }
136
+ if (info.type === 'string' && typeof value !== 'string') {
137
+ return expected('string');
138
+ }
139
+ if (info.type === 'array' && !Array.isArray(value)) {
140
+ return expected('list (e.g. ["a","b"])');
141
+ }
142
+ if (info.type === 'object' && (typeof value !== 'object' || value === null || Array.isArray(value))) {
143
+ return `${(0, ansi_1.bold)(path.join('.'), formatter)} is a config section, not a value to set; set one of its fields instead`;
144
+ }
145
+ return undefined;
146
+ }
147
+ /** yields each leaf `[path, value]` of a (possibly nested) config update object */
148
+ function* configUpdateLeaves(update, prefix = []) {
110
149
  for (const [key, value] of Object.entries(update)) {
111
- const fullKey = prefix ? `${prefix}.${key}` : key;
112
- if (value && typeof value === 'object' && !Array.isArray(value)) {
113
- keys.push(...collectKeysFromUpdate(value, fullKey));
150
+ const path = [...prefix, key];
151
+ if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
152
+ yield* configUpdateLeaves(value, path);
114
153
  }
115
154
  else {
116
- keys.push(fullKey);
155
+ yield [path, value];
156
+ }
157
+ }
158
+ }
159
+ /**
160
+ * The first schema violation (an unknown key or a wrong-typed value) in a config update, or `undefined` if it is
161
+ * valid. Shared by the repl line parser and the {@link executeConfigQuery|executor}, so a programmatic or JSON-API
162
+ * update is validated exactly like a `:config +key=value` line and never merges junk or a mistyped value.
163
+ */
164
+ function validateConfigUpdate(update, formatter = ansi_1.voidFormatter) {
165
+ for (const [path, value] of configUpdateLeaves(update)) {
166
+ const err = unknownConfigKey(path, formatter) ?? badConfigValue(path, value, formatter);
167
+ if (err !== undefined) {
168
+ return err;
169
+ }
170
+ }
171
+ return undefined;
172
+ }
173
+ function configQueryLineParser(output, line, config) {
174
+ const first = line[0] ?? '';
175
+ if (first.startsWith('+')) {
176
+ const [pathPart, ...valueParts] = first.slice(1).split('=');
177
+ // build the update object
178
+ const path = pathPart.split('.').filter(p => p.length > 0);
179
+ if (path.length === 0 || valueParts.length !== 1) {
180
+ return configError(output, `Invalid config update syntax, must be of the form ${(0, ansi_1.bold)('+path.to.field=value', output.formatter)}`);
181
+ }
182
+ const raw = valueParts[0];
183
+ let value;
184
+ try {
185
+ value = JSON.parse(raw); // numbers, booleans, arrays, ...
186
+ }
187
+ catch {
188
+ value = raw; // fall back to a plain string
117
189
  }
190
+ const update = path.reduceRight((acc, key) => ({ [key]: acc }), value);
191
+ const err = validateConfigUpdate(update, output.formatter);
192
+ return err !== undefined ? configError(output, err) : { query: [{ type: 'config', update }] };
118
193
  }
119
- return keys;
194
+ // a plain path inspects that part; an empty suffix dumps the whole config
195
+ const path = first.split('.').filter(p => p.length > 0);
196
+ if (path.length === 0) {
197
+ return { query: [{ type: 'config' }] };
198
+ }
199
+ if (first.includes('*')) {
200
+ // a glob reads several keys at once (inspection only, setting stays a single explicit key)
201
+ const matches = configGlobMatcher(first);
202
+ const found = [...configPaths(config)].filter(matches).sort((a, b) => a.join('.').localeCompare(b.join('.')));
203
+ return found.length === 0
204
+ ? configError(output, `No config key matches ${(0, ansi_1.bold)(first, output.formatter)}`)
205
+ : { query: found.map(p => ({ type: 'config', inspect: p })) };
206
+ }
207
+ const unknown = unknownConfigKey(path, output.formatter);
208
+ return unknown !== undefined ? configError(output, unknown) : { query: [{ type: 'config', inspect: path }] };
209
+ }
210
+ /** report a parse/validation error for the line and produce no query, so nothing runs and the config is not dumped */
211
+ function configError(output, message) {
212
+ output.stdout(message);
213
+ return { query: undefined };
214
+ }
215
+ /** the dotted leaf keys of a (possibly nested) config update object */
216
+ function collectKeysFromUpdate(update) {
217
+ return [...configUpdateLeaves(update)].map(([path]) => path.join('.'));
120
218
  }
121
219
  function getValueAtPath(obj, path) {
122
220
  let current = obj;
@@ -131,22 +229,63 @@ function getValueAtPath(obj, path) {
131
229
  return current;
132
230
  }
133
231
  let configSchemaDescription;
134
- /** the Joi-schema type + description of a config path (from {@link FlowrConfig.Schema}), used to document a `?key` inspection */
232
+ /** the keys the schema offers below a path, including the unset optional ones */
233
+ function configSchemaKeys(path) {
234
+ configSchemaDescription ??= config_1.FlowrConfig.Schema.describe();
235
+ return (0, schema_1.descriptionPathKeys)(configSchemaDescription, path);
236
+ }
237
+ /** the Joi-schema type + description of a config path (from {@link FlowrConfig.Schema}), used to document a key inspection */
135
238
  function configSchemaInfo(path) {
136
239
  configSchemaDescription ??= config_1.FlowrConfig.Schema.describe();
137
240
  return (0, schema_1.descriptionPathInfo)(configSchemaDescription, path);
138
241
  }
139
- /** value completions for a config leaf: both booleans, an enum's members, or a compact `<type>` hint */
242
+ /** value completions for a config leaf: booleans, an enum's members (offered bare, like `true`/`false`), or a compact `<type>` hint */
140
243
  function configValueHints(info) {
141
244
  if (info.type === 'boolean') {
142
245
  return ['true', 'false'];
143
246
  }
144
247
  if (info.valids && info.valids.length > 0) {
145
- return info.valids.map(v => JSON.stringify(v));
248
+ // a string enum completes as its bare member (like a boolean); non-strings keep their JSON form
249
+ return info.valids.map(v => typeof v === 'string' ? v : JSON.stringify(v));
146
250
  }
147
251
  return info.type ? [`<${info.type}>`] : [];
148
252
  }
253
+ /** the leaf's `concrete` completable values (booleans/enum members) vs a `<type>` `placeholder` that is only shown, never inserted */
254
+ function splitValueHints(info) {
255
+ const hints = configValueHints(info);
256
+ return { concrete: hints.filter(v => !v.startsWith('<')), placeholder: hints.find(v => v.startsWith('<')) };
257
+ }
258
+ /** children of an inspected object listed before the rest is summarized */
259
+ const MaxInspectedChildren = 15;
260
+ /** the longest a child's value may get before only its size is shown */
261
+ const MaxInspectedValueWidth = 48;
262
+ /** a nested object is only summarized, inspecting it directly unfolds it */
263
+ function compactValue(value) {
264
+ const json = JSON.stringify(value, json_1.jsonReplacer);
265
+ if (value === null || typeof value !== 'object' || json.length <= MaxInspectedValueWidth) {
266
+ return json;
267
+ }
268
+ const keys = Array.isArray(value) ? value.length : Object.keys(value).length;
269
+ return Array.isArray(value) ? `[${keys} entries]` : `{${keys} keys}`;
270
+ }
271
+ /** an object reads better as its children than as one json blob */
272
+ function inspectedChildren(value, path, formatter) {
273
+ const entries = Object.entries(value);
274
+ const shown = entries.slice(0, MaxInspectedChildren);
275
+ const longest = Math.max(...shown.map(([key]) => key.length));
276
+ const lines = shown.map(([key, child]) => {
277
+ const type = configSchemaInfo([...path, key]).type;
278
+ return ` - ${(key + ':').padEnd(longest + 1)} ${compactValue(child)}`
279
+ + (type ? ` ${(0, ansi_1.italic)(`(${type})`, formatter)}` : '');
280
+ });
281
+ if (entries.length > shown.length) {
282
+ lines.push(` ${(0, ansi_1.italic)(`... and ${entries.length - shown.length} more, inspect them with ${path.join('.')}.<key>`, formatter)}`);
283
+ }
284
+ return lines;
285
+ }
149
286
  exports.ConfigQueryDefinition = {
287
+ title: 'Config Query',
288
+ syntax: '@config [<path> | <glob>] | @config +<path>=<value>',
150
289
  executor: config_query_executor_1.executeConfigQuery,
151
290
  asciiSummarizer: (formatter, _analyzer, queryResults, result, queries) => {
152
291
  const out = queryResults;
@@ -159,23 +298,34 @@ exports.ConfigQueryDefinition = {
159
298
  for (const key of updatedKeys) {
160
299
  const path = key.split('.');
161
300
  const newValue = getValueAtPath(out.config, path);
162
- result.push(` - ${key}: ${JSON.stringify(newValue, json_1.jsonReplacer)}`);
301
+ result.push(` - ${key}=${JSON.stringify(newValue, json_1.jsonReplacer)}`);
163
302
  }
164
303
  }
165
304
  else if (inspects.length > 0) {
166
305
  result.push(' ╰ Config:');
167
306
  for (const path of inspects) {
168
307
  const info = configSchemaInfo(path);
169
- const value = JSON.stringify(getValueAtPath(out.config, [...path]), json_1.jsonReplacer);
170
- result.push(` - ${path.join('.')}${info.type ? ` ${(0, ansi_1.italic)(`(${info.type})`, formatter)}` : ''}: ${value}`);
308
+ const value = getValueAtPath(out.config, [...path]);
309
+ const type = info.type ? ` ${(0, ansi_1.italic)(`(${info.type})`, formatter)}` : '';
310
+ const children = value !== null && typeof value === 'object' && !Array.isArray(value)
311
+ ? inspectedChildren(value, path, formatter) : undefined;
312
+ result.push(` - ${path.join('.')}${type}${children ? '' : `: ${JSON.stringify(value, json_1.jsonReplacer)}`}`);
171
313
  if (info.description) {
172
314
  result.push(` ${(0, ansi_1.italic)(info.description, formatter)}`);
173
315
  }
316
+ result.push(...children ?? []);
174
317
  }
175
318
  }
176
319
  else {
177
320
  result.push(` ╰ Config:\n${JSON.stringify(out.config, json_1.jsonReplacer, 4)}`);
178
321
  }
322
+ if (out.specialization) {
323
+ const keys = collectKeysFromUpdate(out.specialization.overwrite);
324
+ result.push(` ╰ Specialized for project kind ${(0, ansi_1.bold)(out.specialization.kind, formatter)} (overrides ${keys.join(', ') || '(nothing)'})`);
325
+ }
326
+ else {
327
+ result.push(` ╰ ${(0, ansi_1.italic)('No project-kind specialization in effect', formatter)}`);
328
+ }
179
329
  return true;
180
330
  },
181
331
  completer: configReplCompleter,
@@ -21,6 +21,7 @@ export interface ControlFlowQueryResult extends BaseQueryResult {
21
21
  readonly controlFlow: ControlFlowInformation;
22
22
  }
23
23
  export declare const ControlFlowQueryDefinition: {
24
+ readonly title: "Control-Flow Query";
24
25
  readonly executor: typeof executeControlFlowQuery;
25
26
  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>;
26
27
  readonly schema: Joi.ObjectSchema<any>;
@@ -11,6 +11,7 @@ const control_flow_graph_1 = require("../../../control-flow/control-flow-graph")
11
11
  const cfg_1 = require("../../../util/mermaid/cfg");
12
12
  const cfg_simplification_1 = require("../../../control-flow/cfg-simplification");
13
13
  exports.ControlFlowQueryDefinition = {
14
+ title: 'Control-Flow Query',
14
15
  executor: control_flow_query_executor_1.executeControlFlowQuery,
15
16
  asciiSummarizer: async (formatter, analyzer, queryResults, result) => {
16
17
  const out = queryResults;
@@ -13,6 +13,7 @@ export interface DataflowLensQueryResult extends BaseQueryResult {
13
13
  readonly simplifiedGraph: DataflowGraph;
14
14
  }
15
15
  export declare const DataflowLensQueryDefinition: {
16
+ readonly title: "Dataflow Lens Query";
16
17
  readonly executor: typeof executeDataflowLensQuery;
17
18
  readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
18
19
  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 df_helper_1 = require("../../../dataflow/graph/df-helper");
12
12
  exports.DataflowLensQueryDefinition = {
13
+ title: 'Dataflow Lens Query',
13
14
  executor: dataflow_lens_query_executor_1.executeDataflowLensQuery,
14
15
  asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
15
16
  const out = queryResults;
@@ -14,6 +14,7 @@ export interface DataflowQueryResult extends BaseQueryResult {
14
14
  readonly graph: DataflowGraph;
15
15
  }
16
16
  export declare const DataflowQueryDefinition: {
17
+ readonly title: "Dataflow Query";
17
18
  readonly executor: typeof executeDataflowQuery;
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 df_helper_1 = require("../../../dataflow/graph/df-helper");
12
12
  /** Above this many characters, the mermaid.live link is dropped from the REPL output (large graphs produce megabyte-sized base64 urls). */
13
13
  const MaxMermaidUrlLength = 8000;
14
14
  exports.DataflowQueryDefinition = {
15
+ title: 'Dataflow Query',
15
16
  executor: dataflow_query_executor_1.executeDataflowQuery,
16
17
  asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
17
18
  const out = queryResults;
@@ -5,7 +5,7 @@ const query_1 = require("../../query");
5
5
  const dependencies_query_format_1 = require("./dependencies-query-format");
6
6
  const vertex_1 = require("../../../dataflow/graph/vertex");
7
7
  const identifier_1 = require("../../../dataflow/environments/identifier");
8
- const dfg_get_origin_1 = require("../../../dataflow/origin/dfg-get-origin");
8
+ const df_helper_1 = require("../../../dataflow/graph/df-helper");
9
9
  const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
10
10
  const objects_1 = require("../../../util/objects");
11
11
  const function_info_1 = require("./function-info/function-info");
@@ -103,12 +103,7 @@ function getResults(queries, { dataflow, config, normalize }, results, kind, fun
103
103
  for (const { id, linkedIds } of results) {
104
104
  const vertex = dfg.getVertex(id);
105
105
  const info = functionMap.get(name);
106
- // the qualified call name (`dplyr::filter` for a bare `filter()` after `library(dplyr)`),
107
- // falling back to the plain called name when the call does not resolve to a loaded package
108
- const functionName = identifier_1.Identifier.toQualified((0, dfg_get_origin_1.getOriginInDfg)(dfg, id)) ?? vertex.name;
109
- // a call qualified to (or resolved via a loaded library to) a different package than the
110
- // function's is not this function - e.g. purrr::map, or a bare map() after library(purrr),
111
- // is not the maps `map` plot; bare/matching-namespace calls still count.
106
+ const functionName = df_helper_1.Dataflow.qualify(id, dfg, false) ?? vertex.name;
112
107
  if (info.package !== undefined) {
113
108
  const callNamespace = identifier_1.Identifier.getNamespace(functionName);
114
109
  if (callNamespace !== undefined && callNamespace !== info.package) {
@@ -1,5 +1,6 @@
1
1
  import type { BaseQueryFormat, BaseQueryResult, BasicQueryData } from '../../base-query-format';
2
2
  import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
3
+ import { type OutputFormatter } from '../../../util/text/ansi';
3
4
  import Joi from 'joi';
4
5
  import { executeDependenciesQuery } from './dependencies-query-executor';
5
6
  import type { FunctionInfo } from './function-info/function-info';
@@ -55,6 +56,16 @@ export declare const DefaultDependencyCategories: {
55
56
  readonly queryDisplayName: "Tests";
56
57
  readonly functions: FunctionInfo[];
57
58
  };
59
+ readonly undeclared: {
60
+ readonly queryDisplayName: "Undeclared Dependencies";
61
+ readonly functions: [];
62
+ readonly additionalAnalysis: (data: BasicQueryData, ignoreDefault: boolean, _functions: FunctionInfo[], _queryResults: CallContextQueryResult, result: DependencyInfo[]) => Promise<void>;
63
+ };
64
+ readonly unused: {
65
+ readonly queryDisplayName: "Unused Dependencies";
66
+ readonly functions: [];
67
+ readonly additionalAnalysis: (data: BasicQueryData, ignoreDefault: boolean, _functions: FunctionInfo[], _queryResults: CallContextQueryResult, result: DependencyInfo[]) => Promise<void>;
68
+ };
58
69
  };
59
70
  export type DefaultDependencyCategoryName = keyof typeof DefaultDependencyCategories;
60
71
  export type DependencyCategoryName = DefaultDependencyCategoryName | string;
@@ -87,8 +98,9 @@ export interface DependencyInfo extends Record<string, unknown> {
87
98
  */
88
99
  export declare function getAllCategories(queries: readonly DependenciesQuery[]): Record<DependencyCategoryName, DependencyCategorySettings>;
89
100
  export declare const DependenciesQueryDefinition: {
101
+ readonly title: "Dependencies Query";
90
102
  readonly executor: typeof executeDependenciesQuery;
91
- readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[], queries: readonly import("../../query").Query[]) => true;
103
+ readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[], queries: readonly import("../../query").Query[]) => true;
92
104
  readonly schema: Joi.ObjectSchema<any>;
93
105
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult, query: readonly import("../../query").Query[]) => NodeId[];
94
106
  };