INNER CODE UNIT · TypeScript
writeCommandFile
Dakkshin/after-effects-mcp · src/index.ts:108
function writeCommandFile(command: string, args: Record<string, any> = {}): void {
try {
const commandFile = path.join(getAETempDir(), 'ae_command.json');
const commandData = {
command,
args,
timestamp: new Date().toISOString(),
status: "pending" // pending, running, completed, error
};
fs.writeFileSync(commandFile, JSON.stringify(commandData, null, 2));
console.error(`Command "${command}" written to ${commandFile}`);
} catch (error) {
console.error("Error writing command file:", error);
}
}
// Helper function to clear the results file to avoid stale cache
function clearResultsFile(): void {