This commit is contained in:
Luiz Silva 2026-06-23 12:21:41 -03:00
parent 223f9167f2
commit 73d6a77624
13 changed files with 614 additions and 0 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

44
agents/ag-back/agent.json Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

44
agents/ag-ux/agent.json Normal file

File diff suppressed because one or more lines are too long

View file

@ -237,11 +237,61 @@ else
exit 1 exit 1
fi fi
# --- CONFIGURAR SYMLINKS .gemini/agents/ (Antigravity) ---
echo ""
echo "🔗 Configurando agentes para o Antigravity (.gemini/agents/)..."
GEMINI_AGENTS_DIR="$PROJETO_DIR/.gemini/agents"
mkdir -p "$GEMINI_AGENTS_DIR"
LINKS_CRIADOS=0
for agente_dir in "$AGENT_DIR/agents/"*/; do
AGENTE=$(basename "$agente_dir")
DESTINO="$GEMINI_AGENTS_DIR/$AGENTE"
# Verificar se o agente tem agent.json (no submodule ou inherited)
if [ ! -f "$agente_dir/agent.json" ]; then
# Tentar gerar se o adaptador existir
if [ -f "$AGENT_DIR/adaptadores/antigravity/gerar-agent-json.sh" ]; then
sh "$AGENT_DIR/adaptadores/antigravity/gerar-agent-json.sh" "$AGENTE" >/dev/null 2>&1
fi
fi
# Só criar symlink se agent.json existir
[ ! -f "$agente_dir/agent.json" ] && continue
# Calcular path relativo: .gemini/agents/ag-xxx → .agent/agents/ag-xxx
REL_PATH="../../.agent/agents/$AGENTE"
if [ -L "$DESTINO" ]; then
ATUAL=$(readlink "$DESTINO")
[ "$ATUAL" = "$REL_PATH" ] && continue
rm "$DESTINO"
elif [ -d "$DESTINO" ]; then
continue
fi
if [ "$DRY_RUN" = "1" ]; then
echo " [dry-run] .gemini/agents/$AGENTE → $REL_PATH"
else
ln -s "$REL_PATH" "$DESTINO"
echo " ✅ .gemini/agents/$AGENTE"
fi
LINKS_CRIADOS=$((LINKS_CRIADOS + 1))
done
if [ "$LINKS_CRIADOS" -gt 0 ]; then
echo " 📋 $LINKS_CRIADOS symlink(s) criado(s)"
else
echo " ✅ Todos os symlinks já estavam atualizados"
fi
echo "" echo ""
if [ "$ERROS" -gt 0 ]; then if [ "$ERROS" -gt 0 ]; then
echo "⚠ [$PROJETO] Concluído com $ERROS erro(s)." echo "⚠ [$PROJETO] Concluído com $ERROS erro(s)."
else else
echo "✅ [$PROJETO] inherited/ sincronizado com sucesso." echo "✅ [$PROJETO] inherited/ sincronizado com sucesso."
echo "✅ Agentes acessíveis via @ag-* no chat do Antigravity."
echo "" echo ""
echo "💡 Seus arquivos locais estão em: .agent/local/" echo "💡 Seus arquivos locais estão em: .agent/local/"
fi fi

View file

@ -0,0 +1,87 @@
#!/bin/sh
# =============================================================================
# configurar-gemini-agents.sh — Configura agentes Azteca no Antigravity
#
# Cria symlinks de .gemini/agents/ag-* → .agent/agents/ag-*
# para que o Antigravity descubra os agentes customizados.
#
# Uso (executar na RAIZ do projeto filho, onde .agent/ é submodule):
# sh .agent/configurar-gemini-agents.sh
#
# O script automaticamente gera os agent.json se ainda não existirem.
#
# Resultado:
# .gemini/agents/ag-back → ../../.agent/agents/ag-back
# .gemini/agents/ag-front → ../../.agent/agents/ag-front
# ... (todos os agentes)
# =============================================================================
set -e
# Verificar que estamos na raiz de um projeto com .agent/
if [ ! -d ".agent/agents" ]; then
echo "❌ Diretório .agent/agents/ não encontrado."
echo " Execute este script na raiz do projeto (onde .agent/ é submodule)."
exit 1
fi
# Verificar/gerar agent.json
FIRST_AGENT=$(ls .agent/agents/ | head -1)
if [ ! -f ".agent/agents/$FIRST_AGENT/agent.json" ]; then
echo "⚙ agent.json não encontrados. Gerando..."
if [ -f ".agent/adaptadores/antigravity/gerar-agent-json.sh" ]; then
sh .agent/adaptadores/antigravity/gerar-agent-json.sh
echo ""
else
echo "❌ Adaptador não encontrado: .agent/adaptadores/antigravity/gerar-agent-json.sh"
exit 1
fi
fi
# Criar .gemini/agents/ se não existir
mkdir -p .gemini/agents
# Contadores
CRIADOS=0
EXISTENTES=0
# Criar symlinks para cada agente
for agente_dir in .agent/agents/*/; do
agente=$(basename "$agente_dir")
# Verificar que tem agent.json
if [ ! -f "$agente_dir/agent.json" ]; then
echo "⚠ Pulando $agente (sem agent.json)"
continue
fi
destino=".gemini/agents/$agente"
if [ -L "$destino" ]; then
# Symlink já existe — verificar se aponta para o lugar certo
atual=$(readlink "$destino")
esperado="../../.agent/agents/$agente"
if [ "$atual" = "$esperado" ]; then
EXISTENTES=$((EXISTENTES + 1))
continue
else
echo "🔄 Atualizando symlink: $agente ($atual → $esperado)"
rm "$destino"
fi
elif [ -d "$destino" ]; then
echo "⚠ $destino é um diretório real (não symlink) — pulando"
continue
fi
ln -s "../../.agent/agents/$agente" "$destino"
CRIADOS=$((CRIADOS + 1))
echo "✅ Symlink: .gemini/agents/$agente → .agent/agents/$agente"
done
echo ""
echo "📋 Resumo:"
echo " Criados: $CRIADOS"
echo " Já existiam: $EXISTENTES"
echo " Total de agentes: $(ls -d .agent/agents/*/ | wc -l)"
echo ""
echo "✅ Pronto! Os agentes Azteca agora são acessíveis via @ag-* no chat do Antigravity."