🚀 Auto-deploy: BrainWind atualizado em 12/07/2026 15:56:23
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
import { generateAllScenarios } from '../src/lib/audit/scenarios';
|
||||||
|
import { buildPrompt } from '../src/lib/audit/prompt-builder';
|
||||||
|
|
||||||
|
// Pega os dois primeiros cenários (geralmente Galpão e Edifício Blessmann)
|
||||||
|
const scenarios = generateAllScenarios().slice(0, 2);
|
||||||
|
|
||||||
|
const prompt = buildPrompt(scenarios);
|
||||||
|
|
||||||
|
console.log('=== SYSTEM PROMPT ===\n');
|
||||||
|
console.log(prompt.system);
|
||||||
|
console.log('\n=== USER PROMPT ===\n');
|
||||||
|
console.log(prompt.user);
|
||||||
@@ -78,6 +78,7 @@ export function buildAuditReport(
|
|||||||
verdict,
|
verdict,
|
||||||
checks: r.checks ?? [],
|
checks: r.checks ?? [],
|
||||||
summary: r.summary ?? '',
|
summary: r.summary ?? '',
|
||||||
|
calculation_steps: r.calculation_steps,
|
||||||
llmNotes: r.llmNotes,
|
llmNotes: r.llmNotes,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ export async function runAudit(
|
|||||||
// Avisar a UI do progresso absoluto
|
// Avisar a UI do progresso absoluto
|
||||||
onProgress?.(completed);
|
onProgress?.(completed);
|
||||||
|
|
||||||
const rawResponse = await runLLMAudit(config, prompt.system, prompt.user, (msg) => {
|
const rawResponse = await runLLMAudit(config, prompt.system, prompt.user, () => {
|
||||||
// opcional
|
// opcional
|
||||||
}, signal);
|
}, signal);
|
||||||
rawResponseFull += rawResponse + '\n\n';
|
rawResponseFull += rawResponse + '\n\n';
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ export function serializeScenario(scenario: AuditScenario): string {
|
|||||||
inputs: scenario.inputs,
|
inputs: scenario.inputs,
|
||||||
intermediates: scenario.intermediates,
|
intermediates: scenario.intermediates,
|
||||||
outputs: scenario.outputs,
|
outputs: scenario.outputs,
|
||||||
expectedRanges: scenario.expectedRanges,
|
|
||||||
diagramType: scenario.diagramType,
|
|
||||||
diagramProps: scenario.diagramProps,
|
|
||||||
}, null, 2);
|
}, null, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ export interface ScenarioResult {
|
|||||||
readonly verdict: CheckStatus;
|
readonly verdict: CheckStatus;
|
||||||
readonly checks: readonly AuditCheck[];
|
readonly checks: readonly AuditCheck[];
|
||||||
readonly summary: string;
|
readonly summary: string;
|
||||||
|
readonly calculation_steps?: string;
|
||||||
readonly llmNotes?: string;
|
readonly llmNotes?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,5 +137,6 @@ export interface AuditLLMResponse {
|
|||||||
readonly explanation: string;
|
readonly explanation: string;
|
||||||
}[];
|
}[];
|
||||||
readonly summary: string;
|
readonly summary: string;
|
||||||
|
readonly calculation_steps?: string;
|
||||||
readonly llmNotes?: string;
|
readonly llmNotes?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
# BRAINWIND: SCRIPT DE DEPLOY TOTAL & SINCRONIZAÇÃO AUTOMÁTICA
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
|
||||||
|
# Cores e Formatação Premium
|
||||||
|
CYAN='\033[0;36m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
RED='\033[0;31m'
|
||||||
|
NC='\033[0m'
|
||||||
|
|
||||||
|
echo -e "\n${CYAN}🚀 Iniciando Ciclo Automático de Deploy BrainWind...${NC}"
|
||||||
|
|
||||||
|
# Carrega variáveis do .env se existir para ter os UUIDs e URLs
|
||||||
|
if [ -f .env ]; then
|
||||||
|
export $(grep -v '^#' .env | xargs)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fallback para o UUID da imagem fornecida
|
||||||
|
COOLIFY_RESOURCE_UUID="${COOLIFY_RESOURCE_UUID:-kj3wl9hm4bjt0qxr84iy9v9k}"
|
||||||
|
|
||||||
|
# 1. Sincronização com Repositório (Git)
|
||||||
|
echo -e "${YELLOW}📝 Sincronizando código com o repositório...${NC}"
|
||||||
|
git add .
|
||||||
|
|
||||||
|
# Verifica se existem alterações para o commit
|
||||||
|
if git diff-index --quiet HEAD --; then
|
||||||
|
echo -e "${GREEN}✨ Código local já está sincronizado com o último commit.${NC}"
|
||||||
|
else
|
||||||
|
TIMESTAMP=$(date +"%d/%m/%Y %H:%M:%S")
|
||||||
|
echo -e "${CYAN}📤 Enviando alterações (Auto-update $TIMESTAMP)...${NC}"
|
||||||
|
git commit -m "🚀 Auto-deploy: BrainWind atualizado em $TIMESTAMP"
|
||||||
|
git push origin main
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 2. Gatilho de Deploy no Coolify (API Oficial v1)
|
||||||
|
if [ ! -z "$COOLIFY_RESOURCE_UUID" ]; then
|
||||||
|
echo -e "${YELLOW}🔄 Disparando Deploy via API Oficial no Coolify...${NC}"
|
||||||
|
COOLIFY_TOKEN="12|wbepNILQe24LAOjfEUmMROgU93F6uG1zuwPLwrRi786bca03"
|
||||||
|
|
||||||
|
# Endpoint de Deploy via API v1
|
||||||
|
curl -s -X GET "https://painel.reifonas.cloud/api/v1/deploy?uuid=${COOLIFY_RESOURCE_UUID}&force=false" \
|
||||||
|
-H "Authorization: Bearer $COOLIFY_TOKEN"
|
||||||
|
|
||||||
|
echo -e "\n${GREEN}✅ Deploy oficial via API engatilhado (Hash Sincronizado).${NC}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. Resultado Final
|
||||||
|
echo -e "${GREEN}🏁 Ciclo concluído com sucesso.${NC}\n"
|
||||||
Reference in New Issue
Block a user