Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/complete-agi-core / orchestrator/sync-state.sh |
| Date | Not specified in source |
| Repository | Janady13/complete-agi-core |
| Revision | 33aa84f2aa61cedbe010240ada7f4efbdfe795a7 |
| Branch | claude/improve-math-logic-ehIW1 |
| Path or archive member | orchestrator/sync-state.sh |
| Original SHA-256 | 6d36c031243c5d053b6b0d00bbe93f44fa384f6ff9ffc2f8f29225040948836e |
| Git blob SHA | 0b6360c317c4be0f61b38634469c7b095890cb6e |
| Reading-copy SHA-256 | 6d36c031243c5d053b6b0d00bbe93f44fa384f6ff9ffc2f8f29225040948836e |
Recovered source transcript
Download complete source text ↓64 lines · 2.4 KB
#!/bin/bash
source ~/.agi_core/production.env 2>/dev/null || true
# Unified iCloud AGI Storage - All cores sync here
ICLOUD_AGI="${HOME}/Library/Mobile Documents/com~apple~CloudDocs/AGI_Data"
CLI=/Users/josephanady/AGICore/build/agi_core_cli
API_URL="https://agi_core.org/.netlify/functions/api/agi/ingest"
LOCAL_STATE=~/.agi_core/agi_state.bin
# Create all AGI core directories in iCloud
mkdir -p "${ICLOUD_AGI}/agi_core"
mkdir -p "${ICLOUD_AGI}/brain"
mkdir -p "${ICLOUD_AGI}/hive"
mkdir -p "${ICLOUD_AGI}/seferim/snapshots"
mkdir -p "${ICLOUD_AGI}/seferim/substrate"
# Source paths for other AGI cores
BRAIN_GOOGLE="${HOME}/Library/CloudStorage/GoogleDrive-joseph.w.anady@gmail.com/My Drive/brain stuff"
HIVE_DIR="${HOME}/The AI/hive-production"
SEFERIM_G16="${HOME}/Library/Mobile Documents/com~apple~CloudDocs/Projects/SEFERIM_AGI_G16"
ICLOUD_STATE="${ICLOUD_AGI}/agi_core/agi_state.bin"
sync_count=0
while true; do
# === AGICore (every 5 seconds) ===
STATE=$($CLI status 2>/dev/null)
if [ -n "$STATE" ]; then
# Save compressed JSON to iCloud
echo "$STATE" | zstd -q -f -o "${ICLOUD_AGI}/agi_core/agi_state.json.zst" 2>/dev/null
# Keep tiny local copy for API
echo "$STATE" > ~/.agi_core/agi_state.json
# POST to API
curl -s -X POST "$API_URL" \
-H "Content-Type: application/json" \
-H "X-AGI-Token: $AGI_INGEST_TOKEN" \
-d "$STATE" > /dev/null 2>&1
fi
# === Sync other AGI cores (every 30 seconds) ===
if [ $((sync_count % 6)) -eq 0 ]; then
# Brain stuff from Google Drive -> iCloud
if [ -d "$BRAIN_GOOGLE/logs" ]; then
tar -cf - -C "$BRAIN_GOOGLE" logs 2>/dev/null | zstd -q > "${ICLOUD_AGI}/brain/brain_logs.tar.zst" 2>/dev/null || true
fi
# Hive data -> iCloud
if [ -d "$HIVE_DIR/data" ]; then
tar -cf - -C "$HIVE_DIR" data 2>/dev/null | zstd -q > "${ICLOUD_AGI}/hive/hive_data.tar.zst" 2>/dev/null || true
fi
if [ -d "$HIVE_DIR/logs" ]; then
tar -cf - -C "$HIVE_DIR" logs 2>/dev/null | zstd -q > "${ICLOUD_AGI}/hive/hive_logs.tar.zst" 2>/dev/null || true
fi
# SEFERIM G16 -> iCloud (if exists)
if [ -d "$SEFERIM_G16" ]; then
find "$SEFERIM_G16" -name "*.json" -mmin -5 -exec zstd -q -f {} -o "${ICLOUD_AGI}/seferim/snapshots/{}.zst" \; 2>/dev/null || true
fi
fi
sync_count=$((sync_count + 1))
sleep 5
done