evals 2.2.6 → 2.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.js +38 -1
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -7,6 +7,9 @@ import { exec } from 'child_process';
7
7
 
8
8
  const e = React.createElement;
9
9
 
10
+ // Diagnostic: Uncomment to verify script is running
11
+ console.error('CLI script started, platform:', process.platform, 'isTTY:', process.stdin.isTTY);
12
+
10
13
  // "ARIZE EVALS" - EXACTLY matched width (both 44 chars)
11
14
  const largeLogo = `
12
15
  █████╗ ██████╗ ██╗ ███████╗ ███████╗
@@ -206,4 +209,38 @@ function App() {
206
209
  }
207
210
 
208
211
  // Run the app
209
- render(e(App), { patchConsole: false });
212
+ // Check if we have an interactive terminal (required for Ink)
213
+ if (!process.stdin.isTTY || !process.stdout.isTTY) {
214
+ console.error('Error: This command requires an interactive terminal.');
215
+ console.error('Please run `npx evals` from your terminal (not from a script or non-interactive environment).');
216
+ process.exit(1);
217
+ }
218
+
219
+ // Handle uncaught errors
220
+ process.on('uncaughtException', (error) => {
221
+ console.error('Uncaught exception:', error.message);
222
+ console.error(error.stack);
223
+ process.exit(1);
224
+ });
225
+
226
+ process.on('unhandledRejection', (reason, promise) => {
227
+ console.error('Unhandled rejection at:', promise);
228
+ console.error('Reason:', reason);
229
+ process.exit(1);
230
+ });
231
+
232
+ // Ensure stdout is not buffered (important for Windows)
233
+ if (process.stdout.isTTY) {
234
+ process.stdout.setEncoding('utf8');
235
+ }
236
+
237
+ try {
238
+ render(e(App), { patchConsole: false });
239
+ } catch (error) {
240
+ console.error('Failed to render interactive CLI:', error.message);
241
+ console.error(error.stack);
242
+ if (process.platform === 'win32') {
243
+ console.error('\nNote: If you\'re using cmd.exe, try running in PowerShell or Git Bash instead.');
244
+ }
245
+ process.exit(1);
246
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evals",
3
- "version": "2.2.6",
3
+ "version": "2.2.7",
4
4
  "description": "Arize evals package",
5
5
  "type": "module",
6
6
  "main": "cli.js",