- Execute all 6 migrations on Desk CRM production database - Create missing tables: cr_lsps, cr_agent_lsps, cr_lsp_usage - Create archive tables: cr_*_usage_archive (4 tables) - Create system tables: cr_migrations, cr_maintenance_log - Make all scripts executable (chmod +x) - Total cr_* tables: 38 Migration files: - 001_initial_schema.sql - 002_add_lsps.sql - 003_add_relationships.sql - 004_add_telemetry.sql - 005_add_archive_tables.sql - 006_add_maintenance_log.sql Scripts: - session-init.sh, session-end.sh - inject-context.sh, inject-agent-context.sh - record-usage.sh, db-backup.sh, sync-to-mysql.sh Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
30 lines
1.5 KiB
Bash
Executable File
30 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# session-init.sh - Inicializa sessão e mostra status da infraestrutura
|
|
# Chamado pelo hook SessionStart
|
|
# Author: Descomplicar®
|
|
|
|
set -e
|
|
|
|
# Gerar session ID único
|
|
SESSION_ID="${CLAUDE_SESSION_ID:-$(date +%s)-$$}"
|
|
export SESSION_ID
|
|
|
|
# Ficheiro de sessão para tracking
|
|
SESSION_FILE="${CLAUDE_PLUGIN_ROOT:-/home/ealmeida/mcp-servers/descomplicar-meta-plugin}/.current_session"
|
|
|
|
# Registar início de sessão
|
|
echo "{\"session_id\": \"$SESSION_ID\", \"started_at\": \"$(date -Iseconds)\", \"tool_calls\": 0}" > "$SESSION_FILE"
|
|
|
|
# Output status (será capturado pelo Claude)
|
|
cat << 'EOF'
|
|
╔══════════════════════════════════════════════════════════════════════╗
|
|
║ DESCOMPLICAR INFRASTRUCTURE - Session Started ║
|
|
╠══════════════════════════════════════════════════════════════════════╣
|
|
║ Meta-Plugin v1.5.1 loaded ║
|
|
║ Commands: /descomplicar:status, :sync, :create, :validate, :release ║
|
|
║ DB Maintenance: :db-cleanup, :db-migrate, :db-backup, :db-archive ║
|
|
╚══════════════════════════════════════════════════════════════════════╝
|
|
EOF
|
|
|
|
exit 0
|