#!/usr/bin/env bash # pnpm rules:catalogue — writes the Worker's MCP catalogue # (apps/business/src/mcp/catalogue.json) and definition keys # (apps/business/src/definition_keys.json) from the Rust: # crates/cotton-tools/src/mcp/object_catalogue.rs over catalogue.rs, and # cotton-core's FIXED_DEFINITION_KEYS / COLUMN_LOOK_KEYS. The same test, run # without the variable, is the drift check. set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" # From crates/, so rustup takes the pinned toolchain (crates/rust-toolchain.toml). cd "$ROOT/crates" COTTON_WRITE_OBJECT_CATALOGUE=1 cargo test -q -p cotton-tools --test object_catalogue