Quick reference for building and deploying TSC plugins.
- Rust toolchain (
rustup) - Node.js 18+ with npm
- Access to toru-steering-center repo (for
toru-plugin-api)
Each plugin has:
plugin-name/
├── Cargo.toml # Rust dependencies
├── src/main.rs # Backend logic
├── frontend/ # React app
│ ├── package.json
│ ├── vite.config.ts
│ └── src/
└── openspec/ # Specs and tasks
cd systemd-services # or systemd-timers
# First time: ensure toru-plugin-api is available
# Option A: Git dependency in Cargo.toml
# Option B: Local path if you have toru-steering-center checked out
cargo build --release
# Test metadata output
./target/release/systemd-services --metadatacd systemd-services/frontend
npm install
npm run build
# Output: dist/bundle.js# On TSC server (or copy via scp)
cp target/release/systemd-services /path/to/tsc/plugins/systemd-services.binary
mkdir -p /path/to/tsc/plugins/systemd-services/frontend
cp frontend/dist/bundle.js /path/to/tsc/plugins/systemd-services/frontend/
chmod +x /path/to/tsc/plugins/systemd-services.binary
# Enable via API
curl -X POST http://localhost:3000/api/plugins/systemd-services/enable[package]
name = "systemd-services"
version = "0.1.0"
edition = "2021"
[dependencies]
toru-plugin-api = { path = "../../toru-steering-center/toru-plugin-api" }
# Or: toru-plugin-api = { git = "https://github.com/toruai/toru-steering-center" }
tokio = { version = "1", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
async-trait = "0.1"
chrono = { version = "0.4", features = ["serde"] }// vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
build: {
lib: {
entry: 'src/main.tsx',
name: 'SystemdServicesPlugin',
formats: ['iife'],
fileName: () => 'bundle.js',
},
rollupOptions: {
output: {
inlineDynamicImports: true,
},
},
},
})- Start TSC in dev mode
- Copy plugin binary and bundle to
./plugins/ - Enable plugin via admin UI or API
- Navigate to plugin route (e.g.,
/systemd-services)
# Check plugin metadata
./plugins/systemd-services.binary --metadata
# View plugin logs
tail -f /var/log/toru/plugins/systemd-services.log
# Check supervisor logs
tail -f /var/log/toru/plugin-supervisor.log
# Test socket manually (if needed)
ls -la /tmp/toru-plugins/# Build both plugins
for p in systemd-services systemd-timers; do
(cd $p && cargo build --release)
(cd $p/frontend && npm run build)
done
# Deploy to remote VPS
rsync -avz systemd-services/target/release/systemd-services user@vps:/opt/tsc/plugins/systemd-services.binary
rsync -avz systemd-services/frontend/dist/bundle.js user@vps:/opt/tsc/plugins/systemd-services/frontend/- TSC Plugin Guide:
/Users/tako/GitRepos/toru-steering-center/docs/plugins/README.md - Plugin Protocol:
/Users/tako/GitRepos/toru-steering-center/docs/plugins/PROTOCOL.md - Example Plugins:
/Users/tako/GitRepos/toru-steering-center/examples/