1import { appendFileSync } from 'fs'2import { ensurePtTmpDir, ptTmpDir } from './ensurePtTmpDirF.mts'6// In MCP mode: write to log file to avoid glitchy stderr output in terminal UI7// In CLI mode: print to stdout for normal visibility8export const mcpDebugLog = (msg: string) => {9 if (process.env.OPENCODE) {11 appendFileSync(logPath, `${new Date().toISOString()} ${msg}\n`)12 } else {13 console.log(msg)14 }15}17// Verbose debug logging - disabled by default, enable when debugging18export const mcpVerboseLog = (msg: string) => {19 return // disabled - remove this line to enable verbose logging20 mcpDebugLog(msg)21}