This repository has been archived on 2026-10-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
maestro/Justfile
resendeandClaude Opus 4.8 257773fb3b
ci / rust (pull_request) Successful in 4m37s
feat(maestro): add just dev full-stack recipe and fix dev attach proxy
`just dev` builds maestro and runs the whole local stack in one command
— registry (:8080), daemon (:7070), and the Vite web UI (:5173) — waits
for each to be healthy, and tears all three down on Ctrl-C. Previously
the Justfile only had frontend/CI recipes; running the project meant
hand-starting the registry and daemon in separate terminals.

Also fix attach under the Vite dev server: `/api/attach/:id` is a
daemon-served broker WebSocket (NAP-243), not a registry route, so the
old catch-all `/api` proxy sent it to the registry and got 404. Route
`/api/attach` to the daemon (overridable via MAESTRO_DAEMON) and keep
everything else on the registry — the same split the production
maestro-web binary does. Verified: handshake now returns 101 and PTY
bytes stream.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 13:11:47 +01:00

67 lines
2.4 KiB
Makefile

# Common dev / build entry points. Run `just` with no args to list.
# The registry (:8080) is the phone book, the daemon (:7070) runs the tmux
# sessions, and Vite serves the UI at http://localhost:5173 (attach is proxied
# to the daemon; see web/vite.config.ts). Override the secret with MAESTRO_TOKEN.
# Run the full local stack — registry + daemon + web UI; Ctrl-C stops all three.
dev:
#!/usr/bin/env bash
set -euo pipefail
token="${MAESTRO_TOKEN:-devtoken}"
bin="target/debug/maestro"
echo "▶ building maestro…"
cargo build --bin maestro
pids=()
cleanup() { echo; echo "▶ stopping stack…"; for p in "${pids[@]:-}"; do kill "$p" 2>/dev/null || true; done; }
trap cleanup EXIT INT TERM
echo "▶ registry → http://127.0.0.1:8080"
MAESTRO_TOKEN="$token" MAESTRO_REGISTRY_BIND_ADDR=127.0.0.1:8080 "$bin" registry &
pids+=($!)
# Wait for the registry to accept connections before starting the daemon.
for _ in $(seq 1 50); do (exec 3<>/dev/tcp/127.0.0.1/8080) 2>/dev/null && break || sleep 0.2; done
echo "▶ daemon → ws://127.0.0.1:7070 (id: $(hostname))"
MAESTRO_TOKEN="$token" \
MAESTRO_REGISTRY_URL=http://127.0.0.1:8080 \
MAESTRO_DAEMON_BIND_ADDR=127.0.0.1:7070 \
MAESTRO_DAEMON_URL=ws://127.0.0.1:7070 \
"$bin" daemon run &
pids+=($!)
for _ in $(seq 1 50); do (exec 3<>/dev/tcp/127.0.0.1/7070) 2>/dev/null && break || sleep 0.2; done
echo "▶ web UI → http://localhost:5173 (Ctrl-C to stop everything)"
pnpm -C web install
MAESTRO_REGISTRY=http://127.0.0.1:8080 MAESTRO_DAEMON=http://127.0.0.1:7070 \
pnpm -C web dev
# Build the maestro-web binary together with the SPA bundle it embeds.
web:
pnpm -C web install --frozen-lockfile
pnpm -C web build
cargo build -p maestro-web --release
# Run the web bundle in dev mode against a local daemon — Vite serves the
# frontend with HMR, and `/api/*` is proxied directly to the daemon at
# 127.0.0.1:7070 (or wherever $MAESTRO_REGISTRY points; see vite.config.ts).
web-dev:
pnpm -C web install
pnpm -C web dev
# Typecheck the frontend without building.
web-typecheck:
pnpm -C web install --frozen-lockfile
pnpm -C web typecheck
# Full workspace build + tests.
test:
cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test --all
# Format every Rust source.
fmt:
cargo fmt --all