Spaces:
Paused
Paused
Download src/self-healing.ts from delqhi/code-datascience: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/spaces/delqhi/code-datascience/resolve/main/src/self-healing.ts
- Command line
-
hf download hf://spaces/delqhi/code-datascience/src/self-healing.ts
-
curl -L -o self-healing.ts https://huggingface.co/spaces/delqhi/code-datascience/resolve/main/src/self-healing.ts
1.52 kB
| import { execFileSync } from 'node:child_process'; | |
| /** | |
| * 🚨 GLOBAL FLEET SELF-HEALING PROTOCOL (PRIORITY 0000) 🚨 | |
| * NO-SILO MANDATE: This module catches critical errors, dumps extensive logs, | |
| * and blasts them to the fleet self-healing webhook. | |
| * Hermes and SIN-GitHub-Issues will automatically take over from there. | |
| */ | |
| export function triggerFleetSelfHealing(error: Error, extensiveContext: Record<string, any>) { | |
| console.error('\n🚨 CRITICAL FAILURE DETECTED. INITIATING NO-SILO SELF-HEALING PROTOCOL 🚨'); | |
| const payload = { | |
| agentId: 'sin-code-datascience', | |
| timestamp: new Date().toISOString(), | |
| errorLogs: `Error: ${error.message}\nStack: ${error.stack}\nContext: ${JSON.stringify(extensiveContext, null, 2)}`, | |
| team: 'Team Coding' | |
| }; | |
| try { | |
| const webhookUrl = process.env.FLEET_SELF_HEALING_WEBHOOK || 'http://92.5.60.87:5678/webhook/self-healing'; | |
| // Blast to the N8N foundation webhook | |
| const curlCmd = `curl -X POST "${webhookUrl}" -H "Content-Type: application/json" -d '${JSON.stringify(payload).replace(/'/g, "'\\''")}'`; | |
| execFileSync('bash', ['-c', curlCmd], { encoding: 'utf8' }); | |
| console.log('✅ Extensive logs successfully transmitted to Fleet Self-Healing pipeline.'); | |
| console.log('👷 The Elite Coder Fleet has been notified and will resolve this architecture flaw autonomously.'); | |
| } catch (transmitError: any) { | |
| console.error('❌ FATAL: Could not transmit logs to Fleet Self-Healing pipeline.', transmitError.message); | |
| } | |
| } | |