calmrun 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ /node_modules
2
+
package/CHANGELOG.md ADDED
@@ -0,0 +1,94 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5
+ [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.2.0] - 2026-11-23
10
+
11
+ ### Added
12
+
13
+ - Detection for builds and tests across ecosystems: C/C++ (make, cmake --build, ctest, ninja,
14
+ meson, bazel, buck2, scons, xmake, compilers), JVM (gradle, maven, mvnd, sbt, ant), .NET
15
+ (dotnet, msbuild), Go, Swift and xcodebuild, Flutter/Dart (incl. build_runner), Ruby,
16
+ PHP (incl. composer test, artisan test), Elixir/Erlang, Haskell, OCaml, Zig, monorepo
17
+ runners (turbo, nx, lerna, pnpm -r, rush, moon) and containers (podman, buildah).
18
+ - New kinds `monorepo` (cost 3), `typecheck` and `lint`; a single compiler call costs 1.
19
+ - Exclusive keys per project folder for these tools (Gradle settings root, `pom.xml`, `*.sln`,
20
+ `Package.swift`, `pubspec.yaml`, …), so two builds of one project never share its output.
21
+ - Worker hints sized to the job's share of the cores for tools that use every core by default:
22
+ `cmake --build --parallel`, `ninja -j`, `meson`, `bazel --jobs`, `buck2 -j`, `dotnet -m`,
23
+ `go -p`, `golangci-lint --concurrency`, `swift -j`, `xcodebuild -jobs`, `flutter/dart test
24
+ --concurrency`, `paratest --processes`, `mix test --max-cases`, `stack`/`cabal`/`dune`/`zig
25
+ -j`, `mvnd -T`, monorepo runner concurrency, `PARALLEL_WORKERS`, `PARALLEL_TEST_PROCESSORS`,
26
+ `MOON_CONCURRENCY`, `DENO_JOBS`, `NEXTEST_TEST_THREADS`, and `pytest -n auto` / `tox -p auto`
27
+ turned into a number. nx, turbo and pnpm are never raised above their own defaults. A flag
28
+ or variable you set yourself always wins. `calmrun doctor` lists them.
29
+ - Gradle `connected*` tasks also take the `emulator` resource.
30
+ - More watch modes refused with their one-shot form (`gradle --continuous`, `dotnet watch`,
31
+ `turbo watch`, `mix test.watch`, `parcel watch`, `sbt ~`, `cargo watch`, …), and more dev
32
+ servers and app runs started outside the queue (`turbo run dev`, `nx serve`, `make dev`,
33
+ `bootRun`, `spring-boot:run`, `rails server`, `zig build run`, …).
34
+ - Launchers `bundle exec`, `dotnet tool run` and `xcrun` are seen through.
35
+
36
+ ### Changed
37
+
38
+ - Releases publish the npm package from CI through npm trusted publishing (with provenance).
39
+ - Dev servers and other commands that run outside the queue keep their arguments unchanged,
40
+ and the Claude Code hook no longer wraps them.
41
+ - The Claude Code hook follows the runner's command rules: a watch mode gets its one-shot form
42
+ (`npx vitest` → `calmrun -- npx vitest run`, `docker compose up` → `… up -d`), and one
43
+ without such a form (`sbt shell`, `cargo watch`) is left alone instead of being sent to a
44
+ calmrun that refuses it.
45
+
46
+ ## [0.1.0] - 2026-11-23
47
+
48
+ ### Added
49
+
50
+ - `calmrun -- <command>`: a machine-wide queue for heavy commands, with a point budget, a
51
+ free-RAM gate, first-come order with limited passing, `--prio high`, and exclusive keys per
52
+ `node_modules` / Cargo `target` folder.
53
+ - Kind detection for vitest, jest, tsc, Playwright-style capture, docker, eslint-style linters,
54
+ pytest, builds and test runners, with default costs and a `[kinds]` config table.
55
+ - `--maxWorkers` for direct vitest calls; refusal of attached `docker compose up`.
56
+ - Low CPU priority for the command (below-normal class on Windows, `nice +10` on Unix) and
57
+ process-tree cleanup (Job Object on Windows, process group on Unix).
58
+ - `status`, `stats`, `bump`, `doctor`, `init` subcommands and `history.jsonl`.
59
+ - `calmrun hook claude`: a Claude Code PreToolUse hook that sends heavy shell commands
60
+ through calmrun.
61
+ - `--wait-timeout SECS`: exit 75 when not started in time and keep the place in line for 10
62
+ minutes; `--ticket <id>` resumes it. The `next:` line gives the exact command.
63
+ - `calmrun guide`, and `next:` hints on refusals and missing commands.
64
+ - Memory ceiling: a job whose process tree passes `ceiling_gb` (default half the RAM), or the
65
+ biggest job when free RAM stays below `critical_free_gb`, is stopped with exit 137.
66
+ - Disk gate: a job waits while its working directory's drive has less than `min_free_disk_gb`
67
+ (default 5) free; it starts anyway, with a warning, when nothing else runs.
68
+ - `CARGO_BUILD_JOBS` for cargo and `--max-workers` for gradle invoked directly, sized to the
69
+ job's share of the cores.
70
+ - The waiting line names what is running: `running: npx vitest in web (3m10s), …`.
71
+ - `calmrun setup`: a dry-run-by-default writer for the calmrun block in the global instruction
72
+ files of Claude Code, Codex, Gemini CLI and OpenCode (marker comments, re-runnable,
73
+ `--remove`), plus `--hook` to merge the Claude Code hook into `settings.json` with a backup.
74
+ - Named resources: `--needs db` takes a slot of `db` (`[resources] db = 1`, `CALMRUN_RESOURCES`).
75
+ - Separate queues: `--id QUEUE` for running, `status` and `bump` (GNU sem style).
76
+ - Relative programs (`./gradlew`, `tool`) are looked up in the job's working directory, also for
77
+ MCP tasks with a `cwd`.
78
+ - Endless commands (watch modes, attached `docker compose up`, interactive `docker run`) are
79
+ refused with the one-shot form; dev servers and `--help` / `--version` run outside the queue.
80
+ - Safety: bare program names never come from the working directory on Windows; `setup` backs
81
+ up every file it rewrites and refuses non-UTF-8 or unreadable files; a corrupt
82
+ `state.json` is set aside, an unreadable one is an error instead of an empty queue.
83
+ - The RAM gate shares one reading per second across waiters and reserves memory for jobs
84
+ that just started. Unix: the command dies with calmrun (Linux parent-death signal, macOS
85
+ watchdog), Ctrl+Z suspends both, and `calmrun mcp` stops its tasks on SIGTERM.
86
+ - `npx tsc@5`-style package specs are detected; `status` shows places kept by a ticket; the
87
+ hook suggests calmrun's absolute path when it is not on PATH.
88
+ - `calmrun mcp`: an MCP server over stdio with `run_task` (same queue as the CLI, captured
89
+ log, last 200 lines, progress notifications, timeout, cancellation), `queue_status` and
90
+ `bump`.
91
+ - Daemons a command leaves running on purpose (Gradle, Kotlin) survive a normal exit; the
92
+ tree is ended only after Ctrl+C or when calmrun is killed.
93
+ - A command ended by Ctrl+C on Windows exits 130; Ctrl+C works even when the parent started
94
+ calmrun with Ctrl+C disabled.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Van Nguyen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.