dev_prune/constants.rs
1// Copyright 2026 VKrishna04
2// SPDX-License-Identifier: Apache-2.0
3
4// Centralized application constants and default configurations.
5//
6// Serves as the single source of truth for app metadata, versioning,
7// default thresholds, and file paths.
8
9/// Application crate version derived dynamically from `Cargo.toml`.
10pub const VERSION: &str = env!("CARGO_PKG_VERSION");
11
12/// Minimum supported Rust version, derived dynamically from `rust-version` in
13/// `Cargo.toml` — which is the single source of truth for the MSRV. Only `cargo
14/// install` users ever meet it; every other channel ships a prebuilt binary.
15pub const MSRV: &str = env!("CARGO_PKG_RUST_VERSION");
16
17/// Application name.
18pub const APP_NAME: &str = "dev-prune";
19
20/// Author of dev-prune.
21pub const AUTHOR: &str = "VKrishna04";
22
23/// Canonical source repository.
24///
25/// The one in `Cargo.toml` is only visible to people who already found the crate. This
26/// one is compiled into the binary, so a copy of the executable still says where it came
27/// from.
28pub const REPO_URL: &str = "https://github.com/Life-Experimentalist/dev-prune";
29
30/// Project homepage.
31pub const HOMEPAGE_URL: &str = "https://devprune.vkrishna04.me";
32
33/// The one-line credit printed under interactive output.
34///
35/// Deliberately plain text in plain sight: it is not obfuscated, not assembled at
36/// runtime, and not checked anywhere. Anyone may fork this project and change this line
37/// — the Apache-2.0 licence says so, and nothing in the code argues. It exists so that
38/// the common case, someone running the published binary, shows where it came from.
39pub const ATTRIBUTION_LINE: &str =
40 "dev-prune · made with ♥ by VKrishna04 · github.com/Life-Experimentalist/dev-prune";
41
42/// The body of `devp --version`.
43///
44/// Built at runtime rather than with `concat!`, which only takes literals and would mean
45/// spelling the author and the URL a second time. Two copies of a string are two things
46/// that can disagree, and this one exists precisely so that a stray copy of the binary
47/// can still be traced back.
48pub static LONG_VERSION: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| {
49 format!(
50 "{VERSION}\n\
51 author: {AUTHOR}\n\
52 repository: {REPO_URL}\n\
53 homepage: {HOMEPAGE_URL}\n\
54 license: Apache-2.0"
55 )
56});
57
58/// How many prune passes `devp stats` keeps a summary of.
59///
60/// The registry is rewritten in full on every save, so this list is a file-size decision
61/// as much as a display one. Fifty passes is roughly a year of a fortnightly schedule.
62pub const PRUNE_HISTORY_LIMIT: usize = 50;
63
64/// How many restore measurements one adapter's throughput average is worth.
65///
66/// Past this, the running totals are halved before the new sample is added, so the
67/// average follows the machine rather than remembering a disk it no longer has. A plain
68/// lifetime mean would quote a spinning-rust number years after the SSD went in.
69pub const RESTORE_RATE_SAMPLE_CAP: u32 = 20;
70
71/// The shortest restore worth learning a throughput from, in milliseconds.
72///
73/// A restore that returned in under this is a manager deciding it had nothing to do —
74/// the packages were still in its cache, or already on disk. Averaging those in would
75/// claim a rate no cold restore can reach.
76pub const RESTORE_RATE_MIN_MILLIS: u64 = 250;
77
78/// The release that started recording per-repository totals and the pass history.
79///
80/// A machine that pruned for months on 1.0.0 has a large lifetime total and no history at
81/// all, and reading that as "nothing was ever pruned here" would be wrong. Both `devp
82/// stats` and its `--json` document quote this version so the gap is explained rather than
83/// looking like data loss. It is deliberately not [`VERSION`]: it names the release the
84/// format changed in, and does not move again.
85pub const HISTORY_STARTS_AT: &str = "1.1.0";
86
87/// Default idle threshold in days before a repository is eligible for pruning.
88pub const DEFAULT_IDLE_DAYS: u64 = 15;
89
90/// Default idle threshold for *build-tree* directories, in days.
91///
92/// Applies to every adapter that answers [`crate::adapters::PackageManager::opt_in`].
93/// Deliberately longer than [`DEFAULT_IDLE_DAYS`],
94/// because those directories come back by recompiling the whole project rather than by
95/// re-downloading a dependency tree, so the bar for "nobody will miss this" sits
96/// higher. The engine applies `max(build_idle_days, idle_days)`.
97///
98/// Three times the dependency window and no more: 60 days was long enough that a
99/// project touched once a quarter never became a candidate at all, which is not
100/// caution, it is the feature never firing.
101pub const DEFAULT_BUILD_IDLE_DAYS: u64 = 45;
102
103/// The per-manager cache size cap `devp config wizard` offers, in gibibytes.
104///
105/// Not a default: `cache_max_gb` is empty until someone puts a number in it, and an
106/// empty map means no cache is ever called too big. This is only the figure the wizard
107/// pre-fills and the docs recommend, and 10 GiB is where it sits because that is the
108/// size at which a download cache stops being a time-saver and starts being the largest
109/// directory on the disk — a `uv` cache measured on the author's machine had passed it
110/// while every project it served fit in a tenth of that.
111pub const RECOMMENDED_CACHE_MAX_GB: u64 = 10;
112
113/// One gibibyte, for turning `cache_max_gb` into the byte count a cache is measured in.
114pub const BYTES_PER_GIB: u64 = 1024 * 1024 * 1024;
115
116/// Shown while `devp trust` and the configurator ask the OS about the scheduler and
117/// Git hooks, then overwritten in place. Kept here because its width is what the
118/// erase writes over, so the two must not be able to drift apart.
119pub const READING_MACHINE: &str = "Reading this machine (scheduler, Git hooks)...";
120
121/// Default interval in days between background daemon prune runs.
122pub const DEFAULT_CHECK_INTERVAL_DAYS: u64 = 2;
123
124/// Whether the setup pass installs the OS scheduler.
125///
126/// On. A pruner that has to be remembered is a pruner that never runs; the scheduled
127/// pass is the product, not an extra. It is still bounded by everything an interactive
128/// run is bounded by — idle threshold, lockfile verification, per-repo opt-outs — and
129/// `devp daemon uninstall` (or `devp config set auto_daemon false`) removes it.
130pub const DEFAULT_AUTO_DAEMON: bool = true;
131
132/// Whether the setup pass installs the global Git auto-registration hooks.
133///
134/// On, but conditionally: installation is skipped, not forced, when `core.hooksPath`
135/// already belongs to husky, pre-commit or lefthook.
136pub const DEFAULT_AUTO_HOOKS: bool = true;
137
138/// Whether dev-prune installs its missing integrations by itself.
139///
140/// On. The pass runs once per installed version — on first run, and again after an
141/// upgrade — and only creates what is absent. Set to `false`, or export
142/// `DEV_PRUNE_NO_AUTO_SETUP`, to manage the integrations entirely by hand.
143///
144/// The environment variable is symmetric: with it set, `devp uninstall` leaves those
145/// same hand-managed integrations — the scheduler, the agent skills, the install
146/// directories guessed from the home folder — alone too, and says so. "Entirely by
147/// hand" has to include the removal, or the variable's promise only holds until the
148/// day you uninstall.
149pub const DEFAULT_AUTO_SETUP: bool = true;
150
151/// Default for whether `link` and `init` write a `.devprune.json` into repositories
152/// they register.
153///
154/// Off: most repositories are fine on the defaults, and a config file dropped into
155/// every repo is litter. The setting exists for people who tune repositories
156/// individually often enough that creating the file by hand every time is the chore.
157pub const DEFAULT_AUTO_CONFIG: bool = false;
158
159/// Default setting for requiring interactive confirmation before pruning.
160pub const DEFAULT_REQUIRE_CONFIRMATION: bool = true;
161
162/// Default size floor, in MiB, below which a bloat directory is left alone.
163///
164/// Zero — every recognised directory is a candidate. Raising it trades a little disk
165/// space for fewer reinstalls: deleting a 3 MiB `node_modules` costs a full `npm ci`
166/// and reclaims almost nothing.
167pub const DEFAULT_MIN_SIZE_MB: u64 = 0;
168
169/// How far below a repository root project discovery descends, by default.
170///
171/// Six covers `packages/scope/name/…` monorepo layouts with room to spare while keeping
172/// the walk bounded on repositories with deep source trees. Configurable with
173/// `devp config set scan_depth`, and per repository with `"scan_depth"` in
174/// `.devprune.json`, because "deep enough" is a property of the layout, not of the tool.
175pub const DEFAULT_SCAN_DEPTH: usize = 6;
176
177/// Upper bound accepted for `scan_depth`.
178///
179/// Not a matter of taste. The walk is breadth-first over every directory that is not
180/// excluded, so cost grows with the tree, and a repository with a deep generated tree
181/// (a Bazel `bazel-out`, a `.terraform` provider cache) can turn an unbounded walk into
182/// a multi-minute stall on a background pass nobody is watching.
183pub const MAX_SCAN_DEPTH_LIMIT: usize = 32;
184
185/// Ceiling on the threads `devp status` uses to size repositories.
186///
187/// The scan is one independent file-system walk per repository, so it is bound by the
188/// disk rather than the CPU and oversubscribing the cores is what makes it fast. The
189/// ceiling exists anyway: past this point a spinning disk spends its time seeking
190/// between trees instead of reading them, and a laptop under a background pass should
191/// still be usable.
192pub const STATUS_SCAN_MAX_THREADS: usize = 32;
193
194/// Threads per reported core for the status scan. Above one because the scan waits on
195/// the disk far more than on the CPU; well below what the disk will queue, because past
196/// that point the extra threads only take turns.
197pub const STATUS_SCAN_THREADS_PER_CORE: usize = 2;
198
199/// Overrides the computed status-scan thread count. Clamped to
200/// [`STATUS_SCAN_MAX_THREADS`]; `1` forces a sequential scan.
201pub const STATUS_SCAN_THREADS_ENV: &str = "DEV_PRUNE_SCAN_THREADS";
202
203/// How many lines of a failed command's output are relayed into a report.
204///
205/// A failing `npm ci` prints its whole usage screen. Six lines is enough for the error
206/// and its cause, and short enough that the prune report around it is still readable;
207/// the rest is reachable through the log file the condensed output still names.
208pub const TOOL_OUTPUT_MAX_LINES: usize = 6;
209
210/// Directory names that mean "the contents of this are disposable".
211///
212/// Matched against a repository's *ancestors*, never against the repository directory
213/// itself: a project may legitimately be called `cache`, but a checkout sitting inside
214/// one is something a tool put there. Editor and agent plugin managers clone into
215/// directories like `~/.claude/plugins/cache/temp_git_<id>`, which is nowhere near the OS
216/// temp directory and is deleted just as fast; twenty-eight of those reached one
217/// registry before this list existed.
218pub const EPHEMERAL_ANCESTORS: &[&str] = &["cache", ".cache", "Cache", "Caches", "tmp", ".tmp"];
219
220/// Repository directory *names* that mean the same thing, wherever they are.
221///
222/// The ancestor list above only catches a throwaway clone that a tool was polite enough
223/// to put under a directory called `cache`. These prefixes catch the clone itself:
224/// `temp_git_1787245534782` is a checkout some plugin manager made, named after the
225/// millisecond it made it, and it will be gone before the next prune pass. Registering
226/// one strands a dead entry in the registry the moment the tool cleans up after itself.
227///
228/// A prefix rather than a substring, and deliberately narrow: `temporary-fixes` and
229/// `my-temp-git-notes` are real repositories somebody named badly, and refusing to track
230/// a real workspace is the worse of the two errors.
231pub const EPHEMERAL_REPO_PREFIXES: &[&str] = &["temp_git_", "tmp_git_"];
232
233/// Whether an adapter whose sync command edits tracked manifests may run it.
234///
235/// Off. `cargo generate-lockfile` re-resolves every dependency and rewrites
236/// `Cargo.lock`; `go mod tidy` edits `go.mod` and `go.sum` and can drop requirements.
237/// A cleanup tool that silently changes files Git tracks has done something the user
238/// did not ask for, so these run read-only and this switch is the informed opt-in.
239pub const DEFAULT_ALLOW_MANIFEST_REWRITE: bool = false;
240
241/// Whether the setup pass installs the Git hooks in front of another tool's.
242///
243/// Off. Chaining is behaviour-preserving — every hook is forwarded on and
244/// `devp hook uninstall` restores the original `core.hooksPath` — but it still rewires
245/// somebody else's Git configuration, which is not a thing to do unasked. Turn it on
246/// with `devp config set auto_hooks_chain true`, or do it once with
247/// `devp hook install --chain`.
248pub const DEFAULT_AUTO_HOOKS_CHAIN: bool = false;
249
250/// GitHub releases page, shown whenever an upgrade is relevant.
251pub const RELEASES_URL: &str = "https://github.com/Life-Experimentalist/dev-prune/releases";
252
253/// The shell installer, printed as an upgrade command and re-run by `devp update
254/// --install` when the running binary came from it.
255pub const INSTALL_SH_URL: &str = "https://devprune.vkrishna04.me/install.sh";
256
257/// The PowerShell installer — same two callers as [`INSTALL_SH_URL`].
258pub const INSTALL_PS1_URL: &str = "https://devprune.vkrishna04.me/install.ps1";
259
260/// GitHub API endpoint for the latest published release.
261///
262/// Contacted by `devp update`, by the interval-gated check behind `run`/`status`/`init`
263/// (off via `update_check false` or `DEV_PRUNE_OFFLINE`), and by the one-time
264/// extension-install offer's `.vsix` fallback. See the network policy in
265/// `docs/PRIVACY.md`.
266pub const LATEST_RELEASE_API_URL: &str =
267 "https://api.github.com/repos/Life-Experimentalist/dev-prune/releases/latest";
268
269/// Where a release's assets live, with `{tag}` standing in for `v1.4.0`.
270///
271/// Used by `devp update --install` to fetch the uncompressed binary and its `.sha256`
272/// sidecar. Deliberately the plain `releases/download` path rather than an API endpoint:
273/// it needs no token, is not rate-limited per-IP the way `api.github.com` is, and is the
274/// same URL a person would click on the release page.
275pub const RELEASE_DOWNLOAD_BASE: &str =
276 "https://github.com/Life-Experimentalist/dev-prune/releases/download";
277
278/// The release-asset name for one platform, without the `.sha256` suffix.
279///
280/// This is a contract with the packaging steps in `.github/workflows/release.yml`, which
281/// build these exact names. A mismatch is not a compile error and not a test failure —
282/// it is a self-update that 404s on the day of a release — so the two are commented as
283/// referring to each other.
284///
285/// `None` on a platform the release does not build for, which is how a source build on,
286/// say, FreeBSD declines the direct route instead of downloading a Linux binary.
287pub fn release_asset_name(version: &str) -> Option<String> {
288 let os = match std::env::consts::OS {
289 "windows" => "windows",
290 "macos" => "darwin",
291 "linux" => "linux",
292 _ => return None,
293 };
294 // The release publishes `x64`/`arm64`/`x86`, not Rust's target-arch spellings.
295 let arch = match std::env::consts::ARCH {
296 "x86_64" => "x64",
297 "aarch64" => "arm64",
298 "x86" => "x86",
299 _ => return None,
300 };
301 // Only Windows ships a 32-bit build; on any other OS `x86` has no asset.
302 if arch == "x86" && os != "windows" {
303 return None;
304 }
305 let ext = if os == "windows" { ".exe" } else { "" };
306 Some(format!("dev-prune-v{version}-{os}-{arch}{ext}"))
307}
308
309/// Whether the periodic release check runs. On by default — see `Settings::update_check`.
310pub const DEFAULT_UPDATE_CHECK: bool = true;
311
312/// Whether a known-newer release installs itself at the end of a prune pass. On by
313/// default — see `Settings::auto_update`.
314pub const DEFAULT_AUTO_UPDATE: bool = true;
315
316/// Whether the installed version is pinned where it is. Off by default, and the only
317/// setting that outranks every other update path -- see `Settings::version_lock`.
318pub const DEFAULT_VERSION_LOCK: bool = false;
319
320/// Default interval, in days, between automatic release checks.
321///
322/// A week. Frequent enough that a security fix is not missed for long, rare enough that
323/// it is invisible in day-to-day use. Override with
324/// `devp config set update_check_interval_days`.
325pub const UPDATE_CHECK_INTERVAL_DAYS: i64 = 7;
326
327/// Default timeout for the release check. Short on purpose — this is a convenience,
328/// and a user waiting on a hung socket is worse than not knowing. Override with
329/// `devp config set update_check_timeout_secs` when a proxy needs longer.
330pub const UPDATE_CHECK_TIMEOUT_SECS: u64 = 5;
331
332/// Timeout for downloading a release binary in `devp update --install`.
333///
334/// Far longer than [`UPDATE_CHECK_TIMEOUT_SECS`], which only reads a few hundred bytes
335/// of JSON: this pulls several megabytes, and a slow connection is not an error.
336pub const UPDATE_DOWNLOAD_TIMEOUT_SECS: u64 = 300;
337
338/// Name of the registry JSON file.
339pub const REGISTRY_FILENAME: &str = "registry.json";
340
341/// Config directory name under user config root.
342pub const CONFIG_DIR_NAME: &str = "dev-prune";
343
344/// Global environment variable name to override config directory location.
345pub const ENV_CONFIG_DIR_OVERRIDE: &str = "DEV_PRUNE_CONFIG_DIR";
346
347/// Environment variable that suppresses the automatic setup pass entirely.
348///
349/// For images, CI and anyone who wants the binary and nothing else. `devp setup` still
350/// works when it is set — this only governs the unattended pass.
351pub const ENV_NO_AUTO_SETUP: &str = "DEV_PRUNE_NO_AUTO_SETUP";
352
353/// Environment variable that keeps the process off the network entirely — the release
354/// check and the extension-download fallback alike. Set by the test suites, useful on
355/// air-gapped machines; the durable per-user switch is
356/// `devp config set update_check false`.
357pub const ENV_OFFLINE: &str = "DEV_PRUNE_OFFLINE";
358
359/// Environment variable that stops both install scripts from asking anything.
360///
361/// The scripts offer to migrate a copy another package manager owns, and `devp install
362/// --channel installer` re-runs the script that made the offer. Without this the offer
363/// would be made again by that inner run, to a user who has already answered it — the
364/// same copy is still on PATH until the uninstall at the end. It is also the switch for
365/// a provisioning script that wants the install and none of the conversation.
366///
367/// Read by `scripts/install.sh`, `scripts/install.ps1`, and set by
368/// `src/commands/install.rs` on the child it spawns.
369pub const ENV_NO_MIGRATE_PROMPT: &str = "DEV_PRUNE_NO_MIGRATE_PROMPT";
370
371/// The install receipt, written beside the managed binary by whichever installer put it
372/// there. See [`crate::receipt`].
373///
374/// Also written by `scripts/install.sh` and `scripts/install.ps1`, by hand, in their own
375/// languages — which is why the field names have a test of their own.
376pub const INSTALL_RECEIPT_FILE: &str = "install.json";
377
378/// Set to any value to keep every full-screen view from opening, so the line-by-line
379/// fallback runs instead.
380///
381/// For agents and wrappers that hold a real terminal — the terminal test alone cannot
382/// tell them apart from a person, and a full-screen view waiting on a keypress from
383/// something that will never send one is a hang.
384pub const ENV_NO_TUI: &str = "DEV_PRUNE_NO_TUI";
385
386/// Windows environment variable that carries the *machine's* architecture when the
387/// running process is emulated.
388///
389/// `std::env::consts::ARCH` is baked in at compile time and only ever describes the
390/// binary. Windows sets this one under WOW64 and under ARM64 emulation, which is the
391/// only way a 32-bit build can tell that it is running on a 64-bit machine.
392/// `scripts/install.ps1` reads the same variable to choose which asset to download.
393pub const ENV_NATIVE_ARCH: &str = "PROCESSOR_ARCHITEW6432";
394
395/// Filename that, when present in a repo root, causes dev-prune to skip that repo entirely.
396///
397/// Create this file with: `touch ignore.devprune.json`
398pub const DEVPRUNE_IGNORE_FILE: &str = "ignore.devprune.json";
399
400/// Default timeout in seconds for lockfile enforcement / CLI commands (10 minutes).
401pub const DEFAULT_COMMAND_TIMEOUT_SECS: u64 = 600;
402
403/// Directory name pnpm gives a store it has to put on a volume of its own.
404///
405/// pnpm hardlinks its store into every `node_modules` it fills, and a hardlink cannot
406/// cross a filesystem. A project on a filesystem that is not the home directory's
407/// therefore gets a store at the root of *its* filesystem instead — `V:\\.pnpm-store` on
408/// a second Windows drive, `/mnt/data/.pnpm-store` on Linux, `/Volumes/Work/.pnpm-store`
409/// on macOS. `devp caches` looks for one on every volume that holds a registered
410/// repository, because `pnpm store path` only ever answers for the volume it is run on.
411pub const PNPM_VOLUME_STORE_DIR: &str = ".pnpm-store";
412
413/// Timeout for the "where does your cache live?" queries `devp caches` makes.
414///
415/// Deliberately not `command_timeout_secs`. That ceiling is sized for `npm ci` and
416/// `cargo metadata`; `npm config get cache` prints one line and returns. A query that
417/// has not answered in five seconds is a broken installation, and the report is better
418/// off falling back to the conventional path than waiting ten minutes for it.
419pub const CACHE_QUERY_TIMEOUT_SECS: u64 = 5;
420
421/// Timeout for asking a container engine how much disk it is using.
422///
423/// Longer than [`CACHE_QUERY_TIMEOUT_SECS`], because `docker system df` is not a config
424/// lookup: the daemon walks every image layer, container and build-cache record to
425/// answer it, and on a store with hundreds of images that is genuinely a few seconds. A
426/// daemon that is not running refuses in milliseconds either way, which is the case this
427/// ceiling is not for.
428pub const CONTAINER_QUERY_TIMEOUT_SECS: u64 = 20;
429
430/// Ceiling for one `devp caches clear` step.
431///
432/// Ten minutes, not the five seconds a query gets: `go clean -modcache` and deleting a
433/// multi-gigabyte `~/.gradle/caches` are genuinely slow, and on Windows every file in a
434/// module cache is read-only, so the delete is a chmod-and-unlink per file. A clear that
435/// has not finished in ten minutes is wedged, and killing it leaves a partially emptied
436/// cache the manager refills on its own.
437pub const CACHE_CLEAR_TIMEOUT_SECS: u64 = 600;
438
439/// Documentation URL for troubleshooting lockfile and pruning failures.
440pub const TROUBLESHOOTING_URL: &str = "https://devprune.vkrishna04.me/docs/troubleshooting";
441/// Name of the structured per-repository configuration file stored inside repo roots.
442pub const PER_REPO_CONFIG_FILE: &str = ".devprune.json";
443
444/// Public URL for the JSON Schema used by IDEs for .devprune.json IntelliSense.
445pub const JSON_SCHEMA_URL: &str = "https://devprune.vkrishna04.me/schemas/v1/devprune.schema.json";
446
447/// Directory under the user's home that marks a Claude Code installation.
448///
449/// Its presence is how the setup pass decides the machine has an agent to install the
450/// skill for; the directory itself is only ever created by Claude Code.
451pub const CLAUDE_HOME_DIR: &str = ".claude";
452
453/// Subdirectory of an agent's home where Agent Skills live, one directory per skill.
454pub const AGENT_SKILLS_SUBDIR: &str = "skills";
455
456/// Marketplace identifier (`publisher.name`) of the VS Code extension, as understood
457/// by `code --install-extension`.
458pub const VSCODE_EXTENSION_ID: &str = "VKrishna04.dev-prune";
459
460/// The WinGet package identifier, as published in `packaging/winget/` and in the
461/// manifests submitted to microsoft/winget-pkgs. `devp update` and `devp uninstall` name
462/// it back to the user, so a typo here sends someone to a command that does not resolve.
463pub const WINGET_PACKAGE_ID: &str = "VKrishna04.dev-prune";
464
465/// The Homebrew tap that carries the formula, as `brew tap` takes it. Not homebrew-core:
466/// plain `brew install dev-prune` resolves there, and that has a notability bar this
467/// project has not cleared. See `docs/DISTRIBUTION.md`.
468pub const HOMEBREW_TAP: &str = "Life-Experimentalist/tap";
469
470/// The Scoop bucket name and the repository behind it. `scoop bucket add` takes both,
471/// and the name is what `scoop install` then resolves `dev-prune` against.
472pub const SCOOP_BUCKET_NAME: &str = "life-experimentalist";
473/// Repository URL for [`SCOOP_BUCKET_NAME`].
474pub const SCOOP_BUCKET_URL: &str = "https://github.com/Life-Experimentalist/scoop-bucket";
475
476/// Where a person can read about the extension before installing it.
477///
478/// The offer prints all three. The two registries carry the same build — the release
479/// `.vsix` — but a machine that trusts one may not have the other, and someone who
480/// wants to read the source before letting anything into their editor needs neither.
481pub const VSCODE_MARKETPLACE_URL: &str =
482 "https://marketplace.visualstudio.com/items?itemName=VKrishna04.dev-prune";
483/// The Open VSX listing, which is what VSCodium, Cursor and Windsurf resolve against.
484pub const OPENVSX_URL: &str = "https://open-vsx.org/extension/VKrishna04/dev-prune";
485
486/// Name of the Windows Task Scheduler task the daemon registers.
487pub const WINDOWS_TASK_NAME: &str = "DevPrune";
488/// File name of the windowless scheduler binary — `dev-prune.exe` with its PE subsystem
489/// set to GUI, the same relationship `pythonw.exe` has to `python.exe`. Generated
490/// locally beside the managed binary; never shipped in any archive.
491pub const WINDOWS_HIDDEN_BIN: &str = "devpw.exe";
492/// Marker file (in the config directory) recording that this machine's Task Scheduler
493/// refused the hidden (S4U) task registration, so setup keeps the visible task instead
494/// of retrying the upgrade on every pass.
495pub const SCHEDULER_HIDDEN_REFUSED_MARKER: &str = "scheduler-hidden-refused";
496
497/// Label of the macOS LaunchAgent the daemon registers (also names its plist file).
498pub const MACOS_LAUNCHD_LABEL: &str = "com.devprune.daemon";
499
500/// Where `devp skill --agent cursor` writes the per-repository rules.
501pub const CURSOR_RULES_FILE: &str = ".cursor/rules/dev-prune.mdc";
502
503/// Where `devp skill --agent windsurf` writes the per-repository rules.
504pub const WINDSURF_RULES_FILE: &str = ".windsurf/rules/dev-prune.md";
505
506/// Where `devp skill --agent antigravity` writes the per-repository rules —
507/// Antigravity (Google) reads workspace rules from `.agent/rules/`.
508pub const ANTIGRAVITY_RULES_FILE: &str = ".agent/rules/dev-prune.md";
509
510/// Where `devp skill --agent cline` writes its rules (Cline reads every file in the
511/// `.clinerules/` directory).
512pub const CLINE_RULES_FILE: &str = ".clinerules/dev-prune.md";
513
514/// Where `devp skill --agent agents-md` writes its marked block — the cross-tool
515/// convention read by Codex, Jules, Amp, Antigravity and others.
516pub const AGENTS_MD_FILE: &str = "AGENTS.md";
517
518/// Where `devp skill --agent roo` writes its rules (Roo Code reads every file in
519/// `.roo/rules/`).
520pub const ROO_RULES_FILE: &str = ".roo/rules/dev-prune.md";
521
522/// Where `devp skill --agent kilocode` writes its rules (Kilo Code reads every file in
523/// `.kilocode/rules/`).
524pub const KILOCODE_RULES_FILE: &str = ".kilocode/rules/dev-prune.md";
525
526/// Where `devp skill --agent continue` writes its rules (Continue reads every file in
527/// `.continue/rules/`).
528pub const CONTINUE_RULES_FILE: &str = ".continue/rules/dev-prune.md";
529
530/// Where `devp skill --agent amazon-q` writes its rules (Amazon Q Developer reads every
531/// file in `.amazonq/rules/`).
532pub const AMAZON_Q_RULES_FILE: &str = ".amazonq/rules/dev-prune.md";
533
534/// Where `devp skill --agent kiro` writes its rules (Kiro reads every file in
535/// `.kiro/steering/`).
536pub const KIRO_STEERING_FILE: &str = ".kiro/steering/dev-prune.md";
537
538/// Where `devp skill --agent trae` writes its rules (Trae reads every file in
539/// `.trae/rules/`).
540pub const TRAE_RULES_FILE: &str = ".trae/rules/dev-prune.md";
541
542/// The shared file `devp skill --agent junie` owns a marked block inside — JetBrains
543/// Junie reads one guidelines file, not a directory.
544pub const JUNIE_GUIDELINES_FILE: &str = ".junie/guidelines.md";
545
546/// The shared file `devp skill --agent gemini` owns a marked block inside — the Gemini
547/// CLI reads one context file per repository.
548pub const GEMINI_MD_FILE: &str = "GEMINI.md";
549
550/// The shared file `devp skill --agent zed` owns a marked block inside. Zed reads
551/// `.rules` ahead of every other convention, so a repository that also has an
552/// `AGENTS.md` still needs this one.
553pub const ZED_RULES_FILE: &str = ".rules";
554
555/// The shared file `devp skill --agent aider` owns a marked block inside. Aider is the
556/// one target that does not read its file on its own: `CONVENTIONS.md` is loaded only
557/// by `aider --read CONVENTIONS.md` or a `read: CONVENTIONS.md` line in
558/// `.aider.conf.yml`, which is why writing it prints that instruction.
559pub const AIDER_CONVENTIONS_FILE: &str = "CONVENTIONS.md";
560
561/// The shared file `devp skill --agent copilot` owns a marked block inside.
562pub const COPILOT_INSTRUCTIONS_FILE: &str = ".github/copilot-instructions.md";
563
564/// Markers around the block in [`COPILOT_INSTRUCTIONS_FILE`] that dev-prune manages.
565/// Everything outside them belongs to the user and is never touched.
566pub const RULES_BLOCK_START: &str = "<!-- dev-prune:rules:start -->";
567pub const RULES_BLOCK_END: &str = "<!-- dev-prune:rules:end -->";
568
569/// The phrase Git uses when it refuses a working tree owned by another account.
570///
571/// Matched against Git's own stderr rather than parsed: the message is twelve lines
572/// long, ten of which are identical for every repository refused, and `devp run`
573/// groups every repository sharing this cause under one explanation and one fix
574/// instead of reprinting those ten lines per repository.
575pub const GIT_DUBIOUS_OWNERSHIP: &str = "detected dubious ownership";
576
577/// The phrase Git uses when the path it was pointed at is not a working tree at all.
578///
579/// Same reasoning as [`GIT_DUBIOUS_OWNERSHIP`]: one cause, one fix, one paragraph.
580pub const GIT_NOT_A_REPOSITORY: &str = "not a git repository";