← back to Designer Wallcoverings

DW-Agents/dw-agents/create-agent-memory-files.sh

77 lines

#!/bin/bash

# Create memory.json files for all agents with authentication credentials

echo "📝 Creating memory.json files for all agents..."
echo ""

AGENT_DIRS=(
    "agent-accounting"
    "agent-completed-tasks"
    "agent-digital-samples"
    "agent-in-parallel"
    "agent-legal-team"
    "agent-log-monitor"
    "agent-marketing"
    "agent-needs-attention"
    "agent-new-client-signup"
    "agent-parallel-processes"
    "agent-purchasing-office"
    "agent-server-uptime"
    "agent-shopify-store"
    "agent-task-orchestrator"
    "agent-todays-highlights"
    "agent-trend-research"
    "agent-ui-manager"
    "agent-zendesk-chat"
)

MEMORY_CONTENT='{
  "authentication": {
    "username": "admin2025",
    "password": "Otis",
    "note": "Use these credentials for all authentication in programming. This prevents authentication errors when accessing the agent."
  },
  "important_notes": [
    "All DW-Agents use unified authentication: admin2025 / Otis",
    "These credentials apply to all agent dashboards and API endpoints",
    "SSO (Single Sign-On) is enabled across all agents via shared-auth.ts",
    "Login once on Master Hub (port 9893) to access all agents"
  ],
  "last_updated": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"
}'

CREATED=0
UPDATED=0

for dir in "${AGENT_DIRS[@]}"; do
    MEMORY_FILE="/root/DW-Agents/$dir/memory.json"

    if [ -f "$MEMORY_FILE" ]; then
        echo "📄 Updating existing: $dir/memory.json"

        # Backup existing file
        cp "$MEMORY_FILE" "$MEMORY_FILE.backup-$(date +%s)"

        # Update with new content
        echo "$MEMORY_CONTENT" > "$MEMORY_FILE"
        ((UPDATED++))
    else
        echo "✨ Creating new: $dir/memory.json"
        echo "$MEMORY_CONTENT" > "$MEMORY_FILE"
        ((CREATED++))
    fi
done

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📊 Summary:"
echo "   ✨ Created: $CREATED memory files"
echo "   📝 Updated: $UPDATED memory files"
echo ""
echo "🔐 All memory files now contain:"
echo "   Username: admin2025"
echo "   Password: Otis"
echo ""
echo "✅ Done!"