@eagleoutice/flowr 2.17.8 → 2.17.9

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.
package/config.d.ts CHANGED
@@ -66,7 +66,7 @@ export interface FlowrLaxSourcingOptions extends MergeableRecord {
66
66
  readonly applyReplacements?: Record<string, string>[];
67
67
  readonly assumeFilesExist?: boolean;
68
68
  }
69
- export type ConfigPlugin<T extends BuiltInFlowrPluginName | string> = T | string | (T extends BuiltInFlowrPluginName ? [T, BuiltInFlowrPluginArgs<T>] : [string, unknown[]]);
69
+ export type ConfigPlugin<T extends BuiltInFlowrPluginName | string> = T | string | (T extends BuiltInFlowrPluginName ? [T, BuiltInFlowrPluginArgs<T>?] : [string, unknown[]?]);
70
70
  /** One {@link FlowrConfig.specializeConfig} entry: a config overwrite, optionally `inherit`ing another kind's overwrite (own keys win). */
71
71
  export type SpecializeConfigEntry = DeepPartial<FlowrConfig> & {
72
72
  readonly inherit?: ProjectKind;
package/config.js CHANGED
@@ -74,6 +74,11 @@ var DropPathsOption;
74
74
  /** try to drop every folder of the path */
75
75
  DropPathsOption["All"] = "all";
76
76
  })(DropPathsOption || (exports.DropPathsOption = DropPathsOption = {}));
77
+ /**
78
+ * A plugin name or a `[name, args]` tuple. The args reach the plugin constructor and override what the config
79
+ * says (e.g., the on-demand mirrors), so an untrusted config keeps the plugin but loses its args.
80
+ */
81
+ const ConfigPluginsSchema = joi_1.default.array().items(joi_1.default.alternatives().try(joi_1.default.string(), joi_1.default.array().ordered(joi_1.default.string().required(), securitySensitive(joi_1.default.array().items(joi_1.default.any()))).min(1).max(2)));
77
82
  /** Whether library exports should be resolved from a signature database (`solver.sigdb.enabled`). */
78
83
  function isSigDbEnabled(config) {
79
84
  return config?.solver.sigdb.enabled === true;
@@ -374,12 +379,12 @@ exports.FlowrConfig = {
374
379
  drawingWritesDevice: joi_1.default.boolean().optional().description('Whether calls drawing on a graphics device (e.g., `plot`) count as writing to it, which the ambient state queries then report.')
375
380
  }).optional().description('Semantics regarding the global state (options, devices, files, ...) calls access.')
376
381
  }).description('Configure language semantics and how flowR handles them.'),
377
- defaultPlugins: joi_1.default.array().items(joi_1.default.alternatives().try(joi_1.default.string(), joi_1.default.array().ordered(joi_1.default.string(), joi_1.default.array().items(joi_1.default.any())).length(2))).optional().description('The default plugins to load when creating a new instance of FlowrAnalyzer'),
382
+ defaultPlugins: ConfigPluginsSchema.optional().description('The default plugins to load when creating a new instance of FlowrAnalyzer'),
378
383
  repl: joi_1.default.object({
379
384
  quickStats: joi_1.default.boolean().optional().description('Whether to show quick stats in the REPL after each evaluation.'),
380
385
  dfProcessorHeat: joi_1.default.boolean().optional().description('This instruments the dataflow processors to count how often each processor is called.'),
381
386
  hints: joi_1.default.boolean().optional().description('Whether to show dim inline hints on the empty prompt (automatically disabled on non-interactive terminals).'),
382
- plugins: joi_1.default.array().items(joi_1.default.alternatives().try(joi_1.default.string(), joi_1.default.array().ordered(joi_1.default.string(), joi_1.default.array().items(joi_1.default.any())).length(2))).optional().description('The plugins to load in REPL mode'),
387
+ plugins: ConfigPluginsSchema.optional().description('The plugins to load in REPL mode'),
383
388
  autoUseFileProtocol: joi_1.default.boolean().optional().description('Prepend the file protocol to a repl input that looks like a path, instead of only warning about it.'),
384
389
  queryStats: joi_1.default.boolean().optional().description('Whether `:query` closes with the line stating how long the queries took (`:query*` never prints it).'),
385
390
  showPlugins: joi_1.default.boolean().optional().description('Whether `:version` grays out the plugins that did not activate during the last analysis.')
@@ -448,7 +453,7 @@ exports.FlowrConfig = {
448
453
  warmInBackground: joi_1.default.boolean().optional().description('Decompress the hot shards (base + most-downloaded) in a background task on startup so the first library() lookup is warm (default false; for long-running servers/REPLs).'),
449
454
  additionalPaths: securitySensitive(joi_1.default.array().items(joi_1.default.string()).optional()).description('Extra directories or bundle/manifest files searched for signature databases (alongside the shipped default and $FLOWR_SIGDB_DIR); a downloaded full-history bundle placed here is mounted automatically.'),
450
455
  downloadRepo: securitySensitive(joi_1.default.string().optional()).description('GitHub owner/repo the full-history bundle is downloaded from via ":signature download" (default "flowr-analysis/flowr"; the release tag comes from the committed sigdb.remote.json unless a version is given).'),
451
- autoSync: joi_1.default.boolean().optional().description('On startup, re-download shards whose committed sigdb.remote.json hash no longer matches the cache, in the background (default false; opt-in network sync after a git pull).'),
456
+ autoSync: securitySensitive(joi_1.default.boolean().optional()).description('On startup, re-download shards whose committed sigdb.remote.json hash no longer matches the cache, in the background (default false; opt-in network sync after a git pull).'),
452
457
  installedLibrary: joi_1.default.object({
453
458
  enabled: joi_1.default.boolean().required().description('Recover packages no signature database knows from their installed copy (default false).'),
454
459
  paths: securitySensitive(joi_1.default.array().items(joi_1.default.string()).optional()).description('Library directories to search; when empty they are discovered from the environment and the project.'),
@@ -483,7 +488,7 @@ exports.FlowrConfig = {
483
488
  transitiveSideEffectRounds: joi_1.default.number().min(1).optional().description(`How many rounds the transitive side-effect fixpoint may run before it is cut off (default ${exports.DefaultTransitiveSideEffectRounds}); the propagation stops on its own as soon as a round adds nothing.`),
484
489
  maxOverlayDepth: joi_1.default.number().min(0).optional().description(`How many binding overlays may stack on one environment frame before a write flattens them (default ${frame_memory_1.DefaultMaxOverlayDepth}); a pure performance knob, trading lookup cost against copy cost without changing any result.`),
485
490
  instrument: joi_1.default.object({
486
- dataflowExtractors: joi_1.default.any().optional().description('These keys are only intended for use within code, allowing to instrument the dataflow analyzer!')
491
+ dataflowExtractors: securitySensitive(joi_1.default.any().optional()).description('These keys are only intended for use within code, allowing to instrument the dataflow analyzer!')
487
492
  }),
488
493
  resolveSource: joi_1.default.object({
489
494
  dropPaths: joi_1.default.string().valid(...Object.values(DropPathsOption)).description('Allow to drop the first or all parts of the sourced path, if it is relative.'),
@@ -600,7 +605,7 @@ exports.FlowrConfig = {
600
605
  },
601
606
  /** Like {@link FlowrConfig.dropSecuritySensitive}, but in {@link SecureMode} also drops the {@link FlowrConfig.regexPaths}. */
602
607
  dropUntrusted(raw) {
603
- const dropped = exports.FlowrConfig.dropSecuritySensitive(raw);
608
+ const dropped = [...dropPrototypeKeys(raw, ''), ...exports.FlowrConfig.dropSecuritySensitive(raw)];
604
609
  return secure_mode_1.SecureMode.isEnabled() ? [...dropped, ...exports.FlowrConfig.regexPaths().flatMap(p => dropPath(raw, p, ''))] : dropped;
605
610
  },
606
611
  /** Creates a new flowr config that has the updated values. */
@@ -785,9 +790,32 @@ function collectTaggedPaths(d, meta, at = []) {
785
790
  return [
786
791
  ...Object.entries(d.keys ?? {}).flatMap(([k, v]) => collectTaggedPaths(v, meta, [...at, k])),
787
792
  ...(d.items ?? []).flatMap(i => collectTaggedPaths(i, meta, [...at, '*'])),
793
+ ...(d.ordered ?? []).flatMap((o, i) => collectTaggedPaths(o, meta, [...at, String(i)])),
788
794
  ...(d.matches ?? []).flatMap(m => collectTaggedPaths(m.schema, meta, at))
789
795
  ];
790
796
  }
797
+ /**
798
+ * Removes every own `__proto__` key: merging the config assigns it as the prototype, which hides the options below it
799
+ * from {@link dropPath} while reads still find them (e.g. `specializeConfig.package.solver.sigdb.__proto__.downloadRepo`).
800
+ */
801
+ function dropPrototypeKeys(obj, at) {
802
+ if (obj === null || typeof obj !== 'object') {
803
+ return [];
804
+ }
805
+ const record = obj;
806
+ const dropped = [];
807
+ for (const key of Object.keys(record)) {
808
+ const next = at === '' ? key : `${at}.${key}`;
809
+ if (key === '__proto__') {
810
+ Reflect.deleteProperty(record, key);
811
+ dropped.push(next);
812
+ }
813
+ else {
814
+ dropped.push(...dropPrototypeKeys(record[key], next));
815
+ }
816
+ }
817
+ return dropped;
818
+ }
791
819
  function dropPath(obj, path, at) {
792
820
  if (obj === null || typeof obj !== 'object' || path.length === 0) {
793
821
  return [];
@@ -795,12 +823,14 @@ function dropPath(obj, path, at) {
795
823
  const [head, ...rest] = path;
796
824
  const record = obj;
797
825
  const dropped = [];
798
- for (const key of head === '*' ? Object.keys(record) : Object.hasOwn(record, head) ? [head] : []) {
826
+ const keys = head === '*' ? Object.keys(record) : Object.hasOwn(record, head) ? [head] : [];
827
+ // back to front, so removing an array element does not shift the ones still to visit
828
+ for (const key of Array.isArray(obj) ? keys.reverse() : keys) {
799
829
  const next = at === '' ? key : `${at}.${key}`;
800
830
  if (rest.length > 0) {
801
831
  dropped.push(...dropPath(record[key], rest, next));
802
832
  }
803
- else if (Reflect.deleteProperty(record, key)) {
833
+ else if (Array.isArray(obj) ? obj.splice(Number(key), 1).length > 0 : Reflect.deleteProperty(record, key)) {
804
834
  dropped.push(next);
805
835
  }
806
836
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.17.8",
3
+ "version": "2.17.9",
4
4
  "description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -47,8 +47,8 @@ export declare function getPlugin(name: string, args?: unknown[]): FlowrAnalyzer
47
47
  */
48
48
  export type PluginToRegister<T extends BuiltInFlowrPluginName | string> = FlowrAnalyzerPlugin | T | string | (T extends BuiltInFlowrPluginName ? [
49
49
  T,
50
- BuiltInFlowrPluginArgs<T>
51
- ] : [string, unknown[]]);
50
+ BuiltInFlowrPluginArgs<T>?
51
+ ] : [string, unknown[]?]);
52
52
  /** Create a Flowr Analyzer plugin from a {@link PluginToRegister} specification. */
53
53
  export declare function makePlugin<T extends BuiltInFlowrPluginName | string>(toRegister: PluginToRegister<T>): FlowrAnalyzerPlugin;
54
54
  export {};
@@ -116,7 +116,7 @@ function makePlugin(toRegister) {
116
116
  return toRegister;
117
117
  }
118
118
  if (Array.isArray(toRegister)) {
119
- const [name, args] = toRegister;
119
+ const [name, args = []] = toRegister;
120
120
  const plugin = getPlugin(name, args);
121
121
  (0, assert_1.guard)(plugin !== undefined, () => `Unknown Flowr Analyzer plugin: ${name.toString()}`);
122
122
  return plugin;
@@ -3,6 +3,6 @@
3
3
  * @module
4
4
  */
5
5
  import { SemVer } from 'semver';
6
- export declare const versionDate = "2026-11-18T18:08:46Z";
6
+ export declare const versionDate = "2026-11-21T09:17:49Z";
7
7
  /** Retrieves the current flowR version as a new {@link SemVer} object. */
8
8
  export declare function flowrVersion(): SemVer;
@@ -8,9 +8,9 @@ exports.flowrVersion = flowrVersion;
8
8
  */
9
9
  const semver_1 = require("semver");
10
10
  // this is automatically replaced with the current version by release-it
11
- const version = '2.17.8';
11
+ const version = '2.17.9';
12
12
  // this is automatically replaced with the release date by release-it (scripts/bump-version.ts)
13
- exports.versionDate = '2026-11-18T18:08:46Z';
13
+ exports.versionDate = '2026-11-21T09:17:49Z';
14
14
  /** Retrieves the current flowR version as a new {@link SemVer} object. */
15
15
  function flowrVersion() {
16
16
  return new semver_1.SemVer(version);