From 973e9dbe8ff3837b290ee7d099e03a81415df626 Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Sun, 31 May 2026 09:37:00 -0700 Subject: [PATCH] sync: auto-sync from GURU-KALI at 2026-05-31 09:36:59 Author: Mike Swanson Machine: GURU-KALI Timestamp: 2026-05-31 09:36:59 --- .claude/scripts/check-ksteen-smartbadge.sh | 17 ++++++++++++++++- .claude/scripts/check-messages.sh | 16 +++++++++++++++- .claude/scripts/migrate-identity.sh | 10 ++++++++++ .claude/scripts/sync.sh | 19 ++++++++----------- 4 files changed, 49 insertions(+), 13 deletions(-) diff --git a/.claude/scripts/check-ksteen-smartbadge.sh b/.claude/scripts/check-ksteen-smartbadge.sh index 2976477..12e9427 100644 --- a/.claude/scripts/check-ksteen-smartbadge.sh +++ b/.claude/scripts/check-ksteen-smartbadge.sh @@ -9,7 +9,22 @@ REPO_ROOT="${CLAUDETOOLS_ROOT:-/d/claudetools}" [ -d "$REPO_ROOT" ] || REPO_ROOT="$(git -C "$(dirname "$0")" rev-parse --show-toplevel 2>/dev/null)" VAULT="$REPO_ROOT/.claude/scripts/vault.sh" RMM="http://172.16.3.30:3001" -COORD="http://172.16.3.30:8001/api/coord" + +# Coord API base — read from identity.json (per-machine override) and fall back +# to the on-LAN default for backward compat. Same lookup pattern as sync.sh. +IDENTITY_PATH="" +for candidate in "$HOME/.claude/identity.json" "$REPO_ROOT/.claude/identity.json"; do + if [ -f "$candidate" ]; then + IDENTITY_PATH="$candidate" + break + fi +done +COORD_BASE="" +if [ -n "$IDENTITY_PATH" ] && command -v jq >/dev/null 2>&1; then + COORD_BASE=$(jq -r '.coord_api // empty' "$IDENTITY_PATH" 2>/dev/null) +fi +[ -z "$COORD_BASE" ] && COORD_BASE="http://172.16.3.30:8001" # default when identity.json doesn't define coord_api +COORD="${COORD_BASE}/api/coord" KSTEEN="ee3c6aea-e9cc-4d2f-9e79-a38dd0eb129e" VERIFY_PS="$REPO_ROOT/.claude/scripts/ksteen-smartbadge-verify.ps1" LOG="$REPO_ROOT/.claude/logs/ksteen-smartbadge.log" diff --git a/.claude/scripts/check-messages.sh b/.claude/scripts/check-messages.sh index 31a1bc3..2e221ae 100644 --- a/.claude/scripts/check-messages.sh +++ b/.claude/scripts/check-messages.sh @@ -3,10 +3,24 @@ # Strip .local suffix if present (macOS convention) HOSTNAME_RAW="$(hostname)" SESSION="${HOSTNAME_RAW%.local}/claude-main" -API="http://172.16.3.30:8001" SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)" MODE_FILE="${SCRIPT_DIR}/current-mode" +# Coord API endpoint — per-machine override in identity.json (same lookup as sync.sh). +# Falls back to the on-LAN default so existing machines keep working unchanged. +IDENTITY_PATH="" +for candidate in "$HOME/.claude/identity.json" "${SCRIPT_DIR}/identity.json"; do + if [ -f "$candidate" ]; then + IDENTITY_PATH="$candidate" + break + fi +done +API="" +if [ -n "$IDENTITY_PATH" ] && command -v jq >/dev/null 2>&1; then + API=$(jq -r '.coord_api // empty' "$IDENTITY_PATH" 2>/dev/null) +fi +[ -z "$API" ] && API="http://172.16.3.30:8001" # default when identity.json doesn't define coord_api + # --- Initialize mode file if missing ----------------------------------------- # The mode file is machine-local (gitignored) and required by this hook. # If missing, create it with "general" as the default mode. diff --git a/.claude/scripts/migrate-identity.sh b/.claude/scripts/migrate-identity.sh index f14ebc6..088d417 100755 --- a/.claude/scripts/migrate-identity.sh +++ b/.claude/scripts/migrate-identity.sh @@ -47,6 +47,11 @@ case "$(uname -m)" in esac echo " Architecture: $ARCH" +# Coord API default — only used if identity.json doesn't already define one. +# The on-LAN address works for all on-network/VPN/Tailscale-routed machines today; +# off-network boxes should edit identity.json to point at a reachable endpoint. +COORD_API_DEFAULT="http://172.16.3.30:8001" + # Detect Ollama endpoint OLLAMA_ENDPOINT="" OLLAMA_FALLBACK="http://100.101.122.4:11434" # Beast via Tailscale @@ -99,6 +104,10 @@ if 'platform' not in data: if 'architecture' not in data: data['architecture'] = '$ARCH' +# Coord API endpoint — populate only if absent so existing machines keep their override. +if 'coord_api' not in data: + data['coord_api'] = '$COORD_API_DEFAULT' + data['last_updated'] = '$(date -u +"%Y-%m-%dT%H:%M:%SZ")' with open('$IDENTITY_PATH_PY', 'w') as f: @@ -116,5 +125,6 @@ echo " ollama.fallback: $OLLAMA_FALLBACK" echo " ollama.prose_model: $PROSE_MODEL" echo " platform: $PLATFORM" echo " architecture: $ARCH" +echo " coord_api: (default $COORD_API_DEFAULT if not already set)" echo "" echo "Review: cat $IDENTITY_PATH" diff --git a/.claude/scripts/sync.sh b/.claude/scripts/sync.sh index 9a05adf..26d22d4 100755 --- a/.claude/scripts/sync.sh +++ b/.claude/scripts/sync.sh @@ -97,16 +97,6 @@ if [ -z "$REPO_ROOT" ]; then REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || true) fi -# Last resort: hardcoded paths (legacy machines) -if [ -z "$REPO_ROOT" ]; then - for candidate in "$HOME/ClaudeTools" "/d/ClaudeTools" "D:/ClaudeTools" "/d/claudetools" "D:/claudetools" "C:/claudetools" "/c/claudetools"; do - if [ -d "$candidate/.git" ]; then - REPO_ROOT="$candidate" - break - fi - done -fi - if [ -z "$REPO_ROOT" ] || [ ! -d "$REPO_ROOT/.git" ]; then echo -e "${RED}[ERROR]${NC} Cannot locate ClaudeTools repo. Add 'claudetools_root' to identity.json" exit 1 @@ -521,7 +511,14 @@ fi echo "" echo "=== Phase 7: Pending To-Dos ===" -COORD_API="http://172.16.3.30:8001" +# Coord API endpoint — per-machine override in identity.json so off-network/VPN/ +# Tailscale boxes can point elsewhere. Default to the on-LAN address for backward +# compat with existing machines that haven't been re-migrated yet. +COORD_API="" +if [ -f ".claude/identity.json" ]; then + COORD_API=$($PYTHON -c "import json; d=json.load(open('.claude/identity.json')); print(d.get('coord_api',''))" 2>/dev/null || echo "") +fi +[ -z "$COORD_API" ] && COORD_API="http://172.16.3.30:8001" # default when identity.json doesn't define coord_api TODO_USER="" TODO_MACHINE="$MACHINE" if [ -f ".claude/identity.json" ]; then