@visulima/vis 1.0.0-alpha.11 → 1.0.0-alpha.13

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 (116) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/LICENSE.md +559 -186
  3. package/README.md +18 -0
  4. package/dist/bin.js +1 -9
  5. package/dist/config/index.d.ts +477 -556
  6. package/dist/config/index.js +1 -2
  7. package/dist/generate/index.js +1 -3
  8. package/dist/packem_chunks/applyDefaults.js +2 -336
  9. package/dist/packem_chunks/bin.js +234 -9552
  10. package/dist/packem_chunks/doctor-probe.js +2 -112
  11. package/dist/packem_chunks/fix.js +11 -234
  12. package/dist/packem_chunks/handler.js +1 -99
  13. package/dist/packem_chunks/handler10.js +2 -53
  14. package/dist/packem_chunks/handler11.js +1 -32
  15. package/dist/packem_chunks/handler12.js +5 -100
  16. package/dist/packem_chunks/handler13.js +1 -25
  17. package/dist/packem_chunks/handler14.js +18 -916
  18. package/dist/packem_chunks/handler15.js +15 -201
  19. package/dist/packem_chunks/handler16.js +1 -124
  20. package/dist/packem_chunks/handler17.js +1 -13
  21. package/dist/packem_chunks/handler18.js +1 -106
  22. package/dist/packem_chunks/handler19.js +1 -19
  23. package/dist/packem_chunks/handler2.js +2 -75
  24. package/dist/packem_chunks/handler20.js +5 -29
  25. package/dist/packem_chunks/handler21.js +1 -222
  26. package/dist/packem_chunks/handler22.js +1 -237
  27. package/dist/packem_chunks/handler23.js +5 -101
  28. package/dist/packem_chunks/handler24.js +1 -110
  29. package/dist/packem_chunks/handler25.js +3 -402
  30. package/dist/packem_chunks/handler26.js +1 -13
  31. package/dist/packem_chunks/handler27.js +1 -63
  32. package/dist/packem_chunks/handler28.js +7 -34
  33. package/dist/packem_chunks/handler29.js +21 -456
  34. package/dist/packem_chunks/handler3.js +4 -95
  35. package/dist/packem_chunks/handler30.js +3 -170
  36. package/dist/packem_chunks/handler31.js +1 -530
  37. package/dist/packem_chunks/handler32.js +2 -214
  38. package/dist/packem_chunks/handler33.js +25 -119
  39. package/dist/packem_chunks/handler34.js +2 -630
  40. package/dist/packem_chunks/handler35.js +3 -283
  41. package/dist/packem_chunks/handler36.js +22 -542
  42. package/dist/packem_chunks/handler37.js +410 -744
  43. package/dist/packem_chunks/handler38.js +22 -989
  44. package/dist/packem_chunks/handler39.js +22 -574
  45. package/dist/packem_chunks/handler4.js +2 -90
  46. package/dist/packem_chunks/handler40.js +22 -1685
  47. package/dist/packem_chunks/handler41.js +6 -1088
  48. package/dist/packem_chunks/handler42.js +5 -797
  49. package/dist/packem_chunks/handler43.js +10 -2658
  50. package/dist/packem_chunks/handler44.js +51 -3784
  51. package/dist/packem_chunks/handler45.js +25 -2574
  52. package/dist/packem_chunks/handler46.js +3 -3769
  53. package/dist/packem_chunks/handler47.js +21 -1485
  54. package/dist/packem_chunks/handler48.js +42 -0
  55. package/dist/packem_chunks/handler5.js +8 -174
  56. package/dist/packem_chunks/handler6.js +1 -95
  57. package/dist/packem_chunks/handler7.js +1 -115
  58. package/dist/packem_chunks/handler8.js +1 -12
  59. package/dist/packem_chunks/handler9.js +1 -29
  60. package/dist/packem_chunks/heal-accept.js +10 -522
  61. package/dist/packem_chunks/heal.js +14 -673
  62. package/dist/packem_chunks/index.js +7 -873
  63. package/dist/packem_chunks/loader.js +1 -23
  64. package/dist/packem_chunks/tar.js +3 -0
  65. package/dist/packem_shared/ai-analysis-hm8d2W7z.js +67 -0
  66. package/dist/packem_shared/ai-cache-DoiF80AR.js +1 -0
  67. package/dist/packem_shared/ai-fix-nn4zOE95.js +43 -0
  68. package/dist/packem_shared/cache-directory-CwHlJhgx.js +1 -0
  69. package/dist/packem_shared/dependency-scan-COr5n63B.js +2 -0
  70. package/dist/packem_shared/docker-D6OGr5_S.js +2 -0
  71. package/dist/packem_shared/failure-log-iUVLf6ts.js +2 -0
  72. package/dist/packem_shared/flakiness-D9wf0t56.js +1 -0
  73. package/dist/packem_shared/giget-CcEy_Elm.js +2 -0
  74. package/dist/packem_shared/index-DH-5hsrC.js +1 -0
  75. package/dist/packem_shared/otel-DxDUPJJH.js +6 -0
  76. package/dist/packem_shared/otelPlugin-CQq6poq8.js +1 -0
  77. package/dist/packem_shared/registry-CkubDdiY.js +2 -0
  78. package/dist/packem_shared/run-summary-utils-BfBvjzhY.js +1 -0
  79. package/dist/packem_shared/runtime-check-BXZ43CBW.js +1 -0
  80. package/dist/packem_shared/selectors-BylODRiM.js +3 -0
  81. package/dist/packem_shared/symbols-CQmER5MT.js +1 -0
  82. package/dist/packem_shared/toolchain-BgBOUHII.js +5 -0
  83. package/dist/packem_shared/typosquats-CcZl99B1.js +1 -0
  84. package/dist/packem_shared/use-measured-height-DjYgUOKk.js +1 -0
  85. package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
  86. package/dist/packem_shared/verify-Baj5mFJ7.js +1 -0
  87. package/dist/packem_shared/vis-update-app-D1jl0UZZ.js +1 -0
  88. package/dist/packem_shared/xxh3-DrAUNq4n.js +1 -0
  89. package/index.js +556 -727
  90. package/package.json +19 -29
  91. package/schemas/project.schema.json +739 -297
  92. package/schemas/vis-config.schema.json +3365 -384
  93. package/templates/buildkite-ci/template.yml +20 -20
  94. package/dist/packem_shared/VisUpdateApp-D-Yz_wvg.js +0 -1316
  95. package/dist/packem_shared/_commonjsHelpers-BqLXS_qQ.js +0 -5
  96. package/dist/packem_shared/ai-analysis-CHeB1joD.js +0 -367
  97. package/dist/packem_shared/ai-cache-Be_jexe4.js +0 -142
  98. package/dist/packem_shared/ai-fix-B9iQVcD2.js +0 -379
  99. package/dist/packem_shared/cache-directory-2qvs4goY.js +0 -98
  100. package/dist/packem_shared/catalog-BJTtyi-O.js +0 -1371
  101. package/dist/packem_shared/dependency-scan-A0KSklpG.js +0 -188
  102. package/dist/packem_shared/docker-2iZzc280.js +0 -181
  103. package/dist/packem_shared/failure-log-Cz3Z4SKL.js +0 -100
  104. package/dist/packem_shared/flakiness-goTxXuCX.js +0 -180
  105. package/dist/packem_shared/otel-DCvqCTz_.js +0 -158
  106. package/dist/packem_shared/otelPlugin-DFaLDvJf.js +0 -3
  107. package/dist/packem_shared/registry-CbqXI0rc.js +0 -272
  108. package/dist/packem_shared/run-summary-utils-PVMl4aIh.js +0 -130
  109. package/dist/packem_shared/runtime-check-Cobi3p6l.js +0 -127
  110. package/dist/packem_shared/selectors-SM69TfqC.js +0 -194
  111. package/dist/packem_shared/symbols-Ta7g2nU-.js +0 -14
  112. package/dist/packem_shared/toolchain-BdZd9eBi.js +0 -975
  113. package/dist/packem_shared/typosquats-C-bCh3PX.js +0 -1210
  114. package/dist/packem_shared/use-measured-height-CNP0vT4M.js +0 -20
  115. package/dist/packem_shared/utils-CthVdBPS.js +0 -40
  116. package/dist/packem_shared/xxh3-Ck8mXNg1.js +0 -239
@@ -1,5 +1,6 @@
1
1
  import { TaskResult, Task, TargetConfiguration, ConstraintsConfig, NamedInputs, TaskRunnerOptions } from '@visulima/task-runner';
2
2
  import { Hookable } from 'hookable';
3
+ import { Tracer } from '@opentelemetry/api';
3
4
  /**
4
5
  * Typed hook surface exposed to vis plugins.
5
6
  *
@@ -82,6 +83,25 @@ interface VisPlugin {
82
83
  */
83
84
  setup?: (hooks: Hookable<VisHooks>) => Promise<void> | void;
84
85
  }
86
+ /**
87
+ * One family of upstream-coupled packages.
88
+ *
89
+ * `members` is an exact-match list. `prefixes` accept any dep whose
90
+ * name starts with the prefix — useful for monorepos that ship many
91
+ * subpackages under one scope (e.g. `@babel/`, `@storybook/`,
92
+ * `@nx/`). A family can use either or both; a dep matching either
93
+ * list belongs to the family.
94
+ */
95
+ interface SimilarDepFamily {
96
+ /** Stable id; used in report output and config overrides. */
97
+ id: string;
98
+ /** Pretty label for the report. Defaults to `id` when omitted. */
99
+ label?: string;
100
+ /** Dep names that belong to this family verbatim. */
101
+ members?: string[];
102
+ /** Dep-name prefixes (literal, no glob). Match if `depName.startsWith(prefix)`. */
103
+ prefixes?: string[];
104
+ }
85
105
  type VersionManagerName = "asdf" | "corepack" | "fnm" | "mise" | "none" | "nvm" | "proto" | "self-activate" | "volta";
86
106
  type RuntimeTool = "bun" | "deno" | "go" | "node" | "npm" | "pnpm" | "python" | "ruby" | "rust" | "yarn";
87
107
  interface ToolchainConfig {
@@ -106,7 +126,7 @@ interface ToolchainConfig {
106
126
  * and returns a promise that resolves on success or rejects on failure.
107
127
  */
108
128
  interface CustomTask {
109
- readonly task: (files: string[]) => Promise<unknown> | unknown;
129
+ readonly task: (files: string[]) => unknown;
110
130
  readonly title: string;
111
131
  }
112
132
  /**
@@ -228,17 +248,6 @@ interface VisTargetOptions {
228
248
  */
229
249
  envFile?: boolean | string | string[];
230
250
  /**
231
- * Override the workspace `strictEnv` setting for this target. When
232
- * truthy, the target fails if its command references an env var
233
- * that resolves to neither the task's effective env nor
234
- * `process.env`. When `false`, the target opts out of a workspace
235
- * `strictEnv: true` (e.g. for a one-off command that legitimately
236
- * tolerates an unset variable).
237
- *
238
- * @see VisConfig.strictEnv
239
- */
240
- strictEnv?: boolean;
241
- /**
242
251
  * When true, the task is serialized with respect to parallel execution
243
252
  * and must be run on the main process (claims stdin). Used for commands
244
253
  * that read from the terminal.
@@ -329,8 +338,22 @@ interface VisTargetOptions {
329
338
  */
330
339
  runInCI?: RunInCI;
331
340
  /**
341
+ * Capability tags that gate this task to runners advertising the
342
+ * same tag. The CLI's `--runner-tags=gpu,slow` flag (or
343
+ * `VIS_RUNNER_TAGS` env var) tells vis what the current runner
344
+ * supports; tasks whose `runnerTags` share at least one tag with
345
+ * the runner set are eligible. Untagged tasks (no `runnerTags` or
346
+ * an empty array) are general-purpose and always run.
347
+ *
348
+ * Use this for special-purpose CI lanes — e.g. a GPU runner that
349
+ * should only pick up visual-regression suites, or a nightly job
350
+ * that runs `slow` integration tests. When neither flag nor env
351
+ * is set, the filter is inactive and every task runs.
352
+ */
353
+ runnerTags?: string[];
354
+ /**
332
355
  * Marks this target as a long-lived service that can be started via
333
- * `vis service start <id>` and auto-attached when other tasks declare
356
+ * `vis service start &lt;id>` and auto-attached when other tasks declare
334
357
  * it in `dependsOn`. Implies persistent + non-cacheable behaviour
335
358
  * (set `preset: "server"` to inherit the rest of the bundle).
336
359
  *
@@ -346,6 +369,16 @@ interface VisTargetOptions {
346
369
  */
347
370
  shell?: string;
348
371
  /**
372
+ * Override the workspace `strictEnv` setting for this target. When
373
+ * truthy, the target fails if its command references an env var
374
+ * that resolves to neither the task's effective env nor
375
+ * `process.env`. When `false`, the target opts out of a workspace
376
+ * `strictEnv: true` (e.g. for a one-off command that legitimately
377
+ * tolerates an unset variable).
378
+ * @see VisConfig.strictEnv
379
+ */
380
+ strictEnv?: boolean;
381
+ /**
349
382
  * Maximum wall-clock milliseconds a single task run is allowed to
350
383
  * take before being killed. `0` / `undefined` means no timeout.
351
384
  *
@@ -414,6 +447,32 @@ interface CodeownersConfig {
414
447
  provider?: "bitbucket" | "github" | "gitlab" | "other";
415
448
  }
416
449
  /**
450
+ * One user-declared customTypes entry. See `policy.customTypes.extraTypes`
451
+ * for the full contract — this is just the row shape.
452
+ */
453
+ interface ExtraCustomType {
454
+ /**
455
+ * Required when `strategy === "string"`. The dep-cluster key the bare
456
+ * version string at `path` should be associated with.
457
+ */
458
+ depName?: string;
459
+ /**
460
+ * Display name for this customType. Used as the cluster key prefix in
461
+ * lint output and JSON. Must not collide with the built-in names.
462
+ */
463
+ name: string;
464
+ /** Dot-separated walk into package.json (e.g. `pnpm.overrides`, `myTool.runtime`). */
465
+ path: string;
466
+ /**
467
+ * How to interpret the JSON found at `path`.
468
+ * - `name@version` — single string `pnpm@9.0.0` (with optional `+sha512.…` hash).
469
+ * - `name~version` — single string `node~20.0.0`, mirrors syncpack's tilde form.
470
+ * - `string` — bare version literal (requires `depName`).
471
+ * - `versionsByName` — `{ name: version }` object such as `engines`.
472
+ */
473
+ strategy: "name@version" | "name~version" | "string" | "versionsByName";
474
+ }
475
+ /**
417
476
  * Declared code-owner assignment for a path glob within a project.
418
477
  * Mirrors moon's `owners` shape so migrations can round-trip cleanly.
419
478
  */
@@ -511,19 +570,6 @@ interface VisConfig {
511
570
  provider?: string;
512
571
  };
513
572
  /**
514
- * When `true`, every task command is scanned for `${VAR}` / `$VAR`
515
- * references before spawn. If a referenced var is unset in the
516
- * task's effective env (envFile + service env + per-task `env` +
517
- * `process.env`), the task fails with an actionable error
518
- * naming the missing variable, instead of letting the shell
519
- * silently substitute an empty string.
520
- *
521
- * Override per run with `--strict-env` / `--no-strict-env`.
522
- * Override per target with `options.strictEnv`.
523
- * @default false
524
- */
525
- strictEnv?: boolean;
526
- /**
527
573
  * Scope the task-runner cache directory by the current git branch.
528
574
  * When `true`, caches are stored under `&lt;cacheDir>/branches/&lt;slug>`
529
575
  * so `main` and feature branches stop thrashing each other —
@@ -612,6 +658,13 @@ interface VisConfig {
612
658
  templates?: Record<string, string>;
613
659
  };
614
660
  /**
661
+ * Discover `.editorconfig` for indent / line-ending defaults during
662
+ * file transformations (sort-package-json, migrate, hook, pm overrides,
663
+ * workspace catalog rewrites). Per-command flags can still override.
664
+ * @default true
665
+ */
666
+ editorconfig?: boolean;
667
+ /**
615
668
  * Inherit configuration from one or more parent configs. Entries are
616
669
  * resolved left-to-right (later wins) and the consumer's own values
617
670
  * always override anything pulled in from `extends`.
@@ -675,37 +728,6 @@ interface VisConfig {
675
728
  templates?: string[];
676
729
  };
677
730
  /**
678
- * Installer backend selection for `vis install` / `vis add` /
679
- * `vis remove` / `vis update` / `vis ci`.
680
- *
681
- * Lets users opt into [aube](https://github.com/endevco/aube) — a
682
- * Rust-native package manager that reads/writes pnpm/npm/yarn/bun
683
- * lockfiles in place — as the default installer, while keeping a
684
- * single switch to fall back to the conventional PM detected from
685
- * the lockfile.
686
- *
687
- * Resolution precedence (highest first):
688
- * 1. CLI flag (`--installer &lt;name>` / `--no-aube`)
689
- * 2. Env var `VIS_INSTALLER`
690
- * 3. This config field
691
- * 4. Auto-detect (the default)
692
- *
693
- * Aube must be installed separately — `vis` does not bundle it.
694
- * Install via `npm i -g @endevco/aube`, `mise use -g aube`, or
695
- * `brew install endevco/tap/aube`.
696
- */
697
- install?: {
698
- /**
699
- * Which package manager performs install/add/remove/etc.
700
- * - `auto` (default): use `aube` when it is on PATH; otherwise
701
- * fall back to the lockfile-detected PM.
702
- * - explicit name: always use that PM. Errors when the named
703
- * binary is missing rather than silently falling back.
704
- * @default "auto"
705
- */
706
- backend?: "aube" | "auto" | "bun" | "npm" | "pnpm" | "yarn";
707
- };
708
- /**
709
731
  * Auto-create targets from detected config files (Project Crystal-style).
710
732
  * Inferred targets sit *below* explicit ones — anything in
711
733
  * `package.json#scripts`, `project.json#targets`, or `vis.task.ts`
@@ -767,6 +789,51 @@ interface VisConfig {
767
789
  */
768
790
  inferTargets?: Record<string, boolean> | boolean;
769
791
  /**
792
+ * Installer backend selection for `vis install` / `vis add` /
793
+ * `vis remove` / `vis update` / `vis ci`.
794
+ *
795
+ * Lets users opt into [aube](https://github.com/endevco/aube) — a
796
+ * Rust-native package manager that reads/writes pnpm/npm/yarn/bun
797
+ * lockfiles in place — as the default installer, while keeping a
798
+ * single switch to fall back to the conventional PM detected from
799
+ * the lockfile.
800
+ *
801
+ * Resolution precedence (highest first):
802
+ * 1. CLI flag (`--installer &lt;name>` / `--no-aube`)
803
+ * 2. Env var `VIS_INSTALLER`
804
+ * 3. This config field
805
+ * 4. Auto-detect (the default)
806
+ *
807
+ * Aube must be installed separately — `vis` does not bundle it.
808
+ * Install via npm (`@endevco/aube`), `mise use -g aube`, or
809
+ * `brew install endevco/tap/aube`.
810
+ */
811
+ install?: {
812
+ /**
813
+ * Which package manager performs install/add/remove/etc.
814
+ * - `auto` (default): use `aube` when it is on PATH; otherwise
815
+ * fall back to the lockfile-detected PM.
816
+ * - explicit name: always use that PM. Errors when the named
817
+ * binary is missing rather than silently falling back.
818
+ * @default "auto"
819
+ */
820
+ backend?: "aube" | "auto" | "bun" | "npm" | "pnpm" | "yarn";
821
+ /**
822
+ * Whether to dispatch PM invocations through `corepack`.
823
+ * - `"auto"` (default): use corepack only when the workspace
824
+ * pins a PM via the `packageManager` field AND `corepack` is
825
+ * on PATH AND the PM is one corepack manages (pnpm/yarn/npm).
826
+ * - `true`: always prefix `corepack` when the binary is on PATH
827
+ * and the PM is corepack-managed (errors loudly otherwise).
828
+ * - `false`: never go through corepack — invoke the PM directly.
829
+ *
830
+ * Mirrors nypm's `corepack: true` flag. Bun, deno, and aube are
831
+ * never wrapped — corepack does not manage them.
832
+ * @default "auto"
833
+ */
834
+ corepack?: "auto" | boolean;
835
+ };
836
+ /**
770
837
  * Named input patterns inherited by every project target. Equivalent
771
838
  * to task-runner's `namedInputs` but configurable from the vis config.
772
839
  */
@@ -781,6 +848,290 @@ interface VisConfig {
781
848
  */
782
849
  plugins?: VisPlugin[];
783
850
  /**
851
+ * Workspace dep-policy lints exposed via `vis lint`. Each block opts in
852
+ * to a single rule; the command flags (`--workspace-protocol`,
853
+ * `--no-redefine-root`, `--banned-deps`) toggle them per-run.
854
+ */
855
+ policy?: {
856
+ /**
857
+ * Map of dep names or globs → reason (or `{ reason, replacement, packages?, paths? }`).
858
+ * Internal/workspace deps are never flagged here; the
859
+ * workspace-protocol lint owns those.
860
+ *
861
+ * Optional `packages` (globs over the declaring package's `name`) and
862
+ * `paths` (globs over the workspace-relative `packageDir`) narrow where
863
+ * the rule applies. With both set, either match is enough. Omit both
864
+ * to ban anywhere — the default.
865
+ * @example
866
+ * ```
867
+ * bannedDeps: {
868
+ * request: "deprecated; use undici",
869
+ * moment: { reason: "huge bundle, frozen upstream", replacement: "date-fns" },
870
+ * "@radix-ui/*": "we standardized on shadcn",
871
+ * react: { reason: "no react in shared libs", paths: ["packages/shared/*"] },
872
+ * "next": { reason: "apps only", packages: ["@app/*"] },
873
+ * }
874
+ * ```
875
+ */
876
+ bannedDeps?: Record<string, string | {
877
+ packages?: string[];
878
+ paths?: string[];
879
+ reason: string;
880
+ replacement?: string;
881
+ }>;
882
+ /**
883
+ * Tweak the custom-types lint that flags drift in `engines.{node,pnpm,...}`,
884
+ * `packageManager`, `volta.{node,pnpm,yarn}`, and the proposed
885
+ * `devEngines.{runtime,packageManager}` array form.
886
+ *
887
+ * Each (customType × name) cluster is tracked independently —
888
+ * `engines.node` and `volta.node` don't cross-couple here. Use a
889
+ * versionGroup once that lands if you need to enforce they agree.
890
+ */
891
+ customTypes?: {
892
+ /**
893
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
894
+ * for the contract — same semantics, applied to drift rewrites
895
+ * across engines / packageManager / volta / devEngines.
896
+ *
897
+ * Note: `--fix` strips any `+sha512.&lt;hash&gt;` suffix from
898
+ * `packageManager` on bump — content-integrity hashes are tied
899
+ * to a specific package, not a version, so users must regenerate
900
+ * via their PM (`pnpm install` re-pins; `corepack use pnpm@X` etc.).
901
+ * @default true
902
+ */
903
+ autofix?: "prompt" | boolean;
904
+ /**
905
+ * User-defined custom-type pin locations. Each entry tells the
906
+ * customTypes lint to read additional version pins from a
907
+ * non-standard JSON path inside every workspace package.json,
908
+ * cluster them by `(name × depName)` like the built-in types,
909
+ * and rewrite them with `--fix`.
910
+ *
911
+ * The original built-ins (`engines`, `volta`, `packageManager`,
912
+ * `devEngines.runtime`, `devEngines.packageManager`) keep
913
+ * running unconditionally — these layer on top.
914
+ *
915
+ * Strategies:
916
+ * - `versionsByName`: the JSON at `path` is `{ [depName]: version }`
917
+ * (like `engines` or `pnpm.overrides`).
918
+ * - `name@version`: the JSON at `path` is a string of the form
919
+ * `name@version` (like `packageManager`). The leading `name@`
920
+ * is preserved; only the version segment is rewritten.
921
+ * - `string`: the JSON at `path` is a bare version string. The
922
+ * `depName` field is required and identifies the dep cluster.
923
+ *
924
+ * `name` must not collide with a built-in type name. `path` is
925
+ * a dot-separated walk into the package.json (e.g. `pnpm.overrides`).
926
+ * @example
927
+ * ```ts
928
+ * extraTypes: [
929
+ * { name: "pnpmOverridesLegacy", path: "pnpm.overrides", strategy: "versionsByName" },
930
+ * { name: "myToolPin", path: "myTool.runtime", strategy: "name@version" },
931
+ * { name: "minNode", path: "config.minNode", strategy: "string", depName: "node" },
932
+ * ]
933
+ * ```
934
+ */
935
+ extraTypes?: ExtraCustomType[];
936
+ /**
937
+ * Dep names exempt from the drift check (exact match against the
938
+ * field name within the block — e.g. `node`, `pnpm`).
939
+ */
940
+ ignore?: string[];
941
+ /**
942
+ * Resolution strategy used when `--fix` runs.
943
+ * - `highest` (default): align every drifting instance to the
944
+ * highest declared version.
945
+ * - `lowest`: align to the lowest.
946
+ * @default "highest"
947
+ */
948
+ resolve?: "highest" | "lowest";
949
+ };
950
+ /**
951
+ * Tweak the dead-workspace-patterns lint that flags entries in
952
+ * `pnpm-workspace.yaml#packages` / `package.json#workspaces` which
953
+ * resolve to zero on-disk directories.
954
+ */
955
+ deadWorkspacePatterns?: {
956
+ /**
957
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
958
+ * for the contract — applied here to dropping unmatched patterns
959
+ * from the workspace config file.
960
+ * @default true
961
+ */
962
+ autofix?: "prompt" | boolean;
963
+ };
964
+ /**
965
+ * Tweak the empty-deps lint that flags empty `dependencies` /
966
+ * `devDependencies` / `peerDependencies` / `optionalDependencies`
967
+ * blocks across the workspace.
968
+ */
969
+ emptyDeps?: {
970
+ /**
971
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
972
+ * for the contract — applied here to removing the empty key.
973
+ * @default true
974
+ */
975
+ autofix?: "prompt" | boolean;
976
+ /**
977
+ * Block names exempt from the rule (e.g. `["peerDependencies"]`
978
+ * to keep the key around as a marker even when empty).
979
+ */
980
+ ignoreBlocks?: ("dependencies" | "devDependencies" | "optionalDependencies" | "peerDependencies")[];
981
+ };
982
+ /**
983
+ * Tweak the redefine-root lint that flags non-root packages duplicating
984
+ * deps already pinned at the workspace root.
985
+ */
986
+ redefineRoot?: {
987
+ /** Dep names that are exempt from the redefine-root rule (exact match). */
988
+ ignore?: string[];
989
+ };
990
+ /**
991
+ * Tweak the root-deps lint that flags runtime `dependencies` declared
992
+ * on the private workspace root (they should live in `devDependencies`).
993
+ */
994
+ rootDeps?: {
995
+ /**
996
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
997
+ * for the contract — applied here to moving entries from
998
+ * `dependencies` to `devDependencies` on the root package.json.
999
+ * @default true
1000
+ */
1001
+ autofix?: "prompt" | boolean;
1002
+ };
1003
+ /**
1004
+ * Tweak the root-package-manager lint that flags a missing or
1005
+ * malformed `packageManager` field on the workspace root.
1006
+ */
1007
+ rootPackageManager?: {
1008
+ /**
1009
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
1010
+ * for the contract. `--fix` only writes when `suggested` is set —
1011
+ * a missing `packageManager` field has no canonical default.
1012
+ * @default true
1013
+ */
1014
+ autofix?: "prompt" | boolean;
1015
+ /**
1016
+ * Canonical specifier (`name@version`) to write when `--fix` runs
1017
+ * and the field is absent. Required to enable autofix —
1018
+ * vis won't guess the workspace's preferred manager.
1019
+ * @example "pnpm@10.32.1"
1020
+ */
1021
+ suggested?: string;
1022
+ };
1023
+ /**
1024
+ * Tweak the root-private lint that flags a workspace root package.json
1025
+ * missing `"private": true`. Only fires when the root looks like a
1026
+ * workspace (npm/yarn/bun `workspaces` field or `pnpm-workspace.yaml`).
1027
+ */
1028
+ rootPrivate?: {
1029
+ /**
1030
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
1031
+ * for the contract — applied here to inserting `"private": true`.
1032
+ * @default true
1033
+ */
1034
+ autofix?: "prompt" | boolean;
1035
+ };
1036
+ /**
1037
+ * Tweak the similar-deps lint that flags drift across related dep
1038
+ * families (e.g. `react` and `react-dom`, all of `@babel/*`).
1039
+ *
1040
+ * The lint is report-only — aligning a family requires picking a
1041
+ * single canonical specifier across heterogeneous range syntaxes
1042
+ * (`^`, `~`, exact), which is too lossy without user input.
1043
+ */
1044
+ similarDeps?: {
1045
+ /**
1046
+ * Additional families merged with the built-ins. Same `id` wins
1047
+ * → user override fully replaces the built-in entry.
1048
+ * @example
1049
+ * ```
1050
+ * extraFamilies: [
1051
+ * { id: "vue", label: "Vue", members: ["vue", "vue-router", "pinia"] },
1052
+ * ]
1053
+ * ```
1054
+ */
1055
+ extraFamilies?: SimilarDepFamily[];
1056
+ /** Family ids to skip entirely (matches `SimilarDepFamily.id`). */
1057
+ ignoreFamilies?: string[];
1058
+ };
1059
+ /**
1060
+ * Tweak the types-in-deps lint that flags `@types/*` declared in
1061
+ * `dependencies` on a private package (they belong in
1062
+ * `devDependencies` since the package never ships).
1063
+ */
1064
+ typesInDeps?: {
1065
+ /**
1066
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
1067
+ * for the contract — applied here to moving the entry to
1068
+ * `devDependencies`. Existing dev pins are preserved on conflict.
1069
+ * @default true
1070
+ */
1071
+ autofix?: "prompt" | boolean;
1072
+ /** Dep names exempt from the rule (exact match, e.g. `@types/node`). */
1073
+ ignore?: string[];
1074
+ };
1075
+ /**
1076
+ * Tweak the workspace-protocol lint that flags internal deps not
1077
+ * using the `workspace:` protocol.
1078
+ */
1079
+ workspaceProtocol?: {
1080
+ /**
1081
+ * Three-state autofix opt-out. Some workspaces want detection
1082
+ * without rewrite (e.g. dual-licensed packages where `workspace:*`
1083
+ * is unsafe).
1084
+ * - `true` (default): `--fix` rewrites the specifier.
1085
+ * - `false`: never rewrite — report the violation only.
1086
+ * - `"prompt"`: ask before each rewrite. Falls back to report-only
1087
+ * when stdin isn't a TTY (CI). Reserved; not yet implemented.
1088
+ *
1089
+ * Note: when `false` (or `"prompt"`), `--fix` still **fails CI** on
1090
+ * detected violations — the rule is "report only", not "ignore".
1091
+ * Drop the rule from the lint selection if you want a clean exit.
1092
+ * @default true
1093
+ * @example
1094
+ * ```
1095
+ * policy: {
1096
+ * workspaceProtocol: { autofix: false },
1097
+ * }
1098
+ * ```
1099
+ */
1100
+ autofix?: "prompt" | boolean;
1101
+ };
1102
+ /**
1103
+ * Tweak the workspace-versions lint that flags external deps declared
1104
+ * at inconsistent versions across the workspace.
1105
+ */
1106
+ workspaceVersions?: {
1107
+ /**
1108
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
1109
+ * for the contract — same semantics, applied to drift rewrites.
1110
+ *
1111
+ * Also gates the `--propose-min` catalog suggestion writer:
1112
+ * when `false` / `"prompt"`, `--fix --propose-min` reports the
1113
+ * proposed catalog entries but does not write
1114
+ * `pnpm-workspace.yaml`. Same "report only, still fails CI"
1115
+ * note applies as on `workspaceProtocol.autofix`.
1116
+ * @default true
1117
+ */
1118
+ autofix?: "prompt" | boolean;
1119
+ /** Dep names exempt from the version-drift check (exact match). */
1120
+ ignore?: string[];
1121
+ /**
1122
+ * Resolution strategy used when `--fix` runs.
1123
+ * - `highest` (default): rewrite every drifting instance to the
1124
+ * highest sibling specifier.
1125
+ * - `lowest`: rewrite to the lowest.
1126
+ * - `catalog`: rewrite any dep already pinned in a workspace catalog
1127
+ * to `catalog:` / `catalog:&lt;name>`. Catalog must exist; this lint
1128
+ * does not create the catalog (see `vis lint --resolve catalog --propose`).
1129
+ * @default "highest"
1130
+ */
1131
+ resolve?: "catalog" | "highest" | "lowest";
1132
+ };
1133
+ };
1134
+ /**
784
1135
  * Pre-flight checks fired before `vis run` starts the orchestrator.
785
1136
  * Each check is opt-out (`false`) — defaults are sensible for the
786
1137
  * common monorepo case.
@@ -1013,10 +1364,37 @@ interface VisConfig {
1013
1364
  sharedWorktreeCache?: boolean;
1014
1365
  /** sort-package-json command defaults */
1015
1366
  sortPackageJson?: {
1367
+ /** Discover `.editorconfig` for indent / line-ending defaults (default: true). */
1368
+ editorconfig?: boolean;
1369
+ /** Collapse `bugs: { url }` to the bare string form when `url` is the only field (default: true). */
1370
+ formatBugs?: boolean;
1371
+ /** Collapse `repository: { type, url }` to the GitHub `owner/repo` shorthand (default: true). */
1372
+ formatRepository?: boolean;
1373
+ /** Sort `exports` condition keys in canonical order (default: true). */
1374
+ sortExports?: boolean;
1016
1375
  /** Alphabetize script commands (default: false) */
1017
1376
  sortScripts?: boolean;
1018
1377
  };
1019
1378
  /**
1379
+ * Sponsorship notice shown after successful commands.
1380
+ *
1381
+ * vis prints a one-line "consider sponsoring visulima" notice at most
1382
+ * once every 14 days (skipped in CI, non-TTY, and when
1383
+ * `VIS_NO_SPONSOR=1` is set). Set `enabled: false` to silence it
1384
+ * permanently for this workspace.
1385
+ * @example
1386
+ * ```
1387
+ * sponsor: { enabled: false }
1388
+ * ```
1389
+ */
1390
+ sponsor?: {
1391
+ /**
1392
+ * Show the sponsor notice on successful command completion.
1393
+ * @default true
1394
+ */
1395
+ enabled?: boolean;
1396
+ };
1397
+ /**
1020
1398
  * Staged file patterns and commands (replaces lint-staged).
1021
1399
  *
1022
1400
  * Accepts all lint-staged config forms:
@@ -1027,6 +1405,19 @@ interface VisConfig {
1027
1405
  * - A top-level generate-task function
1028
1406
  */
1029
1407
  staged?: StagedConfig;
1408
+ /**
1409
+ * When `true`, every task command is scanned for `${VAR}` / `$VAR`
1410
+ * references before spawn. If a referenced var is unset in the
1411
+ * task's effective env (envFile + service env + per-task `env` +
1412
+ * `process.env`), the task fails with an actionable error
1413
+ * naming the missing variable, instead of letting the shell
1414
+ * silently substitute an empty string.
1415
+ *
1416
+ * Override per run with `--strict-env` / `--no-strict-env`.
1417
+ * Override per target with `options.strictEnv`.
1418
+ * @default false
1419
+ */
1420
+ strictEnv?: boolean;
1030
1421
  /** Target default configurations */
1031
1422
  targetDefaults?: Record<string, Partial<VisTargetConfiguration>>;
1032
1423
  /**
@@ -1120,6 +1511,13 @@ interface VisConfig {
1120
1511
  includeLocked?: boolean;
1121
1512
  install?: boolean;
1122
1513
  /**
1514
+ * Maximum number of concurrent registry requests during outdated checks.
1515
+ * Higher values speed up large workspaces but risk hitting registry rate
1516
+ * limits or self-hosted Verdaccio caps.
1517
+ * @default 8
1518
+ */
1519
+ maxConcurrentRequests?: number;
1520
+ /**
1123
1521
  * Minimum number of minutes since a version was published before
1124
1522
  * vis will consider it for updates. This mirrors pnpm's
1125
1523
  * `minimumReleaseAge` — a single setting that applies to both
@@ -1145,6 +1543,20 @@ interface VisConfig {
1145
1543
  */
1146
1544
  packageMode?: Record<string, "latest" | "minor" | "patch">;
1147
1545
  prerelease?: boolean;
1546
+ /**
1547
+ * Which release channels to consider when picking the target version.
1548
+ * - `"stable"` (default) — only ship stable releases (no prereleases).
1549
+ * - `"same"` — match the prerelease channel of the *current* range:
1550
+ * if you're on `react@19.0.0-rc.1`, only `rc.*` candidates qualify;
1551
+ * if you're on a stable, only stable candidates. Prevents
1552
+ * accidentally promoting a prerelease pin to a stable major bump.
1553
+ * - `"any"` — equivalent to `--prerelease`. Any channel is fair game.
1554
+ *
1555
+ * `--release-channel` on the CLI overrides this. If `prerelease: true`
1556
+ * is set without `releaseChannel`, vis treats it as `"any"`.
1557
+ * @default "stable"
1558
+ */
1559
+ releaseChannel?: "any" | "same" | "stable";
1148
1560
  security?: boolean;
1149
1561
  target?: "latest" | "minor" | "patch";
1150
1562
  };
@@ -1158,504 +1570,6 @@ interface VisConfig {
1158
1570
  */
1159
1571
  versionConstraint?: string;
1160
1572
  }
1161
- /**
1162
- * Extended project configuration exposed on the discovered workspace.
1163
- * Adds vis-specific metadata (layer, stack, language, owners) on top of
1164
- * the task-runner `ProjectConfiguration`.
1165
- */
1166
- /**
1167
- * @since 1.0.0
1168
- */
1169
- interface Context {
1170
- /**
1171
- * Get a value from the context.
1172
- *
1173
- * @param key key which identifies a context value
1174
- */
1175
- getValue(key: symbol): unknown;
1176
- /**
1177
- * Create a new context which inherits from this context and has
1178
- * the given key set to the given value.
1179
- *
1180
- * @param key context key for which to set the value
1181
- * @param value value to set for the given key
1182
- */
1183
- setValue(key: symbol, value: unknown): Context;
1184
- /**
1185
- * Return a new context which inherits from this context but does
1186
- * not contain a value for the given key.
1187
- *
1188
- * @param key context key for which to clear a value
1189
- */
1190
- deleteValue(key: symbol): Context;
1191
- }
1192
- /**
1193
- * Attributes is a map from string to attribute values.
1194
- *
1195
- * Note: only the own enumerable keys are counted as valid attribute keys.
1196
- *
1197
- * @since 1.3.0
1198
- */
1199
- interface Attributes {
1200
- [attributeKey: string]: AttributeValue | undefined;
1201
- }
1202
- /**
1203
- * Attribute values may be any non-nullish primitive value except an object.
1204
- *
1205
- * null or undefined attribute values are invalid and will result in undefined behavior.
1206
- *
1207
- * @since 1.3.0
1208
- */
1209
- type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
1210
- interface ExceptionWithCode {
1211
- code: string | number;
1212
- name?: string;
1213
- message?: string;
1214
- stack?: string;
1215
- }
1216
- interface ExceptionWithMessage {
1217
- code?: string | number;
1218
- message: string;
1219
- name?: string;
1220
- stack?: string;
1221
- }
1222
- interface ExceptionWithName {
1223
- code?: string | number;
1224
- message?: string;
1225
- name: string;
1226
- stack?: string;
1227
- }
1228
- /**
1229
- * Defines Exception.
1230
- *
1231
- * string or an object with one of (message or name or code) and optional stack
1232
- *
1233
- * @since 1.0.0
1234
- */
1235
- type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string;
1236
- /**
1237
- * Defines High-Resolution Time.
1238
- *
1239
- * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.
1240
- * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.
1241
- * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.
1242
- * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:
1243
- * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.
1244
- * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:
1245
- * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
1246
- * This is represented in HrTime format as [1609504210, 150000000].
1247
- *
1248
- * @since 1.0.0
1249
- */
1250
- type HrTime = [number, number];
1251
- /**
1252
- * Defines TimeInput.
1253
- *
1254
- * hrtime, epoch milliseconds, performance.now() or Date
1255
- *
1256
- * @since 1.0.0
1257
- */
1258
- type TimeInput = HrTime | number | Date;
1259
- /**
1260
- * @deprecated please use {@link Attributes}
1261
- * @since 1.0.0
1262
- */
1263
- type SpanAttributes = Attributes;
1264
- /**
1265
- * @deprecated please use {@link AttributeValue}
1266
- * @since 1.0.0
1267
- */
1268
- type SpanAttributeValue = AttributeValue;
1269
- /**
1270
- * @since 1.0.0
1271
- */
1272
- interface TraceState {
1273
- /**
1274
- * Create a new TraceState which inherits from this TraceState and has the
1275
- * given key set.
1276
- * The new entry will always be added in the front of the list of states.
1277
- *
1278
- * @param key key of the TraceState entry.
1279
- * @param value value of the TraceState entry.
1280
- */
1281
- set(key: string, value: string): TraceState;
1282
- /**
1283
- * Return a new TraceState which inherits from this TraceState but does not
1284
- * contain the given key.
1285
- *
1286
- * @param key the key for the TraceState entry to be removed.
1287
- */
1288
- unset(key: string): TraceState;
1289
- /**
1290
- * Returns the value to which the specified key is mapped, or `undefined` if
1291
- * this map contains no mapping for the key.
1292
- *
1293
- * @param key with which the specified value is to be associated.
1294
- * @returns the value to which the specified key is mapped, or `undefined` if
1295
- * this map contains no mapping for the key.
1296
- */
1297
- get(key: string): string | undefined;
1298
- /**
1299
- * Serializes the TraceState to a `list` as defined below. The `list` is a
1300
- * series of `list-members` separated by commas `,`, and a list-member is a
1301
- * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs
1302
- * surrounding `list-members` are ignored. There can be a maximum of 32
1303
- * `list-members` in a `list`.
1304
- *
1305
- * @returns the serialized string.
1306
- */
1307
- serialize(): string;
1308
- }
1309
- /**
1310
- * A SpanContext represents the portion of a {@link Span} which must be
1311
- * serialized and propagated along side of a {@link Baggage}.
1312
- *
1313
- * @since 1.0.0
1314
- */
1315
- interface SpanContext {
1316
- /**
1317
- * The ID of the trace that this span belongs to. It is worldwide unique
1318
- * with practically sufficient probability by being made as 16 randomly
1319
- * generated bytes, encoded as a 32 lowercase hex characters corresponding to
1320
- * 128 bits.
1321
- */
1322
- traceId: string;
1323
- /**
1324
- * The ID of the Span. It is globally unique with practically sufficient
1325
- * probability by being made as 8 randomly generated bytes, encoded as a 16
1326
- * lowercase hex characters corresponding to 64 bits.
1327
- */
1328
- spanId: string;
1329
- /**
1330
- * Only true if the SpanContext was propagated from a remote parent.
1331
- */
1332
- isRemote?: boolean;
1333
- /**
1334
- * Trace flags to propagate.
1335
- *
1336
- * It is represented as 1 byte (bitmap). Bit to represent whether trace is
1337
- * sampled or not. When set, the least significant bit documents that the
1338
- * caller may have recorded trace data. A caller who does not record trace
1339
- * data out-of-band leaves this flag unset.
1340
- *
1341
- * see {@link TraceFlags} for valid flag values.
1342
- */
1343
- traceFlags: number;
1344
- /**
1345
- * Tracing-system-specific info to propagate.
1346
- *
1347
- * The tracestate field value is a `list` as defined below. The `list` is a
1348
- * series of `list-members` separated by commas `,`, and a list-member is a
1349
- * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs
1350
- * surrounding `list-members` are ignored. There can be a maximum of 32
1351
- * `list-members` in a `list`.
1352
- * More Info: https://www.w3.org/TR/trace-context/#tracestate-field
1353
- *
1354
- * Examples:
1355
- * Single tracing system (generic format):
1356
- * tracestate: rojo=00f067aa0ba902b7
1357
- * Multiple tracing systems (with different formatting):
1358
- * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE
1359
- */
1360
- traceState?: TraceState;
1361
- }
1362
- /**
1363
- * @since 1.0.0
1364
- */
1365
- interface SpanStatus {
1366
- /** The status code of this message. */
1367
- code: SpanStatusCode;
1368
- /** A developer-facing error message. */
1369
- message?: string;
1370
- }
1371
- /**
1372
- * An enumeration of status codes.
1373
- *
1374
- * @since 1.0.0
1375
- */
1376
- declare enum SpanStatusCode {
1377
- /**
1378
- * The default status.
1379
- */
1380
- UNSET = 0,
1381
- /**
1382
- * The operation has been validated by an Application developer or
1383
- * Operator to have completed successfully.
1384
- */
1385
- OK = 1,
1386
- /**
1387
- * The operation contains an error.
1388
- */
1389
- ERROR = 2,
1390
- }
1391
- /**
1392
- * A pointer from the current {@link Span} to another span in the same trace or
1393
- * in a different trace.
1394
- * Few examples of Link usage.
1395
- * 1. Batch Processing: A batch of elements may contain elements associated
1396
- * with one or more traces/spans. Since there can only be one parent
1397
- * SpanContext, Link is used to keep reference to SpanContext of all
1398
- * elements in the batch.
1399
- * 2. Public Endpoint: A SpanContext in incoming client request on a public
1400
- * endpoint is untrusted from service provider perspective. In such case it
1401
- * is advisable to start a new trace with appropriate sampling decision.
1402
- * However, it is desirable to associate incoming SpanContext to new trace
1403
- * initiated on service provider side so two traces (from Client and from
1404
- * Service Provider) can be correlated.
1405
- *
1406
- * @since 1.0.0
1407
- */
1408
- interface Link {
1409
- /** The {@link SpanContext} of a linked span. */
1410
- context: SpanContext;
1411
- /** A set of {@link SpanAttributes} on the link. */
1412
- attributes?: SpanAttributes;
1413
- /** Count of attributes of the link that were dropped due to collection limits */
1414
- droppedAttributesCount?: number;
1415
- }
1416
- /**
1417
- * An interface that represents a span. A span represents a single operation
1418
- * within a trace. Examples of span might include remote procedure calls or a
1419
- * in-process function calls to sub-components. A Trace has a single, top-level
1420
- * "root" Span that in turn may have zero or more child Spans, which in turn
1421
- * may have children.
1422
- *
1423
- * Spans are created by the {@link Tracer.startSpan} method.
1424
- *
1425
- * @since 1.0.0
1426
- */
1427
- interface Span {
1428
- /**
1429
- * Returns the {@link SpanContext} object associated with this Span.
1430
- *
1431
- * Get an immutable, serializable identifier for this span that can be used
1432
- * to create new child spans. Returned SpanContext is usable even after the
1433
- * span ends.
1434
- *
1435
- * @returns the SpanContext object associated with this Span.
1436
- */
1437
- spanContext(): SpanContext;
1438
- /**
1439
- * Sets an attribute to the span.
1440
- *
1441
- * Sets a single Attribute with the key and value passed as arguments.
1442
- *
1443
- * @param key the key for this attribute.
1444
- * @param value the value for this attribute. Setting a value null or
1445
- * undefined is invalid and will result in undefined behavior.
1446
- */
1447
- setAttribute(key: string, value: SpanAttributeValue): this;
1448
- /**
1449
- * Sets attributes to the span.
1450
- *
1451
- * @param attributes the attributes that will be added.
1452
- * null or undefined attribute values
1453
- * are invalid and will result in undefined behavior.
1454
- */
1455
- setAttributes(attributes: SpanAttributes): this;
1456
- /**
1457
- * Adds an event to the Span.
1458
- *
1459
- * @param name the name of the event.
1460
- * @param [attributesOrStartTime] the attributes that will be added; these are
1461
- * associated with this event. Can be also a start time
1462
- * if type is {@type TimeInput} and 3rd param is undefined
1463
- * @param [startTime] start time of the event.
1464
- */
1465
- addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this;
1466
- /**
1467
- * Adds a single link to the span.
1468
- *
1469
- * Links added after the creation will not affect the sampling decision.
1470
- * It is preferred span links be added at span creation.
1471
- *
1472
- * @param link the link to add.
1473
- */
1474
- addLink(link: Link): this;
1475
- /**
1476
- * Adds multiple links to the span.
1477
- *
1478
- * Links added after the creation will not affect the sampling decision.
1479
- * It is preferred span links be added at span creation.
1480
- *
1481
- * @param links the links to add.
1482
- */
1483
- addLinks(links: Link[]): this;
1484
- /**
1485
- * Sets the status of the span.
1486
- *
1487
- * By default, a span has status {@link SpanStatusCode.UNSET}.
1488
- * Calling this method overrides that default.
1489
- *
1490
- * The status codes have a total order: `OK > ERROR > UNSET`.
1491
- *
1492
- * - Once {@link SpanStatusCode.OK} is set, any further attempts to change
1493
- * the status are ignored.
1494
- * - Any attempt to set {@link SpanStatusCode.UNSET} is always ignored.
1495
- *
1496
- * The `message` field is only used when {@link SpanStatusCode.ERROR} is set.
1497
- * For all other status codes, `message` is ignored.
1498
- *
1499
- * @param status The {@link SpanStatus} to set.
1500
- */
1501
- setStatus(status: SpanStatus): this;
1502
- /**
1503
- * Updates the Span name.
1504
- *
1505
- * This will override the name provided via {@link Tracer.startSpan}.
1506
- *
1507
- * Upon this update, any sampling behavior based on Span name will depend on
1508
- * the implementation.
1509
- *
1510
- * @param name the Span name.
1511
- */
1512
- updateName(name: string): this;
1513
- /**
1514
- * Marks the end of Span execution.
1515
- *
1516
- * Call to End of a Span MUST not have any effects on child spans. Those may
1517
- * still be running and can be ended later.
1518
- *
1519
- * Do not return `this`. The Span generally should not be used after it
1520
- * is ended so chaining is not desired in this context.
1521
- *
1522
- * @param [endTime] the time to set as Span's end time. If not provided,
1523
- * use the current time as the span's end time.
1524
- */
1525
- end(endTime?: TimeInput): void;
1526
- /**
1527
- * Returns the flag whether this span will be recorded.
1528
- *
1529
- * @returns true if this Span is active and recording information like events
1530
- * with the `AddEvent` operation and attributes using `setAttributes`.
1531
- */
1532
- isRecording(): boolean;
1533
- /**
1534
- * Sets exception as a span event
1535
- * @param exception the exception the only accepted values are string or Error
1536
- * @param [time] the time to set as Span's event time. If not provided,
1537
- * use the current time.
1538
- */
1539
- recordException(exception: Exception, time?: TimeInput): void;
1540
- }
1541
- /**
1542
- * @since 1.0.0
1543
- */
1544
- declare enum SpanKind {
1545
- /** Default value. Indicates that the span is used internally. */
1546
- INTERNAL = 0,
1547
- /**
1548
- * Indicates that the span covers server-side handling of an RPC or other
1549
- * remote request.
1550
- */
1551
- SERVER = 1,
1552
- /**
1553
- * Indicates that the span covers the client-side wrapper around an RPC or
1554
- * other remote request.
1555
- */
1556
- CLIENT = 2,
1557
- /**
1558
- * Indicates that the span describes producer sending a message to a
1559
- * broker. Unlike client and server, there is no direct critical path latency
1560
- * relationship between producer and consumer spans.
1561
- */
1562
- PRODUCER = 3,
1563
- /**
1564
- * Indicates that the span describes consumer receiving a message from a
1565
- * broker. Unlike client and server, there is no direct critical path latency
1566
- * relationship between producer and consumer spans.
1567
- */
1568
- CONSUMER = 4,
1569
- }
1570
- /**
1571
- * Options needed for span creation
1572
- *
1573
- * @since 1.0.0
1574
- */
1575
- interface SpanOptions {
1576
- /**
1577
- * The SpanKind of a span
1578
- * @default {@link SpanKind.INTERNAL}
1579
- */
1580
- kind?: SpanKind;
1581
- /** A span's attributes */
1582
- attributes?: Attributes;
1583
- /** {@link Link}s span to other spans */
1584
- links?: Link[];
1585
- /** A manually specified start time for the created `Span` object. */
1586
- startTime?: TimeInput;
1587
- /** The new span should be a root span. (Ignore parent from context). */
1588
- root?: boolean;
1589
- }
1590
- /**
1591
- * Tracer provides an interface for creating {@link Span}s.
1592
- *
1593
- * @since 1.0.0
1594
- */
1595
- interface Tracer {
1596
- /**
1597
- * Starts a new {@link Span}. Start the span without setting it on context.
1598
- *
1599
- * This method do NOT modify the current Context.
1600
- *
1601
- * @param name The name of the span
1602
- * @param [options] SpanOptions used for span creation
1603
- * @param [context] Context to use to extract parent
1604
- * @returns Span The newly created span
1605
- * @example
1606
- * const span = tracer.startSpan('op');
1607
- * span.setAttribute('key', 'value');
1608
- * span.end();
1609
- */
1610
- startSpan(name: string, options?: SpanOptions, context?: Context): Span;
1611
- /**
1612
- * Starts a new {@link Span} and calls the given function passing it the
1613
- * created span as first argument.
1614
- * Additionally the new span gets set in context and this context is activated
1615
- * for the duration of the function call.
1616
- *
1617
- * @param name The name of the span
1618
- * @param [options] SpanOptions used for span creation
1619
- * @param [context] Context to use to extract parent
1620
- * @param fn function called in the context of the span and receives the newly created span as an argument
1621
- * @returns return value of fn
1622
- * @example
1623
- * const something = tracer.startActiveSpan('op', span => {
1624
- * try {
1625
- * do some work
1626
- * span.setStatus({code: SpanStatusCode.OK});
1627
- * return something;
1628
- * } catch (err) {
1629
- * span.setStatus({
1630
- * code: SpanStatusCode.ERROR,
1631
- * message: err.message,
1632
- * });
1633
- * throw err;
1634
- * } finally {
1635
- * span.end();
1636
- * }
1637
- * });
1638
- *
1639
- * @example
1640
- * const span = tracer.startActiveSpan('op', span => {
1641
- * try {
1642
- * do some work
1643
- * return span;
1644
- * } catch (err) {
1645
- * span.setStatus({
1646
- * code: SpanStatusCode.ERROR,
1647
- * message: err.message,
1648
- * });
1649
- * throw err;
1650
- * }
1651
- * });
1652
- * do some more work
1653
- * span.end();
1654
- */
1655
- startActiveSpan<F extends (span: Span) => unknown>(name: string, fn: F): ReturnType<F>;
1656
- startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, fn: F): ReturnType<F>;
1657
- startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, context: Context, fn: F): ReturnType<F>;
1658
- }
1659
1573
  interface OtelPluginOptions {
1660
1574
  /**
1661
1575
  * Rename incoming `project:target` IDs before they become OTel
@@ -1735,9 +1649,16 @@ declare const findVisTaskConfigFile: (projectDirectory: string) => string | unde
1735
1649
  *
1736
1650
  * Falls back to secure defaults if no config file is found.
1737
1651
  * @param workspaceRoot The workspace root directory to search for the config file.
1652
+ * @param options Optional loader options.
1653
+ * @param options.explicitConfigPath Overrides discovery — used by the
1654
+ * global `--config` flag so users can point at any file regardless of
1655
+ * cwd. The path must exist; otherwise an error is thrown so the
1656
+ * config-loader plugin can surface it to the user.
1738
1657
  * @returns The loaded and resolved configuration with secure defaults applied.
1739
1658
  */
1740
- declare const loadVisConfig: (workspaceRoot: string) => Promise<VisConfig>;
1659
+ declare const loadVisConfig: (workspaceRoot: string, options?: {
1660
+ explicitConfigPath?: string;
1661
+ }) => Promise<VisConfig>;
1741
1662
  /**
1742
1663
  * Load the per-package `vis.task.ts` overlay for a project, if any.
1743
1664
  *