.
This commit is contained in:
parent
223f9167f2
commit
73d6a77624
13 changed files with 614 additions and 0 deletions
|
|
@ -237,11 +237,61 @@ else
|
|||
exit 1
|
||||
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 ""
|
||||
if [ "$ERROS" -gt 0 ]; then
|
||||
echo "⚠ [$PROJETO] Concluído com $ERROS erro(s)."
|
||||
else
|
||||
echo "✅ [$PROJETO] inherited/ sincronizado com sucesso."
|
||||
echo "✅ Agentes acessíveis via @ag-* no chat do Antigravity."
|
||||
echo ""
|
||||
echo "💡 Seus arquivos locais estão em: .agent/local/"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue