jevhooks.git / mise.toml
1# The toolchain and the tasks of this repository: the one place every tool
2# version lives. Nothing here needs nix or root:
3#
4#     mise trust && mise install      the toolchain (a C compiler and git must exist)
5#     mise tasks                      what can be run
6#     mise run check                  tests, the mod's JavaScript, the daemon, plugin validation
7#
8# `tools/check-versions.sh` (part of `mise run check`) fails when a version
9# written elsewhere (hk.pkl's hk release) differs from the one here. The nix
10# flake only wraps this file; it holds no version of its own.
11min_version = "2026.10.0"
12
13[tools]
14# The daemon natively, and the mod's routing for wasm32.
15rust = { version = "1.99.0", profile = "minimal", components = "rustfmt,clippy", targets = "wasm32-unknown-unknown" }
16# wasm-opt and wasm2js, which turn the mod's wasm into the plugin's JavaScript
17# (a mod's runtime has no WebAssembly). plugin/hooks/jevhooks.js is committed
18# output of this release: moving it rewrites that file.
19"github:WebAssembly/binaryen" = "version_132"
20
21# The jdx tools: git hooks and secrets.
22hk = "2.5.0"
23pkl = "0.32.1"
24fnox = "1.36.0"
25
26# For `mise run screenshots` only: a terminal to run a real session in, and
27# the program that turns what was on it into an SVG.
28tmux = "3.7c"
29"github:charmbracelet/freeze" = "0.2.2"
30
31[env]
32# hk runs its hooks through mise, so a hook finds hk, pkl and cargo whatever the shell of the commit.
33HK_MISE = "1"
34
35# What the tasks read, all optional. No secret is ever put in this file.
36#   TYPESAFE_API_KEY   Jev's key, for `mise run serve`: from the environment, or from fnox (see fnox.toml)
37#   CLAUDE             the Claude Code binary `plugin:validate` and `plugin:test` run (default: claude)
38
39## Setup
40[tasks.submodules]
41description = "Fetch the git submodule (third-party/jevcrates)"
42run = "git submodule update --init --recursive"
43
44[tasks."hooks:install"]
45description = "Install the git hooks (hk.pkl): clippy before a commit, the tests before a push"
46run = "hk install"
47
48## Build
49[tasks.mod]
50description = "Compile the mod's Rust to wasm, shrink it, and translate it to plugin/hooks/jevhooks.js"
51run = [
52  "cargo build --release --target wasm32-unknown-unknown -p jevhooks-mod",
53  "wasm-opt -Oz target/wasm32-unknown-unknown/release/jevhooks_mod.wasm -o target/jevhooks_mod.opt.wasm",
54  "wasm2js -O2 target/jevhooks_mod.opt.wasm -o plugin/hooks/jevhooks.js",
55]
56
57[tasks.daemon]
58description = "Build the jevhooks binary into plugin/bin, where the plugin's .mcp.json starts it"
59run = [
60  "cargo build --release -p jevhooks-daemon",
61  "mkdir -p plugin/bin",
62  "cp target/release/jevhooks plugin/bin/jevhooks.new",
63  "mv -f plugin/bin/jevhooks.new plugin/bin/jevhooks",
64]
65
66## Checks
67[tasks."check-versions"]
68description = "Fail if a version written outside mise.toml differs from it"
69run = "tools/check-versions.sh"
70
71[tasks.clippy]
72description = "cargo clippy over the workspace (an error-level lint fails; warnings are shown)"
73run = "cargo clippy --workspace"
74
75[tasks.test]
76description = "The Rust workspace's tests (no network, no key, no daemon)"
77run = "cargo test --workspace"
78
79[tasks."test:live"]
80description = "Asks the real Jev the questions as worded today (needs the key and the network; about $0.0003)"
81run = "tools/with-secrets.sh cargo test -p jevhooks-daemon -- --ignored live_jev"
82
83[tasks.screenshots]
84description = "Redraws the READMEs' pictures from a real Claude Code session (needs the key, a signed-in claude and a built daemon; costs a few cents)"
85run = "tools/with-secrets.sh tools/screenshots.sh"
86
87[tasks."plugin:validate"]
88description = "Check the plugin the way Claude Code will read it"
89run = '"${CLAUDE:-claude}" plugin validate plugin'
90
91[tasks."plugin:test"]
92description = "The plugin's tests, against a stand-in daemon (needs only Claude Code)"
93run = '"${CLAUDE:-claude}" plugin test plugin'
94
95[tasks.check]
96description = "Versions, the Rust tests, the mod's JavaScript, the daemon, and plugin validation"
97depends = ["check-versions", "test", "mod", "daemon"]
98run = '"${CLAUDE:-claude}" plugin validate plugin'
99
100## The daemon
101[tasks.serve]
102description = "Run the daemon in the foreground (the key from fnox when it is set up, else the environment)"
103run = "tools/with-secrets.sh plugin/bin/jevhooks serve"
104
105[tasks.status]
106description = "Print the running daemon's status"
107run = "plugin/bin/jevhooks status"