CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
debug-mode.js33 linesDownload Raw Back to serve
1/**2 * @license3 * Copyright 2025 Qwen Team4 * SPDX-License-Identifier: Apache-2.05 */6/**7 * Returns whether the daemon should expose verbose error context in8 * HTTP responses. Mirrors `isServeDebugLoggingEnabled` in9 * `httpAcpBridge.ts` (which gates stderr-side debug log output).10 *11 * Extracted into its own module in fold-in 2i so route files12 * (`workspace-memory.ts`, `workspace-agents.ts`, future Wave 4 mutation13 * routes) can share one canonical predicate when deciding whether to14 * include `errorMessage` / `filePath` in their response bodies.15 * Without the toggle, error responses carry only structured fields16 * (`code` / `scope` / `mode` / `osCode` / ...) so absolute filesystem17 * paths from Node's fs error messages don't leak to authenticated18 * remote callers.19 *20 * Accepts any non-falsy value for the env var; explicit literals21 * `"0" / "false" / "off" / "no"` (case-insensitive, with surrounding22 * whitespace trimmed) disable. Matches the bridge's existing23 * `isServeDebugLoggingEnabled` semantics so the two toggles move in24 * lockstep — operators set `QWEN_SERVE_DEBUG=1` and get both stderr25 * verbosity and response-body detail.26 */27export function isServeDebugMode() {28    const value = process.env['QWEN_SERVE_DEBUG'];29    if (!value)30        return false;31    return !['0', 'false', 'off', 'no'].includes(value.trim().toLowerCase());32}33//# sourceMappingURL=debug-mode.js.map
basant307/AI_Governance_Project · CoolFace