aura-security 0.4.2 → 0.4.3

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.
package/dist/cli.js CHANGED
@@ -24,7 +24,7 @@ import { existsSync, writeFileSync, mkdirSync } from 'fs';
24
24
  import { join, resolve, basename } from 'path';
25
25
  import { spawnSync } from 'child_process';
26
26
  const AURA_URL = process.env.AURA_URL ?? 'http://127.0.0.1:3000';
27
- const VERSION = '0.4.1';
27
+ const VERSION = '0.4.3';
28
28
  // ANSI colors for terminal output
29
29
  const colors = {
30
30
  reset: '\x1b[0m',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aura-security",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Deterministic security auditing engine with optional AI advisory layer. Run as CLI, CI step, or service. AI does not make enforcement decisions.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1436,7 +1436,19 @@
1436
1436
  body: JSON.stringify({ tool: 'scan-local', arguments: args })
1437
1437
  });
1438
1438
 
1439
- const data = await res.json();
1439
+ // Check if response is OK before parsing JSON
1440
+ if (!res.ok) {
1441
+ const errorText = await res.text();
1442
+ throw new Error(`Server error (${res.status}): ${errorText.substring(0, 100)}`);
1443
+ }
1444
+
1445
+ // Safely parse JSON
1446
+ let data;
1447
+ try {
1448
+ data = await res.json();
1449
+ } catch (parseErr) {
1450
+ throw new Error('Invalid response from server (not JSON)');
1451
+ }
1440
1452
  console.log('API Response:', JSON.stringify(data, null, 2));
1441
1453
 
1442
1454
  if (data.result?.error) {