feat: Modernize package with ES modules and improve error handling

- Update to ES modules syntax throughout the codebase
- Add fileURLToPath and dirname imports to handle __dirname in ES modules
- Upgrade Anthropic SDK from 0.10.0 to 0.39.0
- Fix JSON parsing to handle responses wrapped in Markdown code blocks
- Improve documentation with clearer installation instructions
- Add important notes about ES modules and SDK requirements
- Update environment examples with API key format and model recommendations
- Include index.js in package files list
- Bump version to 1.0.2
This commit is contained in:
Eyal Toledano
2025-03-04 14:11:57 -05:00
parent 07648a1417
commit c72373d761
10 changed files with 100 additions and 51 deletions

View File

@@ -5,9 +5,14 @@
* It ensures all necessary files are included and properly configured.
*/
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
import fs from 'fs';
import path from 'path';
import { execSync } from 'child_process';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// Define colors for console output
const COLORS = {