Skip to content

Commit 4253688

Browse files
wpfleger96npub1fgdl5qqnh3k3f2xkqrvt7cujalhm623x4s7fdjdj5yrtp5fzjl9qrjpucw
andauthored
feat(dev): add just production recipe targeting the production relay (#2572)
Signed-off-by: Will Pfleger <[email protected]> Co-authored-by: npub1fgdl5qqnh3k3f2xkqrvt7cujalhm623x4s7fdjdj5yrtp5fzjl9qrjpucw <4a1bfa0013bc6d14a8d600d8bf6392efefbd2a26ac3c96c9b2a106b0d12297ca@buzz.block.builderlab.xyz>
1 parent 9cf9539 commit 4253688

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

‎Justfile‎

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ desktop_dir := "desktop"
66
desktop_tauri_manifest := "desktop/src-tauri/Cargo.toml"
77
web_dir := "web"
88

9-
# Opt-in mesh-llm. Off by default so `just dev`/`just staging` skip ~420 extra
10-
# crates + the llama.cpp native runtime build and stay fast to iterate on.
11-
# Turn on to test mesh compute features: `just mesh=1 dev` / `just mesh=1 staging`.
9+
# Opt-in mesh-llm. Off by default so `just dev`/`just staging`/`just production`
10+
# skip ~420 extra crates + the llama.cpp native runtime build and stay fast to
11+
# iterate on. Turn on to test mesh compute features: `just mesh=1 dev` /
12+
# `just mesh=1 staging` / `just mesh=1 production`.
1213
mesh := ""
1314

1415
# Reset only the current standalone desktop instance before launch.
@@ -517,6 +518,33 @@ staging *ARGS: bootstrap _ensure-sidecar-stubs
517518
echo "Starting staging on Vite port ${BUZZ_VITE_PORT}, relay ${BUZZ_RELAY_URL}"
518519
pnpm exec tauri dev ${FEATURES[@]+"${FEATURES[@]}"} --config "$BUZZ_TAURI_CONFIG" {{ARGS}}
519520
521+
# Run the desktop app against the production relay (installs deps + builds agent tools automatically)
522+
production *ARGS: bootstrap _ensure-sidecar-stubs
523+
#!/usr/bin/env bash
524+
set -euo pipefail
525+
export PATH="{{justfile_directory()}}/bin:$PATH"
526+
pnpm install # unconditional: production must always start with a clean dep tree
527+
cargo build --release -p buzz-acp -p buzz-agent -p buzz-dev-mcp -p buzz-cli -p git-credential-nostr
528+
FEATURES=()
529+
if [[ -n "{{mesh}}" ]]; then
530+
FEATURES=(--features mesh-llm)
531+
export MESH_LLM_NATIVE_RUNTIME_CACHE_DIR="$(./scripts/ensure-mesh-native-runtime.sh)"
532+
fi
533+
# Replace the 0-byte sidecar stub with the real CLI binary so tauri dev picks it up.
534+
TARGET=$(rustc -vV | sed -n 's|host: ||p')
535+
TARGET_DIR=$(cargo metadata --format-version 1 --no-deps | node -p "JSON.parse(require('fs').readFileSync(0, 'utf8')).target_directory")
536+
cp "${TARGET_DIR}/release/buzz" "desktop/src-tauri/binaries/buzz-${TARGET}"
537+
chmod +x "desktop/src-tauri/binaries/buzz-${TARGET}"
538+
cd {{desktop_dir}}
539+
export BUZZ_RELAY_URL="wss://buzz.block.builderlab.xyz"
540+
source ../scripts/instance-env.sh
541+
# Ctrl+C kills the Tauri app before its in-process sweep finishes, leaking
542+
# agent workers. Reap this instance's agents on exit as a backstop.
543+
INSTANCE_ID=$(node -e "console.log(JSON.parse(process.env.BUZZ_TAURI_CONFIG).identifier)")
544+
trap '../scripts/cleanup-instance-agents.sh "$INSTANCE_ID" || true' EXIT
545+
echo "Starting production on Vite port ${BUZZ_VITE_PORT}, relay ${BUZZ_RELAY_URL}"
546+
pnpm exec tauri dev ${FEATURES[@]+"${FEATURES[@]}"} --config "$BUZZ_TAURI_CONFIG" {{ARGS}}
547+
520548
# Run the desktop frontend dev server (port derived from worktree)
521549
desktop-dev:
522550
#!/usr/bin/env bash

0 commit comments

Comments
 (0)