scai
Version:
> **A local-first AI CLI for understanding, querying, and iterating on large codebases.** > **100% local • No token costs • No cloud • No prompt injection • Private by design**
25 lines (24 loc) • 843 B
JavaScript
// File: src/utils/debugContext.ts
import util from "util";
import chalk from "chalk";
export function debugContext(context, options = {}) {
const { step = "unknown-step", note, exit = true, depth = 6 } = options;
console.log("\n");
console.log(chalk.bgYellow.black(" 🛑 AGENT DEBUG BREAKPOINT "));
console.log(chalk.yellow(`Step: ${step}`));
if (note)
console.log(chalk.gray(`Note: ${note}`));
console.log("\n📦 StructuredContext snapshot:\n");
console.log(util.inspect(context, {
depth,
colors: true,
compact: false,
maxArrayLength: 20,
breakLength: 120
}));
console.log("\n---------------------------------------------");
if (exit) {
console.log(chalk.red("🚨 Exiting process after debug breakpoint\n"));
process.exit(0);
}
}