@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
@@ -4,119 +4,223 @@ 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 = sortConfigPaths(configPaths().filter(matches)).map(p => p.join('.'));
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; `reset` (top level, update only) is not a schema key but a fixed action */
53
+ const options = update && path.length === 0 ? [...configSchemaKeys(path), 'reset'] : 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, offered[i] === 'reset' && path.length === 0 ? (0, core_1.describeCompletion)(c, 'discard runtime config updates') : (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 the config schema allows, intermediate objects included, for {@link configGlobMatcher} */
83
+ function configPaths() {
84
+ configSchemaDescription ??= config_1.FlowrConfig.Schema.describe();
85
+ return (0, schema_1.descriptionPaths)(configSchemaDescription);
86
+ }
87
+ /** shallower (fewer path segments) first, alphabetical among equally deep paths */
88
+ function sortConfigPaths(paths) {
89
+ return [...paths].sort((a, b) => a.length - b.length || a.join('.').localeCompare(b.join('.')));
90
+ }
91
+ /** matches a config path against a glob, `*` covering one segment and `**` any number (`**.enabled`, `solver.*`) */
92
+ function configGlobMatcher(pattern) {
93
+ const segments = pattern.split('.');
94
+ let regex = '^';
95
+ for (let i = 0; i < segments.length; i++) {
96
+ const last = i === segments.length - 1;
97
+ if (segments[i] === '**') {
98
+ regex += last ? '[^.]+(?:\\.[^.]+)*' : '(?:[^.]+\\.)*';
77
99
  }
78
100
  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
- };
101
+ regex += segments[i].split('*').map(part => part.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('[^.]*') + (last ? '' : '\\.');
102
102
  }
103
103
  }
104
- return { query: [{ type: 'config' }]
105
- };
104
+ const matches = new RegExp(regex + '$');
105
+ return path => matches.test(path.join('.'));
106
+ }
107
+ /** 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 */
108
+ function unknownConfigKey(path, formatter) {
109
+ configSchemaDescription ??= config_1.FlowrConfig.Schema.describe();
110
+ const unknown = (0, schema_1.firstUnknownSchemaSegment)(configSchemaDescription, path);
111
+ if (unknown === undefined) {
112
+ return undefined; // every segment is a known (or pattern-/free-form-accepted) key
113
+ }
114
+ if (unknown.segment.includes('=')) {
115
+ const full = path.join('.');
116
+ 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.`;
117
+ }
118
+ const where = unknown.at.length === 0 ? 'the top level' : (0, ansi_1.bold)(unknown.at.join('.'), formatter);
119
+ 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)'}`;
120
+ }
121
+ /** an error message if `value` does not fit the schema type at `path`, or `undefined` if it fits */
122
+ function badConfigValue(path, value, formatter) {
123
+ const info = configSchemaInfo(path);
124
+ const expected = (t) => `${(0, ansi_1.bold)(path.join('.'), formatter)} expects a ${t}, got ${(0, ansi_1.bold)(JSON.stringify(value), formatter)}`;
125
+ if (info.valids && info.valids.length > 0 && !info.valids.includes(value)) {
126
+ return expected(`one of ${info.valids.map(v => JSON.stringify(v)).join(', ')}`);
127
+ }
128
+ if (info.type === 'boolean' && typeof value !== 'boolean') {
129
+ return expected('boolean (true/false)');
130
+ }
131
+ if (info.type === 'number' && typeof value !== 'number') {
132
+ return expected('number');
133
+ }
134
+ if (info.type === 'string' && typeof value !== 'string') {
135
+ return expected('string');
136
+ }
137
+ if (info.type === 'array' && !Array.isArray(value)) {
138
+ return expected('list (e.g. ["a","b"])');
139
+ }
140
+ if (info.type === 'object' && (typeof value !== 'object' || value === null || Array.isArray(value))) {
141
+ return `${(0, ansi_1.bold)(path.join('.'), formatter)} is a config section, not a value to set; set one of its fields instead`;
142
+ }
143
+ return undefined;
106
144
  }
107
- function collectKeysFromUpdate(update, prefix = '') {
108
- // only collect leaf keys
109
- const keys = [];
145
+ /** yields each leaf `[path, value]` of a (possibly nested) config update object */
146
+ function* configUpdateLeaves(update, prefix = []) {
110
147
  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));
148
+ const path = [...prefix, key];
149
+ if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
150
+ yield* configUpdateLeaves(value, path);
114
151
  }
115
152
  else {
116
- keys.push(fullKey);
153
+ yield [path, value];
154
+ }
155
+ }
156
+ }
157
+ /**
158
+ * The first schema violation (an unknown key or a wrong-typed value) in a config update, or `undefined` if it is
159
+ * valid. Shared by the repl line parser and the {@link executeConfigQuery|executor}, so a programmatic or JSON-API
160
+ * update is validated exactly like a `:config +key=value` line and never merges junk or a mistyped value.
161
+ */
162
+ function validateConfigUpdate(update, formatter = ansi_1.voidFormatter) {
163
+ for (const [path, value] of configUpdateLeaves(update)) {
164
+ const err = unknownConfigKey(path, formatter) ?? badConfigValue(path, value, formatter);
165
+ if (err !== undefined) {
166
+ return err;
117
167
  }
118
168
  }
119
- return keys;
169
+ return undefined;
170
+ }
171
+ function configQueryLineParser(output, line, _config) {
172
+ const first = line[0] ?? '';
173
+ if (first === '+reset') {
174
+ return { query: [{ type: 'config', reset: true }] };
175
+ }
176
+ if (first.startsWith('+')) {
177
+ const [pathPart, ...valueParts] = first.slice(1).split('=');
178
+ // build the update object
179
+ const path = pathPart.split('.').filter(p => p.length > 0);
180
+ if (path.length === 0 || valueParts.length !== 1) {
181
+ return configError(output, `Invalid config update syntax, must be of the form ${(0, ansi_1.bold)('+path.to.field=value', output.formatter)}`);
182
+ }
183
+ const raw = valueParts[0];
184
+ let value;
185
+ try {
186
+ value = JSON.parse(raw); // numbers, booleans, arrays, ...
187
+ }
188
+ catch {
189
+ try {
190
+ value = JSON.parse(raw.replace(/'([^']*)'/g, (_, s) => JSON.stringify(s))); // allow 'single' quotes too
191
+ }
192
+ catch {
193
+ value = raw; // fall back to a plain string
194
+ }
195
+ }
196
+ const update = path.reduceRight((acc, key) => ({ [key]: acc }), value);
197
+ const err = validateConfigUpdate(update, output.formatter);
198
+ return err !== undefined ? configError(output, err) : { query: [{ type: 'config', update }] };
199
+ }
200
+ // a plain path inspects that part; an empty suffix dumps the whole config
201
+ const path = first.split('.').filter(p => p.length > 0);
202
+ if (path.length === 0) {
203
+ return { query: [{ type: 'config' }] };
204
+ }
205
+ if (first.includes('*')) {
206
+ // a glob reads several keys at once (inspection only, setting stays a single explicit key)
207
+ const matches = configGlobMatcher(first);
208
+ const found = sortConfigPaths(configPaths().filter(matches));
209
+ return found.length === 0
210
+ ? configError(output, `No config key matches ${(0, ansi_1.bold)(first, output.formatter)}`)
211
+ : { query: found.map(p => ({ type: 'config', inspect: p })) };
212
+ }
213
+ const unknown = unknownConfigKey(path, output.formatter);
214
+ return unknown !== undefined ? configError(output, unknown) : { query: [{ type: 'config', inspect: path }] };
215
+ }
216
+ /** report a parse/validation error for the line and produce no query, so nothing runs and the config is not dumped */
217
+ function configError(output, message) {
218
+ output.stdout(message);
219
+ return { query: undefined };
220
+ }
221
+ /** the dotted leaf keys of a (possibly nested) config update object */
222
+ function collectKeysFromUpdate(update) {
223
+ return [...configUpdateLeaves(update)].map(([path]) => path.join('.'));
120
224
  }
121
225
  function getValueAtPath(obj, path) {
122
226
  let current = obj;
@@ -131,51 +235,106 @@ function getValueAtPath(obj, path) {
131
235
  return current;
132
236
  }
133
237
  let configSchemaDescription;
134
- /** the Joi-schema type + description of a config path (from {@link FlowrConfig.Schema}), used to document a `?key` inspection */
238
+ /** the keys the schema offers below a path, including the unset optional ones */
239
+ function configSchemaKeys(path) {
240
+ configSchemaDescription ??= config_1.FlowrConfig.Schema.describe();
241
+ return (0, schema_1.descriptionPathKeys)(configSchemaDescription, path);
242
+ }
243
+ /** the Joi-schema type + description of a config path (from {@link FlowrConfig.Schema}), used to document a key inspection */
135
244
  function configSchemaInfo(path) {
136
245
  configSchemaDescription ??= config_1.FlowrConfig.Schema.describe();
137
246
  return (0, schema_1.descriptionPathInfo)(configSchemaDescription, path);
138
247
  }
139
- /** value completions for a config leaf: both booleans, an enum's members, or a compact `<type>` hint */
248
+ /** value completions for a config leaf: booleans, an enum's members (offered bare, like `true`/`false`), or a compact `<type>` hint */
140
249
  function configValueHints(info) {
141
250
  if (info.type === 'boolean') {
142
251
  return ['true', 'false'];
143
252
  }
144
253
  if (info.valids && info.valids.length > 0) {
145
- return info.valids.map(v => JSON.stringify(v));
254
+ // a string enum completes as its bare member (like a boolean); non-strings keep their JSON form
255
+ return info.valids.map(v => typeof v === 'string' ? v : JSON.stringify(v));
146
256
  }
147
257
  return info.type ? [`<${info.type}>`] : [];
148
258
  }
259
+ /** the leaf's `concrete` completable values (booleans/enum members) vs a `<type>` `placeholder` that is only shown, never inserted */
260
+ function splitValueHints(info) {
261
+ const hints = configValueHints(info);
262
+ return { concrete: hints.filter(v => !v.startsWith('<')), placeholder: hints.find(v => v.startsWith('<')) };
263
+ }
264
+ /** children of an inspected object listed before the rest is summarized */
265
+ const MaxInspectedChildren = 15;
266
+ /** the longest a child's value may get before only its size is shown */
267
+ const MaxInspectedValueWidth = 48;
268
+ /** a nested object is only summarized, inspecting it directly unfolds it */
269
+ function compactValue(value) {
270
+ const json = JSON.stringify(value, json_1.jsonReplacer);
271
+ if (value === null || typeof value !== 'object' || json.length <= MaxInspectedValueWidth) {
272
+ return json;
273
+ }
274
+ const keys = Array.isArray(value) ? value.length : Object.keys(value).length;
275
+ return Array.isArray(value) ? `[${keys} entries]` : `{${keys} keys}`;
276
+ }
277
+ /** an object reads better as its children than as one json blob */
278
+ function inspectedChildren(value, path, formatter) {
279
+ const entries = Object.entries(value);
280
+ const shown = entries.slice(0, MaxInspectedChildren);
281
+ const longest = Math.max(...shown.map(([key]) => key.length));
282
+ const lines = shown.map(([key, child]) => {
283
+ const type = configSchemaInfo([...path, key]).type;
284
+ return ` - ${(key + ':').padEnd(longest + 1)} ${compactValue(child)}`
285
+ + (type ? ` ${(0, ansi_1.italic)(`(${type})`, formatter)}` : '');
286
+ });
287
+ if (entries.length > shown.length) {
288
+ lines.push(` ${(0, ansi_1.italic)(`... and ${entries.length - shown.length} more, inspect them with ${path.join('.')}.<key>`, formatter)}`);
289
+ }
290
+ return lines;
291
+ }
149
292
  exports.ConfigQueryDefinition = {
293
+ title: 'Config Query',
294
+ syntax: '@config [<path> | <glob>] | @config +<path>=<value> | @config +reset',
150
295
  executor: config_query_executor_1.executeConfigQuery,
151
296
  asciiSummarizer: (formatter, _analyzer, queryResults, result, queries) => {
152
297
  const out = queryResults;
153
298
  result.push(`Query: ${(0, ansi_1.bold)('config', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
154
299
  const configQueries = queries.filter(q => q.type === 'config');
155
300
  const inspects = configQueries.filter(q => q.inspect).map(q => q.inspect);
156
- if (configQueries.some(q => q.update)) {
301
+ if (configQueries.some(q => q.reset)) {
302
+ result.push(' ╰ Configuration reset to the analyzer\'s base config');
303
+ }
304
+ else if (configQueries.some(q => q.update)) {
157
305
  const updatedKeys = configQueries.flatMap(q => q.update ? collectKeysFromUpdate(q.update) : []);
158
306
  result.push(' ╰ Updated configuration:');
159
307
  for (const key of updatedKeys) {
160
308
  const path = key.split('.');
161
309
  const newValue = getValueAtPath(out.config, path);
162
- result.push(` - ${key}: ${JSON.stringify(newValue, json_1.jsonReplacer)}`);
310
+ result.push(` - ${key}=${JSON.stringify(newValue, json_1.jsonReplacer)}`);
163
311
  }
164
312
  }
165
313
  else if (inspects.length > 0) {
166
314
  result.push(' ╰ Config:');
167
315
  for (const path of inspects) {
168
316
  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}`);
317
+ const value = getValueAtPath(out.config, [...path]);
318
+ const type = info.type ? ` ${(0, ansi_1.italic)(`(${info.type})`, formatter)}` : '';
319
+ const children = value !== null && typeof value === 'object' && !Array.isArray(value)
320
+ ? inspectedChildren(value, path, formatter) : undefined;
321
+ result.push(` - ${path.join('.')}${type}${children ? '' : `: ${JSON.stringify(value, json_1.jsonReplacer)}`}`);
171
322
  if (info.description) {
172
323
  result.push(` ${(0, ansi_1.italic)(info.description, formatter)}`);
173
324
  }
325
+ result.push(...children ?? []);
174
326
  }
175
327
  }
176
328
  else {
177
329
  result.push(` ╰ Config:\n${JSON.stringify(out.config, json_1.jsonReplacer, 4)}`);
178
330
  }
331
+ if (out.specialization) {
332
+ const keys = collectKeysFromUpdate(out.specialization.overwrite);
333
+ result.push(` ╰ Specialized for project kind ${(0, ansi_1.bold)(out.specialization.kind, formatter)} (overrides ${keys.join(', ') || '(nothing)'})`);
334
+ }
335
+ else {
336
+ result.push(` ╰ ${(0, ansi_1.italic)('No project-kind specialization in effect', formatter)}`);
337
+ }
179
338
  return true;
180
339
  },
181
340
  completer: configReplCompleter,
@@ -183,7 +342,8 @@ exports.ConfigQueryDefinition = {
183
342
  schema: joi_1.default.object({
184
343
  type: joi_1.default.string().valid('config').required().description('The type of the query.'),
185
344
  update: joi_1.default.object().optional().description('An optional partial configuration to update the current configuration with before returning it. Only the provided fields will be updated, all other fields will remain unchanged.'),
186
- inspect: joi_1.default.array().items(joi_1.default.string()).optional().description('An optional `.`-separated path (as a string array) to read a single configuration value instead of returning the whole configuration.')
345
+ inspect: joi_1.default.array().items(joi_1.default.string()).optional().description('An optional `.`-separated path (as a string array) to read a single configuration value instead of returning the whole configuration.'),
346
+ reset: joi_1.default.boolean().optional().description('If true, discard every prior update and revert to the config the analyzer was created with, before returning it.')
187
347
  }).description('The config query retrieves the current configuration of the flowR instance and optionally also updates it.'),
188
348
  flattenInvolvedNodes: () => []
189
349
  };
@@ -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
  };