threadlines 0.2.1 → 0.2.4

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.
@@ -345,9 +345,9 @@ async function checkCommand(options) {
345
345
  });
346
346
  // 7. Display results (with filtering if --full not specified)
347
347
  displayResults(response, options.full || false);
348
- // Exit with appropriate code
349
- const hasAttention = response.results.some(r => r.status === 'attention');
350
- process.exit(hasAttention ? 1 : 0);
348
+ // Exit with appropriate code (attention or errors = failure)
349
+ const hasIssues = response.results.some(r => r.status === 'attention' || r.status === 'error');
350
+ process.exit(hasIssues ? 1 : 0);
351
351
  }
352
352
  catch (error) {
353
353
  const errorMessage = error instanceof Error ? error.message : 'Unknown error';
@@ -368,7 +368,10 @@ function displayResults(response, showFull) {
368
368
  const notRelevant = results.filter((r) => r.status === 'not_relevant').length;
369
369
  const compliant = results.filter((r) => r.status === 'compliant').length;
370
370
  const attention = results.filter((r) => r.status === 'attention').length;
371
+ const errors = results.filter((r) => r.status === 'error').length;
371
372
  const attentionItems = filteredResults.filter((r) => r.status === 'attention');
373
+ // Always show errors regardless of --full flag
374
+ const errorItems = results.filter((r) => r.status === 'error');
372
375
  // Build summary parts
373
376
  const summaryParts = [];
374
377
  if (notRelevant > 0) {
@@ -383,15 +386,11 @@ function displayResults(response, showFull) {
383
386
  if (metadata.timedOut > 0) {
384
387
  summaryParts.push(`${metadata.timedOut} timed out`);
385
388
  }
386
- if (metadata.errors > 0) {
387
- summaryParts.push(`${metadata.errors} errors`);
388
- }
389
- // Display informational message if present (e.g., zero diffs)
390
- if (message) {
391
- console.log('\n' + chalk_1.default.blue('ℹ️ ' + message));
389
+ if (errors > 0) {
390
+ summaryParts.push(`${errors} errors`);
392
391
  }
393
392
  // Show success message with breakdown if no issues
394
- if (attention === 0 && metadata.timedOut === 0 && metadata.errors === 0) {
393
+ if (attention === 0 && metadata.timedOut === 0 && errors === 0) {
395
394
  const summary = summaryParts.length > 0 ? ` (${summaryParts.join(', ')})` : '';
396
395
  console.log('\n' + chalk_1.default.green(`✓ Threadline check passed${summary}`));
397
396
  console.log(chalk_1.default.gray(` ${metadata.totalThreadlines} threadline${metadata.totalThreadlines !== 1 ? 's' : ''} checked\n`));
@@ -421,8 +420,8 @@ function displayResults(response, showFull) {
421
420
  if (metadata.timedOut > 0) {
422
421
  console.log(chalk_1.default.yellow(` ${metadata.timedOut} timed out`));
423
422
  }
424
- if (metadata.errors > 0) {
425
- console.log(chalk_1.default.red(` ${metadata.errors} errors`));
423
+ if (errors > 0) {
424
+ console.log(chalk_1.default.red(` ${errors} errors`));
426
425
  }
427
426
  console.log('');
428
427
  }
@@ -448,4 +447,30 @@ function displayResults(response, showFull) {
448
447
  console.log(''); // Empty line between threadlines
449
448
  }
450
449
  }
450
+ // Show error items (always shown, regardless of --full flag)
451
+ if (errorItems.length > 0) {
452
+ for (const item of errorItems) {
453
+ console.log(chalk_1.default.red(`[error] ${item.expertId}`));
454
+ // Show error message
455
+ if (item.error) {
456
+ console.log(chalk_1.default.red(` Error: ${item.error.message}`));
457
+ if (item.error.type) {
458
+ console.log(chalk_1.default.red(` Type: ${item.error.type}`));
459
+ }
460
+ if (item.error.code) {
461
+ console.log(chalk_1.default.red(` Code: ${item.error.code}`));
462
+ }
463
+ // Show raw response for debugging
464
+ if (item.error.rawResponse) {
465
+ console.log(chalk_1.default.gray(' Raw response:'));
466
+ console.log(chalk_1.default.gray(JSON.stringify(item.error.rawResponse, null, 2).split('\n').map(line => ' ' + line).join('\n')));
467
+ }
468
+ }
469
+ else if (item.reasoning) {
470
+ // Fallback to reasoning if no error object
471
+ console.log(chalk_1.default.red(` ${item.reasoning}`));
472
+ }
473
+ console.log(''); // Empty line between errors
474
+ }
475
+ }
451
476
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "threadlines",
3
- "version": "0.2.1",
3
+ "version": "0.2.4",
4
4
  "description": "Threadlines CLI - AI-powered linter based on your natural language documentation",
5
5
  "main": "dist/index.js",
6
6
  "bin": {