@visulima/vis 1.0.0-alpha.3 → 1.0.0-alpha.30

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 (172) hide show
  1. package/CHANGELOG.md +1117 -24
  2. package/LICENSE.md +11958 -0
  3. package/README.md +344 -20
  4. package/dashboard/dist/index.html +152 -0
  5. package/dist/bin.js +1 -146
  6. package/dist/binx.js +3 -0
  7. package/dist/config/index.d.ts +3154 -0
  8. package/dist/config/index.js +1 -0
  9. package/dist/generate/index.d.ts +157 -0
  10. package/dist/generate/index.js +1 -0
  11. package/dist/packem_chunks/bin.js +1415 -0
  12. package/dist/packem_chunks/bloom-status.js +2 -0
  13. package/dist/packem_chunks/bloom-sync.js +2 -0
  14. package/dist/packem_chunks/cache-attestation.js +1 -0
  15. package/dist/packem_chunks/config.js +19 -0
  16. package/dist/packem_chunks/devtools.js +82 -0
  17. package/dist/packem_chunks/doctor-probe.js +2 -0
  18. package/dist/packem_chunks/fix.js +11 -0
  19. package/dist/packem_chunks/handler.js +1 -0
  20. package/dist/packem_chunks/handler10.js +1 -0
  21. package/dist/packem_chunks/handler11.js +5 -0
  22. package/dist/packem_chunks/handler12.js +1 -0
  23. package/dist/packem_chunks/handler13.js +27 -0
  24. package/dist/packem_chunks/handler14.js +5 -0
  25. package/dist/packem_chunks/handler15.js +1 -0
  26. package/dist/packem_chunks/handler16.js +1 -0
  27. package/dist/packem_chunks/handler17.js +1 -0
  28. package/dist/packem_chunks/handler18.js +1 -0
  29. package/dist/packem_chunks/handler19.js +1 -0
  30. package/dist/packem_chunks/handler2.js +4 -0
  31. package/dist/packem_chunks/handler20.js +5 -0
  32. package/dist/packem_chunks/handler21.js +2 -0
  33. package/dist/packem_chunks/handler22.js +2 -0
  34. package/dist/packem_chunks/handler23.js +1 -0
  35. package/dist/packem_chunks/handler24.js +1 -0
  36. package/dist/packem_chunks/handler25.js +5 -0
  37. package/dist/packem_chunks/handler26.js +1 -0
  38. package/dist/packem_chunks/handler27.js +3 -0
  39. package/dist/packem_chunks/handler28.js +1 -0
  40. package/dist/packem_chunks/handler29.js +7 -0
  41. package/dist/packem_chunks/handler3.js +4 -0
  42. package/dist/packem_chunks/handler30.js +33 -0
  43. package/dist/packem_chunks/handler31.js +3 -0
  44. package/dist/packem_chunks/handler32.js +8 -0
  45. package/dist/packem_chunks/handler33.js +1 -0
  46. package/dist/packem_chunks/handler34.js +5 -0
  47. package/dist/packem_chunks/handler35.js +11 -0
  48. package/dist/packem_chunks/handler36.js +3 -0
  49. package/dist/packem_chunks/handler37.js +22 -0
  50. package/dist/packem_chunks/handler38.js +61 -0
  51. package/dist/packem_chunks/handler39.js +3 -0
  52. package/dist/packem_chunks/handler4.js +6 -0
  53. package/dist/packem_chunks/handler40.js +6 -0
  54. package/dist/packem_chunks/handler41.js +24 -0
  55. package/dist/packem_chunks/handler42.js +153 -0
  56. package/dist/packem_chunks/handler43.js +25 -0
  57. package/dist/packem_chunks/handler44.js +10 -0
  58. package/dist/packem_chunks/handler45.js +708 -0
  59. package/dist/packem_chunks/handler46.js +24 -0
  60. package/dist/packem_chunks/handler47.js +322 -0
  61. package/dist/packem_chunks/handler48.js +48 -0
  62. package/dist/packem_chunks/handler49.js +3 -0
  63. package/dist/packem_chunks/handler5.js +8 -0
  64. package/dist/packem_chunks/handler50.js +27 -0
  65. package/dist/packem_chunks/handler51.js +195 -0
  66. package/dist/packem_chunks/handler52.js +34 -0
  67. package/dist/packem_chunks/handler6.js +1 -0
  68. package/dist/packem_chunks/handler7.js +1 -0
  69. package/dist/packem_chunks/handler8.js +1 -0
  70. package/dist/packem_chunks/handler9.js +1 -0
  71. package/dist/packem_chunks/heal-accept.js +10 -0
  72. package/dist/packem_chunks/heal.js +14 -0
  73. package/dist/packem_chunks/help-command.js +8 -0
  74. package/dist/packem_chunks/index.js +7 -0
  75. package/dist/packem_chunks/keys-refresh.js +4 -0
  76. package/dist/packem_chunks/list.js +3 -0
  77. package/dist/packem_chunks/loader.js +4 -0
  78. package/dist/packem_chunks/loader2.js +1 -0
  79. package/dist/packem_chunks/prune.js +3 -0
  80. package/dist/packem_chunks/run.js +1 -0
  81. package/dist/packem_chunks/status.js +2 -0
  82. package/dist/packem_chunks/sync.js +2 -0
  83. package/dist/packem_chunks/sync2.js +2 -0
  84. package/dist/packem_chunks/tar.js +3 -0
  85. package/dist/packem_chunks/tripwire.js +2 -0
  86. package/dist/packem_chunks/verify-lockfile.js +2 -0
  87. package/dist/packem_shared/Table-DoSoazT6-DwnyTUsA.js +12 -0
  88. package/dist/packem_shared/_commonjsHelpers-CLblCigl.js +1 -0
  89. package/dist/packem_shared/advisories-BxXiKFbL.js +1 -0
  90. package/dist/packem_shared/affected-shas-BdnlfiV1.js +1 -0
  91. package/dist/packem_shared/ai-analysis-KP8b5lc0.js +68 -0
  92. package/dist/packem_shared/ai-fix-BkPUHA0z.js +43 -0
  93. package/dist/packem_shared/anolilab-text-CAM_E6uK.js +13 -0
  94. package/dist/packem_shared/applyDefaults-BogleaFi.js +1 -0
  95. package/dist/packem_shared/build-scripts-DE6U8jVq.js +1 -0
  96. package/dist/packem_shared/cyclonedx-BpGVHqSW.js +4 -0
  97. package/dist/packem_shared/definePlugin-CWm4Dv_t.js +1 -0
  98. package/dist/packem_shared/dependency-scan-BUbOcMwX.js +1 -0
  99. package/dist/packem_shared/docker-CTE3s4LW.js +60 -0
  100. package/dist/packem_shared/failure-log-34Wl3npC.js +2 -0
  101. package/dist/packem_shared/giget-CcEy_Elm.js +2 -0
  102. package/dist/packem_shared/glob-D_7bct6p-D8itOHsr.js +1 -0
  103. package/dist/packem_shared/index-D1xC1Y_R.js +1 -0
  104. package/dist/packem_shared/index-DH-5hsrC.js +1 -0
  105. package/dist/packem_shared/index-hoWfZmNo.js +30 -0
  106. package/dist/packem_shared/license-zZU7aavK.js +1 -0
  107. package/dist/packem_shared/lifecycle-CXaqPGAQ.js +2 -0
  108. package/dist/packem_shared/lockfile-CrT86D6d.js +1 -0
  109. package/dist/packem_shared/lockfile-Cu2BH6bl.js +1 -0
  110. package/dist/packem_shared/manifests-BzWpKW8F.js +1 -0
  111. package/dist/packem_shared/min-release-age-BPVXwPUg.js +34 -0
  112. package/dist/packem_shared/native-config-sync-BRZZetn3.js +21 -0
  113. package/dist/packem_shared/osv-bloom-DSZcHLsM.js +2 -0
  114. package/dist/packem_shared/otelPlugin-CJR2T_lk.js +1 -0
  115. package/dist/packem_shared/peer-warnings-EvSJ18gE.js +1 -0
  116. package/dist/packem_shared/pm-runner-DmKT2FqF.js +1 -0
  117. package/dist/packem_shared/provenance-DkCA8BrN.js +1 -0
  118. package/dist/packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js +1 -0
  119. package/dist/packem_shared/registry-keys-Mixm4eAY.js +1 -0
  120. package/dist/packem_shared/resolve-explicit-D5E72FfN.js +5 -0
  121. package/dist/packem_shared/runtime-check-CilFOqUU.js +1 -0
  122. package/dist/packem_shared/s1ngularity-Qxc6tRRI.js +1 -0
  123. package/dist/packem_shared/scan-progress-DVtCtI2z.js +2 -0
  124. package/dist/packem_shared/selectors-DkgYFzdq.js +3 -0
  125. package/dist/packem_shared/signatures-byuFrtAH.js +2 -0
  126. package/dist/packem_shared/spinner-C8xs6QZv.js +1 -0
  127. package/dist/packem_shared/spinners-f91Rbo99-Bjf3NcO0.js +1 -0
  128. package/dist/packem_shared/symbols-CQmER5MT.js +1 -0
  129. package/dist/packem_shared/tabs-xZkm6Y_J.js +1 -0
  130. package/dist/packem_shared/toolchain-DoG6b_G_.js +5 -0
  131. package/dist/packem_shared/typosquats-BiDxQj7R.js +1 -0
  132. package/dist/packem_shared/use-measured-height-Lea6TCVD.js +1 -0
  133. package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
  134. package/dist/packem_shared/verify-cLcZwKqe.js +1 -0
  135. package/dist/packem_shared/vis-update-app-BCKzlqj8.js +1 -0
  136. package/dist/packem_shared/watch-DEL0yol9.js +1 -0
  137. package/dist/packem_shared/watch-loop-C31Ar7BX.js +11 -0
  138. package/index.d.ts +436 -0
  139. package/index.js +613 -0
  140. package/package.json +71 -26
  141. package/schemas/project.schema.json +991 -0
  142. package/schemas/vis-config.schema.json +4958 -0
  143. package/skills/vis/SKILL.md +96 -0
  144. package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
  145. package/templates/buildkite-ci/template.yml +20 -0
  146. package/dist/ai-analysis.d.ts +0 -40
  147. package/dist/ai-cache.d.ts +0 -21
  148. package/dist/bin.d.ts +0 -1
  149. package/dist/catalog.d.ts +0 -110
  150. package/dist/commands/affected.d.ts +0 -3
  151. package/dist/commands/ai.d.ts +0 -3
  152. package/dist/commands/analyze.d.ts +0 -3
  153. package/dist/commands/check.d.ts +0 -3
  154. package/dist/commands/graph.d.ts +0 -3
  155. package/dist/commands/hook/constants.d.ts +0 -8
  156. package/dist/commands/hook/index.d.ts +0 -3
  157. package/dist/commands/hook/install.d.ts +0 -7
  158. package/dist/commands/hook/migrate.d.ts +0 -27
  159. package/dist/commands/hook/uninstall.d.ts +0 -3
  160. package/dist/commands/migrate/constants.d.ts +0 -12
  161. package/dist/commands/migrate/deps.d.ts +0 -32
  162. package/dist/commands/migrate/index.d.ts +0 -3
  163. package/dist/commands/migrate/json.d.ts +0 -20
  164. package/dist/commands/migrate/lint-staged.d.ts +0 -62
  165. package/dist/commands/migrate/types.d.ts +0 -20
  166. package/dist/commands/run.d.ts +0 -3
  167. package/dist/commands/staged.d.ts +0 -3
  168. package/dist/commands/update.d.ts +0 -3
  169. package/dist/config.d.ts +0 -40
  170. package/dist/config.js +0 -1
  171. package/dist/package-manager.d.ts +0 -23
  172. package/dist/workspace.d.ts +0 -58
@@ -0,0 +1,3154 @@
1
+ import { TargetConfiguration, TaskResult, Task, FingerprintContributor, ConstraintsConfig, NamedInputs, TaskRunnerOptions } from '@visulima/task-runner';
2
+ export { type FingerprintContributor } from '@visulima/task-runner';
3
+ import { Hookable } from 'hookable';
4
+ /**
5
+ * One family of upstream-coupled packages.
6
+ *
7
+ * `members` is an exact-match list. `prefixes` accept any dep whose
8
+ * name starts with the prefix — useful for monorepos that ship many
9
+ * subpackages under one scope (e.g. `@babel/`, `@storybook/`,
10
+ * `@nx/`). A family can use either or both; a dep matching either
11
+ * list belongs to the family.
12
+ */
13
+ interface SimilarDepFamily {
14
+ /** Stable id; used in report output and config overrides. */
15
+ id: string;
16
+ /** Pretty label for the report. Defaults to `id` when omitted. */
17
+ label?: string;
18
+ /** Dep names that belong to this family verbatim. */
19
+ members?: string[];
20
+ /** Dep-name prefixes (literal, no glob). Match if `depName.startsWith(prefix)`. */
21
+ prefixes?: string[];
22
+ }
23
+ /** Adapter IDs that can format (adapter `kind` is `"fmt"` or `"both"`). */
24
+ type FmtAdapterId = "biome" | "deno-fmt" | "dprint" | "oxfmt" | "prettier" | "ruff-fmt";
25
+ /** Adapter IDs that can lint (adapter `kind` is `"lint"` or `"both"`). */
26
+ type LintAdapterId = "biome" | "deno-lint" | "eslint" | "markdownlint" | "oxlint" | "ruff-check" | "shellcheck" | "stylelint";
27
+ type VersionManagerName = "asdf" | "corepack" | "fnm" | "mise" | "none" | "nvm" | "proto" | "self-activate" | "volta";
28
+ type RuntimeTool = "aube" | "bun" | "deno" | "go" | "node" | "npm" | "pnpm" | "python" | "ruby" | "rust" | "yarn";
29
+ interface ToolchainConfig {
30
+ /**
31
+ * When a tool pin doesn't match the running version, try to fix it
32
+ * automatically before `vis run` / `vis ci` proceed. Defaults to
33
+ * `true` when {@link findInstalledManagers} reports at least one
34
+ * installed manager, `false` otherwise.
35
+ *
36
+ * Set to `false` to keep the doctor-style warning behaviour and
37
+ * make users run `vis toolchain install` themselves.
38
+ */
39
+ readonly autoInstall?: boolean;
40
+ /** Explicit manager override, useful in CI. */
41
+ readonly preferredManager?: VersionManagerName;
42
+ /** Overrides for engines/packageManager-derived pins. */
43
+ readonly tools?: Partial<Record<RuntimeTool, string>>;
44
+ }
45
+ /**
46
+ * Custom task form — `{ title, task }` — analogous to lint-staged's
47
+ * listr-style task objects. `task` receives the matched absolute paths
48
+ * and returns a promise that resolves on success or rejects on failure.
49
+ */
50
+ interface CustomTask {
51
+ readonly task: (files: string[]) => unknown;
52
+ readonly title: string;
53
+ }
54
+ /**
55
+ * A task value as authored by the user. Command strings are split into
56
+ * argv and invoked with the matched file paths appended. Arrays run
57
+ * serially. Functions receive the matched paths and return further
58
+ * task values (possibly async). `{ title, task }` objects run `task`
59
+ * directly with no argv construction.
60
+ */
61
+ type StagedTask = CustomTask | StagedTaskFunction | ReadonlyArray<CustomTask | StagedTaskFunction | string> | string | ReadonlyArray<string>;
62
+ type StagedTaskFunction = (files: string[]) => Promise<StagedTaskResult> | StagedTaskResult;
63
+ type StagedTaskResult = CustomTask | ReadonlyArray<CustomTask | string> | string | ReadonlyArray<string>;
64
+ /**
65
+ * Config object mapping glob patterns (basename or path-style) to tasks.
66
+ * A top-level function form lets the user generate the entire config
67
+ * from the staged file list.
68
+ */
69
+ type StagedConfig = Readonly<Record<string, StagedTask>> | StagedConfigFunction;
70
+ type StagedConfigFunction = (files: string[]) => Promise<Record<string, StagedTask>> | Record<string, StagedTask>;
71
+ /**
72
+ * Configuration block declared on a target to mark it as a long-lived
73
+ * "service" — eligible to be started/stopped via `vis service` and
74
+ * auto-attached when other tasks depend on it.
75
+ *
76
+ * Targets must also carry `preset: "server"` (or the equivalent
77
+ * `persistent: true`) for the service-mode lifecycle to apply.
78
+ */
79
+ interface ServiceConfig {
80
+ /**
81
+ * Env vars to expose to dependent tasks when this service is
82
+ * registered. Merged into the dependent task's env after the task's
83
+ * own envFile and before the task's explicit `env` overrides — the
84
+ * dependent task wins on key collisions.
85
+ *
86
+ * Note: only this `env` map propagates to dependents. The service
87
+ * target's own `envFile` is loaded into the **service process** at
88
+ * start time but is *not* forwarded — dependents must declare any
89
+ * shared values they need either here or in their own envFile. This
90
+ * boundary is intentional: envFiles often contain operator-only
91
+ * secrets (deploy keys, admin tokens) that should not leak into
92
+ * downstream test commands.
93
+ */
94
+ env?: Record<string, string>;
95
+ /**
96
+ * Grace period in milliseconds between SIGTERM and SIGKILL when the
97
+ * service is stopped.
98
+ * @default 5000
99
+ */
100
+ killGracePeriodMs?: number;
101
+ /**
102
+ * Optional port the service listens on. Used as the default for
103
+ * `readiness.tcp.port` when no explicit probe is configured, and
104
+ * surfaced by `vis service list`.
105
+ */
106
+ port?: number;
107
+ /** Readiness probe configuration. v1 supports TCP only. */
108
+ readiness?: {
109
+ tcp: {
110
+ host?: string;
111
+ port: number;
112
+ timeoutMs?: number;
113
+ };
114
+ };
115
+ }
116
+ /**
117
+ * Persisted registry entry. One JSON file per running service in
118
+ * `~/.vis-services/&lt;workspaceHash>/&lt;slug>.json`.
119
+ */
120
+ interface ServiceEntry {
121
+ /** Resolved command actually spawned. Used for stale-PID detection. */
122
+ command: string;
123
+ /** Service config captured at start time. */
124
+ config: ServiceConfig;
125
+ cwd: string;
126
+ /**
127
+ * Env vars to forward to dependents. Resolved at start time —
128
+ * defaults to `config.env`, but a future `--env-from` flag could
129
+ * extend this without touching the registry consumer.
130
+ */
131
+ env: Record<string, string>;
132
+ /** Target id, e.g. `apps/api:db`. */
133
+ id: string;
134
+ /** Absolute path to the captured stdout/stderr log file. */
135
+ logFile: string;
136
+ pid: number;
137
+ /**
138
+ * Filesystem-safe slug of `id`. `apps/api:db` → `apps_api__db`.
139
+ * Used as the entry's filename so registry reads can map slug → entry.
140
+ */
141
+ slug: string;
142
+ /** ISO 8601 timestamp of when the service was started. */
143
+ startedAt: string;
144
+ /**
145
+ * vis version that started this service. Auto-attach refuses entries
146
+ * from a mismatched version — protects against schema drift.
147
+ */
148
+ visVersion: string;
149
+ }
150
+ /**
151
+ * First-class task arguments: a declarative schema per target that lets a
152
+ * task define its named/positional arguments, validate what the user passes
153
+ * on the CLI, and render a per-task `--help`. The validated values are also
154
+ * exposed to the command as `VIS_ARG_&lt;NAME>` environment variables so the
155
+ * underlying script can read them without re-parsing argv.
156
+ *
157
+ * This module is intentionally pure (no IO) so it is trivially unit-testable;
158
+ * the run handler wires it to the forwarded-args vector and the task env.
159
+ */
160
+ /** Value type a {@link TaskArgument} coerces to and validates against. */
161
+ type TaskArgumentType = "boolean" | "enum" | "number" | "string";
162
+ /** A coerced task-argument value. */
163
+ type TaskArgumentValue = boolean | number | string;
164
+ /** A single declared argument for a task target. */
165
+ interface TaskArgument {
166
+ /**
167
+ * Short single-character alias (e.g. `r` for `--reporter`, used as `-r`).
168
+ * Must be exactly one character — enforced at run time by
169
+ * {@link validateArgumentSchema}.
170
+ */
171
+ alias?: string;
172
+ /**
173
+ * Allowed values when {@link TaskArgument.type} is `"enum"`. Must be
174
+ * non-empty (and is required) for `enum` — enforced at run time by
175
+ * {@link validateArgumentSchema}.
176
+ */
177
+ choices?: string[];
178
+ /** Value applied when the argument is omitted. Skips the required check. */
179
+ default?: TaskArgumentValue;
180
+ /** One-line help text surfaced by per-task `--help`. */
181
+ description?: string;
182
+ /**
183
+ * Canonical name, without the leading `--` (kebab-case by convention).
184
+ * Must start with a letter and contain only letters, digits, `-`, `_` —
185
+ * enforced at run time by {@link validateArgumentSchema}.
186
+ */
187
+ name: string;
188
+ /**
189
+ * Consume the value from the next free positional argument instead of a
190
+ * `--flag`. Positional args are filled in declaration order.
191
+ */
192
+ positional?: boolean;
193
+ /** Fail the task when the argument is absent and has no `default`. */
194
+ required?: boolean;
195
+ /** Value type for coercion + validation. Defaults to `"string"`. */
196
+ type?: TaskArgumentType;
197
+ }
198
+ /**
199
+ * Semantic classification for a target.
200
+ * - `build`: Generates one or more artifacts; cached by default.
201
+ * - `test`: Validation task (lint, typecheck, unit test). Default type.
202
+ * - `run`: One-off or long-running process. Not cached by default.
203
+ */
204
+ type TargetType = "build" | "run" | "test";
205
+ /**
206
+ * Preset bundles of target options.
207
+ * - `server`: Long-running local dev server — caching off, not in CI,
208
+ * interactive, persistent.
209
+ * - `utility`: Short-lived helper — caching off, not in CI.
210
+ */
211
+ type TargetPreset = "server" | "utility";
212
+ /**
213
+ * Controls whether a target runs in CI.
214
+ * - `true` (default): Always run.
215
+ * - `false`: Never run in CI (local-only).
216
+ * - `"affected"`: Only when the project is affected by the current change set.
217
+ * - `"always"`: Always run, even if unaffected.
218
+ */
219
+ type RunInCI = "affected" | "always" | boolean;
220
+ /**
221
+ * Controls how affected files are forwarded to a task.
222
+ * - `false` (default): Do not forward.
223
+ * - `"args"`: Append affected paths as additional command arguments.
224
+ * - `"env"`: Expose them via `VIS_AFFECTED_FILES` environment variable.
225
+ * - `"both"`: Both of the above.
226
+ */
227
+ type AffectedFilesMode = "args" | "both" | "env" | false;
228
+ /**
229
+ * Vis-specific target options that extend the task-runner's
230
+ * base `TargetConfiguration`. These live under `target.options` and are
231
+ * interpreted by vis before handing the task off to task-runner.
232
+ *
233
+ * Conditional execution (`when:`) and finally tasks (`always:`) live at
234
+ * the target top level, not under `options` — they're handled by the
235
+ * task-runner orchestrator. See `@visulima/task-runner`'s `WhenCondition`.
236
+ */
237
+ interface VisTargetOptions {
238
+ /**
239
+ * How to forward affected files to the task process.
240
+ * Only used when invoked via `vis affected &lt;target>`.
241
+ * @default false
242
+ */
243
+ affectedFiles?: AffectedFilesMode;
244
+ /**
245
+ * Load environment variables from dotenv file(s) before running.
246
+ * - `string`: a single file path (relative to project root).
247
+ * - `string[]`: multiple files — later entries override earlier ones,
248
+ * so put more-specific files last (e.g. `[".env", ".env.local"]`).
249
+ * - `true`: auto-cascade in the Next/Vite order:
250
+ * `.env` → `.env.{NODE_ENV}` → `.env.local` → `.env.{NODE_ENV}.local`.
251
+ * Skips `.env.local` when NODE_ENV is `test`, matching Next.js.
252
+ */
253
+ envFile?: boolean | string | string[];
254
+ /**
255
+ * When true, the task is serialized with respect to parallel execution
256
+ * and must be run on the main process (claims stdin). Used for commands
257
+ * that read from the terminal.
258
+ * @default false
259
+ */
260
+ interactive?: boolean;
261
+ /**
262
+ * When true, the task is hidden from CLI listings and can only be invoked
263
+ * as a dependency of another task.
264
+ * @default false
265
+ */
266
+ internal?: boolean;
267
+ /**
268
+ * Milliseconds the timeout watchdog waits between sending SIGTERM
269
+ * and SIGKILL when the `timeout` budget fires. Tasks that ignore
270
+ * SIGTERM (e.g. test runners holding open child processes) get
271
+ * force-killed after this grace window so a stuck task can't outlive
272
+ * its budget.
273
+ *
274
+ * Set to `0` to skip escalation and rely on SIGTERM only.
275
+ * @default 5000
276
+ */
277
+ killGracePeriodMs?: number;
278
+ /**
279
+ * Serializes all tasks that share the same mutex name. Useful for tasks
280
+ * that contend on a shared resource (e.g., a database migration).
281
+ */
282
+ mutex?: string;
283
+ /**
284
+ * Per-target output verbosity. Overrides the global `--output-style`
285
+ * flag for this specific target.
286
+ *
287
+ * - `"normal"` (default): print every task's terminal output
288
+ * - `"quiet"`: only print output when the task fails. Successful
289
+ * and cached tasks contribute their status line and timing, but
290
+ * their captured stdout/stderr is suppressed.
291
+ *
292
+ * Useful when a routinely-noisy task (a linter or test runner with
293
+ * verbose progress output) should stay quiet during green builds
294
+ * but reveal everything when it fails.
295
+ */
296
+ outputStyle?: "normal" | "quiet";
297
+ /**
298
+ * When true, the task is a long-running / never-ending process.
299
+ * Persistent tasks are scheduled last, execute after all cacheable
300
+ * tasks complete, and are never cached.
301
+ * @default false
302
+ */
303
+ persistent?: boolean;
304
+ /**
305
+ * A preset that pre-fills a common bundle of options.
306
+ * User-provided fields always take precedence over the preset.
307
+ */
308
+ preset?: TargetPreset;
309
+ /**
310
+ * Run the task through a pseudo-terminal so color-aware tools
311
+ * (vitest, eslint, biome, …) render as if attached to a real TTY
312
+ * instead of a pipe. Output is captured via task-runner's
313
+ * `TerminalBuffer` so ANSI escapes are normalized into the final
314
+ * rendered state before reaching the reporter.
315
+ *
316
+ * Forces cache to off — PTY output can include timing-dependent
317
+ * frames (spinners) that aren't safe to replay from a cache.
318
+ * @default false
319
+ */
320
+ pty?: boolean;
321
+ /**
322
+ * Number of times to retry the task on failure. Uses an exponential
323
+ * backoff by default (1s, 2s, 4s, ...).
324
+ * @default 0
325
+ */
326
+ retryCount?: number;
327
+ /**
328
+ * Delay between retry attempts in milliseconds, or `"exponential"`
329
+ * for 2^attempt * 1000 ms.
330
+ * @default "exponential"
331
+ */
332
+ retryDelay?: number | "exponential";
333
+ /**
334
+ * When true, the command executes with the workspace root as CWD
335
+ * instead of the project root.
336
+ * @default false
337
+ */
338
+ runFromWorkspaceRoot?: boolean;
339
+ /**
340
+ * Controls whether the task runs in CI environments.
341
+ * @default true
342
+ */
343
+ runInCI?: RunInCI;
344
+ /**
345
+ * Capability tags that gate this task to runners advertising the
346
+ * same tag. The CLI's `--runner-tags=gpu,slow` flag (or
347
+ * `VIS_RUNNER_TAGS` env var) tells vis what the current runner
348
+ * supports; tasks whose `runnerTags` share at least one tag with
349
+ * the runner set are eligible. Untagged tasks (no `runnerTags` or
350
+ * an empty array) are general-purpose and always run.
351
+ *
352
+ * Use this for special-purpose CI lanes — e.g. a GPU runner that
353
+ * should only pick up visual-regression suites, or a nightly job
354
+ * that runs `slow` integration tests. When neither flag nor env
355
+ * is set, the filter is inactive and every task runs.
356
+ */
357
+ runnerTags?: string[];
358
+ /**
359
+ * Marks this target as a long-lived service that can be started via
360
+ * `vis service start &lt;id>` and auto-attached when other tasks declare
361
+ * it in `dependsOn`. Implies persistent + non-cacheable behaviour
362
+ * (set `preset: "server"` to inherit the rest of the bundle).
363
+ *
364
+ * The presence of this block — not `preset: "server"` alone — is
365
+ * what makes a target eligible for the cross-invocation registry.
366
+ * `preset: "server"` without `service` keeps today's in-run-only
367
+ * behaviour.
368
+ */
369
+ service?: ServiceConfig;
370
+ /**
371
+ * Per-target shell override. When set, the command runs through this
372
+ * shell instead of the platform default.
373
+ */
374
+ shell?: string;
375
+ /**
376
+ * Arguments passed to the per-target shell/interpreter before the command
377
+ * string. Defaults to `["-c"]` (POSIX shells, pwsh). Set this to run the
378
+ * command under an interpreter that uses a different flag — e.g.
379
+ * `shell: "node", shellArgs: ["-e"]` runs the command as inline JS
380
+ * ("script mode"), or `shellArgs: ["-lc"]` for a login shell. Only applies
381
+ * when `shell`/`unixShell`/`windowsShell` resolves to a custom shell.
382
+ *
383
+ * Must be non-empty when set — an empty array would drop the interpreter
384
+ * flag entirely, so the runtime falls back to `-c` defensively.
385
+ */
386
+ shellArgs?: string[];
387
+ /**
388
+ * Override the workspace `strictEnv` setting for this target. When
389
+ * truthy, the target fails if its command references an env var
390
+ * that resolves to neither the task's effective env nor
391
+ * `process.env`. When `false`, the target opts out of a workspace
392
+ * `strictEnv: true` (e.g. for a one-off command that legitimately
393
+ * tolerates an unset variable).
394
+ * @see VisConfig.strictEnv
395
+ */
396
+ strictEnv?: boolean;
397
+ /**
398
+ * Maximum wall-clock milliseconds a single task run is allowed to
399
+ * take before being killed. `0` / `undefined` means no timeout.
400
+ *
401
+ * When the timeout fires the task is sent SIGTERM and, if it has
402
+ * not exited within `killGracePeriodMs`, SIGKILL. The task exits
403
+ * with a failure status carrying the `[timeout]` marker in
404
+ * `terminalOutput`. Retries count per-attempt, not cumulatively.
405
+ *
406
+ * Use this to prevent runaway tasks from eating CI wall-clock time
407
+ * up to the job-level cutoff.
408
+ */
409
+ timeout?: number;
410
+ /**
411
+ * Per-target unix shell override, used on Linux and macOS.
412
+ * Takes precedence over `shell` on unix-like systems.
413
+ */
414
+ unixShell?: string;
415
+ /**
416
+ * Per-target windows shell override, used on Windows.
417
+ * Takes precedence over `shell` on Windows.
418
+ */
419
+ windowsShell?: string;
420
+ }
421
+ /**
422
+ * An extended target configuration that adds the vis-specific options
423
+ * on top of task-runner's `TargetConfiguration`.
424
+ */
425
+ interface VisTargetConfiguration extends Omit<TargetConfiguration, "options"> {
426
+ /**
427
+ * Alternate names that resolve to this target on the CLI. Useful
428
+ * for shortening long canonical names (`test` ↔ `t`) or for
429
+ * offering migration-friendly aliases when renaming targets.
430
+ * Aliases must be globally unique within the workspace.
431
+ */
432
+ aliases?: string[];
433
+ /**
434
+ * Declarative argument schema for this target. Forwarded CLI args
435
+ * (`vis run &lt;target> -- --flag value`) are validated against it, surfaced
436
+ * by per-task `--help`, and exposed to the command as `VIS_ARG_&lt;NAME>`
437
+ * environment variables.
438
+ */
439
+ arguments?: TaskArgument[];
440
+ /**
441
+ * One-line description surfaced by `vis list` and per-task `--help`.
442
+ * Kept short — longer docs belong in project READMEs or
443
+ * vis.config.ts comments.
444
+ */
445
+ description?: string;
446
+ /**
447
+ * True when the target was synthesized by a Project Crystal-style
448
+ * detector (see {@link ../inference}) rather than declared by a
449
+ * package.json script, project.json, or vis.task.ts file. Surfaced
450
+ * by `vis list --inferred` and used by tooling to distinguish
451
+ * implicit defaults from explicit user intent.
452
+ */
453
+ inferred?: boolean;
454
+ /** Vis-specific target options. */
455
+ options?: VisTargetOptions;
456
+ /** Preset applied before user-specified options. */
457
+ preset?: TargetPreset;
458
+ /**
459
+ * Semantic task type. Affects caching defaults and CI filtering.
460
+ * @default "test"
461
+ */
462
+ type?: TargetType;
463
+ }
464
+ /**
465
+ * Typed hook surface exposed to vis plugins.
466
+ *
467
+ * Plugins subscribe via `hooks.hook(name, handler)` — handlers are
468
+ * awaited sequentially in registration order. Returning a promise
469
+ * delays the next hook firing until it resolves, so plugins can
470
+ * safely perform async setup/teardown.
471
+ *
472
+ * Naming deliberately mirrors vite-task / webpack-style verbs:
473
+ * before/after for boundaries, on&lt;Event> for passive observation.
474
+ */
475
+ interface VisHooks {
476
+ /**
477
+ * Fired after the entire task graph completes (including any
478
+ * failures). `results` maps task ID → {@link TaskResult}.
479
+ */
480
+ "run:after": (results: Map<string, TaskResult>) => Promise<void> | void;
481
+ /**
482
+ * Fired once before any task in the graph starts, after workspace
483
+ * discovery and graph construction. Throwing aborts the run.
484
+ */
485
+ "run:before": (context: {
486
+ tasks: Task[];
487
+ workspaceRoot: string;
488
+ }) => Promise<void> | void;
489
+ /**
490
+ * Fired after `vis run` auto-attaches to one or more registered
491
+ * services. `taskIds` lists the in-graph dependents that consumed
492
+ * the service's `env` block; an empty array means the service was
493
+ * registered but no kept task depended on it.
494
+ */
495
+ "service:attach": (entry: ServiceEntry, taskIds: ReadonlyArray<string>) => Promise<void> | void;
496
+ /**
497
+ * Fired after a service is registered and its readiness probe
498
+ * succeeds. Sourced from both `vis service start` (and `restart`'s
499
+ * post-start phase) and any future programmatic call sites.
500
+ */
501
+ "service:start": (entry: ServiceEntry) => Promise<void> | void;
502
+ /**
503
+ * Fired after a registered service is stopped (SIGTERM/SIGKILL
504
+ * acknowledged, registry entry deleted). Not fired when stop is
505
+ * called against an unknown id — only when there was an alive
506
+ * entry to terminate.
507
+ */
508
+ "service:stop": (entry: ServiceEntry) => Promise<void> | void;
509
+ /**
510
+ * Fired after a task completes (success, failure, or cache hit).
511
+ * Receives the final {@link TaskResult}.
512
+ */
513
+ "task:after": (task: Task, result: TaskResult) => Promise<void> | void;
514
+ /**
515
+ * Fired before each task begins execution — after scheduling, before
516
+ * the executor runs the command. Throwing aborts that single task.
517
+ */
518
+ "task:before": (task: Task) => Promise<void> | void;
519
+ /** Fired when a task hit the local or remote cache. */
520
+ "task:cacheHit": (task: Task, result: TaskResult) => Promise<void> | void;
521
+ /**
522
+ * Fired when auto-fingerprint cache diagnostics reports a miss,
523
+ * carrying the human-readable reason string.
524
+ */
525
+ "task:cacheMiss": (task: Task, reasons: string) => Promise<void> | void;
526
+ /** Fired when a task exits non-zero. */
527
+ "task:failure": (task: Task, result: TaskResult) => Promise<void> | void;
528
+ /**
529
+ * Fired during fingerprint construction, after built-in inputs are
530
+ * gathered and before the hash is sealed. Plugins call
531
+ * `contributor.contribute(key, value)` to mix arbitrary strings
532
+ * into the task hash — the hasher namespaces and sorts contributions
533
+ * deterministically so call order doesn't change the result.
534
+ *
535
+ * Throwing aborts hashing for the offending task and surfaces as a
536
+ * task failure before any cache lookup runs. Use this to guarantee
537
+ * a buggy plugin can't quietly poison cache state.
538
+ */
539
+ "task:fingerprint": (task: Task, contributor: FingerprintContributor) => Promise<void> | void;
540
+ /**
541
+ * Fired right before a failed task is re-spawned by the retry
542
+ * controller. `attempt` is 1-indexed and counts the retry that's
543
+ * about to start (so the original failed run was attempt 0).
544
+ * `prevExitCode` is the failing exit status that triggered the
545
+ * retry (the full TaskResult isn't materialized at the retry
546
+ * boundary — only the per-attempt close event is available).
547
+ *
548
+ * Throwing aborts the retry; the previous failure becomes the final
549
+ * result.
550
+ */
551
+ "task:retry": (task: Task, attempt: number, prevExitCode: number) => Promise<void> | void;
552
+ /**
553
+ * Fired with a stderr chunk as a running task emits it. Plugins
554
+ * that ship logs live (Slack, Datadog) should prefer this over
555
+ * `task:after` so they don't wait for the full buffer.
556
+ */
557
+ "task:stderr": (task: Task, chunk: string) => Promise<void> | void;
558
+ /**
559
+ * Fired with a stdout chunk as a running task emits it. See
560
+ * `task:stderr` for semantics.
561
+ */
562
+ "task:stdout": (task: Task, chunk: string) => Promise<void> | void;
563
+ }
564
+ /**
565
+ * Public plugin contract. Implementations register handlers by
566
+ * returning a partial {@link VisHooks} map from `hooks`, or by
567
+ * mutating the Hookable instance directly via `setup(hooks)` for
568
+ * advanced cases (dynamic registration, removeHook, etc.).
569
+ *
570
+ * Plugins are loaded in the order they appear in `visConfig.plugins`.
571
+ * Handler execution order within a hook follows registration order,
572
+ * so earlier plugins see events first.
573
+ */
574
+ interface VisPlugin {
575
+ /**
576
+ * Declarative handlers — the common shape. One entry per hook
577
+ * name; pass a function or an array of functions (all run serially
578
+ * in order).
579
+ */
580
+ hooks?: Partial<{ [K in keyof VisHooks]: VisHooks[K] | VisHooks[K][] }>;
581
+ /** Plugin name — surfaced in debug logs. */
582
+ name: string;
583
+ /**
584
+ * Imperative setup — receives the shared Hookable instance so the
585
+ * plugin can register hooks conditionally, unregister later, or
586
+ * use advanced APIs like `hookOnce`/`beforeEach`/`afterEach`.
587
+ */
588
+ setup?: (hooks: Hookable<VisHooks>) => Promise<void> | void;
589
+ }
590
+ /**
591
+ * Per-adapter override applied by `vis lint` / `vis fmt`. Keyed by
592
+ * adapter id under `lint.adapters` / `fmt.adapters`. Every field is
593
+ * optional — set only what you need to change.
594
+ */
595
+ interface LintFmtAdapterOverride {
596
+ /**
597
+ * Set to `false` to skip this adapter even when its config file or
598
+ * package.json entry is detected. Defaults to `true` (run when
599
+ * detected).
600
+ */
601
+ enabled?: boolean;
602
+ /**
603
+ * Extra arguments appended verbatim to every invocation of this
604
+ * adapter. Useful for tool-specific flags vis doesn't expose
605
+ * directly (e.g. `eslint --rulesdir`).
606
+ */
607
+ extraArgs?: string[];
608
+ }
609
+ /**
610
+ * The 8 Socket.dev-style supply-chain policies. Used in `security.policies`
611
+ * and `security.acceptedRisks[*].policies`. Kept as a const tuple so callers
612
+ * can import the runtime array (`POLICY_NAMES`) for iteration without
613
+ * drifting from the union type.
614
+ */
615
+ declare const POLICY_NAMES: readonly ["firstSeen", "installScripts", "license", "malware", "publisherChange", "score", "unexpectedDeps", "vulnerability"];
616
+ type PolicyName = (typeof POLICY_NAMES)[number];
617
+ /**
618
+ * Recognised input sources for the codeowners aggregator.
619
+ *
620
+ * - `project-json` — owners declared on each project's `project.json`.
621
+ * Canonical source; takes precedence over the other two on path conflicts.
622
+ * - `nested-codeowners` — `CODEOWNERS` files placed at arbitrary depth
623
+ * in the workspace tree (excluding the generated root file).
624
+ * - `package-json-maintainers` — fallback that reads each project's
625
+ * `package.json#maintainers` and emits one entry per project root for
626
+ * projects with no `project.json owners`. GitHub handles are extracted
627
+ * from each maintainer's `url` (e.g. `https://github.com/&lt;handle&gt;`).
628
+ */
629
+ type CodeownersSource = "nested-codeowners" | "package-json-maintainers" | "project-json";
630
+ interface CodeownersConfig {
631
+ /** Markers that bracket the generated block when `preserveBlock` is set. */
632
+ blockMarker?: {
633
+ begin: string;
634
+ end: string;
635
+ };
636
+ /** Workspace-level paths that apply outside any project (e.g., `.github/**`). */
637
+ globalPaths?: Record<string, string[]>;
638
+ /** Glob patterns used to discover nested `CODEOWNERS` files. Defaults to `["**\/CODEOWNERS"]`. */
639
+ nestedIncludes?: string[];
640
+ /** Sort order for generated entries — mirrors moon's `orderBy`. */
641
+ orderBy?: "file-source" | "project-id";
642
+ /**
643
+ * When set, the generated content is spliced between
644
+ * {@link CodeownersConfig.blockMarker} markers in the existing file
645
+ * (markers are appended if missing) instead of overwriting the file.
646
+ */
647
+ preserveBlock?: boolean;
648
+ /** Provider determines whether `channel` is emitted (GitHub supports it via comment). */
649
+ provider?: "bitbucket" | "github" | "gitlab" | "other";
650
+ /**
651
+ * Header instruction shown to reviewers. Replaces the default
652
+ * "Update each project's project.json `owners` field…" line. Useful
653
+ * when the canonical regenerate path is a custom script.
654
+ */
655
+ regenerationCommand?: string;
656
+ /** Enabled input sources. Defaults to `["project-json"]`. */
657
+ sources?: CodeownersSource[];
658
+ }
659
+ /**
660
+ * One user-declared customTypes entry. See `policy.customTypes.extraTypes`
661
+ * for the full contract — this is just the row shape.
662
+ */
663
+ interface ExtraCustomType {
664
+ /**
665
+ * Required when `strategy === "string"`. The dep-cluster key the bare
666
+ * version string at `path` should be associated with.
667
+ */
668
+ depName?: string;
669
+ /**
670
+ * Display name for this customType. Used as the cluster key prefix in
671
+ * lint output and JSON. Must not collide with the built-in names.
672
+ */
673
+ name: string;
674
+ /** Dot-separated walk into package.json (e.g. `pnpm.overrides`, `myTool.runtime`). */
675
+ path: string;
676
+ /**
677
+ * How to interpret the JSON found at `path`.
678
+ * - `name@version` — single string `pnpm@9.0.0` (with optional `+sha512.…` hash).
679
+ * - `name~version` — single string `node~20.0.0`, mirrors syncpack's tilde form.
680
+ * - `string` — bare version literal (requires `depName`).
681
+ * - `versionsByName` — `{ name: version }` object such as `engines`.
682
+ */
683
+ strategy: "name@version" | "name~version" | "string" | "versionsByName";
684
+ }
685
+ /**
686
+ * Declared code-owner assignment for a path glob within a project.
687
+ * Mirrors moon's `owners` shape so migrations can round-trip cleanly.
688
+ */
689
+ interface OwnersEntry {
690
+ /** Optional notification channel (e.g. Slack, Teams). */
691
+ channel?: string;
692
+ /** Owner handles (e.g. `@visulima/core-team`). */
693
+ owners: string[];
694
+ /** File/glob pattern relative to the project root. */
695
+ path: string;
696
+ }
697
+ /**
698
+ * Per-project TypeScript overlay loaded from `vis.task.ts`. Adds a
699
+ * dynamic, type-safe layer for target overrides on top of `project.json`,
700
+ * which stays the canonical home for static metadata (`tags`, `layer`,
701
+ * `stack`, `language`, `owners`, `projectType`, `sourceRoot`,
702
+ * `implicitDependencies`).
703
+ *
704
+ * `vis.task.ts` is opt-in. A package without one behaves identically to
705
+ * before its introduction. Targets defined here merge over `project.json`'s
706
+ * `targets` block — see `design-config-layering.md` for the full
707
+ * precedence stack.
708
+ */
709
+ interface VisTaskConfig {
710
+ /** Per-target overrides — same shape as `project.json#targets`. */
711
+ tasks?: Record<string, VisTargetConfiguration>;
712
+ }
713
+ /**
714
+ * Per-project metadata surfaced by `project.json`. Extended beyond the
715
+ * minimal `projectType` / `tags` / `sourceRoot` fields we historically
716
+ * parsed to include targets, owners, and layer/stack classification.
717
+ */
718
+ interface ProjectJson {
719
+ /** Implicit dependencies on other projects. */
720
+ implicitDependencies?: string[];
721
+ /** Primary language — informational and query-able. */
722
+ language?: string;
723
+ /** Project layer, used for constraint inheritance and query filtering. */
724
+ layer?: "application" | "automation" | "configuration" | "library" | "scaffolding" | "tool";
725
+ /**
726
+ * Project name. When set, takes precedence over `package.json#name`
727
+ * as the project's identity in the workspace graph and CLI filters.
728
+ * Falls back to `package.json#name` when omitted.
729
+ */
730
+ name?: string;
731
+ /** Code owners for paths inside this project. */
732
+ owners?: OwnersEntry[];
733
+ /** Project-level metadata. */
734
+ project?: {
735
+ channel?: string;
736
+ description?: string;
737
+ maintainers?: string[];
738
+ owner?: string;
739
+ title?: string;
740
+ };
741
+ /**
742
+ * Project type — `library`, `application`, `service`, or `tool`.
743
+ *
744
+ * - `library` — reusable code consumed by other workspace projects.
745
+ * - `application` — end-user-facing build target (web app, mobile app).
746
+ * - `service` — long-running HTTP / worker process deployed independently.
747
+ * - `tool` — CLI or developer tooling shipped as an executable.
748
+ */
749
+ projectType?: "application" | "library" | "service" | "tool";
750
+ /**
751
+ * Marks the project as write-restricted. Consumed by
752
+ * `vis sync codeowners --write-guard` to scope the generated
753
+ * Write Guard workflow to this project's paths.
754
+ */
755
+ restricted?: boolean;
756
+ /** Source root, used for display and language inference. */
757
+ sourceRoot?: string;
758
+ /** Tech stack. */
759
+ stack?: "backend" | "data" | "frontend" | "infrastructure" | "systems";
760
+ /** Filterable tags. */
761
+ tags?: string[];
762
+ /** Vis-style target definitions (merged on top of package.json scripts). */
763
+ targets?: Record<string, VisTargetConfiguration>;
764
+ }
765
+ /**
766
+ * A predicate used by {@link VisConfig.scopedTasks}.
767
+ * All listed constraints must match for the block to apply.
768
+ */
769
+ interface ScopedTasksMatch {
770
+ /** Match on primary language. */
771
+ language?: string | string[];
772
+ /** Match on project layer. */
773
+ layer?: ProjectJson["layer"] | ProjectJson["layer"][];
774
+ /** Match on project type. */
775
+ projectType?: "application" | "library" | "service" | "tool";
776
+ /** Match on project stack. */
777
+ stack?: ProjectJson["stack"] | ProjectJson["stack"][];
778
+ /** Match projects tagged with any of these tags. */
779
+ tags?: string[];
780
+ }
781
+ /**
782
+ * A single scoped-tasks block — a set of task defaults gated by an
783
+ * optional match predicate.
784
+ */
785
+ interface ScopedTasksBlock {
786
+ /** Optional match predicate; if omitted, the block applies universally. */
787
+ match?: ScopedTasksMatch;
788
+ /** Task default configurations, keyed by target name. */
789
+ tasks: Record<string, Partial<VisTargetConfiguration>>;
790
+ }
791
+ interface VisConfig {
792
+ /** AI analysis configuration */
793
+ ai?: {
794
+ /** Cache TTL in milliseconds. Overrides default (1h / 30min for security). */
795
+ cacheTtl?: number;
796
+ /** Override default provider priority. Higher number = preferred. */
797
+ priority?: Record<string, number>;
798
+ /** Use a specific provider instead of auto-detecting (e.g., `"claude"`, `"gemini"`). */
799
+ provider?: string;
800
+ };
801
+ /**
802
+ * Scope the task-runner cache directory by the current git branch.
803
+ * When `true`, caches are stored under `&lt;cacheDir>/branches/&lt;slug>`
804
+ * so `main` and feature branches stop thrashing each other —
805
+ * generated artefacts (schemas, `.d.ts` snapshots) that legitimately
806
+ * differ across branches no longer oscillate the cache contents.
807
+ *
808
+ * Falls back to the unscoped path on detached HEAD, non-git
809
+ * workspaces, or when git isn't available.
810
+ * @default false
811
+ */
812
+ branchScopedCache?: boolean;
813
+ /**
814
+ * Code ownership configuration. Controls how `vis sync codeowners`
815
+ * renders the generated CODEOWNERS file.
816
+ */
817
+ codeowners?: CodeownersConfig;
818
+ /**
819
+ * Project dependency constraints.
820
+ * Enforced after building the project graph, before running tasks.
821
+ */
822
+ constraints?: ConstraintsConfig;
823
+ /**
824
+ * Configuration for the `vis create` scaffolding command.
825
+ * Controls template downloads (via giget), default options, and
826
+ * post-creation behavior.
827
+ */
828
+ create?: {
829
+ /**
830
+ * Authorization token for downloading private repository templates.
831
+ * Passed as Bearer token to the git host API.
832
+ * Can also be set via GIGET_AUTH, GITHUB_TOKEN, or GH_TOKEN environment variables.
833
+ */
834
+ auth?: string;
835
+ /**
836
+ * Default editor to configure after scaffolding.
837
+ * When set, `vis create` automatically generates editor config files.
838
+ * @example "vscode"
839
+ */
840
+ defaultEditor?: "vscode";
841
+ /**
842
+ * Default package manager for new standalone projects.
843
+ * When set, skips the PM selection prompt in interactive mode.
844
+ */
845
+ defaultPm?: "bun" | "npm" | "pnpm" | "yarn";
846
+ /**
847
+ * Default giget provider for `owner/repo` shorthand inputs.
848
+ * @default "github"
849
+ */
850
+ defaultProvider?: "bitbucket" | "github" | "gitlab" | "sourcehut";
851
+ /**
852
+ * Initialize a git repository after scaffolding standalone projects.
853
+ * @default false
854
+ */
855
+ gitInit?: boolean;
856
+ /**
857
+ * Install dependencies automatically after scaffolding.
858
+ * @default true
859
+ */
860
+ install?: boolean;
861
+ /**
862
+ * Prefer locally cached templates over re-downloading.
863
+ * Useful for offline development or slow connections.
864
+ * @default false
865
+ */
866
+ preferOffline?: boolean;
867
+ /**
868
+ * Custom template registry URL.
869
+ * When set, giget checks this registry for template metadata
870
+ * before falling back to direct provider resolution.
871
+ * Set to `false` to disable registry lookup entirely.
872
+ * @see https://github.com/unjs/giget#custom-registry
873
+ */
874
+ registry?: false | string;
875
+ /**
876
+ * Named template aliases for quick access.
877
+ * Maps short names to full giget source strings.
878
+ * @example
879
+ * ```
880
+ * templates: {
881
+ * "react": "github:vitejs/vite/packages/create-vite/template-react-ts",
882
+ * "lib": "github:my-org/lib-template",
883
+ * "internal": "gitlab:company/templates/node-service",
884
+ * }
885
+ * ```
886
+ */
887
+ templates?: Record<string, string>;
888
+ };
889
+ /**
890
+ * Default base branch used by `vis affected`, `vis ci`, and `vis run --affected`
891
+ * when no explicit `--base` is passed and no CI smart-resolver fires.
892
+ *
893
+ * Resolved as `origin/&lt;defaultBase>` against the local clone; should be a
894
+ * branch name (not a fully-qualified ref) such as `main`, `master`, or `trunk`.
895
+ * Falls back to `main` when omitted.
896
+ *
897
+ * Migrated automatically from `nx.json#affected.defaultBase` /
898
+ * `nx.json#defaultBase` by `vis migrate nx`.
899
+ * @default "main"
900
+ */
901
+ defaultBase?: string;
902
+ /**
903
+ * Discover `.editorconfig` for indent / line-ending defaults during
904
+ * file transformations (sort-package-json, migrate, hook, pm overrides,
905
+ * workspace catalog rewrites). Per-command flags can still override.
906
+ * @default true
907
+ */
908
+ editorconfig?: boolean;
909
+ /**
910
+ * Inherit configuration from one or more parent configs. Entries are
911
+ * resolved left-to-right (later wins) and the consumer's own values
912
+ * always override anything pulled in from `extends`.
913
+ *
914
+ * Each entry is either:
915
+ * - a relative path (`./shared.config.ts`, `../shared.config.ts`) —
916
+ * resolved against the file declaring `extends`;
917
+ * - an npm package name (`@acme/vis-preset`) — resolved via Node.js
918
+ * module resolution from the consumer file.
919
+ *
920
+ * Absolute paths are rejected — they break across machines and CI.
921
+ * Cycles raise `VisConfigCycleError` during load.
922
+ * @example
923
+ * ```
924
+ * extends: ["@acme/vis-preset", "./shared/security.config.ts"]
925
+ * ```
926
+ */
927
+ extends?: string | string[];
928
+ /**
929
+ * Named file-group patterns, reusable from target `inputs` via the
930
+ * `@filegroup:&lt;name>` token. File groups are resolved relative to each
931
+ * project root at discovery time.
932
+ * @example
933
+ * ```
934
+ * fileGroups: {
935
+ * sources: ["src/**\/*.ts", "!src/**\/*.test.ts"],
936
+ * tests: ["**\/*.test.ts"],
937
+ * }
938
+ * ```
939
+ */
940
+ fileGroups?: Record<string, string[]>;
941
+ /**
942
+ * Configuration for `vis fmt` — the formatter orchestrator.
943
+ *
944
+ * Tunes adapter detection precedence, per-extension routing, and
945
+ * per-adapter overrides. Flags on the CLI always win over config.
946
+ *
947
+ * The default fmt precedence is `oxfmt → biome → dprint → prettier
948
+ * → deno-fmt`. When multiple adapters claim the same extension,
949
+ * the first in this order owns it unless overridden here.
950
+ * @example
951
+ * ```
952
+ * fmt: {
953
+ * order: ["biome", "prettier"],
954
+ * extensionOverrides: { md: "dprint" },
955
+ * adapters: { "deno-fmt": { enabled: false } },
956
+ * }
957
+ * ```
958
+ */
959
+ fmt?: {
960
+ /**
961
+ * Per-adapter overrides. Keyed by `AdapterId`. Set
962
+ * `enabled: false` to skip an adapter even when detected, or
963
+ * `extraArgs` to append flags verbatim.
964
+ */
965
+ adapters?: Partial<Record<FmtAdapterId, LintFmtAdapterOverride>>;
966
+ /**
967
+ * Pin a file extension (without the leading dot) to a specific
968
+ * adapter, overriding the registry's "first detected adapter
969
+ * wins" routing. Use to e.g. send `.md` to `dprint` even when
970
+ * both prettier and dprint are present.
971
+ */
972
+ extensionOverrides?: Record<string, FmtAdapterId>;
973
+ /**
974
+ * Override the adapter precedence order. Adapters omitted from
975
+ * this list still run (appended at the end in registry order),
976
+ * but those listed earlier get priority for extension routing.
977
+ */
978
+ order?: FmtAdapterId[];
979
+ };
980
+ /**
981
+ * Configuration for the `vis generate` in-repo scaffolding command.
982
+ * Points at additional template directories beyond the defaults
983
+ * (`.vis/templates/` and `.moon/templates/`).
984
+ */
985
+ generator?: {
986
+ /**
987
+ * Authorization token forwarded to giget when fetching
988
+ * `git://`/`npm://` remote templates. Falls back to
989
+ * `GIGET_AUTH` / `GITHUB_TOKEN` / `GH_TOKEN` env vars.
990
+ */
991
+ auth?: string;
992
+ /**
993
+ * Prefer locally cached remote templates over re-downloading.
994
+ * Overridable per invocation via `--prefer-offline`.
995
+ * @default false
996
+ */
997
+ preferOffline?: boolean;
998
+ /**
999
+ * Extra directories to scan for templates. Each directory is
1000
+ * checked for both native templates (`&lt;name>.ts`) and
1001
+ * moon-format directories (containing `template.yml`).
1002
+ * @example
1003
+ * ```
1004
+ * generator: {
1005
+ * templates: ["./tools/generators", "./packages/scaffolding/templates"],
1006
+ * }
1007
+ * ```
1008
+ */
1009
+ templates?: string[];
1010
+ };
1011
+ /**
1012
+ * Auto-create targets from detected config files (Project Crystal-style).
1013
+ * On by default; set `false` to disable entirely, or use the object
1014
+ * form to disable individual detectors.
1015
+ *
1016
+ * Inferred targets sit *below* explicit ones — the command from
1017
+ * `package.json#scripts`, `project.json#targets`, or `vis.task.ts`
1018
+ * always wins per-key, so opting in never changes what runs. As a
1019
+ * caching aid, when a `package.json` script's command *is* a
1020
+ * detector's command (optionally with extra flags, no shell
1021
+ * chaining) and the script declares no `inputs`/`outputs`, the
1022
+ * detector's `inputs`/`outputs` are adopted so the script target can
1023
+ * cache precisely and restore its artifacts. Customised/compound
1024
+ * scripts are left untouched.
1025
+ *
1026
+ * Built-in detectors and the targets they synthesize:
1027
+ *
1028
+ * - **App frameworks** — `nuxt` (build/dev/preview/generate),
1029
+ * `next` (build/dev/start), `remix` (build/dev/start), `astro`
1030
+ * (build/dev), `gatsby` (build/develop/serve), `docusaurus`
1031
+ * (build/start/serve).
1032
+ * - **Bundlers** — `vite` (build/dev/preview), `rolldown` (build),
1033
+ * `tsdown` (build), `tsup` (build), `packem` (build), `rollup`
1034
+ * (build), `webpack` (build).
1035
+ * - **Docs sites** — `vitepress` (docs:build/docs:dev/docs:preview),
1036
+ * `typedoc` (docs).
1037
+ * - **Server frameworks** — `nest` (build/start/start:dev).
1038
+ * - **Test runners** — `vitest` (test/test:watch), `jest`
1039
+ * (test/test:watch), `bun` (test), `playwright` (test:e2e),
1040
+ * `cypress` (test:e2e/cypress:open).
1041
+ * - **Stories** — `storybook` (storybook/build-storybook).
1042
+ * - **Type checking** — `typescript` (typecheck via `tsc --noEmit`).
1043
+ * - **Lint / format** — `eslint` (lint), `prettier` (format /
1044
+ * format:check), `biome` (lint, format), `oxlint` (lint),
1045
+ * `oxfmt` (format / format:check), `stylelint` (lint:css),
1046
+ * `knip` (knip).
1047
+ * - **Runtimes** — `deno` (test/lint/fmt/check).
1048
+ * - **Database tooling** — `prisma` (db:generate/db:migrate/
1049
+ * db:push/db:studio), `drizzle` (db:generate/db:migrate/
1050
+ * db:push/db:studio).
1051
+ * - **Codegen / release** — `graphql-codegen` (codegen),
1052
+ * `api-extractor` (api-extract), `changeset` (changeset:version /
1053
+ * changeset:publish / changeset:status).
1054
+ *
1055
+ * Trigger: presence of any matching config file in the project root.
1056
+ * Most detectors additionally match when their framework appears in
1057
+ * `dependencies` / `devDependencies` / `peerDependencies` /
1058
+ * `optionalDependencies` — covering convention-only setups (e.g.
1059
+ * vitest with default config). Detectors that intentionally require
1060
+ * a config file (because the package frequently appears transitively
1061
+ * and a dep-only match would synthesize broken commands): `vite`,
1062
+ * `rolldown`, `rollup`, `webpack`, `storybook`, `nest`, `remix`,
1063
+ * `vitepress`, `bun`, `deno`, `changeset`.
1064
+ *
1065
+ * Conflict resolution: detectors are evaluated in registration order
1066
+ * (see `BUILT_IN_DETECTORS`) and the first to claim a target name
1067
+ * wins. Per-name priorities: `build` → nuxt > next > remix > astro
1068
+ * > gatsby > docusaurus > vite > nest > rolldown > tsdown > tsup >
1069
+ * packem > rollup > webpack; `test` → vitest > jest > bun > deno;
1070
+ * `test:e2e` → playwright > cypress; `lint` → eslint > biome >
1071
+ * oxlint > deno; `format` → prettier > biome > oxfmt; `db:*` →
1072
+ * prisma > drizzle.
1073
+ *
1074
+ * Also accepts an object form (`{ vite: false, vitest: true }`) to
1075
+ * opt individual detectors in or out by name. Detectors omitted from
1076
+ * the object run at their default (enabled). Useful when one
1077
+ * detector misfires for a given workspace without disabling the rest.
1078
+ * @default true
1079
+ */
1080
+ inferTargets?: Record<string, boolean> | boolean;
1081
+ /**
1082
+ * Installer backend selection for `vis install` / `vis add` /
1083
+ * `vis remove` / `vis update` / `vis ci`.
1084
+ *
1085
+ * Lets users opt into [aube](https://github.com/endevco/aube) — a
1086
+ * Rust-native package manager that reads/writes pnpm/npm/yarn/bun
1087
+ * lockfiles in place — as the default installer, while keeping a
1088
+ * single switch to fall back to the conventional PM detected from
1089
+ * the lockfile.
1090
+ *
1091
+ * Resolution precedence (highest first):
1092
+ * 1. CLI flag (`--installer &lt;name>` / `--no-aube`)
1093
+ * 2. Env var `VIS_INSTALLER`
1094
+ * 3. This config field
1095
+ * 4. Auto-detect (the default)
1096
+ *
1097
+ * Aube must be installed separately — `vis` does not bundle it.
1098
+ * Install via npm (`@endevco/aube`), `mise use -g aube`, or
1099
+ * `brew install endevco/tap/aube`.
1100
+ */
1101
+ install?: {
1102
+ /**
1103
+ * Which package manager performs install/add/remove/etc.
1104
+ * - `auto` (default): use `aube` when it is on PATH; otherwise
1105
+ * fall back to the lockfile-detected PM.
1106
+ * - explicit name: always use that PM. Errors when the named
1107
+ * binary is missing rather than silently falling back.
1108
+ * @default "auto"
1109
+ */
1110
+ backend?: "aube" | "auto" | "bun" | "npm" | "pnpm" | "yarn";
1111
+ /**
1112
+ * Whether to dispatch PM invocations through `corepack`.
1113
+ * - `"auto"` (default): use corepack only when the workspace
1114
+ * pins a PM via the `packageManager` field AND `corepack` is
1115
+ * on PATH AND the PM is one corepack manages (pnpm/yarn/npm).
1116
+ * - `true`: always prefix `corepack` when the binary is on PATH
1117
+ * and the PM is corepack-managed (errors loudly otherwise).
1118
+ * - `false`: never go through corepack — invoke the PM directly.
1119
+ *
1120
+ * Mirrors nypm's `corepack: true` flag. Bun, deno, and aube are
1121
+ * never wrapped — corepack does not manage them.
1122
+ * @default "auto"
1123
+ */
1124
+ corepack?: "auto" | boolean;
1125
+ };
1126
+ /**
1127
+ * Configuration for `vis lint` — the linter orchestrator.
1128
+ *
1129
+ * Tunes adapter detection precedence and per-adapter overrides.
1130
+ * Flags on the CLI always win over config.
1131
+ *
1132
+ * The default lint precedence is `oxlint → biome → eslint →
1133
+ * stylelint → deno-lint`. Override with `order` to e.g. let biome
1134
+ * fire before oxlint when the workspace standardises on biome.
1135
+ * @example
1136
+ * ```
1137
+ * lint: {
1138
+ * order: ["biome", "eslint"],
1139
+ * adapters: { "deno-lint": { enabled: false } },
1140
+ * }
1141
+ * ```
1142
+ */
1143
+ lint?: {
1144
+ /**
1145
+ * Per-adapter overrides. Keyed by `AdapterId`. Set
1146
+ * `enabled: false` to skip an adapter even when detected, or
1147
+ * `extraArgs` to append flags verbatim.
1148
+ */
1149
+ adapters?: Partial<Record<LintAdapterId, LintFmtAdapterOverride>>;
1150
+ /**
1151
+ * Override the adapter precedence order. Adapters omitted from
1152
+ * this list still run (appended at the end in registry order)
1153
+ * unless explicitly disabled under `adapters[id].enabled`.
1154
+ */
1155
+ order?: LintAdapterId[];
1156
+ };
1157
+ /**
1158
+ * `vis-mcp` promotion notice shown after successful commands when an
1159
+ * AI CLI (Claude Code, Cursor, Windsurf, Continue, Zed, Cline) is
1160
+ * installed but `@visulima/vis-mcp` is not wired into its config.
1161
+ *
1162
+ * Shown at most once every 14 days; skipped in CI, non-TTY shells,
1163
+ * during `--help`/`--version`/`ai`/`mcp` invocations, and when
1164
+ * `VIS_NO_MCP_PROMOTE=1` is set. Set `enabled: false` to silence
1165
+ * permanently for this workspace.
1166
+ * @example
1167
+ * ```
1168
+ * mcpPromote: { enabled: false }
1169
+ * ```
1170
+ */
1171
+ mcpPromote?: {
1172
+ /**
1173
+ * Show the vis-mcp promotion notice on successful command completion.
1174
+ * @default true
1175
+ */
1176
+ enabled?: boolean;
1177
+ };
1178
+ /**
1179
+ * Named input patterns inherited by every project target. Equivalent
1180
+ * to task-runner's `namedInputs` but configurable from the vis config.
1181
+ */
1182
+ namedInputs?: NamedInputs;
1183
+ /** Package override mappings applied during migration (e.g., `{ "lodash": "lodash-es" }`) */
1184
+ overrides?: Record<string, string>;
1185
+ /**
1186
+ * Plugins — each plugin registers typed hooks that fire at run /
1187
+ * task / cache boundaries. See {@link VisPlugin} for the contract.
1188
+ * Prefer plugins over per-target shell hooks when behaviour needs
1189
+ * access to task metadata, results, or cache state.
1190
+ */
1191
+ plugins?: VisPlugin[];
1192
+ /**
1193
+ * Workspace dep-policy lints exposed via `vis lint`. Each block opts in
1194
+ * to a single rule; the command flags (`--workspace-protocol`,
1195
+ * `--no-redefine-root`, `--banned-deps`) toggle them per-run.
1196
+ */
1197
+ policy?: {
1198
+ /**
1199
+ * Map of dep names or globs → reason (or `{ reason, replacement, packages?, paths? }`).
1200
+ * Internal/workspace deps are never flagged here; the
1201
+ * workspace-protocol lint owns those.
1202
+ *
1203
+ * Optional `packages` (globs over the declaring package's `name`) and
1204
+ * `paths` (globs over the workspace-relative `packageDir`) narrow where
1205
+ * the rule applies. With both set, either match is enough. Omit both
1206
+ * to ban anywhere — the default.
1207
+ * @example
1208
+ * ```
1209
+ * bannedDeps: {
1210
+ * request: "deprecated; use undici",
1211
+ * moment: { reason: "huge bundle, frozen upstream", replacement: "date-fns" },
1212
+ * "@radix-ui/*": "we standardized on shadcn",
1213
+ * react: { reason: "no react in shared libs", paths: ["packages/shared/*"] },
1214
+ * "next": { reason: "apps only", packages: ["@app/*"] },
1215
+ * }
1216
+ * ```
1217
+ */
1218
+ bannedDeps?: Record<string, string | {
1219
+ packages?: string[];
1220
+ paths?: string[];
1221
+ reason: string;
1222
+ replacement?: string;
1223
+ }>;
1224
+ /**
1225
+ * Tweak the custom-types lint that flags drift in `engines.{node,pnpm,...}`,
1226
+ * `packageManager`, `volta.{node,pnpm,yarn}`, and the proposed
1227
+ * `devEngines.{runtime,packageManager}` array form.
1228
+ *
1229
+ * Each (customType × name) cluster is tracked independently —
1230
+ * `engines.node` and `volta.node` don't cross-couple here. Use a
1231
+ * versionGroup once that lands if you need to enforce they agree.
1232
+ */
1233
+ customTypes?: {
1234
+ /**
1235
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
1236
+ * for the contract — same semantics, applied to drift rewrites
1237
+ * across engines / packageManager / volta / devEngines.
1238
+ *
1239
+ * Note: `--fix` strips any `+sha512.&lt;hash&gt;` suffix from
1240
+ * `packageManager` on bump — content-integrity hashes are tied
1241
+ * to a specific package, not a version, so users must regenerate
1242
+ * via their PM (`pnpm install` re-pins; `corepack use pnpm@X` etc.).
1243
+ * @default true
1244
+ */
1245
+ autofix?: "prompt" | boolean;
1246
+ /**
1247
+ * User-defined custom-type pin locations. Each entry tells the
1248
+ * customTypes lint to read additional version pins from a
1249
+ * non-standard JSON path inside every workspace package.json,
1250
+ * cluster them by `(name × depName)` like the built-in types,
1251
+ * and rewrite them with `--fix`.
1252
+ *
1253
+ * The original built-ins (`engines`, `volta`, `packageManager`,
1254
+ * `devEngines.runtime`, `devEngines.packageManager`) keep
1255
+ * running unconditionally — these layer on top.
1256
+ *
1257
+ * Strategies:
1258
+ * - `versionsByName`: the JSON at `path` is `{ [depName]: version }`
1259
+ * (like `engines` or `pnpm.overrides`).
1260
+ * - `name@version`: the JSON at `path` is a string of the form
1261
+ * `name@version` (like `packageManager`). The leading `name@`
1262
+ * is preserved; only the version segment is rewritten.
1263
+ * - `string`: the JSON at `path` is a bare version string. The
1264
+ * `depName` field is required and identifies the dep cluster.
1265
+ *
1266
+ * `name` must not collide with a built-in type name. `path` is
1267
+ * a dot-separated walk into the package.json (e.g. `pnpm.overrides`).
1268
+ * @example
1269
+ * ```ts
1270
+ * extraTypes: [
1271
+ * { name: "pnpmOverridesLegacy", path: "pnpm.overrides", strategy: "versionsByName" },
1272
+ * { name: "myToolPin", path: "myTool.runtime", strategy: "name@version" },
1273
+ * { name: "minNode", path: "config.minNode", strategy: "string", depName: "node" },
1274
+ * ]
1275
+ * ```
1276
+ */
1277
+ extraTypes?: ExtraCustomType[];
1278
+ /**
1279
+ * Dep names exempt from the drift check (exact match against the
1280
+ * field name within the block — e.g. `node`, `pnpm`).
1281
+ */
1282
+ ignore?: string[];
1283
+ /**
1284
+ * Resolution strategy used when `--fix` runs.
1285
+ * - `highest` (default): align every drifting instance to the
1286
+ * highest declared version.
1287
+ * - `lowest`: align to the lowest.
1288
+ * @default "highest"
1289
+ */
1290
+ resolve?: "highest" | "lowest";
1291
+ };
1292
+ /**
1293
+ * Tweak the dead-workspace-patterns lint that flags entries in
1294
+ * `pnpm-workspace.yaml#packages` / `package.json#workspaces` which
1295
+ * resolve to zero on-disk directories.
1296
+ */
1297
+ deadWorkspacePatterns?: {
1298
+ /**
1299
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
1300
+ * for the contract — applied here to dropping unmatched patterns
1301
+ * from the workspace config file.
1302
+ * @default true
1303
+ */
1304
+ autofix?: "prompt" | boolean;
1305
+ };
1306
+ /**
1307
+ * Tweak the empty-deps lint that flags empty `dependencies` /
1308
+ * `devDependencies` / `peerDependencies` / `optionalDependencies`
1309
+ * blocks across the workspace.
1310
+ */
1311
+ emptyDeps?: {
1312
+ /**
1313
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
1314
+ * for the contract — applied here to removing the empty key.
1315
+ * @default true
1316
+ */
1317
+ autofix?: "prompt" | boolean;
1318
+ /**
1319
+ * Block names exempt from the rule (e.g. `["peerDependencies"]`
1320
+ * to keep the key around as a marker even when empty).
1321
+ */
1322
+ ignoreBlocks?: ("dependencies" | "devDependencies" | "optionalDependencies" | "peerDependencies")[];
1323
+ };
1324
+ /**
1325
+ * Tweak the redefine-root lint that flags non-root packages duplicating
1326
+ * deps already pinned at the workspace root.
1327
+ */
1328
+ redefineRoot?: {
1329
+ /** Dep names that are exempt from the redefine-root rule (exact match). */
1330
+ ignore?: string[];
1331
+ };
1332
+ /**
1333
+ * Tweak the root-deps lint that flags runtime `dependencies` declared
1334
+ * on the private workspace root (they should live in `devDependencies`).
1335
+ */
1336
+ rootDeps?: {
1337
+ /**
1338
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
1339
+ * for the contract — applied here to moving entries from
1340
+ * `dependencies` to `devDependencies` on the root package.json.
1341
+ * @default true
1342
+ */
1343
+ autofix?: "prompt" | boolean;
1344
+ };
1345
+ /**
1346
+ * Tweak the root-package-manager lint that flags a missing or
1347
+ * malformed `packageManager` field on the workspace root.
1348
+ */
1349
+ rootPackageManager?: {
1350
+ /**
1351
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
1352
+ * for the contract. `--fix` only writes when `suggested` is set —
1353
+ * a missing `packageManager` field has no canonical default.
1354
+ * @default true
1355
+ */
1356
+ autofix?: "prompt" | boolean;
1357
+ /**
1358
+ * Canonical specifier (`name@version`) to write when `--fix` runs
1359
+ * and the field is absent. Required to enable autofix —
1360
+ * vis won't guess the workspace's preferred manager.
1361
+ * @example "pnpm@10.32.1"
1362
+ */
1363
+ suggested?: string;
1364
+ };
1365
+ /**
1366
+ * Tweak the root-private lint that flags a workspace root package.json
1367
+ * missing `"private": true`. Only fires when the root looks like a
1368
+ * workspace (npm/yarn/bun `workspaces` field or `pnpm-workspace.yaml`).
1369
+ */
1370
+ rootPrivate?: {
1371
+ /**
1372
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
1373
+ * for the contract — applied here to inserting `"private": true`.
1374
+ * @default true
1375
+ */
1376
+ autofix?: "prompt" | boolean;
1377
+ };
1378
+ /**
1379
+ * Tweak the similar-deps lint that flags drift across related dep
1380
+ * families (e.g. `react` and `react-dom`, all of `@babel/*`).
1381
+ *
1382
+ * The lint is report-only — aligning a family requires picking a
1383
+ * single canonical specifier across heterogeneous range syntaxes
1384
+ * (`^`, `~`, exact), which is too lossy without user input.
1385
+ */
1386
+ similarDeps?: {
1387
+ /**
1388
+ * Additional families merged with the built-ins. Same `id` wins
1389
+ * → user override fully replaces the built-in entry.
1390
+ * @example
1391
+ * ```
1392
+ * extraFamilies: [
1393
+ * { id: "vue", label: "Vue", members: ["vue", "vue-router", "pinia"] },
1394
+ * ]
1395
+ * ```
1396
+ */
1397
+ extraFamilies?: SimilarDepFamily[];
1398
+ /** Family ids to skip entirely (matches `SimilarDepFamily.id`). */
1399
+ ignoreFamilies?: string[];
1400
+ };
1401
+ /**
1402
+ * Tweak the types-in-deps lint that flags `@types/*` declared in
1403
+ * `dependencies` on a private package (they belong in
1404
+ * `devDependencies` since the package never ships).
1405
+ */
1406
+ typesInDeps?: {
1407
+ /**
1408
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
1409
+ * for the contract — applied here to moving the entry to
1410
+ * `devDependencies`. Existing dev pins are preserved on conflict.
1411
+ * @default true
1412
+ */
1413
+ autofix?: "prompt" | boolean;
1414
+ /** Dep names exempt from the rule (exact match, e.g. `@types/node`). */
1415
+ ignore?: string[];
1416
+ };
1417
+ /**
1418
+ * Tweak the workspace-protocol lint that flags internal deps not
1419
+ * using the `workspace:` protocol.
1420
+ */
1421
+ workspaceProtocol?: {
1422
+ /**
1423
+ * Three-state autofix opt-out. Some workspaces want detection
1424
+ * without rewrite (e.g. dual-licensed packages where `workspace:*`
1425
+ * is unsafe).
1426
+ * - `true` (default): `--fix` rewrites the specifier.
1427
+ * - `false`: never rewrite — report the violation only.
1428
+ * - `"prompt"`: ask before each rewrite. Falls back to report-only
1429
+ * when stdin isn't a TTY (CI). Reserved; not yet implemented.
1430
+ *
1431
+ * Note: when `false` (or `"prompt"`), `--fix` still **fails CI** on
1432
+ * detected violations — the rule is "report only", not "ignore".
1433
+ * Drop the rule from the lint selection if you want a clean exit.
1434
+ * @default true
1435
+ * @example
1436
+ * ```
1437
+ * policy: {
1438
+ * workspaceProtocol: { autofix: false },
1439
+ * }
1440
+ * ```
1441
+ */
1442
+ autofix?: "prompt" | boolean;
1443
+ };
1444
+ /**
1445
+ * Tweak the workspace-versions lint that flags external deps declared
1446
+ * at inconsistent versions across the workspace.
1447
+ */
1448
+ workspaceVersions?: {
1449
+ /**
1450
+ * Three-state autofix opt-out. See `workspaceProtocol.autofix`
1451
+ * for the contract — same semantics, applied to drift rewrites.
1452
+ *
1453
+ * Also gates the `--propose-min` catalog suggestion writer:
1454
+ * when `false` / `"prompt"`, `--fix --propose-min` reports the
1455
+ * proposed catalog entries but does not write
1456
+ * `pnpm-workspace.yaml`. Same "report only, still fails CI"
1457
+ * note applies as on `workspaceProtocol.autofix`.
1458
+ * @default true
1459
+ */
1460
+ autofix?: "prompt" | boolean;
1461
+ /** Dep names exempt from the version-drift check (exact match). */
1462
+ ignore?: string[];
1463
+ /**
1464
+ * Resolution strategy used when `--fix` runs.
1465
+ * - `highest` (default): rewrite every drifting instance to the
1466
+ * highest sibling specifier.
1467
+ * - `lowest`: rewrite to the lowest.
1468
+ * - `catalog`: rewrite any dep already pinned in a workspace catalog
1469
+ * to `catalog:` / `catalog:&lt;name>`. Catalog must exist; this lint
1470
+ * does not create the catalog (see `vis lint --resolve catalog --propose`).
1471
+ * @default "highest"
1472
+ */
1473
+ resolve?: "catalog" | "highest" | "lowest";
1474
+ };
1475
+ };
1476
+ /**
1477
+ * Pre-flight checks fired before `vis run` starts the orchestrator.
1478
+ * Each check is opt-out (`false`) — defaults are sensible for the
1479
+ * common monorepo case.
1480
+ */
1481
+ preflight?: {
1482
+ /**
1483
+ * Detect "lockfile changed but `node_modules` is stale" before
1484
+ * running tasks. Compares lockfile mtime against the
1485
+ * package-manager-specific install marker
1486
+ * (`node_modules/.modules.yaml` for pnpm, `.package-lock.json`
1487
+ * for npm, etc.). Warns in TTY, hard-fails in CI.
1488
+ * @default true
1489
+ */
1490
+ lockfile?: boolean;
1491
+ };
1492
+ /**
1493
+ * Behavior of `vis run` when invoked tasks declare service dependencies
1494
+ * that aren't running in the workspace registry. CLI `--services=&lt;mode>`
1495
+ * overrides this block.
1496
+ */
1497
+ run?: {
1498
+ /**
1499
+ * Wrap each task's CI log block in collapsible groups so users
1500
+ * can fold/unfold per-task output in the host CI's web UI.
1501
+ * Failed tasks always render expanded so the failure is visible
1502
+ * without an extra click.
1503
+ *
1504
+ * - `auto` (default): pick the format from the detected runner —
1505
+ * `GITHUB_ACTIONS=true` → `github` (`::group::`),
1506
+ * `GITLAB_CI=true` → `gitlab` (`section_start:` ANSI sequences),
1507
+ * `BUILDKITE=true` → `buildkite` (`---` collapsed headers),
1508
+ * `TF_BUILD=True` → `azure` (`##[group]`),
1509
+ * no grouping otherwise.
1510
+ * - `off`: never group (raw separators only — useful when
1511
+ * piping through tools that mangle the directives).
1512
+ * - `azure` / `buildkite` / `github` / `gitlab`: force the format
1513
+ * regardless of detected environment (useful for self-hosted
1514
+ * runners that don't set the standard env vars).
1515
+ *
1516
+ * CircleCI is intentionally not auto-detected: its 2.0+ format
1517
+ * has no inline grouping directive — steps auto-group in the
1518
+ * web UI without any markup from the runner.
1519
+ */
1520
+ ciGrouping?: "auto" | "azure" | "buildkite" | "github" | "gitlab" | "off";
1521
+ /**
1522
+ * One knob controlling auto-start of missing service deps.
1523
+ * - `auto` (default in TTY): pick by task — `dev` → ephemeral,
1524
+ * others → persistent.
1525
+ * - `ephemeral`: services die with the run (no registry entry).
1526
+ * - `persistent`: services persist across runs in the registry.
1527
+ * - `off` (default in CI / non-TTY): print diagnostics and abort.
1528
+ */
1529
+ services?: "auto" | "ephemeral" | "off" | "persistent";
1530
+ };
1531
+ /**
1532
+ * Cascading scoped-task blocks. Each block may narrow its tasks to a
1533
+ * subset of projects via `match`. Blocks are evaluated in order; later
1534
+ * blocks override earlier ones when the same field is set.
1535
+ *
1536
+ * Match predicates are additive — if `match` is omitted, the block applies
1537
+ * to every project.
1538
+ * @example
1539
+ * ```
1540
+ * scopedTasks: [
1541
+ * { match: { tags: ["frontend"] }, tasks: { build: { cache: true } } },
1542
+ * { match: { projectType: "library" }, tasks: { lint: { cache: true } } },
1543
+ * ]
1544
+ * ```
1545
+ */
1546
+ scopedTasks?: ScopedTasksBlock[];
1547
+ /**
1548
+ * Default options for `vis secrets`. CLI flags always take precedence;
1549
+ * this block provides workspace-wide defaults so teams can commit config
1550
+ * once and every invocation picks it up.
1551
+ */
1552
+ secrets?: {
1553
+ /** Path to a baseline of previously-triaged findings (relative to workspace root). */
1554
+ baseline?: string;
1555
+ /** Where the ruleset comes from. Omit for the bundled gitleaks default. */
1556
+ config?: {
1557
+ /** Layer the user's rules on top of the bundled ruleset. Default: `true`. */
1558
+ extendBundled?: boolean;
1559
+ /** Inline rule overrides. Wins over `path` when both are set. */
1560
+ inline?: {
1561
+ allowlist?: unknown;
1562
+ allowlists?: unknown[];
1563
+ description?: string;
1564
+ rules?: unknown[];
1565
+ title?: string;
1566
+ };
1567
+ /** Path to a JSON config (gitleaks-compatible). */
1568
+ path?: string;
1569
+ /** Bundled presets layered on top of the default ruleset (e.g. `"weak-passwords"`). */
1570
+ presets?: string[];
1571
+ };
1572
+ /** Redact secret values in findings. */
1573
+ redact?: boolean;
1574
+ /** Rule-id filters applied after scanning. */
1575
+ rules?: {
1576
+ /** Drop findings whose ruleId matches. */
1577
+ exclude?: string[];
1578
+ /** Only report findings whose ruleId matches. */
1579
+ include?: string[];
1580
+ };
1581
+ /** Walker / filesystem traversal. */
1582
+ walk?: {
1583
+ /**
1584
+ * Paths to additional `.gitignore`-syntax files (e.g. `.secretsignore`).
1585
+ */
1586
+ excludeFromFiles?: string[];
1587
+ /**
1588
+ * Gitignore-syntax patterns (supports negation, directory markers, leading `/`).
1589
+ * Applied on top of `.gitignore`.
1590
+ */
1591
+ excludePatterns?: string[];
1592
+ /** Respect `.gitignore`. Default: `true`. */
1593
+ gitignore?: boolean;
1594
+ /** Include hidden (dotfile) entries. Default: `false`. */
1595
+ includeHidden?: boolean;
1596
+ /** Max file size in bytes. Default 10 MiB. */
1597
+ maxFileSize?: number;
1598
+ };
1599
+ };
1600
+ /**
1601
+ * Supply chain security settings.
1602
+ * These settings are inspired by pnpm's security features and are applied
1603
+ * universally across all package managers (pnpm, npm, yarn, bun).
1604
+ *
1605
+ * For pnpm users: these map directly to pnpm-workspace.yaml settings.
1606
+ * For npm/yarn/bun users: vis enforces these at the vis layer since
1607
+ * those package managers lack native support.
1608
+ */
1609
+ security?: {
1610
+ /**
1611
+ * Packages whose policy findings have been reviewed and explicitly
1612
+ * accepted. Matched against every policy unless `policies` narrows the
1613
+ * scope. Replaces the legacy `security.socket.acceptedRisks` map.
1614
+ *
1615
+ * Key format: package name (`"lodash"`), name@version
1616
+ * (`"lodash@4.17.21"`), or glob (`"@myorg/*"`). Unversioned keys match
1617
+ * all versions of that package.
1618
+ * @example
1619
+ * ```
1620
+ * acceptedRisks: {
1621
+ * "some-risky-pkg": {
1622
+ * reason: "Internal fork, low score expected",
1623
+ * acceptedAt: "2026-03-15T10:00:00Z",
1624
+ * acceptedScore: 0.25,
1625
+ * policies: ["score"],
1626
+ * expiresAt: "2026-12-31",
1627
+ * },
1628
+ * }
1629
+ * ```
1630
+ */
1631
+ acceptedRisks?: Record<string, {
1632
+ /** ISO 8601 timestamp when the risk was accepted. */
1633
+ acceptedAt: string;
1634
+ /**
1635
+ * The overall Socket.dev score at the time of acceptance,
1636
+ * in the range `[0, 1]` (mirrors `policies.score.minimum`).
1637
+ * Only relevant for the `score` policy; ignored elsewhere.
1638
+ */
1639
+ acceptedScore?: number;
1640
+ /**
1641
+ * ISO 8601 date (or datetime). After this point the acceptance
1642
+ * stops applying and vis emits a warning. Leave undefined for
1643
+ * non-expiring entries. Values that fail to parse as a Date
1644
+ * are rejected by the loader rather than silently treated as
1645
+ * "always expired".
1646
+ */
1647
+ expiresAt?: string;
1648
+ /**
1649
+ * Which policies this acceptance covers. When undefined the
1650
+ * acceptance applies to every policy finding on this package.
1651
+ */
1652
+ policies?: PolicyName[];
1653
+ /** User-provided reason for accepting the risk. */
1654
+ reason: string;
1655
+ }>;
1656
+ /**
1657
+ * Map of bin names (or `pkg#bin` qualifiers) blessed for shadowing.
1658
+ * When two installed packages expose the same bin name, vis flags
1659
+ * the collision in `vis security list` and the post-install drift
1660
+ * report — set the bin (or `pkg#bin`) to `true` here to suppress
1661
+ * the warning once you've reviewed the conflict.
1662
+ *
1663
+ * Port of LavaMoat allow-scripts' experimental `allowBins`.
1664
+ * Bare names match any conflicting bin with that name; the
1665
+ * `pkg#bin` form scopes the approval to a single package's bin.
1666
+ * @example
1667
+ * ```
1668
+ * allowBins: {
1669
+ * tsc: true, // bless any 'tsc' bin
1670
+ * "typescript#tsc": true, // bless only typescript's 'tsc'
1671
+ * }
1672
+ * ```
1673
+ */
1674
+ allowBins?: Record<string, boolean>;
1675
+ /**
1676
+ * Offline OSV advisory + `vis audit` configuration.
1677
+ *
1678
+ * Controls `vis audit --offline` and `vis advisories sync` behavior:
1679
+ * - `audit.advisories.source` is the OSV mirror to download from. It
1680
+ * must be `https://` and resolve to a host in `allowedHosts` (or one
1681
+ * of the built-in defaults).
1682
+ * - `audit.offlineByDefault` flips the default of `--offline`.
1683
+ *
1684
+ * Vulnerability severity gating and reachability filtering live under
1685
+ * `policies.vulnerability` (see below).
1686
+ */
1687
+ audit?: {
1688
+ /**
1689
+ * Offline advisory cache settings.
1690
+ */
1691
+ advisories?: {
1692
+ /**
1693
+ * Extra hosts permitted as `audit.advisories.source`. The
1694
+ * built-in allowlist is enforced even if this field is
1695
+ * omitted; entries here add to it.
1696
+ * @example ["mirror.corp.example.com"]
1697
+ */
1698
+ allowedHosts?: string[];
1699
+ /**
1700
+ * Bloom-filter prefilter for OSV `MAL-*` (malicious-package)
1701
+ * advisories. Probes a ~380 KB filter fetched from
1702
+ * `endevco/osv-bloom` and escalates hits to the existing
1703
+ * advisory query path for `(name, version)` confirmation.
1704
+ *
1705
+ * Cost: ~380 KB on the wire, refreshed every 10 minutes
1706
+ * upstream. False-positive rate is ~0.1%, so a typical
1707
+ * 1000-package lockfile triggers zero or one extra
1708
+ * round trip per audit.
1709
+ *
1710
+ * Independent of `audit.advisories.source` / `verify` —
1711
+ * those control the full OSV ingest. The bloom is
1712
+ * MAL-* only and aimed at cold-start preflight and
1713
+ * ephemeral CI runners that haven't synced the full DB.
1714
+ */
1715
+ bloom?: {
1716
+ /**
1717
+ * Extra hosts permitted as `bloom.source`. The
1718
+ * built-in allowlist (`endevco.github.io`) is enforced
1719
+ * even if this field is omitted; entries here add to it.
1720
+ */
1721
+ allowedHosts?: string[];
1722
+ /**
1723
+ * Prefilter mode:
1724
+ * - `off`: never run the bloom check.
1725
+ * - `on`: run when a local filter is cached; on
1726
+ * fetch failure, fall back to the cached filter or
1727
+ * skip the prefilter (audit continues against the
1728
+ * non-bloom path).
1729
+ * - `required`: hard-fail the audit when the bloom
1730
+ * refresh fails or the local cache is missing.
1731
+ * Use in hardened CI together with
1732
+ * `audit.advisories.source`.
1733
+ * @default "off"
1734
+ */
1735
+ mode?: "off" | "on" | "required";
1736
+ /**
1737
+ * Bloom mirror base URL (no trailing slash). Defaults
1738
+ * to the public `endevco/osv-bloom` GH Pages site.
1739
+ * Override only if you mirror the bloom artifacts
1740
+ * internally; the hostname must appear in
1741
+ * `allowedHosts`.
1742
+ * @default "https://endevco.github.io/osv-bloom"
1743
+ */
1744
+ source?: string;
1745
+ };
1746
+ /**
1747
+ * Number of hours after `lastSyncIso` before `vis audit`
1748
+ * prints a "your advisory cache may be stale" notice.
1749
+ * `vis audit` never auto-syncs — the user runs
1750
+ * `vis advisories sync` themselves.
1751
+ * @default 24
1752
+ */
1753
+ refreshIntervalHours?: number;
1754
+ /**
1755
+ * OSV mirror base URL (no trailing slash). Defaults to the
1756
+ * public Google Cloud Storage bucket. Override to point at a
1757
+ * corporate mirror; the hostname must appear in `allowedHosts`
1758
+ * (or one of the built-in defaults) and the scheme must be
1759
+ * `https://`.
1760
+ * @default "https://osv-vulnerabilities.storage.googleapis.com"
1761
+ */
1762
+ source?: string;
1763
+ /**
1764
+ * Sigstore signature verification for the OSV dump.
1765
+ * Requires the native binding to be built with the
1766
+ * `verify-signatures` Cargo feature (default in the release
1767
+ * build). Off by default — the upstream OSV bucket does not
1768
+ * ship signatures today.
1769
+ */
1770
+ verify?: {
1771
+ /**
1772
+ * Enable signature verification. The sync flow downloads
1773
+ * `&lt;eco>/all.zip.sig` next to the zip and aborts if it
1774
+ * cannot verify against `expectedIssuer` / `expectedSubject`.
1775
+ * @default false
1776
+ */
1777
+ enabled?: boolean;
1778
+ /** OIDC issuer that signed the bundle. */
1779
+ expectedIssuer?: string;
1780
+ /** OIDC subject (workload identity) that signed the bundle. */
1781
+ expectedSubject?: string;
1782
+ };
1783
+ };
1784
+ /**
1785
+ * Gates for the auto-fix flow (`vis audit --fix` /
1786
+ * `--fix-transitive`). The CLI prompts outside CI; inside CI
1787
+ * the flags refuse to run unless `--yes` is set and, for
1788
+ * transitives, `apply.transitive.enabled = true`.
1789
+ */
1790
+ apply?: {
1791
+ /**
1792
+ * Gates for `vis audit --fix-transitive`. Two-lock: the
1793
+ * CLI requires `--yes` AND this flag set to `true` before
1794
+ * it will rewrite override entries in CI.
1795
+ */
1796
+ transitive?: {
1797
+ /**
1798
+ * When true, allows `--fix-transitive` to run in CI
1799
+ * environments. Defaults to false because rewriting
1800
+ * overrides is a higher blast radius than bumping a
1801
+ * direct dep.
1802
+ * @default false
1803
+ */
1804
+ enabled?: boolean;
1805
+ };
1806
+ };
1807
+ /**
1808
+ * Vulnerability scanner backend.
1809
+ *
1810
+ * - `auto` (default): delegate to `aube audit` when aube is the
1811
+ * active installer (its scanner reads the same lockfile and
1812
+ * produces equivalent severity ratings); otherwise run vis's
1813
+ * own OSV/Socket scanner.
1814
+ * - `aube`: always delegate to `aube audit`. Errors if `aube` is
1815
+ * not on PATH.
1816
+ * - `vis`: always use vis's built-in scanner — never delegate.
1817
+ *
1818
+ * Delegation avoids redundant work (aube already has a
1819
+ * full-fidelity audit pass that respects its own exclusions
1820
+ * via `aube-workspace.yaml::auditConfig`) and lets users get
1821
+ * a single, consistent result regardless of which entry point
1822
+ * they invoke.
1823
+ * @default "auto"
1824
+ */
1825
+ backend?: "aube" | "auto" | "vis";
1826
+ /**
1827
+ * When true, `vis audit` skips network calls and queries the
1828
+ * offline cache. Equivalent to the CLI `--offline` flag.
1829
+ * @default false
1830
+ */
1831
+ offlineByDefault?: boolean;
1832
+ };
1833
+ /**
1834
+ * When true, prevents transitive dependencies from using exotic sources
1835
+ * (git repositories, direct tarball URLs). Only direct dependencies may
1836
+ * use such sources. Equivalent to pnpm's `blockExoticSubdeps`.
1837
+ * @default false
1838
+ */
1839
+ blockExoticSubdeps?: boolean;
1840
+ /**
1841
+ * deps.dev (Google Open Source Insights) data-source configuration.
1842
+ * Public, unauthenticated; pulls Scorecard data + advisories from
1843
+ * `api.deps.dev`. Complements or replaces Socket.dev. Heavily cached.
1844
+ * @see https://docs.deps.dev/api/v3/
1845
+ */
1846
+ depsDev?: {
1847
+ /**
1848
+ * Cache TTL for advisory entries (immutable once published). 7 days.
1849
+ * @default 604800000
1850
+ */
1851
+ advisoryCacheTtlMs?: number;
1852
+ /**
1853
+ * Enable deps.dev scanning on install/update/check/audit commands.
1854
+ * @default false
1855
+ */
1856
+ enabled?: boolean;
1857
+ /**
1858
+ * Cache TTL for OpenSSF Scorecard project data (refreshes weekly). 24 hours.
1859
+ * @default 86400000
1860
+ */
1861
+ projectCacheTtlMs?: number;
1862
+ /**
1863
+ * Request timeout in milliseconds.
1864
+ * @default 15000
1865
+ */
1866
+ timeoutMs?: number;
1867
+ /**
1868
+ * Cache TTL for npm version metadata (immutable). 7 days.
1869
+ * @default 604800000
1870
+ */
1871
+ versionCacheTtlMs?: number;
1872
+ };
1873
+ /**
1874
+ * Package names exempted from the `blockExoticSubdeps` check.
1875
+ * Bare names and a trailing `*` glob (`@scope/*`) are supported.
1876
+ * Use for an internal package legitimately published as a git or
1877
+ * tarball dependency.
1878
+ * @example ["@myorg/legacy", "internal-*"]
1879
+ */
1880
+ exoticSubdepsAllow?: string[];
1881
+ /**
1882
+ * Pre-install marshall pipeline — packument-derived supply-chain
1883
+ * gates (author, provenance, s1ngularity, new-bin, metadata,
1884
+ * downloads, expired-domains, signatures, archived-repo) that run before
1885
+ * `vis add` / `vis install &lt;pkg>` / `vis update &lt;pkg>` hand off to
1886
+ * the underlying package manager. Every entry is optional; omit a
1887
+ * key and the marshall runs with defaults. Set `enabled: false`
1888
+ * on a specific marshall to skip it without touching env vars.
1889
+ */
1890
+ marshalls?: {
1891
+ /** Archived-repo marshall (GitHub repository status). */
1892
+ archivedRepo?: {
1893
+ /** Package names to skip. */
1894
+ allowlist?: string[];
1895
+ /** Default: marshall is on. Set false to disable. */
1896
+ enabled?: boolean;
1897
+ /** GitHub PAT for the API call (5k/hr vs 60/hr). */
1898
+ githubToken?: string;
1899
+ };
1900
+ /** Author / publisher heuristics. */
1901
+ author?: {
1902
+ allowlist?: string[]; /** Days since the publisher's last release before flagging as error. */
1903
+ dormantErrorDays?: number;
1904
+ /** Days since the publisher's last release before flagging as warning. */
1905
+ dormantWarnDays?: number;
1906
+ enabled?: boolean; /** Window for the "new publisher on an established package" check. */
1907
+ newPublisherWindowDays?: number;
1908
+ /** Days since the resolved version was published — error threshold. */
1909
+ recentVersionErrorDays?: number;
1910
+ /** Days since the resolved version was published — warning threshold. */
1911
+ recentVersionWarnDays?: number;
1912
+ };
1913
+ /** npm `deprecated`-flag check on the resolved version. */
1914
+ deprecation?: {
1915
+ allowlist?: string[];
1916
+ enabled?: boolean;
1917
+ };
1918
+ /** Monthly download-count floor. */
1919
+ downloads?: {
1920
+ allowlist?: string[];
1921
+ enabled?: boolean; /** Below this monthly count → error (default: 20). */
1922
+ errorThreshold?: number;
1923
+ /** Below this monthly count → warning (default: 1000). */
1924
+ warnThreshold?: number;
1925
+ };
1926
+ /** Maintainer-email-domain NS lookup. */
1927
+ expiredDomains?: {
1928
+ /** Domains exempted from the check (legacy / internal). */
1929
+ allowDomains?: string[];
1930
+ allowlist?: string[]; /** DNS resolvers to query (default: system). */
1931
+ dnsServers?: string[];
1932
+ enabled?: boolean; /** Per-domain DNS timeout (default: 5000). */
1933
+ timeoutMs?: number;
1934
+ };
1935
+ /** README / license / repository presence checks. */
1936
+ metadata?: {
1937
+ allowlist?: string[]; /** Subset of checks to run. Default: all three. */
1938
+ checks?: ("license" | "readme" | "repo")[];
1939
+ enabled?: boolean;
1940
+ };
1941
+ /** New CLI-bin script introduced in this version. */
1942
+ newBin?: {
1943
+ allowlist?: string[];
1944
+ enabled?: boolean;
1945
+ };
1946
+ /** Whole-package age heuristics (newly created / unmaintained). */
1947
+ packageAge?: {
1948
+ allowlist?: string[];
1949
+ enabled?: boolean; /** Package created fewer than this many days ago → error. Default 22. */
1950
+ newPackageDays?: number;
1951
+ /** No publish within this many days → warning. Default 365. */
1952
+ unmaintainedDays?: number;
1953
+ };
1954
+ /** Provenance regression check. */
1955
+ provenance?: {
1956
+ allowlist?: string[];
1957
+ enabled?: boolean;
1958
+ };
1959
+ /**
1960
+ * Composite "compromised-publish shape" detector — flags a single
1961
+ * version that simultaneously introduced/changed an install hook
1962
+ * AND dropped the provenance attestation a prior stable version
1963
+ * carried (the August 2025 s1ngularity / Nx fingerprint).
1964
+ */
1965
+ s1ngularity?: {
1966
+ allowlist?: string[];
1967
+ enabled?: boolean;
1968
+ };
1969
+ /**
1970
+ * ECDSA P-256 verification against npm's signing keys. Disabled
1971
+ * by default because npm coverage still has gaps that produce
1972
+ * noisy warnings on legitimate packages.
1973
+ */
1974
+ signatures?: {
1975
+ allowlist?: string[]; /** Default: marshall is *off*. Set true to enable. */
1976
+ enabled?: boolean;
1977
+ /** Override the keys endpoint (default: npm registry). */
1978
+ keysUrl?: string;
1979
+ /** How to treat an expired-but-known key. Default: "warning". */
1980
+ treatExpiredAs?: "error" | "warning";
1981
+ };
1982
+ };
1983
+ /**
1984
+ * When true, `security.policies.installScripts.allow` keys are matched
1985
+ * as `name@version`. A version bump on an approved package drops it from
1986
+ * the allowlist until the new version is explicitly re-approved (port
1987
+ * of LavaMoat allow-scripts' version-aware policy matcher).
1988
+ *
1989
+ * After a version bump, run `vis approve-builds` or `vis security list`
1990
+ * — both surface a "Version drift" block with the suggested new key
1991
+ * (`old-key → new-key`) so you can update `vis.config.ts` by hand.
1992
+ * @default false
1993
+ */
1994
+ pinVersions?: boolean;
1995
+ /**
1996
+ * Supply-chain policy gates. Each sub-block enables one policy and
1997
+ * configures its behavior. When a sub-block is omitted the policy is
1998
+ * inactive. `acceptedRisks` (above) silences specific packages without
1999
+ * disabling a policy globally.
2000
+ *
2001
+ * The 8 policies are inspired by Socket.dev's classification:
2002
+ * - `malware` — Socket-flagged malicious packages
2003
+ * - `firstSeen` — packages published less than N minutes ago
2004
+ * - `unexpectedDeps` — packages outside an allow-list / baseline
2005
+ * - `publisherChange` — maintainer set changed between installs
2006
+ * - `installScripts` — preinstall/install/postinstall scripts
2007
+ * - `score` — Socket overall score below threshold
2008
+ * - `vulnerability` — OSV vulnerability findings
2009
+ * - `license` — SPDX allow / deny lists
2010
+ */
2011
+ policies?: {
2012
+ /**
2013
+ * Minimum number of minutes that must pass after a version is
2014
+ * published before vis will allow installation. Migrated from
2015
+ * the legacy `security.minimumReleaseAge` field. Equivalent to
2016
+ * pnpm's `minimumReleaseAge`.
2017
+ * @default 0
2018
+ * @example { minutes: 1440, exclude: ["@myorg/*"] } // 24 hours
2019
+ */
2020
+ firstSeen?: {
2021
+ /**
2022
+ * Package names/patterns excluded from the firstSeen check.
2023
+ * Equivalent to pnpm's `minimumReleaseAgeExclude`.
2024
+ * @example ["webpack", "react", "@myorg/*"]
2025
+ */
2026
+ exclude?: string[];
2027
+ /** Minutes after publish before install is allowed. */
2028
+ minutes?: number;
2029
+ };
2030
+ /**
2031
+ * Build-script (pre/install/postinstall/prepare) controls.
2032
+ * Migrated from the legacy `security.allowBuilds` /
2033
+ * `security.strictDepBuilds` fields.
2034
+ * @example { allow: { esbuild: true }, strict: true }
2035
+ */
2036
+ installScripts?: {
2037
+ /**
2038
+ * Map of package names/patterns to allow (true) or deny
2039
+ * (false) build scripts. Packages not listed are denied
2040
+ * by default. Equivalent to pnpm's `allowBuilds`.
2041
+ */
2042
+ allow?: Record<string, boolean>;
2043
+ /**
2044
+ * When true, installation will fail (exit non-zero) if any
2045
+ * dependencies have unreviewed build scripts. Equivalent to
2046
+ * pnpm's `strictDepBuilds`.
2047
+ * @default false
2048
+ */
2049
+ strict?: boolean;
2050
+ };
2051
+ /**
2052
+ * SPDX license allow / deny lists. Deny wins on any sub-license
2053
+ * match in SPDX expressions (`(MIT OR GPL-3.0)` against
2054
+ * `deny: ["GPL-3.0"]` is blocked). Packages with no declared
2055
+ * license are flagged when `allow` is set.
2056
+ * @example
2057
+ * ```
2058
+ * license: {
2059
+ * allow: ["MIT", "Apache-2.0", "BSD-3-Clause"],
2060
+ * deny: ["GPL-3.0", "AGPL-3.0"],
2061
+ * }
2062
+ * ```
2063
+ */
2064
+ license?: {
2065
+ /**
2066
+ * SPDX identifiers that are explicitly permitted. When set,
2067
+ * any package whose declared license is not on this list is
2068
+ * blocked.
2069
+ */
2070
+ allow?: string[];
2071
+ /**
2072
+ * SPDX identifiers that are explicitly forbidden. Always
2073
+ * wins over `allow` when both reference the same identifier.
2074
+ */
2075
+ deny?: string[];
2076
+ };
2077
+ /**
2078
+ * Behavior when the Socket.dev feed flags a package as malicious
2079
+ * (`alerts[].type === "Malware"`).
2080
+ *
2081
+ * The default is cross-field: `{ mode: "block" }` whenever
2082
+ * `security.socket.enabled !== false` (the engine cannot evaluate
2083
+ * malware without Socket data), and `"off"` otherwise. Consumers
2084
+ * resolve this default at evaluation time.
2085
+ */
2086
+ malware?: {
2087
+ /**
2088
+ * - `"block"` — emit a block decision.
2089
+ * - `"warn"` — surface as a warning; do not gate exit code.
2090
+ * - `"off"` — disable the policy entirely.
2091
+ */
2092
+ mode?: "block" | "off" | "warn";
2093
+ };
2094
+ /**
2095
+ * Trust-level checking for package publishing. Migrated from the
2096
+ * legacy `security.trustPolicy*` fields. Equivalent to pnpm's
2097
+ * `trustPolicy`.
2098
+ * @example { mode: "no-downgrade", ignoreAfter: 43200 } // 30 days
2099
+ */
2100
+ publisherChange?: {
2101
+ /**
2102
+ * Package selectors excluded from the check.
2103
+ * Equivalent to pnpm's `trustPolicyExclude`.
2104
+ * @example ["chokidar@4.0.3"]
2105
+ */
2106
+ exclude?: string[];
2107
+ /**
2108
+ * Ignore packages published more than N minutes ago. Useful
2109
+ * for older packages that pre-date provenance support.
2110
+ * Equivalent to pnpm's `trustPolicyIgnoreAfter`.
2111
+ */
2112
+ ignoreAfter?: number;
2113
+ /**
2114
+ * - `"off"` — no trust checking (default).
2115
+ * - `"no-downgrade"` — block when a package's trust level
2116
+ * has decreased compared to previous releases (e.g., was
2117
+ * published by trusted publisher, now only has provenance).
2118
+ */
2119
+ mode?: "no-downgrade" | "off";
2120
+ };
2121
+ /**
2122
+ * Socket.dev overall-score threshold. Packages scoring below
2123
+ * `minimum` trigger a block decision (or interactive prompt
2124
+ * during `vis add`). Migrated from the legacy
2125
+ * `security.socket.minimumScore` field.
2126
+ * @example { minimum: 0.4 }
2127
+ */
2128
+ score?: {
2129
+ /**
2130
+ * Minimum overall Socket.dev score (0–1). Set to 0 to
2131
+ * disable the gate while keeping Socket data fetched.
2132
+ *
2133
+ * Consulted by `vis add`, `audit`, `doctor`, `check`, and
2134
+ * `update`; resolved once in `buildSocketOptions`, then
2135
+ * threaded through every consumer. Falls back to
2136
+ * `DEFAULT_LOW_SCORE_THRESHOLD` (`0.4`) when unset.
2137
+ */
2138
+ minimum?: number;
2139
+ };
2140
+ /**
2141
+ * Net-new transitive dependency detection. Either provide a
2142
+ * static allow-list, a baseline lockfile path (recommended), or
2143
+ * both — the intersection is enforced.
2144
+ * @example { baselineLockfile: "./security/lockfile.baseline.yaml" }
2145
+ */
2146
+ unexpectedDeps?: {
2147
+ /**
2148
+ * Allow-list of dependency names that may appear in the
2149
+ * resolved package set. Glob patterns are supported.
2150
+ * @example ["lodash", "axios", "@myorg/*"]
2151
+ */
2152
+ allow?: string[];
2153
+ /**
2154
+ * Path (absolute or relative to the workspace root) to a
2155
+ * baseline lockfile snapshot. The policy diffs the current
2156
+ * lockfile against this baseline and flags any package that
2157
+ * didn't exist before.
2158
+ * @example "./security/lockfile.baseline.yaml"
2159
+ */
2160
+ baselineLockfile?: string;
2161
+ };
2162
+ /**
2163
+ * OSV vulnerability gating. Migrated from the legacy
2164
+ * `security.audit.failOn` + `security.audit.usage` fields.
2165
+ */
2166
+ vulnerability?: {
2167
+ /**
2168
+ * Severity threshold that makes `vis audit` exit non-zero.
2169
+ * Equivalent to the CLI `--fail-on` flag.
2170
+ * @example "high"
2171
+ */
2172
+ failOn?: "critical" | "high" | "low" | "medium";
2173
+ /**
2174
+ * Reachability filter — only report vulnerabilities in
2175
+ * packages the workspace statically imports.
2176
+ */
2177
+ usage?: {
2178
+ /**
2179
+ * Packages to always treat as reachable even if no
2180
+ * static import is found.
2181
+ * @example ["esbuild", "webpack-cli"]
2182
+ */
2183
+ alwaysAssumeUsed?: string[];
2184
+ /**
2185
+ * Enable the reachability filter by default. Equivalent
2186
+ * to `--usage` on the CLI; `--no-usage` disables.
2187
+ * @default false
2188
+ */
2189
+ enabled?: boolean;
2190
+ };
2191
+ };
2192
+ };
2193
+ /**
2194
+ * Which provider wins merge conflicts when multiple are enabled (e.g.
2195
+ * both Socket.dev and deps.dev return data for the same package). The
2196
+ * primary provider's `score` is kept; alerts from secondaries are
2197
+ * appended and deduped by `key`. Defaults to whichever provider is
2198
+ * enabled first in this order: socket → deps-dev → snyk.
2199
+ */
2200
+ primaryProvider?: "deps-dev" | "snyk" | "socket";
2201
+ /**
2202
+ * Snyk data-source configuration. Snyk only contributes vulnerability
2203
+ * data (no maintenance / quality / supply-chain / license signal);
2204
+ * those axes stay neutral. Requires both an org id and an API token —
2205
+ * if either is missing the provider is skipped.
2206
+ * @see https://docs.snyk.io/snyk-api/using-specific-snyk-apis/issues-list-issues-for-a-package
2207
+ */
2208
+ snyk?: {
2209
+ /**
2210
+ * Snyk API token. Set via VIS_SNYK_TOKEN environment variable or
2211
+ * here.
2212
+ */
2213
+ apiToken?: string;
2214
+ /**
2215
+ * Snyk REST API version date sent as the `version` query param.
2216
+ * @default "2024-10-15"
2217
+ */
2218
+ apiVersion?: string;
2219
+ /**
2220
+ * Cache TTL in milliseconds for Snyk issue lookups. 6 hours.
2221
+ * @default 21600000
2222
+ */
2223
+ cacheTtlMs?: number;
2224
+ /**
2225
+ * Enable Snyk security scanning on install/update/check/audit
2226
+ * commands.
2227
+ * @default false
2228
+ */
2229
+ enabled?: boolean;
2230
+ /**
2231
+ * Snyk organization id (the REST endpoint is org-scoped). Set via
2232
+ * VIS_SNYK_ORG environment variable or here.
2233
+ */
2234
+ orgId?: string;
2235
+ /**
2236
+ * Request timeout in milliseconds for the Snyk API. 15 seconds.
2237
+ * @default 15000
2238
+ */
2239
+ timeoutMs?: number;
2240
+ };
2241
+ /**
2242
+ * Socket.dev data-source configuration. Connection knobs only — score
2243
+ * thresholds and accepted-risk overrides moved to `policies.score` and
2244
+ * `security.acceptedRisks` respectively.
2245
+ * @see https://socket.dev
2246
+ */
2247
+ socket?: {
2248
+ /**
2249
+ * Custom Socket.dev API token. Falls back to the public API token.
2250
+ * Set via VIS_SOCKET_TOKEN environment variable or here.
2251
+ */
2252
+ apiToken?: string;
2253
+ /**
2254
+ * Cache TTL in milliseconds for Socket.dev reports. 1 hour.
2255
+ * @default 3600000
2256
+ */
2257
+ cacheTtlMs?: number;
2258
+ /**
2259
+ * Enable Socket.dev security scanning on install/update/check commands.
2260
+ * @default false
2261
+ */
2262
+ enabled?: boolean;
2263
+ /**
2264
+ * Request timeout in milliseconds for the Socket.dev API. 15 seconds.
2265
+ * @default 15000
2266
+ */
2267
+ timeoutMs?: number;
2268
+ };
2269
+ /**
2270
+ * Package names to skip during typosquat detection.
2271
+ * Use this for internal packages or known-safe names that happen to
2272
+ * look similar to popular packages.
2273
+ * @example ["my-internal-axois", "@myorg/recat"]
2274
+ */
2275
+ typosquatAllowlist?: string[];
2276
+ };
2277
+ /**
2278
+ * Share the cache between sibling git worktrees. When the workspace is a
2279
+ * linked worktree (created with `git worktree add`), the cache root is
2280
+ * relocated from `&lt;linkedRoot>/.vis/cache` to the *main*
2281
+ * worktree's `.vis/cache`. Multiple parallel agents working in
2282
+ * sibling worktrees then share a single cache instead of rebuilding the
2283
+ * same hash N times.
2284
+ *
2285
+ * Single-checkout repos (where `.git` is a directory) are unaffected.
2286
+ *
2287
+ * Set to `false` to opt out — useful when worktrees deliberately need
2288
+ * independent caches, e.g. for hermetic experiments.
2289
+ * @default true
2290
+ */
2291
+ sharedWorktreeCache?: boolean;
2292
+ /** sort-package-json command defaults */
2293
+ sortPackageJson?: {
2294
+ /** Discover `.editorconfig` for indent / line-ending defaults (default: true). */
2295
+ editorconfig?: boolean;
2296
+ /** Collapse `bugs: { url }` to the bare string form when `url` is the only field (default: true). */
2297
+ formatBugs?: boolean;
2298
+ /** Collapse `repository: { type, url }` to the GitHub `owner/repo` shorthand (default: true). */
2299
+ formatRepository?: boolean;
2300
+ /** Sort `exports` condition keys in canonical order (default: true). */
2301
+ sortExports?: boolean;
2302
+ /** Alphabetize script commands (default: false) */
2303
+ sortScripts?: boolean;
2304
+ };
2305
+ /**
2306
+ * Sponsorship notice shown after successful commands.
2307
+ *
2308
+ * vis prints a one-line "consider sponsoring visulima" notice at most
2309
+ * once every 14 days (skipped in CI, non-TTY, and when
2310
+ * `VIS_NO_SPONSOR=1` is set). Set `enabled: false` to silence it
2311
+ * permanently for this workspace.
2312
+ * @example
2313
+ * ```
2314
+ * sponsor: { enabled: false }
2315
+ * ```
2316
+ */
2317
+ sponsor?: {
2318
+ /**
2319
+ * Show the sponsor notice on successful command completion.
2320
+ * @default true
2321
+ */
2322
+ enabled?: boolean;
2323
+ };
2324
+ /**
2325
+ * Staged file patterns and commands (replaces lint-staged).
2326
+ *
2327
+ * Accepts all lint-staged config forms:
2328
+ * - `string` or `string[]` commands
2329
+ * - Sync/async functions returning `string | string[]`
2330
+ * - `{ title, task }` objects for named side-effect tasks
2331
+ * - Mixed arrays of strings and functions
2332
+ * - A top-level generate-task function
2333
+ */
2334
+ staged?: StagedConfig;
2335
+ /**
2336
+ * When `true`, every task command is scanned for `${VAR}` / `$VAR`
2337
+ * references before spawn. If a referenced var is unset in the
2338
+ * task's effective env (envFile + service env + per-task `env` +
2339
+ * `process.env`), the task fails with an actionable error
2340
+ * naming the missing variable, instead of letting the shell
2341
+ * silently substitute an empty string.
2342
+ *
2343
+ * Override per run with `--strict-env` / `--no-strict-env`.
2344
+ * Override per target with `options.strictEnv`.
2345
+ * @default false
2346
+ */
2347
+ strictEnv?: boolean;
2348
+ /**
2349
+ * Named bundles of target dependencies, referenceable from any task's
2350
+ * `dependsOn`. `dependsOn: [{ group: "lint" }]` expands to every entry
2351
+ * in the named group; nested groups are resolved recursively and a
2352
+ * cycle raises during discovery.
2353
+ */
2354
+ taskGroups?: Record<string, (string | {
2355
+ dependencies?: boolean;
2356
+ projects?: string | string[];
2357
+ target: string;
2358
+ } | {
2359
+ group: string;
2360
+ })[]>;
2361
+ /**
2362
+ * Task runner options forwarded verbatim to `defaultTaskRunner`.
2363
+ *
2364
+ * Includes `remoteCache` (HTTP or REAPI gRPC backend), `cacheDirectory`,
2365
+ * `parallel`, `globalEnv`, `globalInputs`, etc.
2366
+ * See `TaskRunnerOptions` for the full surface.
2367
+ */
2368
+ taskRunner?: Partial<TaskRunnerOptions>;
2369
+ /**
2370
+ * Workspace-wide task defaults keyed by target name. Applied universally
2371
+ * to every project that exposes a matching target. Use `scopedTasks` when
2372
+ * defaults should only apply to a subset of projects.
2373
+ */
2374
+ tasks?: Record<string, Partial<VisTargetConfiguration>>;
2375
+ /**
2376
+ * Toolchain (Node / pnpm / python / rust / ...) management. vis
2377
+ * delegates to whichever version manager (proto, mise, fnm, volta,
2378
+ * asdf, nvm, corepack) the developer already has — it does not ship
2379
+ * its own.
2380
+ *
2381
+ * Re-exported from `./toolchain` so the public config type stays
2382
+ * in lockstep with the resolver implementation. `self-activate` is
2383
+ * narrowed out of `preferredManager` here — it's auto-resolved for
2384
+ * pnpm/yarn `packageManager` pins and isn't meaningful as an
2385
+ * override.
2386
+ */
2387
+ toolchain?: Omit<ToolchainConfig, "preferredManager"> & {
2388
+ readonly preferredManager?: Exclude<VersionManagerName, "self-activate">;
2389
+ };
2390
+ /** Terminal UI configuration */
2391
+ tui?: {
2392
+ /**
2393
+ * Auto-exit the TUI after tasks complete.
2394
+ * - `false`: Stay open until the user presses `q` (default)
2395
+ * - `true`: Show quit dialog with 3-second countdown after completion
2396
+ * - `number`: Show quit dialog with custom countdown in seconds
2397
+ */
2398
+ autoExit?: boolean | number;
2399
+ };
2400
+ /** Update command defaults */
2401
+ update?: {
2402
+ /**
2403
+ * Dependency fields to scan for outdated packages.
2404
+ * Beyond the standard fields, supports:
2405
+ * - `"overrides"` (npm)
2406
+ * - `"resolutions"` (yarn)
2407
+ * - `"pnpm.overrides"`
2408
+ * @default ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"]
2409
+ */
2410
+ depFields?: string[];
2411
+ exclude?: string[];
2412
+ format?: "json" | "minimal" | "table";
2413
+ /**
2414
+ * Package names or glob patterns to permanently ignore during updates.
2415
+ * Ignored packages are skipped and listed in the output so you know
2416
+ * they were not checked.
2417
+ * @example ["eslint", "@types/*"]
2418
+ */
2419
+ ignore?: string[];
2420
+ include?: string[];
2421
+ /**
2422
+ * Include packages with pinned/exact versions (no `^` or `~` prefix).
2423
+ * By default, pinned versions are skipped during update checks.
2424
+ * @default false
2425
+ */
2426
+ includeLocked?: boolean;
2427
+ install?: boolean;
2428
+ /**
2429
+ * Maximum number of concurrent registry requests during outdated checks.
2430
+ * Higher values speed up large workspaces but risk hitting registry rate
2431
+ * limits or self-hosted Verdaccio caps.
2432
+ * @default 8
2433
+ */
2434
+ maxConcurrentRequests?: number;
2435
+ /**
2436
+ * Minimum number of minutes since a version was published before
2437
+ * vis will consider it for updates. This mirrors pnpm's
2438
+ * `minimumReleaseAge` — a single setting that applies to both
2439
+ * install and update.
2440
+ *
2441
+ * Not set by default. If your package manager config
2442
+ * (`pnpm-workspace.yaml`) has `minimumReleaseAge`, vis will
2443
+ * read it from there as a fallback.
2444
+ * @example 1440 // 24 hours
2445
+ */
2446
+ minimumReleaseAge?: number;
2447
+ /**
2448
+ * Package names/patterns excluded from the minimumReleaseAge check.
2449
+ * @example ["webpack", "@myorg/*"]
2450
+ */
2451
+ minimumReleaseAgeExclude?: string[];
2452
+ /**
2453
+ * Per-package or per-pattern update target overrides.
2454
+ * Keys are exact package names, glob patterns, or regex patterns
2455
+ * wrapped in `/` (e.g., `/^@vue/`).
2456
+ * Values are `"latest"`, `"minor"`, or `"patch"`.
2457
+ * @example { "typescript": "minor", "/^@vue/": "patch" }
2458
+ */
2459
+ packageMode?: Record<string, "latest" | "minor" | "patch">;
2460
+ prerelease?: boolean;
2461
+ /**
2462
+ * Which release channels to consider when picking the target version.
2463
+ * - `"stable"` (default) — only ship stable releases (no prereleases).
2464
+ * - `"same"` — match the prerelease channel of the *current* range:
2465
+ * if you're on `react@19.0.0-rc.1`, only `rc.*` candidates qualify;
2466
+ * if you're on a stable, only stable candidates. Prevents
2467
+ * accidentally promoting a prerelease pin to a stable major bump.
2468
+ * - `"any"` — equivalent to `--prerelease`. Any channel is fair game.
2469
+ *
2470
+ * `--release-channel` on the CLI overrides this. If `prerelease: true`
2471
+ * is set without `releaseChannel`, vis treats it as `"any"`.
2472
+ * @default "stable"
2473
+ */
2474
+ releaseChannel?: "any" | "same" | "stable";
2475
+ security?: boolean;
2476
+ target?: "latest" | "minor" | "patch";
2477
+ };
2478
+ /**
2479
+ * Minimum vis CLI version required by this workspace. When the
2480
+ * running vis binary is older than this constraint, vis exits with
2481
+ * an actionable error before executing any command.
2482
+ *
2483
+ * Accepts a semver range string (e.g. `">=1.0.0"`, `"^1.2.0"`).
2484
+ * @example ">=1.0.0"
2485
+ */
2486
+ versionConstraint?: string;
2487
+ }
2488
+ /**
2489
+ * @since 1.0.0
2490
+ */
2491
+ interface Context {
2492
+ /**
2493
+ * Get a value from the context.
2494
+ *
2495
+ * @param key key which identifies a context value
2496
+ */
2497
+ getValue(key: symbol): unknown;
2498
+ /**
2499
+ * Create a new context which inherits from this context and has
2500
+ * the given key set to the given value.
2501
+ *
2502
+ * @param key context key for which to set the value
2503
+ * @param value value to set for the given key
2504
+ */
2505
+ setValue(key: symbol, value: unknown): Context;
2506
+ /**
2507
+ * Return a new context which inherits from this context but does
2508
+ * not contain a value for the given key.
2509
+ *
2510
+ * @param key context key for which to clear a value
2511
+ */
2512
+ deleteValue(key: symbol): Context;
2513
+ }
2514
+ /**
2515
+ * Attributes is a map from string to attribute values.
2516
+ *
2517
+ * Note: only the own enumerable keys are counted as valid attribute keys.
2518
+ *
2519
+ * @since 1.3.0
2520
+ */
2521
+ interface Attributes {
2522
+ [attributeKey: string]: AttributeValue | undefined;
2523
+ }
2524
+ /**
2525
+ * Attribute values may be any non-nullish primitive value except an object.
2526
+ *
2527
+ * null or undefined attribute values are invalid and will result in undefined behavior.
2528
+ *
2529
+ * @since 1.3.0
2530
+ */
2531
+ type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
2532
+ interface ExceptionWithCode {
2533
+ code: string | number;
2534
+ name?: string;
2535
+ message?: string;
2536
+ stack?: string;
2537
+ }
2538
+ interface ExceptionWithMessage {
2539
+ code?: string | number;
2540
+ message: string;
2541
+ name?: string;
2542
+ stack?: string;
2543
+ }
2544
+ interface ExceptionWithName {
2545
+ code?: string | number;
2546
+ message?: string;
2547
+ name: string;
2548
+ stack?: string;
2549
+ }
2550
+ /**
2551
+ * Defines Exception.
2552
+ *
2553
+ * string or an object with one of (message or name or code) and optional stack
2554
+ *
2555
+ * @since 1.0.0
2556
+ */
2557
+ type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string;
2558
+ /**
2559
+ * Defines High-Resolution Time.
2560
+ *
2561
+ * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.
2562
+ * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.
2563
+ * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.
2564
+ * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:
2565
+ * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.
2566
+ * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:
2567
+ * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
2568
+ * This is represented in HrTime format as [1609504210, 150000000].
2569
+ *
2570
+ * @since 1.0.0
2571
+ */
2572
+ type HrTime = [number, number];
2573
+ /**
2574
+ * Defines TimeInput.
2575
+ *
2576
+ * hrtime, epoch milliseconds, performance.now() or Date
2577
+ *
2578
+ * @since 1.0.0
2579
+ */
2580
+ type TimeInput = HrTime | number | Date;
2581
+ /**
2582
+ * @deprecated please use {@link Attributes}
2583
+ * @since 1.0.0
2584
+ */
2585
+ type SpanAttributes = Attributes;
2586
+ /**
2587
+ * @deprecated please use {@link AttributeValue}
2588
+ * @since 1.0.0
2589
+ */
2590
+ type SpanAttributeValue = AttributeValue;
2591
+ /**
2592
+ * @since 1.0.0
2593
+ */
2594
+ interface TraceState {
2595
+ /**
2596
+ * Create a new TraceState which inherits from this TraceState and has the
2597
+ * given key set.
2598
+ * The new entry will always be added in the front of the list of states.
2599
+ *
2600
+ * @param key key of the TraceState entry.
2601
+ * @param value value of the TraceState entry.
2602
+ */
2603
+ set(key: string, value: string): TraceState;
2604
+ /**
2605
+ * Return a new TraceState which inherits from this TraceState but does not
2606
+ * contain the given key.
2607
+ *
2608
+ * @param key the key for the TraceState entry to be removed.
2609
+ */
2610
+ unset(key: string): TraceState;
2611
+ /**
2612
+ * Returns the value to which the specified key is mapped, or `undefined` if
2613
+ * this map contains no mapping for the key.
2614
+ *
2615
+ * @param key with which the specified value is to be associated.
2616
+ * @returns the value to which the specified key is mapped, or `undefined` if
2617
+ * this map contains no mapping for the key.
2618
+ */
2619
+ get(key: string): string | undefined;
2620
+ /**
2621
+ * Serializes the TraceState to a `list` as defined below. The `list` is a
2622
+ * series of `list-members` separated by commas `,`, and a list-member is a
2623
+ * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs
2624
+ * surrounding `list-members` are ignored. There can be a maximum of 32
2625
+ * `list-members` in a `list`.
2626
+ *
2627
+ * @returns the serialized string.
2628
+ */
2629
+ serialize(): string;
2630
+ }
2631
+ /**
2632
+ * A SpanContext represents the portion of a {@link Span} which must be
2633
+ * serialized and propagated along side of a {@link Baggage}.
2634
+ *
2635
+ * @since 1.0.0
2636
+ */
2637
+ interface SpanContext {
2638
+ /**
2639
+ * The ID of the trace that this span belongs to. It is worldwide unique
2640
+ * with practically sufficient probability by being made as 16 randomly
2641
+ * generated bytes, encoded as a 32 lowercase hex characters corresponding to
2642
+ * 128 bits.
2643
+ */
2644
+ traceId: string;
2645
+ /**
2646
+ * The ID of the Span. It is globally unique with practically sufficient
2647
+ * probability by being made as 8 randomly generated bytes, encoded as a 16
2648
+ * lowercase hex characters corresponding to 64 bits.
2649
+ */
2650
+ spanId: string;
2651
+ /**
2652
+ * Only true if the SpanContext was propagated from a remote parent.
2653
+ */
2654
+ isRemote?: boolean;
2655
+ /**
2656
+ * Trace flags to propagate.
2657
+ *
2658
+ * It is represented as 1 byte (bitmap). Bit to represent whether trace is
2659
+ * sampled or not. When set, the least significant bit documents that the
2660
+ * caller may have recorded trace data. A caller who does not record trace
2661
+ * data out-of-band leaves this flag unset.
2662
+ *
2663
+ * see {@link TraceFlags} for valid flag values.
2664
+ */
2665
+ traceFlags: number;
2666
+ /**
2667
+ * Tracing-system-specific info to propagate.
2668
+ *
2669
+ * The tracestate field value is a `list` as defined below. The `list` is a
2670
+ * series of `list-members` separated by commas `,`, and a list-member is a
2671
+ * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs
2672
+ * surrounding `list-members` are ignored. There can be a maximum of 32
2673
+ * `list-members` in a `list`.
2674
+ * More Info: https://www.w3.org/TR/trace-context/#tracestate-field
2675
+ *
2676
+ * Examples:
2677
+ * Single tracing system (generic format):
2678
+ * tracestate: rojo=00f067aa0ba902b7
2679
+ * Multiple tracing systems (with different formatting):
2680
+ * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE
2681
+ */
2682
+ traceState?: TraceState;
2683
+ }
2684
+ /**
2685
+ * @since 1.0.0
2686
+ */
2687
+ interface SpanStatus {
2688
+ /** The status code of this message. */
2689
+ code: SpanStatusCode;
2690
+ /** A developer-facing error message. */
2691
+ message?: string;
2692
+ }
2693
+ /**
2694
+ * An enumeration of status codes.
2695
+ *
2696
+ * @since 1.0.0
2697
+ */
2698
+ declare enum SpanStatusCode {
2699
+ /**
2700
+ * The default status.
2701
+ */
2702
+ UNSET = 0,
2703
+ /**
2704
+ * The operation has been validated by an Application developer or
2705
+ * Operator to have completed successfully.
2706
+ */
2707
+ OK = 1,
2708
+ /**
2709
+ * The operation contains an error.
2710
+ */
2711
+ ERROR = 2,
2712
+ }
2713
+ /**
2714
+ * A pointer from the current {@link Span} to another span in the same trace or
2715
+ * in a different trace.
2716
+ * Few examples of Link usage.
2717
+ * 1. Batch Processing: A batch of elements may contain elements associated
2718
+ * with one or more traces/spans. Since there can only be one parent
2719
+ * SpanContext, Link is used to keep reference to SpanContext of all
2720
+ * elements in the batch.
2721
+ * 2. Public Endpoint: A SpanContext in incoming client request on a public
2722
+ * endpoint is untrusted from service provider perspective. In such case it
2723
+ * is advisable to start a new trace with appropriate sampling decision.
2724
+ * However, it is desirable to associate incoming SpanContext to new trace
2725
+ * initiated on service provider side so two traces (from Client and from
2726
+ * Service Provider) can be correlated.
2727
+ *
2728
+ * @since 1.0.0
2729
+ */
2730
+ interface Link {
2731
+ /** The {@link SpanContext} of a linked span. */
2732
+ context: SpanContext;
2733
+ /** A set of {@link SpanAttributes} on the link. */
2734
+ attributes?: SpanAttributes;
2735
+ /** Count of attributes of the link that were dropped due to collection limits */
2736
+ droppedAttributesCount?: number;
2737
+ }
2738
+ /**
2739
+ * An interface that represents a span. A span represents a single operation
2740
+ * within a trace. Examples of span might include remote procedure calls or a
2741
+ * in-process function calls to sub-components. A Trace has a single, top-level
2742
+ * "root" Span that in turn may have zero or more child Spans, which in turn
2743
+ * may have children.
2744
+ *
2745
+ * Spans are created by the {@link Tracer.startSpan} method.
2746
+ *
2747
+ * @since 1.0.0
2748
+ */
2749
+ interface Span {
2750
+ /**
2751
+ * Returns the {@link SpanContext} object associated with this Span.
2752
+ *
2753
+ * Get an immutable, serializable identifier for this span that can be used
2754
+ * to create new child spans. Returned SpanContext is usable even after the
2755
+ * span ends.
2756
+ *
2757
+ * @returns the SpanContext object associated with this Span.
2758
+ */
2759
+ spanContext(): SpanContext;
2760
+ /**
2761
+ * Sets an attribute to the span.
2762
+ *
2763
+ * Sets a single Attribute with the key and value passed as arguments.
2764
+ *
2765
+ * @param key the key for this attribute.
2766
+ * @param value the value for this attribute. Setting a value null or
2767
+ * undefined is invalid and will result in undefined behavior.
2768
+ */
2769
+ setAttribute(key: string, value: SpanAttributeValue): this;
2770
+ /**
2771
+ * Sets attributes to the span.
2772
+ *
2773
+ * @param attributes the attributes that will be added.
2774
+ * null or undefined attribute values
2775
+ * are invalid and will result in undefined behavior.
2776
+ */
2777
+ setAttributes(attributes: SpanAttributes): this;
2778
+ /**
2779
+ * Adds an event to the Span.
2780
+ *
2781
+ * @param name the name of the event.
2782
+ * @param [attributesOrStartTime] the attributes that will be added; these are
2783
+ * associated with this event. Can be also a start time
2784
+ * if type is {@type TimeInput} and 3rd param is undefined
2785
+ * @param [startTime] start time of the event.
2786
+ */
2787
+ addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this;
2788
+ /**
2789
+ * Adds a single link to the span.
2790
+ *
2791
+ * Links added after the creation will not affect the sampling decision.
2792
+ * It is preferred span links be added at span creation.
2793
+ *
2794
+ * @param link the link to add.
2795
+ */
2796
+ addLink(link: Link): this;
2797
+ /**
2798
+ * Adds multiple links to the span.
2799
+ *
2800
+ * Links added after the creation will not affect the sampling decision.
2801
+ * It is preferred span links be added at span creation.
2802
+ *
2803
+ * @param links the links to add.
2804
+ */
2805
+ addLinks(links: Link[]): this;
2806
+ /**
2807
+ * Sets the status of the span.
2808
+ *
2809
+ * By default, a span has status {@link SpanStatusCode.UNSET}.
2810
+ * Calling this method overrides that default.
2811
+ *
2812
+ * The status codes have a total order: `OK > ERROR > UNSET`.
2813
+ *
2814
+ * - Once {@link SpanStatusCode.OK} is set, any further attempts to change
2815
+ * the status are ignored.
2816
+ * - Any attempt to set {@link SpanStatusCode.UNSET} is always ignored.
2817
+ *
2818
+ * The `message` field is only used when {@link SpanStatusCode.ERROR} is set.
2819
+ * For all other status codes, `message` is ignored.
2820
+ *
2821
+ * @param status The {@link SpanStatus} to set.
2822
+ */
2823
+ setStatus(status: SpanStatus): this;
2824
+ /**
2825
+ * Updates the Span name.
2826
+ *
2827
+ * This will override the name provided via {@link Tracer.startSpan}.
2828
+ *
2829
+ * Upon this update, any sampling behavior based on Span name will depend on
2830
+ * the implementation.
2831
+ *
2832
+ * @param name the Span name.
2833
+ */
2834
+ updateName(name: string): this;
2835
+ /**
2836
+ * Marks the end of Span execution.
2837
+ *
2838
+ * Call to End of a Span MUST not have any effects on child spans. Those may
2839
+ * still be running and can be ended later.
2840
+ *
2841
+ * Do not return `this`. The Span generally should not be used after it
2842
+ * is ended so chaining is not desired in this context.
2843
+ *
2844
+ * @param [endTime] the time to set as Span's end time. If not provided,
2845
+ * use the current time as the span's end time.
2846
+ */
2847
+ end(endTime?: TimeInput): void;
2848
+ /**
2849
+ * Returns the flag whether this span will be recorded.
2850
+ *
2851
+ * @returns true if this Span is active and recording information like events
2852
+ * with the `AddEvent` operation and attributes using `setAttributes`.
2853
+ */
2854
+ isRecording(): boolean;
2855
+ /**
2856
+ * Sets exception as a span event
2857
+ * @param exception the exception the only accepted values are string or Error
2858
+ * @param [time] the time to set as Span's event time. If not provided,
2859
+ * use the current time.
2860
+ */
2861
+ recordException(exception: Exception, time?: TimeInput): void;
2862
+ }
2863
+ /**
2864
+ * @since 1.0.0
2865
+ */
2866
+ declare enum SpanKind {
2867
+ /** Default value. Indicates that the span is used internally. */
2868
+ INTERNAL = 0,
2869
+ /**
2870
+ * Indicates that the span covers server-side handling of an RPC or other
2871
+ * remote request.
2872
+ */
2873
+ SERVER = 1,
2874
+ /**
2875
+ * Indicates that the span covers the client-side wrapper around an RPC or
2876
+ * other remote request.
2877
+ */
2878
+ CLIENT = 2,
2879
+ /**
2880
+ * Indicates that the span describes producer sending a message to a
2881
+ * broker. Unlike client and server, there is no direct critical path latency
2882
+ * relationship between producer and consumer spans.
2883
+ */
2884
+ PRODUCER = 3,
2885
+ /**
2886
+ * Indicates that the span describes consumer receiving a message from a
2887
+ * broker. Unlike client and server, there is no direct critical path latency
2888
+ * relationship between producer and consumer spans.
2889
+ */
2890
+ CONSUMER = 4,
2891
+ }
2892
+ /**
2893
+ * Options needed for span creation
2894
+ *
2895
+ * @since 1.0.0
2896
+ */
2897
+ interface SpanOptions {
2898
+ /**
2899
+ * The SpanKind of a span
2900
+ * @default {@link SpanKind.INTERNAL}
2901
+ */
2902
+ kind?: SpanKind;
2903
+ /** A span's attributes */
2904
+ attributes?: Attributes;
2905
+ /** {@link Link}s span to other spans */
2906
+ links?: Link[];
2907
+ /** A manually specified start time for the created `Span` object. */
2908
+ startTime?: TimeInput;
2909
+ /** The new span should be a root span. (Ignore parent from context). */
2910
+ root?: boolean;
2911
+ }
2912
+ /**
2913
+ * Tracer provides an interface for creating {@link Span}s.
2914
+ *
2915
+ * @since 1.0.0
2916
+ */
2917
+ interface Tracer {
2918
+ /**
2919
+ * Starts a new {@link Span}. Start the span without setting it on context.
2920
+ *
2921
+ * This method do NOT modify the current Context.
2922
+ *
2923
+ * @param name The name of the span
2924
+ * @param [options] SpanOptions used for span creation
2925
+ * @param [context] Context to use to extract parent
2926
+ * @returns Span The newly created span
2927
+ * @example
2928
+ * const span = tracer.startSpan('op');
2929
+ * span.setAttribute('key', 'value');
2930
+ * span.end();
2931
+ */
2932
+ startSpan(name: string, options?: SpanOptions, context?: Context): Span;
2933
+ /**
2934
+ * Starts a new {@link Span} and calls the given function passing it the
2935
+ * created span as first argument.
2936
+ * Additionally the new span gets set in context and this context is activated
2937
+ * for the duration of the function call.
2938
+ *
2939
+ * @param name The name of the span
2940
+ * @param [options] SpanOptions used for span creation
2941
+ * @param [context] Context to use to extract parent
2942
+ * @param fn function called in the context of the span and receives the newly created span as an argument
2943
+ * @returns return value of fn
2944
+ * @example
2945
+ * const something = tracer.startActiveSpan('op', span => {
2946
+ * try {
2947
+ * do some work
2948
+ * span.setStatus({code: SpanStatusCode.OK});
2949
+ * return something;
2950
+ * } catch (err) {
2951
+ * span.setStatus({
2952
+ * code: SpanStatusCode.ERROR,
2953
+ * message: err.message,
2954
+ * });
2955
+ * throw err;
2956
+ * } finally {
2957
+ * span.end();
2958
+ * }
2959
+ * });
2960
+ *
2961
+ * @example
2962
+ * const span = tracer.startActiveSpan('op', span => {
2963
+ * try {
2964
+ * do some work
2965
+ * return span;
2966
+ * } catch (err) {
2967
+ * span.setStatus({
2968
+ * code: SpanStatusCode.ERROR,
2969
+ * message: err.message,
2970
+ * });
2971
+ * throw err;
2972
+ * }
2973
+ * });
2974
+ * do some more work
2975
+ * span.end();
2976
+ */
2977
+ startActiveSpan<F extends (span: Span) => unknown>(name: string, fn: F): ReturnType<F>;
2978
+ startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, fn: F): ReturnType<F>;
2979
+ startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, context: Context, fn: F): ReturnType<F>;
2980
+ }
2981
+ interface OtelPluginOptions {
2982
+ /**
2983
+ * Rename incoming `project:target` IDs before they become OTel
2984
+ * span names. Defaults to passing the id through unchanged.
2985
+ */
2986
+ renameSpan?: (task: Task) => string;
2987
+ /** Tracer used to emit spans. Pass the one from `@opentelemetry/api`'s `trace.getTracer("vis")`. */
2988
+ tracer: Tracer;
2989
+ }
2990
+ /**
2991
+ * Reference plugin that maps vis hook lifecycle events to OTel spans.
2992
+ *
2993
+ * Emits:
2994
+ * - one **root span** named `vis.run` spanning `run:before` → `run:after`
2995
+ * - one **child span** per task spanning `task:before` → `task:after`
2996
+ * with attributes `vis.task.id`, `vis.task.project`, `vis.task.target`,
2997
+ * `vis.task.cache_status`, `vis.task.exit_code`
2998
+ * - `task:failure` sets span status to ERROR and records the exit code
2999
+ *
3000
+ * Streaming stdout/stderr events are intentionally **not** emitted as
3001
+ * span events — high-frequency chunks would blow up OTel backends. Use
3002
+ * a log exporter if you need stream-level visibility.
3003
+ * @example
3004
+ * ```ts
3005
+ * import { trace } from "@opentelemetry/api";
3006
+ * import { defineConfig } from "@visulima/vis/config";
3007
+ * import { otelPlugin } from "@visulima/vis/plugins/otel";
3008
+ *
3009
+ * const tracer = trace.getTracer("vis", "1.0.0");
3010
+ *
3011
+ * export default defineConfig({
3012
+ * plugins: [otelPlugin({ tracer })],
3013
+ * });
3014
+ * ```
3015
+ */
3016
+ declare const otelPlugin: (options: OtelPluginOptions) => VisPlugin;
3017
+ /**
3018
+ * Type-safe helper for defining a vis plugin. Pure identity — exists
3019
+ * only so plugin authors get inference from the `VisPlugin` contract
3020
+ * without needing a `satisfies` annotation.
3021
+ *
3022
+ * Lives in its own module so plugins can import it without going
3023
+ * through `config.ts`, which re-exports plugins like `otelPlugin` and
3024
+ * would otherwise form an import cycle.
3025
+ */
3026
+ declare const definePlugin: (plugin: VisPlugin) => VisPlugin;
3027
+ /** Supported config file names, checked in priority order. */
3028
+ declare const CONFIG_FILES: string[];
3029
+ /** Per-package overlay file names, checked in priority order. */
3030
+ declare const TASK_CONFIG_FILES: string[];
3031
+ /**
3032
+ * Default `security.policies.firstSeen.minutes` applied by `vis init`.
3033
+ * 2 days — long enough to filter out most rage-published malware while
3034
+ * staying short enough that genuine fixes still land in a working week.
3035
+ *
3036
+ * Note: this is NOT merged into `SECURITY_DEFAULTS` — leaving it undefined
3037
+ * preserves the "no opinion" semantics that downstream drift checks rely
3038
+ * on. `vis init` writes the value explicitly into the generated config.
3039
+ */
3040
+
3041
+ /**
3042
+ * Secure-by-default security settings based on npm supply chain best practices.
3043
+ *
3044
+ * Applied automatically when using `defineConfig()` or `loadVisConfig()`.
3045
+ * Users can override any value — their settings always take precedence.
3046
+ * @see https://github.com/lirantal/awesome-npm-security-best-practices
3047
+ */
3048
+ declare const SECURITY_DEFAULTS: NonNullable<VisConfig["security"]>;
3049
+ /**
3050
+ * Apply secure defaults to a raw config object.
3051
+ * Merges `SECURITY_DEFAULTS` into `config.security`, preserving all user overrides.
3052
+ */
3053
+ declare const applyDefaults: (config: VisConfig) => VisConfig;
3054
+ /**
3055
+ * Find the vis config file in a directory.
3056
+ *
3057
+ * Reads the directory listing once and intersects it with the known
3058
+ * config filenames rather than `stat`-ing each candidate — one syscall
3059
+ * instead of up to six. Priority order is preserved via
3060
+ * `CONFIG_FILES` so `.ts` still wins over `.mjs` when both exist.
3061
+ * @param directory The directory to search in.
3062
+ * @returns The absolute path to the config file, or `undefined` if not found.
3063
+ */
3064
+ declare const findVisConfigFile: (directory: string) => string | undefined;
3065
+ /**
3066
+ * Find the per-package `vis.task.ts` overlay in a project directory.
3067
+ * Same single-readdir lookup pattern as {@link findVisConfigFile}.
3068
+ */
3069
+ declare const findVisTaskConfigFile: (projectDirectory: string) => string | undefined;
3070
+ /**
3071
+ * Load the vis configuration from a `vis.config.ts` (or `.js`, `.mjs`, `.cjs`, `.mts`, `.cts`) file.
3072
+ *
3073
+ * Resolves the entire `extends` chain, post-order, and folds it into a
3074
+ * single merged config (extends first, root last — child wins). The
3075
+ * cache key covers every file in the chain, so editing any extended
3076
+ * file invalidates the cache.
3077
+ *
3078
+ * Falls back to secure defaults if no config file is found.
3079
+ * @param workspaceRoot The workspace root directory to search for the config file.
3080
+ * @param options Optional loader options.
3081
+ * @param options.explicitConfigPath Overrides discovery — used by the
3082
+ * global `--config` flag so users can point at any file regardless of
3083
+ * cwd. The path must exist; otherwise an error is thrown so the
3084
+ * config-loader plugin can surface it to the user.
3085
+ * @returns The loaded and resolved configuration with secure defaults applied.
3086
+ */
3087
+ declare const loadVisConfig: (workspaceRoot: string, options?: {
3088
+ explicitConfigPath?: string;
3089
+ }) => Promise<VisConfig>;
3090
+ /**
3091
+ * Load the per-package `vis.task.ts` overlay for a project, if any.
3092
+ *
3093
+ * Returns `undefined` when no overlay file exists. Otherwise compiles
3094
+ * the file via jiti and caches the result under
3095
+ * `node_modules/.cache/vis/task-configs/&lt;project>.json`, keyed by the
3096
+ * file's content hash. Editing one project's overlay does not invalidate
3097
+ * the root config cache.
3098
+ *
3099
+ * Errors thrown by the file are wrapped in `VisConfigLoadError` so the
3100
+ * source path is reported instead of an opaque workspace.ts failure.
3101
+ * @param workspaceRoot Absolute workspace root path (cache scope).
3102
+ * @param projectDirectory Absolute path of the project to probe.
3103
+ * @param projectName Project identifier — used to scope the cache file.
3104
+ */
3105
+ declare const loadVisTaskConfig: (workspaceRoot: string, projectDirectory: string, projectName: string) => Promise<VisTaskConfig | undefined>;
3106
+ /**
3107
+ * Type-safe helper for defining a per-package `vis.task.ts` overlay.
3108
+ * Pure identity — exists only so users get type inference and
3109
+ * autocomplete from the `VisTaskConfig` shape.
3110
+ * @example
3111
+ * ```typescript
3112
+ * // packages/api/crud/vis.task.ts
3113
+ * import { defineTaskConfig } from "@visulima/vis/config";
3114
+ *
3115
+ * export default defineTaskConfig({
3116
+ * targets: {
3117
+ * build: {
3118
+ * inputs: ["@inherit", "src/proto/**\/*.proto"],
3119
+ * outputs: ["dist/**\/*"],
3120
+ * },
3121
+ * },
3122
+ * });
3123
+ * ```
3124
+ */
3125
+ declare const defineTaskConfig: (config: VisTaskConfig) => VisTaskConfig;
3126
+ /**
3127
+ * Type-safe helper for defining vis configuration.
3128
+ *
3129
+ * Pure typed-identity — returns its argument unchanged. The point is purely
3130
+ * editor autocomplete and structural type-checking on the literal you pass
3131
+ * in. Secure defaults are applied by `loadVisConfig` at load time, not here,
3132
+ * so wrapping vs. using `satisfies VisConfig` produces the exact same
3133
+ * runtime behavior. To see the active defaults, run `vis check --security-config`.
3134
+ * @example
3135
+ * ```typescript
3136
+ * // vis.config.ts — minimal config, fully secured by defaults
3137
+ * import { defineConfig } from "@visulima/vis/config";
3138
+ *
3139
+ * export default defineConfig({
3140
+ * security: {
3141
+ * policies: {
3142
+ * installScripts: {
3143
+ * allow: {
3144
+ * esbuild: true,
3145
+ * "@prisma/client": true,
3146
+ * },
3147
+ * },
3148
+ * },
3149
+ * },
3150
+ * });
3151
+ * ```
3152
+ */
3153
+ declare const defineConfig: (config: VisConfig) => VisConfig;
3154
+ export { CONFIG_FILES, type OtelPluginOptions, SECURITY_DEFAULTS, TASK_CONFIG_FILES, type VisConfig, type VisHooks, type VisPlugin, type VisTaskConfig, applyDefaults, defineConfig, definePlugin, defineTaskConfig, findVisConfigFile, findVisTaskConfigFile, loadVisConfig, loadVisTaskConfig, otelPlugin };