mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-17 05:22:17 +00:00
Move ECC_SHOW_RECOVERY_HINTS parsing into scripts/lib/hooks/recovery-hints.js so every hook trims and accepts the same truthy values. Add default-off and opt-in assertions for the condensed GateGuard denial, config-protection (protected and truncated payloads) and the fail-closed truncation wrapper. Co-Authored-By: TRAE <noreply@trae.ai>
13 lines
515 B
JavaScript
13 lines
515 B
JavaScript
'use strict';
|
|
|
|
// Denial text is tool output the guarded agent reads. Naming the env vars that
|
|
// disable a hook hands it a bypass, so recovery instructions are opt-in for
|
|
// human operators (#3844). Every hook must parse the switch the same way.
|
|
const ENABLE_VALUES = new Set(['1', 'true', 'on', 'enabled', 'enable', 'yes']);
|
|
|
|
function showRecoveryHints(value = process.env.ECC_SHOW_RECOVERY_HINTS) {
|
|
return ENABLE_VALUES.has(String(value || '').trim().toLowerCase());
|
|
}
|
|
|
|
module.exports = { showRecoveryHints };
|