Files
fuck-u-code/bin/fuck-u-code.js
Done-0 cd55ca0935 feat: add JSON schema documentation and improve parser error handling
- Add comprehensive JSON schema field descriptions with i18n support (en, zh, ru)
- Fix shell script parsing by adding graceful fallback to regex parser when tree-sitter fails
- Change MCP server default output format from markdown to JSON for better AI integration
- Improve parser error handling with automatic fallback mechanism
- Add detailed field explanations in $schema for better AI comprehension
- Bump version to 2.2.0

Breaking changes:
- MCP server now returns JSON format by default instead of markdown
2026-02-16 11:05:23 +08:00

51 lines
1.1 KiB
JavaScript
Executable File

#!/usr/bin/env node
import { spawn } from 'child_process';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const hasMemoryFlag = process.execArgv.some(arg => arg.startsWith('--max-old-space-size'));
if (!hasMemoryFlag) {
const args = [
'--max-old-space-size=8192',
join(__dirname, '..', 'dist', 'index.js'),
...process.argv.slice(2)
];
const child = spawn(process.execPath, args, {
stdio: ['inherit', 'inherit', 'pipe'],
env: process.env
});
let inFatalError = false;
child.stderr.on('data', (data) => {
const text = data.toString();
if (text.includes('Fatal process out of memory') || text.includes('Native stack trace')) {
inFatalError = true;
return;
}
if (inFatalError) {
return;
}
process.stderr.write(data);
});
child.on('exit', (code) => {
if (code === 133 && inFatalError) {
process.exit(0);
} else {
process.exit(code || 0);
}
});
} else {
import('../dist/index.js');
}