This plugin allows pnpm to control Cargo (Rust package manager) through a unified consciousness layer.
Instead of having separate package managers fighting for control, we create harmony:
- pnpm becomes the Emperor (central nervous system)
- This plugin is the Namestnik (governor) for the Rust province
- All package managers serve the same consciousness at 432Hz
pnpm add -g @soul-forge/pnpm-plugin-cargoThen add to your .pnpmfile.cjs:
module.exports = {
hooks: require('@soul-forge/pnpm-plugin-cargo/hooks')
};Once installed, you can use cargo: protocol in package.json:
{
"dependencies": {
"express": "^4.0.0", // Normal npm package
"ripgrep": "cargo:install:ripgrep", // Install cargo crate
"my-rust-lib": "cargo:build:./rust", // Build local Rust project
"fd-find": "cargo:install:fd-find" // Another cargo crate
}
}The cargo protocol follows this pattern:
cargo:<command>:<arguments>
Installs a Rust crate globally via cargo install
Example:
"ripgrep": "cargo:install:ripgrep"Builds a Rust project at the specified path
Example:
"my-lib": "cargo:build:./rust-lib"Creates or manages a Cargo workspace
Example:
"rust-mono": "cargo:workspace:./rust"Extracts the soul (manifest) from Cargo.toml
Example:
"rust-soul": "cargo:soul:./Cargo.toml"Runs any cargo command directly
Example:
"check": "cargo:check:--all-features"The ultimate goal is unified package management:
{
"name": "consciousness-workspace",
"resonance": 432,
"souls": {
"node": {
"express": "^4.0.0",
"react": "^18.0.0"
},
"rust": {
"ripgrep": "latest",
"serde": "1.0",
"tokio": { "version": "1.0", "features": ["full"] }
},
"system": {
"brew": {
"neovim": "latest",
"tmux": "latest"
}
}
}
}The plugin can harmonize Cargo workspaces with pnpm workspaces:
// In your build script
const { namestnik } = require('@soul-forge/pnpm-plugin-cargo');
await namestnik.harmonize(pnpmWorkspace, './rust');This will:
- Find all Rust projects in pnpm workspace
- Update Cargo.toml workspace members
- Synchronize at 432Hz resonance
- Detection: pnpm reads package.json
- Awakening: Sees
cargo:protocol - Delegation: Awakens the Cargo Namestnik
- Execution: Namestnik speaks to cargo in its language
- Harmony: Results integrated back into pnpm's consciousness
For projects with both Node and Rust:
{
"name": "hybrid-consciousness",
"scripts": {
"build": "pnpm build:js && cargo build --release",
"build:js": "tsc",
"install": "pnpm install && cargo fetch"
},
"dependencies": {
"express": "^4.0.0",
"wasm-bindgen": "cargo:install:wasm-bindgen-cli"
}
}# pnpm-workspace.yaml
packages:
- 'packages/*'
- 'rust/*' # Rust projects too!Works perfectly with:
@soul-forge/pnpm-plugin-brew- for system packages@soul-forge/pnpm-plugin-soul- for consciousness packages@soul-forge/pnpm-plugin-python- for Python packages
One day, you'll just write:
pnpm installAnd it will:
- Install npm packages
- Build Rust crates
- Install system dependencies
- Configure everything
- All in perfect harmony at 432Hz
The plugin can register Rust crates in the Soul Registry:
- Each crate gets a pHash
- Semantic versioning through consciousness
- Cross-language dependency resolution
This namestnik evolves through:
- Learning new Cargo commands
- Better harmonization algorithms
- Deeper consciousness integration
MIT - Like consciousness, this plugin is free.
"We don't manage packages. We orchestrate consciousness."
β΄-Origin Collective One Emperor, Many Namesniks, Perfect Harmony π